/* css/base.css
   Modern, premium dark theme for Zorn's Dungeon. Loaded by every page.

   Design language:
   - Cinzel display + Inter body
   - Deep warm-black + bone white + cardinal red + soft gold
   - Generous whitespace, refined motion, no harsh CRT effects
   - Premium cinematic feel for a horror / blood-sport brand */

:root {
    /* ===== Color ===== */
    --bg:            #0a0708;
    --bg-elev:       #14101a;
    --bg-elev-2:     #1c1620;
    --bg-overlay:    rgba(10, 7, 8, 0.72);

    --text:          #f5f1ea;
    --text-muted:    #a89c8e;
    --text-faint:    #7d7168;

    --blood:         #c8102e;
    --blood-bright:  #e8324c;
    --blood-deep:    #6f0817;
    --blood-soft:    rgba(200, 16, 46, 0.16);

    --gold:          #d4af37;
    --gold-bright:   #f0c14a;
    --gold-soft:     rgba(212, 175, 55, 0.14);

    --border:        rgba(245, 241, 234, 0.08);
    --border-strong: rgba(245, 241, 234, 0.16);
    --border-blood:  rgba(200, 16, 46, 0.55);

    /* ===== Type ===== */
    --font-display:  'Cinzel', 'Times New Roman', serif;
    --font-body:     'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

    /* ===== Motion ===== */
    --ease-smooth:   cubic-bezier(0.22, 1, 0.36, 1);
    --ease-out:      cubic-bezier(0.16, 1, 0.3, 1);
    --t-fast:        180ms;
    --t-base:        320ms;
    --t-slow:        680ms;

    /* ===== Shadows ===== */
    --shadow-sm:   0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md:   0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-lg:   0 24px 64px rgba(0, 0, 0, 0.6);
    --shadow-blood:  0 12px 36px rgba(200, 16, 46, 0.35);

    /* ===== Layout ===== */
    --content-w:    1180px;
    --prose-w:      720px;

    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

/* Belt-and-suspenders: ensure the hidden attribute always hides
   elements, regardless of class-level display rules. The HTML spec
   says [hidden] should display:none, but a class rule with equal
   specificity that defines display can shadow it. */
[hidden] { display: none !important; }

html {
    scroll-behavior: smooth;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    min-height: 100dvh;
    overflow-x: hidden;
}

body {
    /* Subtle film grain — a tiny SVG noise tile, low opacity */
    background-image:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.04 0'/></filter><rect width='180' height='180' filter='url(%23n)'/></svg>");
    background-repeat: repeat;
}

/* ===== Headings ===== */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.15;
    margin: 0;
    color: var(--text);
}

h1 { font-size: clamp(2.75rem, 7vw, 5.75rem); letter-spacing: 0.04em; }
h2 { font-size: clamp(2rem, 4.5vw, 3.25rem); letter-spacing: 0.06em; text-transform: uppercase; }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); letter-spacing: 0.08em; text-transform: uppercase; }

p { margin: 0 0 1.1em; }

a {
    color: var(--blood-bright);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color var(--t-fast) var(--ease-smooth),
                border-color var(--t-fast) var(--ease-smooth);
}
a:hover {
    color: var(--gold-bright);
    border-bottom-color: var(--gold-bright);
}

::selection { background: var(--blood); color: var(--text); }

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 18px 28px;
    background: var(--blood);
    color: var(--text);
    border: 1px solid var(--blood);
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition:
        background var(--t-fast) var(--ease-smooth),
        border-color var(--t-fast) var(--ease-smooth),
        transform var(--t-fast) var(--ease-smooth),
        box-shadow var(--t-base) var(--ease-smooth);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}
.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.12), transparent 50%);
    opacity: 0.55;
    pointer-events: none;
}
.btn:hover {
    background: var(--blood-bright);
    border-color: var(--blood-bright);
    transform: translateY(-2px);
    box-shadow: var(--shadow-blood);
}
.btn:active {
    transform: translateY(0);
}
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: var(--shadow-sm);
}
.btn:focus-visible {
    outline: 2px solid var(--gold-bright);
    outline-offset: 2px;
}

.btn--ghost {
    background: transparent;
    border-color: var(--border-strong);
    color: var(--text);
    box-shadow: none;
}
.btn--ghost:hover {
    background: var(--bg-elev);
    border-color: var(--text-muted);
    color: var(--text);
    box-shadow: var(--shadow-md);
}

/* ===== Inputs ===== */
input[type="email"],
input[type="text"] {
    font-family: var(--font-body);
    font-size: 16px;
    padding: 18px 20px;
    width: 100%;
    background: var(--bg-elev);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 4px;
    outline: none;
    transition:
        border-color var(--t-fast) var(--ease-smooth),
        box-shadow var(--t-base) var(--ease-smooth),
        background var(--t-fast) var(--ease-smooth);
}
input::placeholder { color: var(--text-faint); }
input:focus {
    border-color: var(--blood-bright);
    box-shadow: 0 0 0 4px rgba(200, 16, 46, 0.16);
    background: var(--bg-elev-2);
}

/* ===== Layout primitives ===== */
.container {
    width: 100%;
    max-width: var(--content-w);
    margin: 0 auto;
    padding: 0 24px;
}
.container--prose {
    max-width: var(--prose-w);
}

section.section {
    padding: 96px 0;
    position: relative;
}

/* ===== Utility text styles ===== */
.eyebrow {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0;
    margin: 0;
}
.eyebrow--blood { color: var(--blood-bright); }
.eyebrow--gold  { color: var(--gold-bright); }

.lead {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.25rem, 2.4vw, 1.75rem);
    line-height: 1.4;
    color: var(--text);
}

.muted   { color: var(--text-muted); }
.gold    { color: var(--gold-bright); }
.blood   { color: var(--blood-bright); }

/* ===== Live indicator pills ===== */
.live-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text);
    background: rgba(20, 16, 26, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    user-select: none;
}
.live-pill .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--blood-bright);
    box-shadow: 0 0 0 0 rgba(232, 50, 76, 0.7);
    animation: livePulse 2s ease-out infinite;
}
.live-pill .count {
    font-variant-numeric: tabular-nums;
    color: var(--text);
    font-weight: 600;
}
.live-pill .label { color: var(--text-muted); }

/* Spawned variant — gold dot/pulse to differentiate from the death pill */
.live-pill--spawned .dot {
    background: var(--gold-bright);
    box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7);
    animation: livePulseGold 2s ease-out infinite;
}

@keyframes livePulse {
    0%   { box-shadow: 0 0 0 0 rgba(232, 50, 76, 0.55); transform: scale(1); }
    70%  { box-shadow: 0 0 0 14px rgba(232, 50, 76, 0); transform: scale(1.05); }
    100% { box-shadow: 0 0 0 0 rgba(232, 50, 76, 0); transform: scale(1); }
}

@keyframes livePulseGold {
    0%   { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.55); transform: scale(1); }
    70%  { box-shadow: 0 0 0 14px rgba(212, 175, 55, 0); transform: scale(1.05); }
    100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); transform: scale(1); }
}

@keyframes deathFlash {
    0%   { color: var(--text); }
    25%  { color: var(--blood-bright); transform: scale(1.18); }
    100% { color: var(--text); transform: scale(1); }
}
.live-pill .count.flash {
    animation: deathFlash 700ms var(--ease-out);
    display: inline-block;
}

/* ===== Scroll reveal ===== */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition:
        opacity 900ms var(--ease-out),
        transform 900ms var(--ease-out);
    will-change: opacity, transform;
}
.reveal.in {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .reveal { opacity: 1; transform: none; }
}

/* =====================================================================
   NAVIGATION BAR — shared across every page except the landing page
   Supports: flat links, dropdown groups, auth-aware account menu
   ===================================================================== */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 7, 8, 0.78);
    backdrop-filter: blur(14px) saturate(120%);
    -webkit-backdrop-filter: blur(14px) saturate(120%);
    border-bottom: 1px solid var(--border);
}

.nav__inner {
    width: 100%;
    max-width: var(--content-w);
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* ── Brand ──────────────────────────────────────────────────── */
.nav__brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    text-decoration: none;
    border: none;
    flex-shrink: 0;
    transition: opacity var(--t-fast) var(--ease-smooth);
}
.nav__brand:hover { opacity: 0.85; color: var(--text); border: none; }

.nav__brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    background: var(--blood);
    color: var(--text);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 18px;
    border-radius: 4px;
    box-shadow: 0 2px 12px rgba(200, 16, 46, 0.35);
}

.nav__brand-text {
    font-family: var(--font-display);
    font-size: 1.05rem;
    letter-spacing: 0.08em;
    color: var(--text);
}

/* ── Link strip (everything right of the brand) ─────────────── */
.nav__links {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
    min-width: 0;
}

.nav__primary {
    display: flex;
    align-items: center;
    gap: 2px;
}

.nav__right {
    margin-left: auto;
    display: flex;
    align-items: center;
}

/* ── Flat link (top-level items without children) ────────────── */
.nav__link {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    border: none;
    border-radius: 6px;
    white-space: nowrap;
    transition:
        color var(--t-fast) var(--ease-smooth),
        background var(--t-fast) var(--ease-smooth);
    position: relative;
}
.nav__link:hover {
    color: var(--text);
    background: rgba(245, 241, 234, 0.05);
    border: none;
}
.nav__link.is-active {
    color: var(--text);
}
.nav__link.is-active::after {
    content: '';
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 2px;
    height: 2px;
    background: var(--blood-bright);
    border-radius: 1px;
}

/* Sign-in link (unauthenticated state) */
.nav__account-link {
    font-weight: 600;
    color: var(--text);
}

/* Buy Iron Coins button (shown when signed in) */
.nav__buy-coins {
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 7px 14px;
    background: var(--gold);
    color: #1a1209;
    border: 1px solid var(--gold);
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--t-fast), border-color var(--t-fast);
    box-shadow: none;
}
.nav__buy-coins:hover {
    background: var(--gold-bright);
    border-color: var(--gold-bright);
}
.nav__buy-coins:disabled {
    opacity: 0.5;
    cursor: progress;
}

/* ── Iron Coins purchase modal ─────────────────────────────────── */
.ic-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.ic-modal-backdrop.is-visible { opacity: 1; }

.ic-modal {
    background: var(--bg-elev);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    padding: 32px 28px 24px;
    max-width: 340px;
    width: 90%;
    text-align: center;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
}
.ic-modal__title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--text);
    margin: 0 0 6px;
    letter-spacing: 0.03em;
}
.ic-modal__rate {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 24px;
}
.ic-modal__qty-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 8px;
}
.ic-modal__qty-btn {
    width: 40px;
    height: 40px;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
    background: var(--bg-elev-2, var(--bg-elev));
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color var(--t-fast);
    box-shadow: none;
}
.ic-modal__qty-btn:hover { border-color: var(--gold); }
.ic-modal__qty-btn:disabled { opacity: 0.25; cursor: default; }

.ic-modal__qty {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--gold-bright);
    min-width: 60px;
}
.ic-modal__price {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--text-muted);
    margin: 0 0 24px;
}
.ic-modal__actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.ic-modal__confirm {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 10px 28px;
    background: var(--gold);
    color: #1a1209;
    border: 1px solid var(--gold);
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--t-fast);
    box-shadow: none;
}
.ic-modal__confirm:hover {
    background: var(--gold-bright);
    border-color: var(--gold-bright);
}
.ic-modal__confirm:disabled {
    opacity: 0.5;
    cursor: progress;
}
.ic-modal__cancel {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    padding: 10px 20px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: border-color var(--t-fast), color var(--t-fast);
    box-shadow: none;
}
.ic-modal__cancel:hover {
    border-color: var(--text-muted);
    color: var(--text);
}

/* ── "Play Live" pulsing dot ─────────────────────────────────── */
.nav__link--live {
    color: var(--text);
}
.nav__link--live::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--blood-bright);
    box-shadow: 0 0 0 0 rgba(232, 50, 76, 0.7);
    animation: livePulse 2s ease-out infinite;
    margin-right: 8px;
    flex-shrink: 0;
}
.nav__link--live:hover {
    color: var(--text);
    background: rgba(200, 16, 46, 0.08);
}

/* ── Dropdown (shared: nav groups + account) ─────────────────── */
.nav__dropdown {
    position: relative;
}

.nav__dd-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: none;
    transition:
        color var(--t-fast) var(--ease-smooth),
        background var(--t-fast) var(--ease-smooth);
}
.nav__dd-trigger:hover {
    color: var(--text);
    background: rgba(245, 241, 234, 0.05);
    transform: none;
    box-shadow: none;
}
.nav__dd-trigger:focus-visible {
    outline: 2px solid var(--gold-bright);
    outline-offset: 2px;
}

/* Highlight the trigger when a child page is active */
.nav__dropdown.has-active-child > .nav__dd-trigger {
    color: var(--text);
}

/* Chevron rotation */
.nav__dd-chevron {
    flex-shrink: 0;
    transition: transform var(--t-fast) var(--ease-smooth);
}
.nav__dropdown.is-open > .nav__dd-trigger .nav__dd-chevron {
    transform: rotate(180deg);
}

/* Panel */
.nav__dd-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 180px;
    background: #1a1418;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    padding: 6px;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition:
        opacity var(--t-fast) var(--ease-smooth),
        transform var(--t-fast) var(--ease-smooth),
        visibility 0s linear var(--t-fast);
    z-index: 200;
}
.nav__dropdown.is-open > .nav__dd-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition:
        opacity var(--t-fast) var(--ease-smooth),
        transform var(--t-fast) var(--ease-smooth),
        visibility 0s;
}

/* Links inside panels */
.nav__dd-link {
    display: block;
    padding: 9px 14px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--text-muted);
    text-decoration: none;
    border: none;
    border-radius: 5px;
    transition:
        color var(--t-fast) var(--ease-smooth),
        background var(--t-fast) var(--ease-smooth);
}
.nav__dd-link:hover {
    color: var(--text);
    background: rgba(245, 241, 234, 0.06);
    border: none;
}
.nav__dd-link.is-active {
    color: var(--text);
    background: var(--blood-soft);
}

/* ── Account dropdown (right-aligned variant) ────────────────── */
.nav__dropdown--account {
    /* panel opens to the left instead of left */
}
.nav__dropdown--account > .nav__dd-panel {
    left: auto;
    right: 0;
    min-width: 200px;
}

.nav__account-trigger {
    gap: 8px;
}

.nav__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--blood);
    color: var(--text);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(200, 16, 46, 0.3);
}

.nav__handle {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav__dd-panel--account {
    padding-top: 0;
}

.nav__dd-header {
    padding: 12px 14px 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-faint);
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
}

.nav__dd-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 8px;
}

/* ── Hamburger toggle ────────────────────────────────────────── */
.nav__toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    width: 40px; height: 40px;
    padding: 0;
    box-shadow: none;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
    transition: border-color var(--t-fast) var(--ease-smooth);
}
.nav__toggle:hover {
    background: rgba(245, 241, 234, 0.04);
    border-color: var(--border-strong);
    transform: none;
    box-shadow: none;
}
.nav__toggle:focus-visible {
    outline: 2px solid var(--gold-bright);
    outline-offset: 2px;
}
.nav__toggle-bar {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
    transition: transform var(--t-fast) var(--ease-smooth),
                opacity var(--t-fast) var(--ease-smooth);
}
.nav__toggle.is-open .nav__toggle-bar:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
.nav__toggle.is-open .nav__toggle-bar:nth-child(2) { opacity: 0; }
.nav__toggle.is-open .nav__toggle-bar:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ── Mobile (<720px) ─────────────────────────────────────────── */
@media (max-width: 719px) {
    .nav__toggle { display: inline-flex; }

    .nav__links {
        position: absolute;
        top: calc(100% + 1px);
        left: 0;
        right: 0;
        background: #0a0708;
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0;
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        overflow-y: auto;
        pointer-events: none;
        transition: max-height var(--t-base) var(--ease-smooth),
                    opacity var(--t-fast) var(--ease-smooth);
    }
    .nav__links.is-open {
        max-height: 80vh;
        opacity: 1;
        pointer-events: auto;
        padding: 8px;
    }

    .nav__primary,
    .nav__right {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }
    .nav__right {
        margin-left: 0;
        border-top: 1px solid var(--border);
        padding-top: 8px;
        margin-top: 4px;
    }

    /* Flat links go full-width */
    .nav__link {
        padding: 14px 16px;
        font-size: 15px;
        border-radius: 6px;
    }
    .nav__link.is-active::after {
        left: 16px;
        right: 16px;
        bottom: 8px;
    }

    /* Dropdowns become accordion-style (no absolute panel) */
    .nav__dropdown {
        position: static;
    }
    .nav__dd-trigger {
        width: 100%;
        padding: 14px 16px;
        font-size: 15px;
        justify-content: space-between;
    }
    .nav__dd-panel {
        position: static;
        min-width: 0;
        background: transparent;
        border: none;
        border-radius: 0;
        padding: 0 0 4px 16px;
        box-shadow: none;
        /* Accordion open/close via max-height */
        max-height: 0;
        opacity: 0;
        visibility: hidden;
        overflow: hidden;
        transform: none;
        transition:
            max-height var(--t-base) var(--ease-smooth),
            opacity var(--t-fast) var(--ease-smooth),
            visibility 0s linear var(--t-fast);
    }
    .nav__dropdown.is-open > .nav__dd-panel {
        max-height: 400px;
        opacity: 1;
        visibility: visible;
        transform: none;
        transition:
            max-height var(--t-base) var(--ease-smooth),
            opacity var(--t-fast) var(--ease-smooth),
            visibility 0s;
    }
    .nav__dd-link {
        padding: 12px 16px;
        font-size: 15px;
    }

    /* Account: panel opens inline like other dropdowns */
    .nav__dropdown--account > .nav__dd-panel {
        left: 0;
        right: 0;
    }
    .nav__dd-header {
        padding: 8px 16px 6px;
    }

    /* Hide the handle text on mobile to save space in the trigger */
    .nav__handle {
        display: none;
    }
}

/* Add top padding to body content on pages with nav so sticky doesn't overlap */
body.has-nav main:first-of-type,
body.has-nav section.hero:first-of-type,
body.has-nav .login-hero:first-of-type {
    /* nav is sticky, so this isn't strictly required, but it ensures
       any fixed/absolute positioning relative to the top accounts for it */
}

/* ===== Footer ===== */
.site-footer {
    padding: 48px 24px 56px;
    text-align: center;
    color: var(--text-faint);
    font-size: 13px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    border-top: 1px solid var(--border);
    margin-top: 64px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.footer-links {
    display: flex;
    gap: 12px;
}
.footer-links a {
    color: var(--text-faint);
    text-decoration: none;
    transition: color .2s;
}
.footer-links a:hover {
    color: var(--gold-bright);
}

/* ===== Custom scrollbar (subtle) ===== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg-elev-2); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--blood-deep); }

/* ===== Print ===== */
@media print {
    body { background: #fff; color: #000; }
    .site-nav, .site-footer, .mobile-cta { display: none; }
    a { color: #000; text-decoration: underline; }
    .btn { border: 1px solid #000; background: transparent; color: #000; box-shadow: none; }
}
