/* =====================================================
   WOMB-INARY.COM - Harry Potter Library Aesthetic
   ===================================================== */

/* -------------------- CSS Variables -------------------- */
:root {
    /* Primary Colors - Gold & Bronze */
    --gold-primary: #D4AF37;
    --gold-light: #F1CF87;
    --gold-dark: #A67C00;
    --bronze: #CD7F32;
    --bronze-light: #E8A84C;
    --bronze-dark: #8B5A2B;

    /* Library Wood Tones */
    --mahogany: #4E2A1E;
    --mahogany-light: #6B4423;
    --mahogany-dark: #3A1F16;
    --warm-brown: #5D3A1A;
    --dark-wood: #2C1810;
    --deep-wood: #1A0F0A;

    /* Ambient Colors */
    --candlelight: #FDB863;
    --candlelight-glow: rgba(253, 184, 99, 0.4);
    --firelight: #FF6B35;

    /* Parchment & Paper */
    --parchment: #F4E8D0;
    --parchment-light: #FFF8E7;
    --parchment-dark: #E6D5B8;
    --cream: #FFFEF5;

    /* Text Colors */
    --ink-dark: #1A0F0A;
    --ink-medium: #3D2914;
    --ink-light: #6B5344;

    /* Shadows & Glows */
    --shadow-soft: 0 10px 40px rgba(26, 15, 10, 0.3);
    --shadow-deep: 0 20px 60px rgba(26, 15, 10, 0.5);
    --shadow-glow: 0 0 30px rgba(212, 175, 55, 0.3);
    --text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);

    /* Typography */
    --font-display: 'Cinzel', serif;
    --font-elegant: 'Cormorant Garamond', serif;
    --font-body: 'Crimson Text', serif;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-xxl: 5rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 30px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.4s ease;
    --transition-slow: 0.6s ease;
}

/* -------------------- Reset & Base -------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    color: var(--ink-dark);
    background: var(--dark-wood);
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-fast);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
    color: var(--gold-primary);
}

/* -------------------- Parchment Overlay -------------------- */
.parchment-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1000;
    background-image: url('images/img10.jpg');
    background-size: cover;
    opacity: 0.03;
    mix-blend-mode: multiply;
}

/* -------------------- Candle Particles -------------------- */
.candle-particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 999;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--candlelight);
    border-radius: 50%;
    opacity: 0;
    animation: float-particle 8s infinite ease-in-out;
    box-shadow: 0 0 10px var(--candlelight), 0 0 20px var(--candlelight-glow);
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { left: 30%; animation-delay: 1.5s; }
.particle:nth-child(3) { left: 50%; animation-delay: 3s; }
.particle:nth-child(4) { left: 70%; animation-delay: 4.5s; }
.particle:nth-child(5) { left: 90%; animation-delay: 6s; }

@keyframes float-particle {
    0%, 100% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    50% {
        opacity: 0.4;
    }
    90% {
        opacity: 0;
    }
    95% {
        transform: translateY(-20vh) scale(1);
    }
}

/* -------------------- Container -------------------- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* -------------------- Hero Section -------------------- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.hero-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at center top, transparent 0%, rgba(26, 15, 10, 0.4) 70%),
        linear-gradient(to bottom, rgba(26, 15, 10, 0.2) 0%, rgba(26, 15, 10, 0.5) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: var(--space-xl) var(--space-md);
    max-width: 1000px;
}

/* -------------------- Logo/Crest -------------------- */
.logo-container {
    margin-bottom: var(--space-xl);
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-logo {
    width: 600px;
    height: auto;
    max-width: 90vw;
    filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.7));
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.logo-section {
    margin-bottom: var(--space-lg);
}

.crest-container {
    position: relative;
    display: inline-block;
    width: 180px;
    height: 200px;
}

.crown {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    z-index: 3;
}

.crown-svg {
    color: var(--gold-primary);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.shield {
    position: absolute;
    top: 35px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 120px;
    background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold-primary) 50%, var(--gold-light) 100%);
    clip-path: polygon(0 0, 100% 0, 100% 70%, 50% 100%, 0 70%);
    box-shadow: var(--shadow-glow), inset 0 2px 10px rgba(255, 255, 255, 0.3);
    z-index: 2;
}

.shield-inner {
    position: absolute;
    inset: 4px;
    background: linear-gradient(180deg, var(--mahogany) 0%, var(--mahogany-dark) 100%);
    clip-path: polygon(0 0, 100% 0, 100% 70%, 50% 100%, 0 70%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.shield-w {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gold-primary);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1;
}

.shield-icons {
    display: flex;
    gap: 8px;
    margin-top: 5px;
}

.shield-icons svg {
    width: 20px;
    height: 20px;
    color: var(--gold-light);
}

.laurel-left, .laurel-right {
    position: absolute;
    top: 40px;
    width: 40px;
    height: 100px;
    z-index: 1;
}

.laurel-left {
    left: 10px;
}

.laurel-right {
    right: 10px;
}

.laurel-left svg, .laurel-right svg {
    width: 100%;
    height: 100%;
    color: var(--gold-primary);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* -------------------- Brand Name -------------------- */
.brand-name {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    color: var(--parchment-light);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: var(--space-sm);
    text-shadow:
        0 0 20px rgba(212, 175, 55, 0.5),
        0 4px 8px rgba(0, 0, 0, 0.5);
}

.brand-womb, .brand-inary {
    color: var(--parchment-light);
}

.brand-dash {
    color: var(--gold-primary);
}

.brand-com {
    color: var(--gold-light);
    font-size: 0.6em;
}

/* -------------------- Tagline -------------------- */
.tagline {
    font-family: var(--font-elegant);
    font-size: clamp(1.55rem, 3.4vw, 2.2rem);
    font-style: italic;
    color: var(--gold-light);
    margin-bottom: var(--space-xl);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* -------------------- Navigation Buttons (OLD - kept for other pages) -------------------- */
.nav-buttons {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-md);
    max-width: 900px;
    margin: 0 auto;
}

/* -------------------- NEW Hero Navigation -------------------- */
.nav-buttons-new {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xl);
    max-width: 700px;
    margin: 0 auto;
}

/* Featured Main Card */
.nav-card.featured {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-lg) var(--space-xl);
    background: linear-gradient(135deg,
        rgba(40, 22, 15, 0.92) 0%,
        rgba(30, 16, 10, 0.96) 100%);
    border: 2px solid var(--gold-primary);
    border-radius: 60px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.7),
        0 0 80px rgba(212, 175, 55, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.nav-card.featured:hover {
    transform: translateY(-4px);
    border-color: var(--gold-light);
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.8),
        0 0 100px rgba(212, 175, 55, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.nav-card-symbol {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--ink-dark);
    background: linear-gradient(145deg, var(--gold-light) 0%, var(--gold-primary) 50%, var(--gold-dark) 100%);
    border-radius: 50%;
    box-shadow:
        0 4px 20px rgba(212, 175, 55, 0.5),
        inset 0 2px 4px rgba(255, 255, 255, 0.4),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    transition: all 0.4s ease;
}

.nav-card.featured:hover .nav-card-symbol {
    transform: scale(1.05);
    box-shadow:
        0 6px 30px rgba(212, 175, 55, 0.6),
        inset 0 2px 4px rgba(255, 255, 255, 0.5),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2);
}

.nav-card-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-card-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--parchment-light);
    letter-spacing: 0.04em;
}

.nav-card-desc {
    font-family: var(--font-elegant);
    font-size: 1.05rem;
    font-style: italic;
    color: var(--gold-light);
    opacity: 0.9;
}

/* Secondary Navigation Links */
.nav-secondary {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    justify-content: center;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: rgba(26, 15, 10, 0.6);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 30px;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
}

.nav-link:hover {
    background: rgba(40, 22, 15, 0.8);
    border-color: var(--gold-primary);
    transform: translateY(-2px);
}

.nav-link-symbol {
    font-size: 1.1rem;
    color: var(--gold-primary);
    opacity: 0.8;
    transition: all 0.3s ease;
}

.nav-link:hover .nav-link-symbol {
    opacity: 1;
    transform: scale(1.1);
}

.nav-link-text {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--parchment);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.nav-link:hover .nav-link-text {
    color: var(--gold-light);
}

/* -------------------- Section Backgrounds -------------------- */
.section-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.section-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(26, 15, 10, 0.85) 0%,
        rgba(26, 15, 10, 0.7) 50%,
        rgba(26, 15, 10, 0.85) 100%);
    z-index: 1;
}

.section-gradient.dark {
    background: linear-gradient(180deg,
        rgba(26, 15, 10, 0.9) 0%,
        rgba(26, 15, 10, 0.8) 50%,
        rgba(26, 15, 10, 0.9) 100%);
}

.section-gradient.warm {
    background: linear-gradient(180deg,
        rgba(26, 15, 10, 0.8) 0%,
        rgba(93, 58, 26, 0.6) 50%,
        rgba(26, 15, 10, 0.8) 100%);
}

/* -------------------- Section Headers -------------------- */
.section-header {
    margin-bottom: var(--space-xl);
}

.section-header.center {
    text-align: center;
}

.section-header h2 {
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    margin-bottom: var(--space-sm);
    text-shadow: var(--text-shadow);
    font-weight: 500;
    letter-spacing: -0.01em;
}

.section-header p {
    font-family: var(--font-elegant);
    font-size: 1.15rem;
    font-style: italic;
    color: var(--parchment-dark);
    max-width: 600px;
    opacity: 0.9;
}

.section-header.center p {
    margin: 0 auto;
}

.section-label {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--gold-primary);
    margin-bottom: var(--space-sm);
}

.section-label::before,
.section-label::after {
    content: '';
    display: block;
    width: 28px;
    height: 1px;
    background: var(--gold-primary);
    opacity: 0.55;
    flex-shrink: 0;
}

/* -------------------- Chat Section -------------------- */
.chat-section {
    position: relative;
    padding: var(--space-xxl) 0;
    min-height: 100vh;
    isolation: isolate;
}

.chat-background {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.chat-container {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: var(--space-lg);
    align-items: start;
}

.chat-panel {
    background: rgba(255, 248, 231, 0.95);
    border-radius: var(--radius-lg);
    border: 2px solid var(--gold-dark);
    box-shadow: var(--shadow-deep);
    overflow: hidden;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    background: linear-gradient(90deg, var(--mahogany) 0%, var(--mahogany-light) 100%);
    border-bottom: 2px solid var(--gold-dark);
}

.chat-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gold-primary);
}

.chat-icon {
    width: 30px;
    height: 30px;
    background: var(--gold-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-status {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--candlelight);
    padding: 4px 12px;
    background: rgba(253, 184, 99, 0.2);
    border-radius: 20px;
    border: 1px solid var(--candlelight);
}

.chat-messages {
    padding: var(--space-md);
    min-height: 350px;
    max-height: 450px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    background: linear-gradient(180deg, var(--parchment-light) 0%, var(--parchment) 100%);
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--parchment-dark);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--gold-dark);
    border-radius: 4px;
}

.message {
    display: flex;
    gap: var(--space-sm);
    animation: fadeInUp 0.4s ease;
}

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

@keyframes textPulse {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 0.75; }
}

.message.loading .message-content {
    animation: textPulse 1.8s ease-in-out infinite;
    border-left-color: rgba(212, 175, 55, 0.4) !important;
}

.message.loading .message-content p {
    font-style: italic;
    color: var(--ink-light);
    letter-spacing: 0.01em;
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold-primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--cream);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.message.user .message-avatar {
    background: linear-gradient(135deg, var(--mahogany) 0%, var(--mahogany-light) 100%);
}

.message-content {
    max-width: 75%;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 245, 0.97);
    border: 1px solid var(--parchment-dark);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* AI bubble — subtle left gold rule */
.message.ai .message-content {
    border-left: 3px solid var(--gold-primary);
}

/* User bubble — warm parchment, gold border, no garish gradient */
.message.user .message-content {
    background: rgba(255, 248, 225, 0.95);
    border: 1px solid var(--gold-primary);
    border-right: 3px solid var(--gold-primary);
    color: var(--ink-dark);
}

.message-content p {
    font-size: 1rem;
    line-height: 1.65;
    font-family: var(--font-body);
}

/* Coined word highlight in chat */
.coined-word {
    font-family: var(--font-display);
    font-size: 1.05em;
    font-weight: 600;
    color: var(--gold-dark);
    letter-spacing: 0.02em;
    border-bottom: 1px solid var(--gold-primary);
    padding-bottom: 1px;
    position: relative;
    cursor: default;
}

/* Tooltip */
.coined-word::after {
    content: attr(data-definition);
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 248, 231, 0.98);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 400;
    font-style: italic;
    line-height: 1.6;
    letter-spacing: 0;
    padding: 12px 18px;
    border-radius: 8px;
    border: 1.5px solid var(--gold-primary);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(212, 175, 55, 0.15);
    white-space: normal;
    width: 270px;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 100;
}

/* Tooltip arrow */
.coined-word::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 9px);
    left: 50%;
    transform: translateX(-50%);
    border: 7px solid transparent;
    border-top-color: var(--gold-primary);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 101;
}

.coined-word:hover::after,
.coined-word:hover::before {
    opacity: 1;
}

.chat-input-area {
    padding: 14px var(--space-md);
    background: linear-gradient(180deg, var(--parchment-dark) 0%, var(--parchment) 100%);
    border-top: 1px solid var(--gold-dark);
}

.chat-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-form input {
    flex: 1;
    padding: 12px var(--space-md);
    font-family: var(--font-elegant);
    font-size: 1.05rem;
    font-style: italic;
    color: var(--ink-dark);
    background: rgba(255, 255, 245, 0.9);
    border: 1.5px solid var(--gold-dark);
    border-radius: 4px;
    outline: none;
    transition: var(--transition-fast);
}

.chat-form input:focus {
    border-color: var(--gold-primary);
    background: rgba(255, 255, 250, 1);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.18);
    font-style: normal;
}

.chat-form input::placeholder {
    color: var(--ink-light);
    font-style: italic;
    opacity: 0.75;
}

.send-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    color: var(--ink-dark);
    background: linear-gradient(145deg, var(--gold-light) 0%, var(--gold-primary) 60%, var(--gold-dark) 100%);
    border-radius: 50%;
    box-shadow: 0 3px 12px rgba(212, 175, 55, 0.35);
    transition: var(--transition-fast);
}

.send-button span {
    display: none;
}

.send-button:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 5px 18px rgba(212, 175, 55, 0.5);
}

.send-button svg {
    transition: var(--transition-fast);
}

.send-button:hover svg {
    transform: translateX(2px);
}

/* -------------------- Chat Sidebar -------------------- */
.chat-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.sidebar-panel {
    background: rgba(255, 248, 231, 0.9);
    border-radius: var(--radius-lg);
    border: 2px solid var(--gold-dark);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: linear-gradient(90deg, var(--mahogany) 0%, var(--mahogany-light) 100%);
    border-bottom: 2px solid var(--gold-dark);
}

.panel-header h3 {
    font-size: 0.95rem;
    color: var(--gold-primary);
}

.term-count, .demo-badge {
    font-family: var(--font-body);
    font-size: 0.75rem;
    padding: 2px 10px;
    border-radius: 15px;
    background: rgba(212, 175, 55, 0.2);
    color: var(--gold-light);
    border: 1px solid var(--gold-dark);
}

.panel-body {
    padding: var(--space-md);
    background: var(--parchment-light);
}

.panel-body p {
    font-size: 0.9rem;
    color: var(--ink-medium);
    line-height: 1.6;
}

.empty-state {
    font-style: italic;
    color: var(--ink-light);
}

.term-suggestion {
    padding: var(--space-sm);
    margin-bottom: var(--space-sm);
    background: var(--cream);
    border: 1px solid var(--parchment-dark);
    border-radius: var(--radius-sm);
}

.term-suggestion:last-child {
    margin-bottom: 0;
}

.term-suggestion h4 {
    font-family: var(--font-display);
    font-size: 0.95rem;
    color: var(--gold-dark);
    margin-bottom: 4px;
}

.term-suggestion p {
    font-size: 0.85rem;
}

/* AI coined word badge */
.term-suggestion.ai-coined {
    border-color: var(--gold-primary);
    background: rgba(212, 175, 55, 0.08);
}

.coined-badge {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.7rem;
    font-family: var(--font-display);
    letter-spacing: 0.05em;
    color: var(--gold-primary);
    text-transform: uppercase;
}

/* Submit panel */
.submit-word-preview {
    padding: var(--space-sm);
    background: var(--cream);
    border: 1px solid var(--gold-primary);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-sm);
}

.submit-word-preview strong {
    display: block;
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--gold-dark);
    margin-bottom: 4px;
}

.submit-word-preview p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

.btn-submit-word {
    width: 100%;
    padding: 10px 16px;
    background: var(--gold-primary);
    color: var(--parchment-dark);
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    margin-bottom: var(--space-sm);
}

.btn-submit-word:hover:not(:disabled) {
    background: var(--gold-dark);
    transform: translateY(-1px);
}

.btn-submit-word.submitted {
    background: rgba(212, 175, 55, 0.3);
    color: var(--gold-primary);
    cursor: default;
}

.submit-note {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
    margin: 0;
    line-height: 1.4;
}

/* -------------------- Preview Section -------------------- */
.preview-section {
    position: relative;
    padding: var(--space-xxl) 0;
    isolation: isolate;
}

.preview-background {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.word-card {
    position: relative;
    background: rgba(255, 248, 231, 0.95);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    transition: var(--transition-medium);
}

.word-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.word-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.2);
    border-color: var(--gold-primary);
}

.word-card:hover::before {
    opacity: 1;
}

.word-card h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
    color: var(--mahogany-dark);
    letter-spacing: 0.01em;
}

.word-card .definition {
    font-size: 0.975rem;
    color: var(--ink-medium);
    margin-bottom: var(--space-md);
    line-height: 1.65;
    font-family: var(--font-elegant);
    font-style: italic;
}

.word-tag {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    padding: 4px 10px;
    background: transparent;
    color: var(--gold-dark);
    border-radius: 2px;
    border: 1px solid rgba(166, 124, 0, 0.5);
    opacity: 0.8;
}

.section-cta {
    text-align: center;
}

/* -------------------- Buttons -------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-lg);
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 30px;
    transition: var(--transition-fast);
}

.btn-primary {
    color: var(--ink-dark);
    background: linear-gradient(145deg, var(--gold-light) 0%, var(--gold-primary) 50%, var(--gold-dark) 100%);
    border: none;
    box-shadow:
        0 4px 20px rgba(212, 175, 55, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    font-weight: 600;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 30px rgba(212, 175, 55, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-secondary {
    color: var(--gold-primary);
    background: transparent;
    border: 1px solid var(--gold-primary);
}

.btn-secondary:hover {
    background: rgba(212, 175, 55, 0.1);
    transform: translateY(-2px);
}

.btn-ghost {
    color: var(--parchment);
    background: rgba(40, 22, 15, 0.7);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.btn-ghost:hover {
    background: rgba(60, 32, 22, 0.9);
    border-color: var(--gold-primary);
    transform: translateY(-2px);
}

/* -------------------- Features Section -------------------- */
.features-section {
    position: relative;
    padding: var(--space-xxl) 0;
    isolation: isolate;
}

.features-background {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: var(--space-xl);
    align-items: center;
}

.features-copy h2 {
    margin-bottom: var(--space-md);
}

.features-copy p {
    color: var(--parchment-dark);
    margin-bottom: var(--space-md);
    font-size: 1.1rem;
}

.text-link {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gold-primary);
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
}

.text-link span {
    transition: var(--transition-fast);
}

.text-link:hover span {
    transform: translateX(5px);
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.feature-item {
    display: flex;
    gap: var(--space-lg);
    padding: var(--space-lg);
    background: rgba(255, 248, 231, 0.05);
    border-radius: var(--radius-md);
    border: 1px solid rgba(212, 175, 55, 0.15);
    transition: var(--transition-fast);
}

.feature-item:hover {
    background: rgba(255, 248, 231, 0.1);
    border-color: rgba(212, 175, 55, 0.4);
}

.feature-number {
    font-family: var(--font-elegant);
    font-size: 2.5rem;
    font-weight: 400;
    font-style: italic;
    color: var(--gold-primary);
    line-height: 1;
    opacity: 0.7;
    min-width: 50px;
}

.feature-content h3 {
    font-size: 1.15rem;
    margin-bottom: var(--space-xs);
    color: var(--parchment-light);
}

.feature-content p {
    color: var(--parchment-dark);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* -------------------- Trust Section -------------------- */
.trust-section {
    position: relative;
    padding: var(--space-xl) 0;
    isolation: isolate;
}

.trust-background {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.trust-section .section-header {
    margin-bottom: var(--space-lg);
}

.trust-grid {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    flex-wrap: wrap;
    max-width: 900px;
    margin: 0 auto;
}

.trust-item {
    text-align: center;
    padding: var(--space-md) var(--space-lg);
    background: rgba(255, 248, 231, 0.03);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    flex: 0 1 200px;
}

.trust-item:hover {
    background: rgba(255, 248, 231, 0.06);
    border-color: rgba(212, 175, 55, 0.3);
}

.trust-item h3 {
    font-size: 0.9rem;
    margin-bottom: var(--space-xs);
    color: var(--gold-primary);
}

.trust-item p {
    color: rgba(244, 232, 208, 0.55);
    font-size: 0.85rem;
    line-height: 1.5;
}

/* -------------------- CTA Section -------------------- */
.cta-section {
    position: relative;
    padding: var(--space-xxl) 0;
    isolation: isolate;
}

.cta-background {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.cta-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-xl);
    padding: var(--space-xl) calc(var(--space-xl) * 1.5);
    background: linear-gradient(135deg, rgba(60, 32, 22, 0.95) 0%, rgba(40, 22, 15, 0.98) 100%);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: var(--radius-xl);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.cta-content h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: var(--space-sm);
}

.cta-content p {
    color: var(--parchment-dark);
    font-size: 1.1rem;
}

.cta-buttons {
    display: flex;
    gap: var(--space-md);
}

/* -------------------- Submit Form -------------------- */
.submit-card {
    max-width: 720px;
    margin: 0 auto;
    padding: var(--space-xl) calc(var(--space-xl) * 1.25);
    background: linear-gradient(135deg, rgba(60, 32, 22, 0.95) 0%, rgba(40, 22, 15, 0.98) 100%);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: var(--radius-xl);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.submit-intro {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.submit-intro h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: var(--space-sm);
}

.submit-intro p {
    color: var(--parchment-dark);
    font-size: 1rem;
    line-height: 1.6;
    max-width: 50ch;
    margin: 0 auto;
}

.submit-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.form-row:has(.form-field-narrow) {
    grid-template-columns: 2fr 1fr;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-label {
    font-family: var(--font-display);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold-primary);
}

.form-label-optional {
    color: rgba(241, 207, 135, 0.6);
}

.form-label em {
    font-style: italic;
    font-family: var(--font-elegant);
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.8rem;
    color: rgba(244, 232, 208, 0.45);
    margin-left: 0.25rem;
}

.submit-form input[type="text"],
.submit-form input[type="email"],
.submit-form select,
.submit-form textarea {
    width: 100%;
    padding: 0.75rem 0.9rem;
    background: rgba(255, 248, 231, 0.04);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: var(--radius-sm);
    color: var(--parchment-light);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.5;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.submit-form textarea {
    resize: vertical;
    min-height: 96px;
    font-family: var(--font-elegant);
}

.submit-form input::placeholder,
.submit-form textarea::placeholder {
    color: rgba(244, 232, 208, 0.35);
    font-style: italic;
}

.submit-form input:focus,
.submit-form select:focus,
.submit-form textarea:focus {
    outline: none;
    border-color: var(--gold-primary);
    background: rgba(255, 248, 231, 0.07);
}

.submit-form select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--gold-primary) 50%), linear-gradient(135deg, var(--gold-primary) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 2rem;
}

.form-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.submit-row {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    align-items: center;
    margin-top: var(--space-sm);
}

.submit-row .btn-primary {
    min-width: 240px;
}

.submit-status {
    min-height: 1.25rem;
    margin: 0;
    font-family: var(--font-elegant);
    font-style: italic;
    font-size: 0.95rem;
    color: rgba(244, 232, 208, 0.65);
    text-align: center;
}

.submit-status.is-success {
    color: var(--gold-light);
}

.submit-status.is-error {
    color: #e8a08a;
}

@media (max-width: 640px) {
    .submit-card {
        padding: var(--space-lg) var(--space-md);
    }
    .form-row,
    .form-row:has(.form-field-narrow) {
        grid-template-columns: 1fr;
    }
}

/* -------------------- Footer -------------------- */
.footer {
    padding: var(--space-xl) 0 var(--space-lg);
    background: linear-gradient(180deg, var(--dark-wood) 0%, var(--deep-wood) 100%);
    border-top: 1px solid rgba(212, 175, 55, 0.2);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.footer-brand .logo-text {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--gold-primary);
    letter-spacing: 0.02em;
}

.footer-brand p {
    color: rgba(244, 232, 208, 0.5);
    font-size: 0.9rem;
    margin-top: var(--space-xs);
    font-family: var(--font-elegant);
    font-style: italic;
}

.footer-nav {
    display: flex;
    gap: var(--space-lg);
}

.footer-nav a {
    font-family: var(--font-display);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(244, 232, 208, 0.5);
    transition: var(--transition-fast);
}

.footer-nav a:hover {
    color: var(--gold-primary);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-md);
    border-top: 1px solid rgba(212, 175, 55, 0.1);
}

.footer-bottom p {
    font-size: 0.8rem;
    color: rgba(244, 232, 208, 0.35);
    letter-spacing: 0.02em;
}

/* -------------------- Page Headers (for other pages) -------------------- */
.page-header {
    position: relative;
    padding: 120px 0 var(--space-xl);
    text-align: center;
}

.page-header-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.page-header h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: var(--space-sm);
    text-shadow: var(--text-shadow);
}

.page-header .lead {
    font-size: 1.2rem;
    color: var(--parchment-dark);
    max-width: 600px;
    margin: 0 auto;
}

/* -------------------- Sticky Header (for inner pages) -------------------- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: var(--space-sm) 0;
    background: rgba(26, 15, 10, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--gold-dark);
    transition: var(--transition-fast);
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gold-primary);
}

.site-nav {
    display: flex;
    gap: var(--space-lg);
}

.site-nav a {
    font-family: var(--font-display);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--parchment-dark);
    position: relative;
}

.site-nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gold-primary);
    transition: var(--transition-fast);
}

.site-nav a:hover,
.site-nav a.active {
    color: var(--gold-primary);
}

.site-nav a:hover::after,
.site-nav a.active::after {
    width: 100%;
}

/* -------------------- Content Sections -------------------- */
.content-section {
    padding: var(--space-xxl) 0;
}

.content-section.alt {
    background: rgba(78, 42, 30, 0.3);
}

/* -------------------- Grid Layouts -------------------- */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
}

/* -------------------- Cards (for various pages) -------------------- */
.card {
    background: rgba(255, 248, 231, 0.95);
    border: 2px solid var(--gold-dark);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    box-shadow: var(--shadow-soft);
    transition: var(--transition-medium);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-deep), var(--shadow-glow);
    border-color: var(--gold-primary);
}

.card h3 {
    margin-bottom: var(--space-sm);
}

.card p {
    color: var(--ink-medium);
}

/* -------------------- Event Cards -------------------- */
.event-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: var(--space-lg);
    align-items: center;
    padding: var(--space-lg);
    background: rgba(255, 248, 231, 0.95);
    border: 2px solid var(--gold-dark);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    transition: var(--transition-medium);
}

.event-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-deep);
    border-color: var(--gold-primary);
}

.event-date {
    width: 80px;
    height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold-primary) 100%);
    border-radius: var(--radius-sm);
    text-align: center;
}

.event-month {
    font-family: var(--font-display);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--cream);
}

.event-day {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--cream);
    line-height: 1;
}

.event-info h3 {
    font-size: 1.2rem;
    margin-bottom: var(--space-xs);
}

.event-info p {
    color: var(--ink-medium);
    font-size: 0.95rem;
}

.event-meta {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-sm);
    font-size: 0.85rem;
    color: var(--ink-light);
}

.event-name-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
    margin-bottom: var(--space-xs);
}

.event-name-row h3 {
    margin-bottom: 0;
}

.event-category {
    flex-shrink: 0;
}

.events-empty {
    padding: var(--space-xxl) 0;
    text-align: center;
    font-family: var(--font-elegant);
    font-style: italic;
    color: var(--ink-light);
    font-size: 1.05rem;
}

/* -------------------- Product Cards -------------------- */
.product-card {
    background: rgba(255, 248, 231, 0.95);
    border: 2px solid var(--gold-dark);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-medium);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-deep), var(--shadow-glow);
    border-color: var(--gold-primary);
}

.product-image {
    height: 280px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-elegant);
    font-style: italic;
    color: var(--ink-light);
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.product-info {
    padding: var(--space-md);
}

.product-info h3 {
    font-size: 1.1rem;
    margin-bottom: var(--space-xs);
}

.product-info p {
    color: var(--ink-medium);
    font-size: 0.9rem;
    margin-bottom: var(--space-sm);
}

.product-price {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gold-dark);
}

/* -------------------- Rights Page Sections -------------------- */
.rights-section {
    padding: var(--space-xl) 0;
}

.rights-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl);
}

.rights-card {
    padding: var(--space-xl);
    background: rgba(255, 248, 231, 0.95);
    border: 2px solid var(--gold-dark);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.rights-card h3 {
    font-size: 1.5rem;
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.rights-card h3 svg {
    width: 30px;
    height: 30px;
    color: var(--gold-primary);
}

.rights-card ul {
    list-style: none;
    margin-top: var(--space-md);
}

.rights-card li {
    position: relative;
    padding-left: var(--space-md);
    margin-bottom: var(--space-sm);
    color: var(--ink-medium);
}

.rights-card li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 8px;
    height: 8px;
    background: var(--gold-primary);
    border-radius: 50%;
}

/* -------------------- Dictionary Page -------------------- */
.dictionary-toolbar {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
    padding: var(--space-md);
    background: rgba(255, 248, 231, 0.9);
    border: 2px solid var(--gold-dark);
    border-radius: var(--radius-md);
}

.search-input {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--ink-dark);
    background: var(--cream);
    border: 2px solid var(--gold-dark);
    border-radius: 30px;
    outline: none;
}

.search-input:focus {
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.filter-chips {
    display: flex;
    gap: var(--space-sm);
}

.filter-chip {
    padding: var(--space-xs) var(--space-md);
    font-family: var(--font-display);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-medium);
    background: var(--parchment);
    border: 1px solid var(--parchment-dark);
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.filter-chip:hover,
.filter-chip.active {
    color: var(--ink-dark);
    background: var(--gold-light);
    border-color: var(--gold-primary);
}

.dictionary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

/* -------------------- Responsive Design -------------------- */

/* ===== TABLET (1024px and below) ===== */
@media (max-width: 1024px) {
    .nav-buttons {
        grid-template-columns: repeat(2, 1fr);
    }

    .nav-card.featured {
        padding: var(--space-md) var(--space-lg);
    }

    .nav-card-symbol {
        width: 56px;
        height: 56px;
        font-size: 1.8rem;
    }

    .nav-card-title {
        font-size: 1.2rem;
    }

    .chat-container {
        grid-template-columns: 1fr;
    }

    .preview-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    .trust-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }

    .cta-card {
        flex-direction: column;
        text-align: center;
    }

    .dictionary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .rights-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== MOBILE LANDSCAPE / SMALL TABLET (768px and below) ===== */
@media (max-width: 768px) {
    :root {
        --space-xxl: 3rem;
        --space-xl: 2rem;
        --space-lg: 1.5rem;
    }

    /* Container - less padding on mobile */
    .container {
        padding: 0 var(--space-sm);
    }

    /* Grid utilities collapse on tablet/phone (prevents horizontal overflow) */
    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    /* ----- HERO SECTION - MOBILE ----- */
    .hero {
        min-height: 100svh; /* Use svh for mobile address bar */
        padding: var(--space-lg) 0;
    }

    .hero-content {
        padding: var(--space-lg) var(--space-sm);
    }

    /* Logo - scale nicely on mobile */
    .logo-container {
        margin-bottom: var(--space-lg);
    }

    .hero-logo {
        width: 280px;
        max-width: 75vw;
        filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.6));
    }

    /* Brand name */
    .brand-name {
        font-size: clamp(1.5rem, 6.8vw, 2.1rem);
        letter-spacing: 0.08em;
        margin-bottom: var(--space-xs);
        white-space: nowrap;
    }

    .brand-com {
        font-size: 0.55em;
        letter-spacing: 0.04em;
    }

    /* Tagline */
    .tagline {
        font-size: clamp(1.3rem, 4.5vw, 1.65rem);
        margin-bottom: var(--space-lg);
        padding: 0 var(--space-sm);
    }

    /* ----- NAVIGATION - MOBILE ----- */
    .nav-buttons-new {
        gap: var(--space-md);
        width: 100%;
        padding: 0 var(--space-xs);
    }

    /* Featured card - beautiful on mobile */
    .nav-card.featured {
        flex-direction: row;
        align-items: center;
        gap: var(--space-md);
        padding: var(--space-md) var(--space-lg);
        border-radius: 50px;
        width: 100%;
        max-width: 340px;
        margin: 0 auto;
    }

    .nav-card-symbol {
        width: 52px;
        height: 52px;
        font-size: 1.6rem;
        flex-shrink: 0;
    }

    .nav-card-content {
        align-items: flex-start;
        text-align: left;
    }

    .nav-card-title {
        font-size: 1.1rem;
    }

    .nav-card-desc {
        font-size: 0.9rem;
    }

    /* Secondary nav - 2x2 grid on mobile */
    .nav-secondary {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-xs);
        width: 100%;
        max-width: 340px;
        margin: 0 auto;
    }

    .nav-link {
        padding: var(--space-sm) var(--space-md);
        justify-content: center;
        min-height: 48px; /* Touch-friendly */
        border-radius: 24px;
    }

    .nav-link-symbol {
        font-size: 1rem;
    }

    .nav-link-text {
        font-size: 0.7rem;
        letter-spacing: 0.03em;
    }

    /* ----- SECTION HEADERS - MOBILE ----- */
    .section-header {
        margin-bottom: var(--space-lg);
        text-align: center;
    }

    .section-header h2 {
        font-size: clamp(1.5rem, 6vw, 2rem);
        margin-bottom: var(--space-xs);
    }

    .section-header p {
        font-size: 0.95rem;
        padding: 0 var(--space-sm);
    }

    .section-label {
        font-size: 0.7rem;
        margin-bottom: var(--space-xs);
    }

    /* ----- CHAT SECTION - MOBILE ----- */
    .chat-section {
        padding: var(--space-xl) 0;
        min-height: auto;
    }

    .chat-container {
        gap: var(--space-md);
    }

    .chat-panel {
        border-radius: var(--radius-md);
    }

    .chat-header {
        padding: var(--space-sm) var(--space-md);
    }

    .chat-title {
        font-size: 0.95rem;
        gap: var(--space-xs);
    }

    .chat-icon {
        width: 26px;
        height: 26px;
    }

    .chat-status {
        font-size: 0.7rem;
        padding: 3px 10px;
    }

    /* Chat messages - optimized for mobile */
    .chat-messages {
        min-height: 280px;
        max-height: 60vh;
        padding: var(--space-sm);
        gap: var(--space-sm);
    }

    .message {
        gap: var(--space-xs);
    }

    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    .message-content {
        max-width: 85%;
        padding: var(--space-xs) var(--space-sm);
        border-radius: var(--radius-sm);
    }

    .message-content p {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    /* Chat input - mobile optimized */
    .chat-input-area {
        padding: var(--space-sm);
    }

    .chat-form {
        gap: var(--space-xs);
    }

    .chat-form input {
        padding: 14px var(--space-md);
        font-size: 16px; /* Prevents iOS zoom */
        border-radius: 24px;
        border-width: 1.5px;
    }

    .send-button {
        padding: 14px 20px;
        border-radius: 24px;
        font-size: 0.85rem;
        min-width: 90px;
    }

    .send-button svg {
        width: 18px;
        height: 18px;
    }

    /* Chat sidebar - mobile */
    .chat-sidebar {
        margin-top: var(--space-md);
        gap: var(--space-sm);
    }

    .sidebar-panel {
        border-radius: var(--radius-md);
    }

    .panel-header {
        padding: var(--space-xs) var(--space-sm);
    }

    .panel-header h3 {
        font-size: 0.85rem;
    }

    .panel-body {
        padding: var(--space-sm);
    }

    .panel-body p {
        font-size: 0.85rem;
    }

    /* ----- WORD CARDS / PREVIEW - MOBILE ----- */
    .preview-section {
        padding: var(--space-xl) 0;
    }

    .preview-grid {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }

    .word-card {
        padding: var(--space-md);
        border-radius: var(--radius-sm);
    }

    .word-card h3 {
        font-size: 1.15rem;
        margin-bottom: var(--space-xs);
    }

    .word-card .definition {
        font-size: 0.9rem;
        margin-bottom: var(--space-sm);
        line-height: 1.5;
    }

    .word-tag {
        font-size: 0.6rem;
        padding: 4px 10px;
    }

    .section-cta {
        margin-top: var(--space-md);
    }

    .section-cta .btn {
        width: 100%;
        max-width: 280px;
    }

    /* ----- FEATURES SECTION - MOBILE ----- */
    .features-section {
        padding: var(--space-xl) 0;
    }

    .features-grid {
        gap: var(--space-lg);
    }

    .features-copy {
        text-align: center;
    }

    .features-copy h2 {
        font-size: clamp(1.4rem, 5vw, 1.8rem);
    }

    .features-copy p {
        font-size: 0.95rem;
    }

    .text-link {
        justify-content: center;
    }

    .features-list {
        gap: var(--space-sm);
    }

    .feature-item {
        padding: var(--space-md);
        gap: var(--space-md);
        border-radius: var(--radius-sm);
    }

    .feature-number {
        font-size: 2rem;
        min-width: 40px;
    }

    .feature-content h3 {
        font-size: 1rem;
    }

    .feature-content p {
        font-size: 0.85rem;
    }

    /* ----- TRUST SECTION - MOBILE ----- */
    .trust-section {
        padding: var(--space-lg) 0;
    }

    .trust-grid {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
        max-width: 100%;
    }

    .trust-item {
        padding: var(--space-md);
        flex: none;
        width: 100%;
    }

    .trust-item h3 {
        font-size: 0.85rem;
    }

    .trust-item p {
        font-size: 0.8rem;
    }

    /* ----- CTA SECTION - MOBILE ----- */
    .cta-section {
        padding: var(--space-xl) 0;
    }

    .cta-card {
        padding: var(--space-lg);
        border-radius: var(--radius-lg);
        gap: var(--space-lg);
    }

    .cta-content h2 {
        font-size: clamp(1.2rem, 5vw, 1.6rem);
    }

    .cta-content p {
        font-size: 0.95rem;
    }

    .cta-buttons {
        flex-direction: column;
        width: 100%;
        gap: var(--space-sm);
    }

    .cta-buttons .btn {
        width: 100%;
        padding: var(--space-md) var(--space-lg);
        min-height: 52px;
    }

    /* ----- FOOTER - MOBILE ----- */
    .footer {
        padding: var(--space-lg) 0 var(--space-md);
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: var(--space-md);
    }

    .footer-brand .logo-text {
        font-size: 1.2rem;
    }

    .footer-brand p {
        font-size: 0.85rem;
    }

    .footer-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--space-sm) var(--space-md);
    }

    .footer-nav a {
        font-size: 0.75rem;
        padding: var(--space-xs) 0;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .footer-bottom {
        padding-top: var(--space-sm);
    }

    .footer-bottom p {
        font-size: 0.75rem;
    }

    /* ----- BUTTONS - MOBILE ----- */
    .btn {
        min-height: 48px;
        padding: var(--space-sm) var(--space-lg);
        font-size: 0.85rem;
    }

    /* ----- OTHER PAGES - MOBILE ----- */
    .site-header .container {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .site-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.65rem 0.9rem;
    }

    .site-nav a {
        font-size: 0.72rem;
        letter-spacing: 0.06em;
    }

    .dictionary-toolbar {
        flex-direction: column;
        padding: var(--space-sm);
    }

    .filter-chips {
        flex-wrap: wrap;
        justify-content: center;
    }

    .filter-chip {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .dictionary-grid {
        grid-template-columns: 1fr;
    }

    .event-card {
        grid-template-columns: 1fr;
        text-align: center;
        padding: var(--space-md);
    }

    .event-date {
        margin: 0 auto var(--space-sm);
        width: 70px;
        height: 70px;
    }

    .event-day {
        font-size: 1.5rem;
    }

    .event-meta {
        justify-content: center;
    }

    .page-header {
        padding: 80px 0 var(--space-lg);
    }

    .page-header h1 {
        font-size: clamp(1.8rem, 6vw, 2.5rem);
    }

    .page-header .lead {
        font-size: 1rem;
        padding: 0 var(--space-sm);
    }
}

/* ===== SMALL MOBILE (480px and below) ===== */
@media (max-width: 480px) {
    :root {
        --space-lg: 1.25rem;
        --space-xl: 1.75rem;
        --space-xxl: 2.5rem;
    }

    /* All grid utilities → single column on phones */
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    /* Hero adjustments for small screens */
    .hero-logo {
        width: 220px;
        max-width: 65vw;
    }

    .brand-name {
        font-size: 1.5rem;
        letter-spacing: 0.08em;
    }

    .tagline {
        font-size: 1.25rem;
    }

    /* Navigation - stack vertically on very small screens */
    .nav-card.featured {
        max-width: 100%;
        padding: var(--space-sm) var(--space-md);
    }

    .nav-card-symbol {
        width: 44px;
        height: 44px;
        font-size: 1.4rem;
    }

    .nav-card-title {
        font-size: 1rem;
    }

    .nav-card-desc {
        font-size: 0.8rem;
    }

    .nav-secondary {
        max-width: 100%;
    }

    .nav-link {
        padding: 10px var(--space-sm);
    }

    .nav-link-symbol {
        font-size: 0.9rem;
    }

    .nav-link-text {
        font-size: 0.65rem;
    }

    /* Section headers */
    .section-header h2 {
        font-size: 1.4rem;
    }

    .section-header p {
        font-size: 0.9rem;
    }

    /* Chat - compact for small screens */
    .chat-messages {
        min-height: 220px;
        max-height: 50vh;
    }

    .message-content {
        max-width: 88%;
    }

    .message-content p {
        font-size: 0.85rem;
    }

    .chat-form input {
        padding: 12px var(--space-sm);
    }

    .send-button {
        padding: 12px 14px;
        min-width: 52px;
    }

    .send-button span {
        display: none; /* Hide text on very small screens */
    }

    .send-button svg {
        width: 20px;
        height: 20px;
    }

    /* Word cards */
    .word-card {
        padding: var(--space-sm) var(--space-md);
    }

    .word-card h3 {
        font-size: 1.05rem;
    }

    .word-card .definition {
        font-size: 0.85rem;
    }

    /* Features */
    .feature-item {
        padding: var(--space-sm);
        gap: var(--space-sm);
    }

    .feature-number {
        font-size: 1.6rem;
        min-width: 32px;
    }

    .feature-content h3 {
        font-size: 0.95rem;
    }

    .feature-content p {
        font-size: 0.8rem;
    }

    /* CTA */
    .cta-card {
        padding: var(--space-md);
    }

    .cta-content h2 {
        font-size: 1.15rem;
    }

    .cta-content p {
        font-size: 0.85rem;
    }

    /* Footer */
    .footer-nav {
        gap: var(--space-xs) var(--space-sm);
    }

    .footer-nav a {
        font-size: 0.7rem;
    }
}

/* ===== VERY SMALL MOBILE (360px and below) ===== */
@media (max-width: 360px) {
    .hero-logo {
        width: 180px;
    }

    .brand-name {
        font-size: 1.3rem;
    }

    .nav-card.featured {
        flex-direction: column;
        text-align: center;
        border-radius: 24px;
    }

    .nav-card-content {
        align-items: center;
    }

    .nav-secondary {
        grid-template-columns: 1fr 1fr;
    }

    .chat-messages {
        min-height: 200px;
    }
}

/* ===== LANDSCAPE MOBILE ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: var(--space-md) 0;
    }

    .hero-logo {
        width: 150px;
    }

    .logo-container {
        margin-bottom: var(--space-sm);
    }

    .tagline {
        margin-bottom: var(--space-md);
    }

    .nav-buttons-new {
        gap: var(--space-sm);
    }

    .chat-messages {
        min-height: 150px;
        max-height: 40vh;
    }
}

/* ===== SAFE AREA INSETS (for notched phones) ===== */
@supports (padding: max(0px)) {
    .hero-content {
        padding-left: max(var(--space-sm), env(safe-area-inset-left));
        padding-right: max(var(--space-sm), env(safe-area-inset-right));
    }

    .container {
        padding-left: max(var(--space-sm), env(safe-area-inset-left));
        padding-right: max(var(--space-sm), env(safe-area-inset-right));
    }

    .footer {
        padding-bottom: max(var(--space-md), env(safe-area-inset-bottom));
    }

    .chat-input-area {
        padding-bottom: max(var(--space-sm), env(safe-area-inset-bottom));
    }
}

/* ===== TOUCH-FRIENDLY ENHANCEMENTS ===== */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .nav-link,
    .btn,
    .filter-chip,
    .footer-nav a {
        min-height: 48px;
    }

    /* Remove hover effects that don't work on touch */
    .nav-card.featured:hover,
    .word-card:hover,
    .feature-item:hover,
    .trust-item:hover {
        transform: none;
    }

    /* Active states for touch */
    .nav-card.featured:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }

    .btn:active {
        transform: scale(0.97);
        transition: transform 0.1s ease;
    }

    .word-card:active {
        transform: scale(0.99);
        transition: transform 0.1s ease;
    }

    .nav-link:active {
        background: rgba(212, 175, 55, 0.2);
        transform: scale(0.97);
    }

    .send-button:active {
        transform: scale(0.95);
        box-shadow: 0 2px 10px rgba(212, 175, 55, 0.3);
    }
}

/* ===== MOBILE PERFORMANCE & UX ===== */
@media (max-width: 768px) {
    /* Smoother scrolling */
    html {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }

    /* Prevent text selection on buttons for cleaner UX */
    .btn,
    .nav-link,
    .nav-card.featured,
    .send-button {
        -webkit-user-select: none;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }

    /* Disable floating animation on mobile for performance */
    .hero-logo {
        animation: none;
    }

    /* Reduce particle effects on mobile for performance */
    .candle-particles .particle {
        animation-duration: 12s;
    }

    .candle-particles .particle:nth-child(3),
    .candle-particles .particle:nth-child(5) {
        display: none;
    }

    /* Smoother message animations */
    .message {
        animation: fadeInUp 0.3s ease;
    }

    /* Focus states for accessibility */
    .chat-form input:focus {
        outline: none;
        border-color: var(--gold-primary);
        box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.25);
    }

    .btn:focus,
    .nav-link:focus,
    .send-button:focus {
        outline: 2px solid var(--gold-primary);
        outline-offset: 2px;
    }
}

/* ===== DARK MODE PREFERENCE (optional enhancement) ===== */
@media (prefers-reduced-motion: reduce) {
    .hero-logo,
    .particle,
    .message,
    .reveal {
        animation: none !important;
        transition: none !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .hero-background,
    .section-bg,
    .parchment-overlay,
    .candle-particles,
    .chat-section,
    .cta-section,
    .footer {
        display: none;
    }

    body {
        background: white;
        color: black;
    }
}

/* -------------------- Animations -------------------- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(212, 175, 55, 0.5);
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease forwards;
}

.animate-slide-up {
    animation: slideUp 0.6s ease forwards;
}

.animate-glow {
    animation: glow 3s ease-in-out infinite;
}

/* -------------------- Section Stacking Fix -------------------- */
/* Background divs use z-index:0, content container lifts to z-index:1.
   Avoids negative z-index sinking below the body background color. */
.chat-background,
.preview-background,
.features-background,
.trust-background,
.cta-background {
    z-index: 0 !important;
}

.chat-section > .container,
.preview-section > .container,
.features-section > .container,
.trust-section > .container,
.cta-section > .container {
    position: relative;
    z-index: 1;
}

/* -------------------- Scroll Reveal -------------------- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* -------------------- Utility Classes -------------------- */
.text-center { text-align: center; }
.text-gold { color: var(--gold-primary); }
.text-parchment { color: var(--parchment); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

/* ==================== Word Modal ==================== */

#dictionaryGrid .word-card {
    cursor: pointer;
}

.word-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 5, 2, 0.85);
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.word-modal-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.word-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -46%);
    z-index: 901;
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    background: rgba(255, 248, 231, 0.98);
    border: 1px solid rgba(212, 175, 55, 0.6);
    border-radius: var(--radius-md);
    padding: var(--space-xl) var(--space-xl) var(--space-lg);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    text-align: center;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.word-modal.is-open {
    display: flex;
    opacity: 1;
    transform: translate(-50%, -50%);
}

.word-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.word-modal__close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--ink-light);
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s;
}

.word-modal__close:hover {
    color: var(--mahogany-dark);
}

.word-modal__portrait {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    margin: 0 auto var(--space-md);
    background: var(--mahogany-dark);
    border: 2px solid var(--gold-primary);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.word-modal__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.word-modal__initial {
    font-family: var(--font-display);
    font-size: 2.2rem;
    color: var(--gold-primary);
    line-height: 1;
    user-select: none;
}

.word-modal__name {
    font-family: var(--font-display);
    font-size: 1.65rem;
    color: var(--mahogany-dark);
    margin-bottom: var(--space-xs);
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.word-modal__tag {
    margin-bottom: var(--space-md);
    display: inline-block;
}

.word-modal__def {
    font-family: var(--font-elegant);
    font-style: italic;
    font-size: 1.05rem;
    color: var(--ink-medium);
    line-height: 1.75;
    margin-bottom: var(--space-lg);
    text-align: center;
}

.word-modal__share {
    width: 100%;
    cursor: pointer;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
}

@media (max-width: 480px) {
    .word-modal {
        padding: var(--space-lg) var(--space-md) var(--space-md);
        max-height: 95vh;
    }

    .word-modal__name {
        font-size: 1.35rem;
    }

    .word-modal__def {
        font-size: 0.975rem;
    }
}
