/**
 * ROBIN IJSSELDIJK OFFICIAL, BRAND CSS SPINE
 * ============================================
 * Semantic design tokens + shared base styles for every page.
 * Pairs with assets/js/brand.js (the Tailwind config spine).
 *
 * Use these variables in inline styles / SVG gradients instead of raw hex:
 *   stop-color="var(--brand-accent)"  background: var(--surface);
 */

:root {
    /* Brand */
    --brand-accent: #3F7FF0;   /* Luminous Sapphire */
    --brand-deep: #0B4EC2;     /* AA-safe deep sapphire (text on light / button bg) */
    --brand-depth: #0E3578;    /* gradient partner / deep surface */
    --brand-white: #FFFFFF;    /* Core White */
    --brand-void: #000000;     /* Void Black */

    /* Semantic, light theme */
    --surface: #FFFFFF;
    --surface-alt: #F7F9FD;            /* faint sapphire-tinted off-white */
    --on-surface: #0D1626;             /* sapphire-950, body text on light */
    --on-surface-muted: #47546B;
    --accent: var(--brand-deep);       /* accent that is text-safe on this surface */
    --accent-vivid: var(--brand-accent);
    --border-subtle: rgba(13, 22, 38, 0.08);
    --glow-accent: rgba(81, 139, 237, 0.5);

    /* Elevation surface ladder, light theme */
    --surface-1: #F7F9FD;
    --surface-2: #EEF3FB;
    --surface-3: #FFFFFF;

    /* Shadow & glow ladder, light theme.
       Depth = soft deep-sapphire shadows; glow stays deliberate, never decorative. */
    --shadow-card: 0 4px 20px rgba(31, 91, 193, 0.10);
    --shadow-card-glow: 0 4px 20px rgba(31, 91, 193, 0.14);
    --shadow-elev-1: 0 1px 4px rgba(13, 22, 38, 0.06), 0 2px 10px rgba(31, 91, 193, 0.06);
    --shadow-elev-2: 0 4px 12px rgba(13, 22, 38, 0.08), 0 8px 28px rgba(31, 91, 193, 0.10);
    --shadow-elev-3: 0 12px 32px rgba(13, 22, 38, 0.10), 0 20px 48px -12px rgba(31, 91, 193, 0.16);
    --shadow-glow-sm: 0 0 15px rgba(31, 91, 193, 0.30);
    --shadow-glow-md: 0 0 30px -5px rgba(31, 91, 193, 0.35);
    --shadow-glow-lg: 0 0 45px -10px rgba(31, 91, 193, 0.40);
    --shadow-glow-lift: 0 10px 30px -10px rgba(31, 91, 193, 0.45);
}

html.dark {
    /* Semantic, dark theme (Void Black canvas) */
    --surface: #000000;
    --surface-alt: #070D18;            /* card floor above the void */
    --on-surface: #F5F8FE;
    --on-surface-muted: #93A0B8;
    --accent: var(--brand-accent);     /* luminous sapphire is AA-safe on black (6.27:1) */
    --accent-vivid: var(--brand-accent);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --glow-accent: rgba(81, 139, 237, 0.45);

    /* Elevation surface ladder, dark theme (tints above Void Black) */
    --surface-1: #070D18;
    --surface-2: #0B1424;
    --surface-3: #101B30;

    /* Shadow & glow ladder, dark theme.
       Depth = black drop + luminous sapphire edge; glow is the importance marker. */
    --shadow-card: 0 4px 20px rgba(81, 139, 237, 0.12);
    --shadow-card-glow: 0 4px 20px rgba(81, 139, 237, 0.15);
    --shadow-elev-1: 0 2px 8px rgba(0, 0, 0, 0.5), 0 0 12px rgba(81, 139, 237, 0.05);
    --shadow-elev-2: 0 6px 20px rgba(0, 0, 0, 0.55), 0 0 24px rgba(81, 139, 237, 0.08);
    --shadow-elev-3: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 40px rgba(81, 139, 237, 0.12);
    --shadow-glow-sm: 0 0 15px rgba(81, 139, 237, 0.50);
    --shadow-glow-md: 0 0 30px -5px rgba(81, 139, 237, 0.50);
    --shadow-glow-lg: 0 0 45px -10px rgba(81, 139, 237, 0.55);
    --shadow-glow-lift: 0 10px 30px -10px rgba(81, 139, 237, 0.55);
}

/* ---- Sapphire glass, overlays, sticky bars, popovers ---- */
.glass {
    background: rgba(255, 255, 255, 0.72);
    -webkit-backdrop-filter: blur(18px) saturate(1.5);
    backdrop-filter: blur(18px) saturate(1.5);
}
html.dark .glass {
    background: rgba(7, 13, 24, 0.62);
}
/* Fallback when backdrop-filter is unsupported: go opaque enough to read */
@supports not (backdrop-filter: blur(1px)) {
    .glass { background: rgba(255, 255, 255, 0.95); }
    html.dark .glass { background: rgba(7, 13, 24, 0.94); }
}

/* ---- Shared base (was duplicated per page) ---- */
[x-cloak] { display: none !important; }

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0.5;
    animation: twinkle var(--duration) ease-in-out infinite;
}

/* ---- Page entrance (replaces the JS opacity:0 FOUC hack) ----
   Pure CSS: content can never be stuck invisible waiting for JS/window.load. */
body {
    opacity: 0;
    animation: brand-page-in 0.4s ease-out 0.12s forwards;
}
@keyframes brand-page-in {
    to { opacity: 1; }
}

/* ---- Interaction feel: interactive elements never snap ----
   Element-level rule, so any Tailwind transition-* utility still wins. */
a, button, [role="button"], summary {
    transition-property: color, background-color, border-color, opacity, box-shadow, transform, text-decoration-color;
    transition-duration: 250ms;
    transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- Reading experience (interview pages, via assets/js/reading.js) ---- */
.reading-progress {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 3px;
    background: linear-gradient(90deg, var(--brand-deep), var(--brand-accent));
    box-shadow: 0 0 12px var(--glow-accent);
    transform: scaleX(0);
    transform-origin: left center;
    z-index: 60; /* above the z-50 nav */
    pointer-events: none;
}

.reading-rail {
    position: fixed;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    z-index: 40;
}
.reading-rail-dot {
    position: relative;
    width: 10px; height: 10px;
    border-radius: 9999px;
    background: var(--on-surface-muted);
    opacity: 0.45;
    transition: opacity 250ms ease-out, background-color 250ms ease-out, transform 250ms ease-out, box-shadow 250ms ease-out;
}
.reading-rail-dot:hover { opacity: 1; transform: scale(1.25); }
.reading-rail-dot.is-active {
    background: var(--brand-accent);
    opacity: 1;
    transform: scale(1.3);
    box-shadow: var(--shadow-glow-sm);
}
.reading-rail-label {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    white-space: nowrap;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--on-surface);
    background: var(--surface-alt);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-elev-1);
    border-radius: 9999px;
    padding: 0.3rem 0.75rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 250ms ease-out, transform 250ms ease-out;
}
.reading-rail-dot:hover .reading-rail-label,
.reading-rail-dot.is-active:hover .reading-rail-label {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* Speaker navigation bar above transcripts (assets/js/reading.js) */
.speaker-bar {
    position: sticky;
    top: 5.5rem;              /* clears the fixed nav */
    z-index: 30;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.9rem;
    margin: 0 0 1.5rem 0;
    border-radius: 9999px;
    border: 1px solid var(--border-subtle);
    background: var(--surface-alt);
    box-shadow: var(--shadow-elev-2);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    backdrop-filter: blur(14px) saturate(1.4);
}
.speaker-bar-title {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--on-surface-muted);
    padding: 0 0.35rem;
}
.speaker-pill {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--on-surface);
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 9999px;
    padding: 0.35rem 0.8rem;
    cursor: pointer;
}
.speaker-pill:hover {
    border-color: var(--brand-accent);
    color: var(--accent);
    box-shadow: var(--shadow-glow-sm);
    transform: translateY(-1px);
}
.speaker-pill-count {
    display: inline-block;
    margin-left: 0.3rem;
    font-size: 0.62rem;
    font-weight: 800;
    color: var(--accent);
    opacity: 0.85;
}
.speaker-jump-flash {
    animation: speaker-flash 1.4s ease-out 1;
}
@keyframes speaker-flash {
    0%   { box-shadow: 0 0 0 2px var(--brand-accent), var(--shadow-glow-md); }
    100% { box-shadow: 0 0 0 0 rgba(81, 139, 237, 0), var(--shadow-card); }
}

/* Staggered card reveals (JS adds reveal-init below the fold, reveal-in on entry) */
.reveal-init {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 600ms cubic-bezier(0.22, 1, 0.36, 1), transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal-init.reveal-in {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Accessibility: respect reduced motion globally ---- */
@media (prefers-reduced-motion: reduce) {
    body { opacity: 1; animation: none; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}


/* MOBILE GUARD, the document itself must never scroll sideways */
html, body { overflow-x: clip; }
@supports not (overflow-x: clip) { html, body { overflow-x: hidden; } }
