/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #f8f6f1;
    --fg: #1f1a14;
    --card: #f5f2ec;
    --primary: #2d6b4f;
    --primary-fg: #f5f2ec;
    --secondary: #e8e0d0;
    --muted: #9a8e7e;
    --accent: #d4552a;
    --border: #ddd5c8;
    --gold: #c9952e;
    --radius: 0.375rem;
    --shadow-card: 0 4px 24px -4px rgba(31,26,20,0.08);
    --shadow-elevated: 0 12px 40px -8px rgba(31,26,20,0.12);
    --font-display: 'Playfair Display', serif;
    --font-literary: 'Cormorant Garamond', serif;
    --font-body: 'Inter', sans-serif;
}

html { scroll-behavior: smooth; }
body { font-family: var(--font-body); background: var(--bg); color: var(--fg); line-height: 1.6; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input { font-family: var(--font-body); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.hidden { display: none !important; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.625rem 1.5rem; border-radius: var(--radius);
    font-size: 0.875rem; font-weight: 500; font-family: var(--font-body);
    transition: all 0.2s ease;
}
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-primary:hover { background: #245a41; }
.btn-outline-light { border: 1px solid rgba(255,255,255,0.3); color: #fff; }
.btn-outline-light:hover { background: rgba(255,255,255,0.1); }
.btn-sm { padding: 0.375rem 1rem; font-size: 0.8125rem; }
.btn-full { width: 100%; }

/* ===== NAVBAR ===== */
.navbar {
    position: sticky; top: 0; z-index: 100;
    background: rgba(248,246,241,0.95); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.nav-container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav-logo { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--fg); }
.nav-links { display: flex; gap: 0.25rem; }
.nav-links a {
    padding: 0.5rem 0.75rem; border-radius: var(--radius);
    font-size: 0.875rem; font-weight: 500; color: var(--muted);
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--fg); }
.nav-right { display: flex; align-items: center; gap: 0.75rem; }
.nav-search-btn { padding: 0.5rem; color: var(--muted); border-radius: 50%; transition: all 0.2s; }
.nav-search-btn:hover { background: var(--secondary); color: var(--fg); }
.nav-hamburger { display: none; flex-direction: column; gap: 4px; padding: 0.5rem; }
.nav-hamburger span { display: block; width: 20px; height: 2px; background: var(--fg); border-radius: 2px; transition: all 0.3s; }

@media (max-width: 768px) {
    .nav-links {
        display: none; position: absolute; top: 64px; left: 0; right: 0;
        flex-direction: column; background: var(--bg); border-bottom: 1px solid var(--border);
        padding: 1rem 1.5rem;
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 0.625rem 0; }
    .nav-hamburger { display: flex; }
    .nav-right .btn { display: none; }
}

/* ===== HERO ===== */
.hero {
    position: relative; display: flex; align-items: center; justify-content: center;
    min-height: 70vh; overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to bottom, rgba(31,26,20,0.7), rgba(31,26,20,0.5), var(--bg));
}
.hero-content { position: relative; z-index: 2; text-align: center; padding: 4rem 0; }
.hero-title {
    font-family: var(--font-display); font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 700; color: #fff; letter-spacing: -0.02em;
    animation: fadeUp 0.8s ease forwards;
}
.hero-subtitle {
    font-family: var(--font-literary); font-size: clamp(1.125rem, 3vw, 1.5rem);
    font-style: italic; color: rgba(255,255,255,0.8);
    max-width: 520px; margin: 1rem auto 0;
    animation: fadeUp 0.8s ease 0.2s both;
}
.hero-actions {
    display: flex; gap: 1rem; justify-content: center; margin-top: 2rem;
    animation: fadeUp 0.8s ease 0.4s both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== SECTIONS ===== */
.section-label {
    text-align: center; font-family: var(--font-display);
    font-size: 0.8125rem; font-weight: 500; text-transform: uppercase;
    letter-spacing: 0.3em; color: var(--muted);
}

/* ===== FEATURED POETRY ===== */
.featured { padding: 5rem 0; }
.poetry-carousel {
    position: relative; max-width: 640px; margin: 3rem auto 0;
    display: flex; align-items: center;
}
.poetry-slide { flex: 1; text-align: center; min-height: 120px; }
.poetry-slide .verse {
    font-family: var(--font-literary); font-size: clamp(1.125rem, 3vw, 1.375rem);
    line-height: 1.8; color: var(--fg);
}
.poetry-slide .poet-name {
    margin-top: 1.5rem; font-family: var(--font-body);
    font-size: 0.8125rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.1em; color: var(--muted);
}
.poetry-slide .poem-type {
    display: inline-block; margin-top: 0.375rem;
    padding: 0.125rem 0.75rem; border-radius: 999px;
    background: rgba(45,107,79,0.1); color: var(--primary);
    font-size: 0.75rem; font-family: var(--font-body);
}
.carousel-arrow {
    padding: 0.5rem; border-radius: 50%; color: var(--muted);
    transition: all 0.2s; flex-shrink: 0;
}
.carousel-arrow:hover { background: var(--secondary); color: var(--fg); }
.poetry-actions {
    display: flex; justify-content: center; gap: 1.5rem; margin-top: 2rem;
}
.action-btn {
    display: flex; align-items: center; gap: 0.375rem;
    font-size: 0.875rem; color: var(--muted); transition: color 0.2s;
}
.action-btn:hover { color: var(--accent); }
.action-btn svg { flex-shrink: 0; }

/* Slide transitions */
.poetry-slide { transition: opacity 0.4s ease, transform 0.4s ease; }
.poetry-slide.slide-out { opacity: 0; transform: translateY(-16px); }
.poetry-slide.slide-in { opacity: 0; transform: translateY(16px); }

/* ===== POETS ===== */
.poets-section { padding: 5rem 0; background: var(--card); border-top: 1px solid var(--border); }
.poets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; margin-top: 3rem; }
.poet-card {
    padding: 1.5rem; background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-card);
    transition: all 0.3s ease; opacity: 0; transform: translateY(20px);
}
.poet-card.visible { opacity: 1; transform: translateY(0); }
.poet-card:hover { box-shadow: var(--shadow-elevated); transform: translateY(-2px); }
.poet-avatar {
    width: 48px; height: 48px; border-radius: 50%;
    background: rgba(45,107,79,0.1); color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-size: 1.125rem; font-weight: 700;
}
.poet-card h3 {
    margin-top: 1rem; font-family: var(--font-display);
    font-size: 1.125rem; font-weight: 600; color: var(--fg);
    transition: color 0.2s;
}
.poet-card:hover h3 { color: var(--primary); }
.poet-card .era { margin-top: 0.25rem; font-size: 0.875rem; color: var(--muted); }
.poet-card .works { margin-top: 0.5rem; font-size: 0.75rem; color: var(--muted); }

/* ===== FOOTER ===== */
.footer { padding: 3rem 0; border-top: 1px solid var(--border); background: var(--card); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; }
.footer-logo { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; }
.footer-tagline { margin-top: 0.5rem; font-family: var(--font-literary); font-style: italic; font-size: 0.875rem; color: var(--muted); }
.footer-col h4 { font-family: var(--font-body); font-size: 0.875rem; font-weight: 600; }
.footer-col ul { margin-top: 0.75rem; }
.footer-col li { margin-top: 0.5rem; }
.footer-col a { font-size: 0.875rem; color: var(--muted); transition: color 0.2s; }
.footer-col a:hover { color: var(--fg); }
.footer-bottom { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); text-align: center; font-size: 0.75rem; color: var(--muted); }

@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
}

/* ===== MODAL ===== */
.modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 200;
    background: rgba(31,26,20,0.5); backdrop-filter: blur(4px);
    align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--bg); border-radius: 0.5rem; padding: 2rem;
    width: 90%; max-width: 420px; position: relative;
    box-shadow: var(--shadow-elevated);
    animation: modalIn 0.3s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-close { position: absolute; top: 0.75rem; right: 0.75rem; font-size: 1.5rem; color: var(--muted); padding: 0.25rem 0.5rem; }
.modal-close:hover { color: var(--fg); }
.modal-title { font-family: var(--font-display); font-size: 1.5rem; text-align: center; }
.modal-subtitle { font-family: var(--font-literary); font-size: 1.125rem; font-style: italic; color: var(--muted); text-align: center; margin-top: 0.25rem; }

/* Role selector */
.role-selector { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin: 1.25rem 0; }
.role-btn {
    display: flex; flex-direction: column; align-items: center; gap: 0.375rem;
    padding: 0.75rem; border: 2px solid var(--border); border-radius: 0.5rem;
    color: var(--muted); transition: all 0.2s; font-size: 0.75rem; font-weight: 500;
}
.role-btn:hover { border-color: rgba(45,107,79,0.3); }
.role-btn.active { border-color: var(--primary); background: rgba(45,107,79,0.05); color: var(--primary); }

/* Tabs */
.tab-bar { display: grid; grid-template-columns: 1fr 1fr; background: var(--secondary); border-radius: var(--radius); overflow: hidden; margin-bottom: 1rem; }
.tab { padding: 0.5rem; font-size: 0.875rem; font-weight: 500; color: var(--muted); transition: all 0.2s; }
.tab.active { background: var(--bg); color: var(--fg); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

/* Form */
.auth-form { display: flex; flex-direction: column; gap: 0.875rem; }
.form-group { display: flex; flex-direction: column; gap: 0.375rem; }
.form-group label { font-size: 0.875rem; font-weight: 500; }
.form-group input {
    padding: 0.625rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius);
    font-size: 0.875rem; background: var(--bg); color: var(--fg);
    transition: border-color 0.2s;
}
.form-group input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(45,107,79,0.1); }
