/* ==========================================================================
   KalaBodha chakra theme system — Muladhara (root): grounding, security.
   Three modes, one token file. Each mode re-derives the Muladhara pull —
   "Nothing moves this" — from the brief's neuroscience principle (stability
   and weight cues; dim enclosed scenes lower arousal; the red glow stays
   contained, power held in reserve), never by mechanical inversion.

   dark   (default) — the vault at night. Deep warm earth, contained red glow.
   bright — the vault in daylight. Warm parchment/stone; weight is kept through
            heavy earth-ink and full-strength deep reds — never floaty pastels.
   night  — night-light. Warm dim amber, blue light removed, arousal lowered
            further. The vault at rest.
   ========================================================================== */

:root,
:root[data-theme="dark"] {
    --kb-bg: #1c1512;
    --kb-surface: #292524;
    --kb-surface-2: #332b26;
    --kb-ink: #f0e9e0;
    --kb-muted: #b8a89a;
    --kb-dim: #7d6f61;
    --kb-accent: #991b1b;
    --kb-accent-soft: #b91c1c;
    --kb-gold: #a16207;
    --kb-border: rgba(240, 233, 224, 0.08);
    --kb-border-strong: rgba(240, 233, 224, 0.16);
    --kb-glow: 0 4px 20px rgba(153, 27, 27, 0.28);
    --kb-hero-glow: radial-gradient(circle at 50% 38%, rgba(153, 27, 27, 0.10) 0%, transparent 55%);
    --kb-font-display: Georgia, 'Times New Roman', serif;
    --kb-font-body: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

:root[data-theme="bright"] {
    --kb-bg: #f4efe6;
    --kb-surface: #ece4d4;
    --kb-surface-2: #e0d4bc;
    --kb-ink: #2b2119;
    --kb-muted: #6b5d4d;
    --kb-dim: #8d7d68;
    --kb-accent: #7f1d1d;
    --kb-accent-soft: #991b1b;
    --kb-gold: #a16207;
    --kb-border: rgba(43, 33, 25, 0.12);
    --kb-border-strong: rgba(43, 33, 25, 0.24);
    --kb-glow: 0 4px 18px rgba(127, 29, 29, 0.16);
    --kb-hero-glow: radial-gradient(circle at 50% 38%, rgba(127, 29, 29, 0.07) 0%, transparent 55%);
    --kb-font-display: Georgia, 'Times New Roman', serif;
    --kb-font-body: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

:root[data-theme="night"] {
    --kb-bg: #171009;
    --kb-surface: #221812;
    --kb-surface-2: #2b1f16;
    --kb-ink: #e8d9c4;
    --kb-muted: #a68f6f;
    --kb-dim: #6f5c44;
    --kb-accent: #8c2b20;
    --kb-accent-soft: #a03525;
    --kb-gold: #8a5f1c;
    --kb-border: rgba(232, 217, 196, 0.08);
    --kb-border-strong: rgba(232, 217, 196, 0.16);
    --kb-glow: 0 4px 18px rgba(140, 43, 32, 0.22);
    --kb-hero-glow: radial-gradient(circle at 50% 38%, rgba(140, 43, 32, 0.10) 0%, transparent 55%);
    --kb-font-display: Georgia, 'Times New Roman', serif;
    --kb-font-body: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Chakra font pairing: sturdy slab display (fortress, not flashy) + clean sans body */
body {
    font-family: var(--kb-font-body);
}

h1, h2, h3, .logo-text {
    font-family: var(--kb-font-display);
    letter-spacing: 0;
}

/* Theme toggle — segmented control, lives in the site header / hero */
.kb-theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--kb-border-strong);
    border-radius: 999px;
    background: var(--kb-surface);
}

.kb-theme-toggle button {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--kb-muted);
    font-family: var(--kb-font-body);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.kb-theme-toggle button:hover {
    color: var(--kb-ink);
}

.kb-theme-toggle button[aria-pressed="true"] {
    background: var(--kb-accent);
    color: #fff;
}

.kb-theme-toggle button:focus-visible {
    outline: 2px solid var(--kb-gold);
    outline-offset: 2px;
}

/* Placement helpers */
.hero .kb-theme-toggle {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 2;
}

.kb-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.kb-topbar .back-link {
    margin-bottom: 0;
}

.page-header {
    position: relative;
}

.page-header .kb-theme-toggle {
    position: absolute;
    top: 0;
    right: 0;
}

/* Hero artwork — the vault in bedrock, framed like a sealed chamber */
.hero-art {
    margin: 3rem auto 0;
    max-width: 720px;
    position: relative;
    z-index: 1;
}

.hero-art img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--kb-border-strong);
    box-shadow: var(--kb-glow);
}

@media (max-width: 640px) {
    .hero .kb-theme-toggle {
        top: 0.75rem;
        right: 0.75rem;
    }
    .hero-art {
        margin-top: 2rem;
    }
}
