/* ============================================================
   Shared site stylesheet.
   Loaded after Tailwind CDN, before per-page <style>.
   Owns theme variables, body baseline, focus ring, reduced-motion,
   readability helpers, and the global scrollbar utility.
   Page-specific styles stay in the page's inline <style>.
   ============================================================ */

/* --- Theme variables ---------------------------------------- */
/* Canonical names match DESIGN.md token names. Legacy --bg-color
   etc. are kept as aliases for incremental migration of inline
   var() references in page-specific styles. */
:root {
    --background: #0a0a0a;
    --text: #f0f0f0;
    --accent: #ffcc00;
    --surface: rgba(23, 23, 23, 0.6);
    --surface-header: rgba(10, 10, 10, 0.8);
    --border: rgba(255, 255, 255, 0.08);
    --accent-glow: rgba(255, 204, 0, 0.4);

    /* Legacy aliases — DO NOT use in new code. Run a cleanup PR
       to grep-replace `var(--<old>)` → `var(--<new>)` and drop. */
    --bg-color: var(--background);
    --text-color: var(--text);
    --accent-color: var(--accent);
    --card-bg: var(--surface);
    --header-bg: var(--surface-header);
    --border-color: var(--border);
    --glow-color: var(--accent-glow);
}

body.light-mode {
    --background: #fcfcfc;
    --text: #1a1a1a;
    --surface: rgba(255, 255, 255, 0.9);
    --surface-header: rgba(252, 252, 252, 0.9);
    --border: rgba(0, 0, 0, 0.1);
    --accent-glow: rgba(255, 204, 0, 0.2);
}

/* --- Body baseline ------------------------------------------ */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

::selection {
    background-color: var(--accent-color);
    color: #000;
}

/* --- Keyboard focus baseline (WCAG 2.4.7) ------------------- */
/* Per-element overrides set stronger outlines; this is the
   fallback so no interactive element silently loses its ring. */
:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* --- WCAG 2.3.3 reduced-motion guard ------------------------ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* --- fx helpers --------------------------------------------- */
/* Readability shadow for accent / white text laid over the hero
   canvas, splatter background, or photos. Used by both index
   and philosophy hero / section headers. */
.fx-shadow-readable {
    text-shadow:
        0 0 6px rgba(0, 0, 0, 0.9),
        0 0 14px rgba(0, 0, 0, 0.6),
        0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Frosted-glass panel for naked card headers (WORKS labels/titles,
   JOURNEY meta, LAB section subtitle). ::before paints a soft dark
   veil that bleeds slightly past the content edges, with a thin
   amber accent stripe on the left so it reads as a "tagged plaque". */
.fx-glass-panel {
    position: relative;
    isolation: isolate;
}
.fx-glass-panel::before {
    content: "";
    position: absolute;
    inset: -10px -16px;
    background: linear-gradient(135deg,
            rgba(0, 0, 0, 0.78) 0%,
            rgba(0, 0, 0, 0.58) 65%,
            rgba(0, 0, 0, 0.42) 100%);
    backdrop-filter: blur(10px) saturate(120%);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    border-radius: 8px;
    border-left: 2px solid rgba(255, 204, 0, 0.55);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
    z-index: -1;
    pointer-events: none;
}

/* --- Utility: hide scrollbar (horizontal scrollers) --------- */
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}
.hide-scrollbar {
    -ms-overflow-style: none; /* IE / legacy Edge */
    scrollbar-width: none;    /* Firefox */
}
