/* ─────────────────────────────────────────────────────────────
   POE2 v0.5 — Unified theme (light default + dark via [data-theme="dark"])
   League colors tuned to canonical PoE iconography, bright for light mode.
   ───────────────────────────────────────────────────────────── */

:root {
    /* Surfaces */
    --bg-base: #f4f6fa;          /* cool off-white */
    --bg-surface: #ffffff;
    --bg-elevated: #eef2f7;
    --bg-step: #f8fafc;
    --border-subtle: #dfe4ec;
    --border-accent: #c4cbd6;

    /* Text */
    --text-primary: #0f172a;     /* near-black, slate undertone */
    --text-body: #334155;
    --text-muted: #64748b;
    --text-dim: #94a3b8;
    --parchment: #0f172a;        /* now means "darkest text" for headings */

    /* Gold accents (PoE2 native) */
    --gold: #b08537;
    --gold-bright: #d4a258;
    --gold-deep: #8a6a2c;

    /* Semantic colors — bright, canonical PoE league hues */
    --sage:    #16a34a;          /* tip / success / ritual / wildwood */
    --burnt:   #dc2626;          /* warning / vaal */
    --steel:   #1d4ed8;          /* loc / abyss */
    --tan:     #b45309;          /* npc / fortress bronze */
    --plum:    #7c3aed;          /* new pathing notes / breach */
    --crimson: #b91c1c;          /* pinnacle threats */

    /* Per-league solid colors (used in endgame zone cards + diagram) */
    --c-fortress:   #b45309;     /* NW · precursor bronze */
    --c-vaal:       #991b1b;     /* N  · vaal crimson */
    --c-abyss:      #047857;     /* E  · deep green (per user) */
    --c-expedition: #d97706;     /* SE · Kalguuran gold */
    --c-breach:     #7c3aed;     /* S  · breach purple */
    --c-delirium:   #64748b;     /* SW · silver chrome (mid-stop) */
    --c-delirium-a: #e2e8f0;     /* light end of silver gradient */
    --c-delirium-b: #64748b;     /* dark end of silver gradient */
    --c-ritual:     #be185d;     /* W  · rose-wine (blood ritual) */

    /* Shadow stack */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 30px rgba(15, 23, 42, 0.12);

    /* Overlays (theme-aware) */
    --overlay-gold-soft: rgba(176, 133, 55, 0.07);
    --overlay-gold-strong: rgba(176, 133, 55, 0.14);
    --overlay-sage: rgba(22, 163, 74, 0.08);
    --overlay-burnt: rgba(220, 38, 38, 0.08);
    --overlay-steel: rgba(29, 78, 216, 0.08);
    --overlay-tan: rgba(180, 83, 9, 0.08);
    --overlay-plum: rgba(124, 58, 237, 0.08);

    /* Body font weight feels lighter on cream — use normal */
    --body-weight: 400;
}

[data-theme="dark"] {
    --bg-base: #181410;
    --bg-surface: #221c15;
    --bg-elevated: #2a2218;
    --bg-step: #1f1a13;
    --border-subtle: #3a2f20;
    --border-accent: #5a4830;

    --text-primary: #d8cab0;
    --text-body: #b8a888;
    --text-muted: #8a7c64;
    --text-dim: #5a4f3e;
    --parchment: #e8d8a8;

    --gold: #c89860;
    --gold-bright: #e8b878;
    --gold-deep: #a07840;

    --sage:    #9bb87a;
    --burnt:   #c87060;
    --steel:   #7e9eb8;
    --tan:     #c4a47e;
    --plum:    #b88aa0;
    --crimson: #c84a4a;

    /* Per-league colors — slightly desaturated for dark mode */
    --c-fortress:   #d97706;
    --c-vaal:       #dc2626;
    --c-abyss:      #10b981;     /* brighter green for dark */
    --c-expedition: #fbbf24;
    --c-breach:     #a78bfa;
    --c-delirium:   #94a3b8;
    --c-delirium-a: #cbd5e1;
    --c-delirium-b: #475569;
    --c-ritual:     #ec4899;     /* brighter rose for dark */

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.55);

    --overlay-gold-soft: rgba(200, 152, 96, 0.06);
    --overlay-gold-strong: rgba(200, 152, 96, 0.12);
    --overlay-sage: rgba(155, 184, 122, 0.08);
    --overlay-burnt: rgba(200, 112, 96, 0.08);
    --overlay-steel: rgba(126, 158, 184, 0.08);
    --overlay-tan: rgba(196, 164, 126, 0.08);
    --overlay-plum: rgba(184, 138, 160, 0.08);

    --body-weight: 300;
}

/* ─── BASE ─────────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', 'IBM Plex Sans', system-ui, sans-serif;
    background: var(--bg-base);
    color: var(--text-body);
    font-size: 13.5px;
    line-height: 1.6;
    min-height: 100vh;
    font-weight: var(--body-weight);
    transition: background-color 0.3s ease, color 0.3s ease;
}
body::before {
    content: '';
    position: fixed; inset: 0;
    background-image: none;
    pointer-events: none;
    z-index: 0;
}
[data-theme="dark"] body { background: radial-gradient(ellipse at top left, rgba(200, 152, 96, 0.05) 0%, transparent 50%), var(--bg-base); }

/* ─── THEME TOGGLE (top-right floating) ────────────────────── */
.theme-toggle {
    position: fixed;
    top: 1rem; right: 1rem;
    z-index: 1000;
    background: var(--bg-surface);
    border: 1px solid var(--border-accent);
    color: var(--text-body);
    padding: 0.5rem 0.9rem;
    border-radius: 100px;
    cursor: pointer;
    font-family: 'Inter', 'IBM Plex Sans', sans-serif;
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0.3px;
    display: flex; align-items: center; gap: 0.45rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}
.theme-toggle:hover {
    border-color: var(--gold);
    color: var(--gold);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.theme-toggle .icon { font-size: 13px; }
/* ─── TOP NAV ─────────────────────────────────────────────── */
.top-nav {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-accent);
    padding: 0.55rem 7rem 0.55rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}
.top-nav-home {
    font-family: 'Cinzel', serif;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 10.5px;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    font-weight: 600;
    transition: color 0.15s;
    white-space: nowrap;
}
.top-nav-home:hover { color: var(--gold); }
.top-nav-links {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.top-nav-link {
    color: var(--text-body);
    text-decoration: none;
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--border-subtle);
    border-radius: 3px;
    font-size: 10.5px;
    font-family: 'Cinzel', serif;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    font-weight: 600;
    transition: all 0.15s;
    white-space: nowrap;
}
.top-nav-link:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: var(--overlay-gold-soft);
}
.top-nav-link.current {
    color: var(--gold);
    border-color: var(--gold-deep);
    background: var(--overlay-gold-strong);
}
@media (max-width: 700px) {
    /* Reserve right padding so the fixed theme-toggle doesn't sit on top of nav links */
    .top-nav { padding: 0.5rem 5.25rem 0.5rem 0.75rem; flex-wrap: wrap; }
    .top-nav-links { gap: 0.3rem; }
    .top-nav-link { padding: 0.25rem 0.55rem; font-size: 9.5px; letter-spacing: 1px; }
}


/* ─── CONTAINER (sidebar layout) ───────────────────────────── */
.container { display: flex; min-height: 100vh; position: relative; z-index: 1; }
