/*
 * ideas.krisadamstv.com — Global Stylesheet v2
 *
 * Source of truth for all idea page styling.
 * Edit here, then deploy with:
 *   cd /root/ideas && python3 publish.py --all
 *
 * This file is copied to /var/www/ideas/style.css on every publish.
 * Pages reference it as:  <link rel="stylesheet" href="/style.css">
 *
 * Architecture notes:
 * ─────────────────────────────────────────────────────────────────
 * - Google Fonts are loaded as <link> tags in the HTML template
 *   (includes Material Symbols Outlined for inline icons)
 * - CSS variables (--var-name) are defined in :root for easy theming
 * - Scroll-triggered reveal animations driven by ideas.js IntersectionObserver
 * - .idea-link component for cross-page tracked navigation
 * - .status-badge components for live/built/planned status indicators
 * - .stat-grid for key metrics display
 * - .icon-label for inline Material Symbol + text combos
 * ─────────────────────────────────────────────────────────────────
 */

/* ── Typed Custom Properties (@property) ────────────────────── */
/*
 * Gives browsers type information so these values can be interpolated
 * in CSS animations and transitions — gradients, glows, distances.
 *
 * --glow-alpha:  opacity of box-shadow glow effects (number, 0–1)
 * --reveal-y:    translateY distance for scroll-reveal entry (length)
 */

@property --glow-alpha {
    syntax: '<number>';
    initial-value: 0;
    inherits: false;
}

@property --reveal-y {
    syntax: '<length>';
    initial-value: 28px;
    inherits: false;
}


/* ── Design Tokens ───────────────────────────────────────────── */

:root {
    --bg-primary:       #0a0a0f;
    --bg-secondary:     #12121a;
    --bg-tertiary:      #1a1a28;
    --bg-card:          #16161f;

    --text-primary:     #e8e6e3;
    --text-secondary:   #9a9a9a;
    --text-muted:       #666;

    --accent-primary:   #6c8aff;
    --accent-secondary: #a78bfa;
    --accent-warm:      #f59e0b;
    --accent-danger:    #ef4444;
    --accent-green:     #10b981;
    --accent-cyan:      #22d3ee;

    --border:           #2a2a3a;
    --border-light:     #1e1e2e;

    --shadow:           0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-glow:      0 0 30px rgba(108, 138, 255, 0.08);
    --radius:           8px;
    --radius-lg:        16px;

    --ease-out-expo:    cubic-bezier(0.16, 1, 0.3, 1);

    /* Spring easing — slight overshoot, settles naturally.
     * Use for things that slide or bounce into place.
     * linear() is Chrome 113+, Firefox 112+, Safari 17.2+ */
    --spring:        linear(
        0, 0.006, 0.025 2.8%, 0.101 6.1%, 0.539 18.9%,
        0.721 25.3%, 0.849 31.5%, 0.937 38.1%, 1.001 48.7%,
        1.008 53.2%, 0.999 60.9%, 1
    );

    /* Gentle spring — softer overshoot for cards and overlays */
    --spring-gentle: linear(
        0, 0.009, 0.035 3.1%, 0.141, 0.281 11.4%,
        0.723 20.7%, 0.938 29%, 1.027, 1.063, 1.077,
        1.067, 1.009 62.3%, 1
    );
}


/* ── Reset & Base ────────────────────────────────────────────── */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    background-image:
        radial-gradient(ellipse at 15% 30%, rgba(108,138,255,0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 70%, rgba(167,139,250,0.04) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(34,211,238,0.015) 0%, transparent 60%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}



/* ── Hero Image ──────────────────────────────────────────────── */

.hero {
    position: relative;
    width: 100%;
    max-height: 55vh;
    overflow: hidden;
    margin-bottom: 0;
}

.hero img {
    width: 100%;
    height: 55vh;
    object-fit: cover;
    display: block;
    filter: brightness(0.65) saturate(1.1);
    transform: scale(1.05);
    transition: transform 0.1s linear;
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70%;
    background: linear-gradient(transparent, var(--bg-primary) 95%);
    pointer-events: none;
}

/* Subtle top-edge vignette */
.hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 30%;
    background: linear-gradient(to bottom, rgba(10,10,15,0.3), transparent);
    pointer-events: none;
    z-index: 1;
}

/* Hero entry animation — cinematic blur-in */
.hero img {
    animation: hero-reveal 1.6s var(--ease-out-expo) both;
}

@keyframes hero-reveal {
    from {
        opacity: 0;
        filter: brightness(0.3) saturate(0.5) blur(12px);
        transform: scale(1.12);
    }
    to {
        opacity: 1;
        filter: brightness(0.65) saturate(1.1) blur(0);
        transform: scale(1.05);
    }
}


/* ── Page Layout ─────────────────────────────────────────────── */

.content {
    --content-w: 780px;
    --breakout-w: 1100px;
    --gutter: 2rem;

    display: grid;
    grid-template-columns:
        [full-start] minmax(var(--gutter), 1fr)
        [breakout-start] minmax(0, calc((var(--breakout-w) - var(--content-w)) / 2))
        [content-start] min(var(--content-w), 100% - var(--gutter) * 2)
        [content-end] minmax(0, calc((var(--breakout-w) - var(--content-w)) / 2))
        [breakout-end] minmax(var(--gutter), 1fr)
        [full-end];

    padding-top: 2rem;
    padding-bottom: 6rem;
    position: relative;
    z-index: 1;
    animation: fadeUp 0.6s ease-out;
    counter-reset: idea-section;
}

.content > * {
    grid-column: content;
}

.has-hero .content {
    margin-top: -4rem;
}

.footer {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-light);
    max-width: 780px;
    margin: 0 auto;
}

.footer a {
    color: var(--text-muted);
}

/* ── Kronos Town Footer Mark ─────────────────────────────────── */

.footer-town {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.footer-town-mark {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0.6;
    transition: opacity 0.4s;
}

.footer-town:hover .footer-town-mark {
    opacity: 1;
}

.footer-town-glyph {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1.5px solid var(--accent-primary);
    position: relative;
    opacity: 0.5;
    transition: opacity 0.4s, box-shadow 0.4s;
}

.footer-town-glyph::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent-primary);
    transform: translate(-50%, -50%);
}

.footer-town:hover .footer-town-glyph {
    opacity: 1;
    box-shadow: 0 0 12px rgba(108, 138, 255, 0.3);
}

.theme-gold .footer-town-glyph {
    border-color: var(--accent-primary);
}

.theme-gold .footer-town-glyph::after {
    background: var(--accent-primary);
}

.theme-gold .footer-town:hover .footer-town-glyph {
    box-shadow: 0 0 12px rgba(212, 160, 23, 0.3);
}

.footer-town-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    opacity: 0.4;
}


/* ── Typography ──────────────────────────────────────────────── */

h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    color: #fff;
    position: relative;
    animation: title-entrance 1.1s var(--ease-out-expo) both;
}

@keyframes title-entrance {
    from {
        opacity: 0;
        filter: blur(8px);
        transform: translateY(14px) scale(0.97);
    }
    to {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0) scale(1);
    }
}

/* Accent line under H1 */
h1::after {
    content: "";
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, var(--accent-primary), var(--accent-secondary));
    border-radius: 2px;
    margin-top: 1rem;
    margin-bottom: 1rem;
    animation: accent-line-grow 0.8s var(--ease-out-expo) 0.4s both;
}

@keyframes accent-line-grow {
    from { width: 0; opacity: 0; }
    to   { width: 60px; opacity: 1; }
}

h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 3.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    padding-left: 1rem;
    border-bottom: 1px solid var(--border);
    border-left: 3px solid var(--accent-primary);
    color: #fff;
    position: relative;
    text-shadow: 0 0 24px rgba(108, 138, 255, 0.18);
}

/* auto-numbered section counters: 01 // 02 // etc */
.content h2::before {
    counter-increment: idea-section;
    content: "0" counter(idea-section) " //";
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    color: var(--accent-primary);
    opacity: 0.6;
    margin-bottom: 0.25rem;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    color: var(--accent-primary);
}

h4 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    color: var(--accent-secondary);
}

p {
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

strong {
    color: #fff;
    font-weight: 600;
}

em {
    color: var(--text-secondary);
    font-style: italic;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

a:hover {
    border-bottom-color: var(--accent-primary);
}


/* ── Cross-Idea Links (.idea-link) ───────────────────────────── */
/*
 * These are generated by the publisher for [text](idea:slug) syntax.
 * Style here affects ALL cross-idea navigation across every page.
 */

a.idea-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25em;
    color: var(--accent-secondary);
    background: rgba(167, 139, 250, 0.08);
    border: 1px solid rgba(167, 139, 250, 0.2);
    border-radius: 6px;
    padding: 0.15em 0.6em;
    font-size: 0.92em;
    font-weight: 500;
    transition: background 0.15s, border-color 0.15s;
    text-decoration: none;
    white-space: nowrap;
}

a.idea-link:hover {
    background: rgba(167, 139, 250, 0.16);
    border-color: rgba(167, 139, 250, 0.5);
    border-bottom-color: rgba(167, 139, 250, 0.5);
}

.idea-link-arrow {
    font-style: normal;
    font-size: 0.85em;
    opacity: 0.7;
    flex-shrink: 0;
    white-space: nowrap;
    margin-left: auto;
    padding-left: 0.4em;
}


/* ── Blockquotes ─────────────────────────────────────────────── */

blockquote {
    border-left: 3px solid var(--accent-secondary);
    background: linear-gradient(135deg, rgba(26,26,46,0.95) 0%, rgba(13,13,26,0.6) 100%);
    padding: 1.75rem 2rem;
    margin: 2rem 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-size: 1.1rem;
    line-height: 1.65;
    color: var(--text-primary);
    position: relative;
}

blockquote::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, var(--accent-secondary), transparent);
    opacity: 0.3;
}

blockquote p {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

blockquote p:last-child {
    margin-bottom: 0;
}

blockquote strong {
    color: var(--accent-secondary);
    font-style: normal;
}

blockquote {
    transition: border-left-color 0.3s, box-shadow 0.3s;
}

blockquote:hover {
    border-left-color: #c4a4ff;
    box-shadow: 0 0 24px rgba(167, 139, 250, 0.06);
}


/* ── Lists ───────────────────────────────────────────────────── */

ul, ol {
    margin: 1rem 0 1.5rem 1.5rem;
}

li {
    margin-bottom: 0.4rem;
}

li strong {
    color: var(--accent-warm);
}

/* Task lists */
li input[type="checkbox"] {
    margin-right: 0.5rem;
    accent-color: var(--accent-primary);
}

/* Checked task items get a green glow */
li input[type="checkbox"]:checked {
    accent-color: var(--accent-green);
}

li input[type="checkbox"]:checked + span,
li:has(input[type="checkbox"]:checked) {
    color: var(--text-primary);
}

li input[type="checkbox"]:not(:checked) + span,
li:has(input[type="checkbox"]:not(:checked)) {
    color: var(--text-muted);
}

/* Numbered lists used as receipt trails / ordered deep-dives */
.content > ol {
    counter-reset: receipt;
    list-style: none;
    padding-left: 0;
}

.content > ol > li {
    counter-increment: receipt;
    position: relative;
    padding-left: 2.5rem;
    margin-bottom: 1rem;
}

.content > ol > li::before {
    content: counter(receipt);
    position: absolute;
    left: 0;
    top: 0.15rem;
    width: 1.6rem;
    height: 1.6rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-primary);
}


/* ── Tables ──────────────────────────────────────────────────── */

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.92rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

thead {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, rgba(108,138,255,0.05) 100%);
}

th {
    text-align: left;
    padding: 0.8rem 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: var(--accent-primary);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

td {
    padding: 0.7rem 1rem;
    border-top: 1px solid var(--border-light);
    color: var(--text-secondary);
}

tr:hover td {
    background: rgba(108, 138, 255, 0.04);
    color: var(--text-primary);
}


/* ── Code ────────────────────────────────────────────────────── */

code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.88em;
    background: var(--bg-tertiary);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    color: var(--accent-warm);
}

pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

pre code {
    background: none;
    padding: 0;
    color: var(--text-primary);
    font-size: 0.85rem;
    line-height: 1.6;
}


/* ── Horizontal Rules ────────────────────────────────────────── */

hr {
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border), transparent);
    margin: 3rem 0;
    position: relative;
}

hr::before {
    content: "◆";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-primary);
    color: var(--border);
    padding: 0 0.75rem;
    font-size: 0.55rem;
    letter-spacing: 0.3em;
}


/* ── Section Visuals (injected by enrich.py + publish.py) ────── */
/*
 * Each AI-generated section illustration is wrapped in .section-visual.
 * Rendered as a full-width cinematic break between sections.
 */

.section-visual {
    grid-column: breakout;
    width: 100%;
    margin: 2rem 0 2.5rem;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    line-height: 0;
}

.section-visual img {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
    filter: brightness(0.85) saturate(0.9);
    margin: 0;
    border-radius: var(--radius);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    transition: transform 0.5s ease, filter 0.3s ease;
}

.section-visual img:hover {
    filter: brightness(0.95) saturate(1.05);
    transform: scale(1.01);
}

/* Vignette overlay */
.section-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 40%,
        rgba(10, 10, 15, 0.7) 100%
    );
    border-radius: var(--radius);
    pointer-events: none;
}

/* Caption text (optional, inside figure) */
.section-visual figcaption {
    position: absolute;
    bottom: 0.75rem;
    right: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    color: rgba(255,255,255,0.25);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    pointer-events: none;
    z-index: 2;
}


/* ═══════════════════════════════════════════════════════════════ */
/*  BREAKOUT LAYOUT — Elements that escape the content column     */
/* ═══════════════════════════════════════════════════════════════ */
/*
 * The .content grid defines five named column lines:
 *   full-start | breakout-start | content-start … content-end | breakout-end | full-end
 *
 * Default: every child goes to `content` (780px max).
 * Apply these classes to break wider:
 *   .breakout     → breakout columns (~1100px)
 *   .full-bleed   → edge-to-edge viewport
 *   .pull-right   → content + right breakout margin
 *   .pull-left    → left breakout margin + content
 */

.breakout,
.content > .breakout {
    grid-column: breakout;
}

.full-bleed,
.content > .full-bleed {
    grid-column: full-start / full-end;
}

.pull-right,
.content > .pull-right {
    grid-column: content-start / breakout-end;
}

.pull-left,
.content > .pull-left {
    grid-column: breakout-start / content-end;
}


/* ── Frames — Bordered containers for images or content ──────── */
/*
 * <div class="frame breakout">
 *   <img src="photo.png" alt="...">
 *   <div class="frame-caption">Caption text here</div>
 * </div>
 */

.frame {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-card);
    box-shadow: var(--shadow);
    transition: border-color 0.35s, box-shadow 0.35s, transform 0.4s var(--spring-gentle);
    margin: 2rem 0;
}

.frame:hover {
    border-color: rgba(108, 138, 255, 0.25);
    box-shadow: var(--shadow), 0 0 40px rgba(108, 138, 255, 0.06);
    transform: translateY(-3px);
}

.frame img {
    width: 100%;
    display: block;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
}

.frame-caption {
    padding: 1rem 1.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.55;
    border-top: 1px solid var(--border-light);
}

.frame-caption strong {
    color: var(--accent-primary);
}

/* Split frame — image + text side by side */
.frame-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.frame-split img {
    height: 100%;
    object-fit: cover;
}

.frame-split .frame-body {
    padding: 2rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.frame-split .frame-body h3 {
    margin-top: 0;
}

@media (max-width: 768px) {
    .frame-split {
        grid-template-columns: 1fr;
    }

    .frame-split img {
        max-height: 240px;
    }
}


/* ── Image Masks — Clip shapes for square images ─────────────── */
/*
 * Apply to <img> or a wrapper <div>.
 * Square images (1:1) look best with these masks.
 *
 * <img src="avatar.png" class="mask-circle">
 * <div class="frame mask-rounded-xl"><img src="..."></div>
 */

.mask-circle {
    clip-path: circle(50%);
    aspect-ratio: 1;
    object-fit: cover;
}

.mask-rounded {
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.mask-rounded-xl {
    border-radius: 24px;
    overflow: hidden;
}

.mask-pill {
    border-radius: 9999px;
    overflow: hidden;
}

.mask-diamond {
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    aspect-ratio: 1;
    object-fit: cover;
}

.mask-hex {
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    aspect-ratio: 1;
    object-fit: cover;
}

.mask-soft {
    mask-image: radial-gradient(ellipse 90% 90% at center, black 55%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 90% 90% at center, black 55%, transparent 100%);
}

.mask-arch {
    border-radius: 50% 50% var(--radius) var(--radius) / 30% 30% 0 0;
    overflow: hidden;
}

/* Decorative ring behind masked images */
.mask-ring {
    position: relative;
    display: inline-block;
}

.mask-ring::before {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: inherit;
    border: 2px solid rgba(108, 138, 255, 0.15);
    pointer-events: none;
    animation: constellation-pulse 3s ease-in-out infinite;
}


/* ── Pull Quote — Editorial breakout quotation ───────────────── */
/*
 * <div class="pull-quote">
 *   <p>"The important thing is not to stop questioning."</p>
 * </div>
 */

.pull-quote {
    grid-column: content-start / breakout-end;
    margin: 2.5rem 0;
    padding: 2rem 2.5rem 2rem 3rem;
    border-left: 3px solid var(--accent-secondary);
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.35rem;
    font-style: italic;
    line-height: 1.65;
    color: var(--text-primary);
    background: linear-gradient(135deg, rgba(167,139,250,0.05) 0%, transparent 80%);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    position: relative;
}

.pull-quote::before {
    content: "\201C";
    position: absolute;
    top: -0.15em;
    left: 0.6rem;
    font-family: 'Playfair Display', serif;
    font-size: 4.5rem;
    color: var(--accent-secondary);
    opacity: 0.15;
    line-height: 1;
}

.pull-quote p {
    margin: 0;
}

.pull-quote cite,
.pull-quote .pull-quote-attr {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    font-style: normal;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 0.75rem;
}

@media (max-width: 768px) {
    .pull-quote {
        grid-column: content;
        padding: 1.5rem 1.5rem 1.5rem 2rem;
        font-size: 1.15rem;
    }
}


/* ── Cinema Panel — Full-bleed cinematic image break ─────────── */
/*
 * <figure class="cinema-panel full-bleed">
 *   <img src="landscape.png" alt="...">
 *   <figcaption>Shot from the summit</figcaption>
 * </figure>
 */

.cinema-panel {
    grid-column: full-start / full-end;
    position: relative;
    max-height: 55vh;
    overflow: hidden;
    margin: 3rem 0;
    line-height: 0;
}

.cinema-panel img {
    width: 100%;
    height: 55vh;
    object-fit: cover;
    display: block;
    filter: brightness(0.65) saturate(1.1);
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    transition: filter 0.5s ease;
}

.cinema-panel:hover img {
    filter: brightness(0.72) saturate(1.15);
}

.cinema-panel::before,
.cinema-panel::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    pointer-events: none;
    z-index: 1;
}

.cinema-panel::before {
    top: 0;
    height: 25%;
    background: linear-gradient(to bottom, var(--bg-primary), transparent);
}

.cinema-panel::after {
    bottom: 0;
    height: 35%;
    background: linear-gradient(to top, var(--bg-primary), transparent);
}

.cinema-panel figcaption {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.35);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    z-index: 2;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .cinema-panel {
        max-height: 40vh;
    }

    .cinema-panel img {
        height: 40vh;
    }
}


/* ── Offset Card — Two-column breakout panel ─────────────────── */
/*
 * <div class="offset-card breakout">
 *   <img src="detail.png" alt="...">
 *   <div class="offset-card-text">
 *     <h3>Title</h3>
 *     <p>Description</p>
 *   </div>
 * </div>
 */

.offset-card {
    grid-column: breakout;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: center;
    margin: 2.5rem 0;
    padding: 2rem 2.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.offset-card:hover {
    border-color: rgba(108, 138, 255, 0.2);
    box-shadow: var(--shadow), var(--shadow-glow);
}

.offset-card img {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    margin: 0;
}

.offset-card-text h3 {
    margin-top: 0;
}

.offset-card-text p:last-child {
    margin-bottom: 0;
}

/* Reversed variant — text first, image second */
.offset-card.reversed {
    direction: rtl;
}

.offset-card.reversed > * {
    direction: ltr;
}

@media (max-width: 768px) {
    .offset-card {
        grid-column: content;
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem;
    }

    .offset-card.reversed {
        direction: ltr;
    }
}


/* ── Inset Panel — Recessed content block ────────────────────── */
/*
 * <div class="inset">
 *   <p>Background detail or aside.</p>
 * </div>
 */

.inset {
    margin: 2rem 0;
    padding: 1.75rem 2rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: inset 0 2px 12px rgba(0,0,0,0.25);
}

.inset p:last-child {
    margin-bottom: 0;
}


/* ── Gallery Grid — Breakout multi-image layout ──────────────── */
/*
 * <div class="gallery breakout">
 *   <img src="a.png" class="mask-rounded" alt="...">
 *   <img src="b.png" class="mask-rounded" alt="...">
 *   <img src="c.png" class="mask-rounded" alt="...">
 * </div>
 */

.gallery {
    grid-column: breakout;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 2.5rem 0;
}

.gallery img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: transform 0.4s var(--spring-gentle), box-shadow 0.3s;
    margin: 0;
}

.gallery img:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow), var(--shadow-glow);
}

@media (max-width: 640px) {
    .gallery {
        grid-column: full-start / full-end;
        gap: 0.5rem;
        padding: 0 var(--gutter);
    }
}


/* ── Accent Stripe — Full-bleed colored divider ──────────────── */

.accent-stripe {
    grid-column: full-start / full-end;
    height: 3px;
    margin: 3rem 0;
    background: linear-gradient(
        to right,
        transparent 5%,
        var(--accent-primary) 30%,
        var(--accent-secondary) 50%,
        var(--accent-cyan) 70%,
        transparent 95%
    );
    opacity: 0.25;
}


/* ── Staggered Children Reveal ────────────────────────────────── */
/*
 * When a list or table is revealed, children cascade in one by one.
 * JS stamps .stagger-children on revealed parents; CSS does the rest.
 */

.stagger-children > li,
.stagger-children > tbody > tr {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s var(--ease-out-expo), transform 0.5s var(--ease-out-expo);
}

.stagger-children.stagger-active > li,
.stagger-children.stagger-active > tbody > tr {
    opacity: 1;
    transform: translateY(0);
}

/* Each child gets 50ms more delay than the last (set by JS via --stagger) */
.stagger-children > li:nth-child(1)  { transition-delay: 0ms; }
.stagger-children > li:nth-child(2)  { transition-delay: 50ms; }
.stagger-children > li:nth-child(3)  { transition-delay: 100ms; }
.stagger-children > li:nth-child(4)  { transition-delay: 150ms; }
.stagger-children > li:nth-child(5)  { transition-delay: 200ms; }
.stagger-children > li:nth-child(6)  { transition-delay: 250ms; }
.stagger-children > li:nth-child(7)  { transition-delay: 300ms; }
.stagger-children > li:nth-child(8)  { transition-delay: 350ms; }
.stagger-children > li:nth-child(9)  { transition-delay: 400ms; }
.stagger-children > li:nth-child(10) { transition-delay: 450ms; }
.stagger-children > li:nth-child(n+11) { transition-delay: 500ms; }

.stagger-children > tbody > tr:nth-child(1)  { transition-delay: 0ms; }
.stagger-children > tbody > tr:nth-child(2)  { transition-delay: 60ms; }
.stagger-children > tbody > tr:nth-child(3)  { transition-delay: 120ms; }
.stagger-children > tbody > tr:nth-child(4)  { transition-delay: 180ms; }
.stagger-children > tbody > tr:nth-child(5)  { transition-delay: 240ms; }
.stagger-children > tbody > tr:nth-child(6)  { transition-delay: 300ms; }
.stagger-children > tbody > tr:nth-child(7)  { transition-delay: 360ms; }
.stagger-children > tbody > tr:nth-child(8)  { transition-delay: 420ms; }
.stagger-children > tbody > tr:nth-child(n+9) { transition-delay: 480ms; }


/* ── Section Image Scroll Parallax ───────────────────────────── */
/*
 * Section images drift upward subtly as they scroll through the viewport.
 * CSS scroll-driven animation handles this natively in modern browsers.
 * JS fallback applies a simpler transform for older browsers.
 */

@keyframes section-parallax {
    from { transform: translateY(20px) scale(1.02); }
    to   { transform: translateY(-20px) scale(1.0); }
}

@supports (animation-timeline: view()) {
    .section-visual img {
        animation: section-parallax linear both;
        animation-timeline: view();
        animation-range: entry 0% exit 100%;
    }
}


/* ── HR Glow Sweep ───────────────────────────────────────────── */
/*
 * Horizontal rules get an animated highlight that sweeps across.
 */

.content hr {
    position: relative;
    overflow: hidden;
}


/* ── Content Images — Depth hover ────────────────────────────── */

.content img {
    max-width: 100%;
    border-radius: var(--radius-lg);
    margin: 2rem 0;
    box-shadow: var(--shadow), 0 0 0 1px rgba(42, 42, 58, 0.5);
    transition: transform 0.5s var(--spring-gentle), box-shadow 0.4s, filter 0.4s;
}

.content img:hover {
    transform: scale(1.012) translateY(-2px);
    box-shadow: var(--shadow), var(--shadow-glow), 0 12px 40px rgba(0,0,0,0.3);
    filter: brightness(1.05);
}


/* ── Mouse Glow Follower ─────────────────────────────────────── */
/*
 * JS injects a fixed div that follows the cursor with a soft radial gradient.
 * Pure atmosphere — barely visible, responds to mouse position.
 */

.cursor-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 1s ease;
    background: radial-gradient(circle, rgba(108,138,255,0.04) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    will-change: left, top;
}

.cursor-glow.active { opacity: 1; }

.theme-gold .cursor-glow {
    background: radial-gradient(circle, rgba(212,160,23,0.05) 0%, transparent 70%);
}


/* ── Blockquote Blur-In (automatic reveal variant) ───────────── */

.content blockquote.reveal-ready {
    --reveal-y: 12px;
}


/* ── Scroll-Linked Atmosphere Shift ──────────────────────────── */
/*
 * Body background gradient shifts as you scroll deeper.
 * JS updates --scroll-depth (0–1), CSS transitions the glow position.
 */

body {
    --scroll-depth: 0;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: calc(0.3 + var(--scroll-depth) * 0.3);
    background:
        radial-gradient(
            ellipse at calc(20% + var(--scroll-depth) * 60%) calc(80% - var(--scroll-depth) * 50%),
            rgba(167,139,250,0.04) 0%, transparent 50%
        ),
        radial-gradient(
            ellipse at calc(80% - var(--scroll-depth) * 40%) calc(20% + var(--scroll-depth) * 60%),
            rgba(34,211,238,0.03) 0%, transparent 45%
        );
    transition: opacity 0.3s ease;
}

.theme-gold body::after {
    background:
        radial-gradient(
            ellipse at calc(20% + var(--scroll-depth) * 60%) calc(80% - var(--scroll-depth) * 50%),
            rgba(212,160,23,0.05) 0%, transparent 50%
        ),
        radial-gradient(
            ellipse at calc(80% - var(--scroll-depth) * 40%) calc(20% + var(--scroll-depth) * 60%),
            rgba(245,200,66,0.03) 0%, transparent 45%
        );
}


/* ── Animations ──────────────────────────────────────────────── */

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ── Responsive — Tablet ─────────────────────────────────────── */

@media (max-width: 768px) {
    body {
        font-size: 16px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.4rem;
    }

    .content {
        --gutter: 1.25rem;
        padding-top: 1.5rem;
        padding-bottom: 4rem;
    }

    .hero img {
        height: 35vh;
    }

    table {
        font-size: 0.82rem;
    }

    th, td {
        padding: 0.5rem 0.6rem;
    }

    .section-visual {
        grid-column: full-start / full-end;
        width: 100%;
        margin: 1.5rem 0 2rem;
        max-height: 260px;
    }

    .section-visual img {
        height: 260px;
        animation: none;
    }

    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .callout {
        padding-left: 2.75rem;
    }
}


/* ── Responsive — Mobile ─────────────────────────────────────── */

@media (max-width: 480px) {
    h1 {
        font-size: 1.65rem;
    }

    .content {
        --gutter: 1rem;
        padding-top: 1rem;
        padding-bottom: 3rem;
    }
}


/* ── Secret Phrase — Redacted Reveal ────────────────────────── */
/*
 * Usage in markdown: [secret]your phrase here[/secret]
 * First click: subtle pulse (nothing revealed)
 * Second click within 1.5s: text glows in for 3 seconds, then redacts
 */

.secret-phrase {
    display: inline-block;
    position: relative;
    cursor: pointer;
    user-select: none;
    border-radius: 3px;
    vertical-align: baseline;
}

.secret-mask {
    display: inline-block;
    background: #1a1a1a;
    border-radius: 3px;
    height: 1.1em;
    width: 100%;
    position: absolute;
    top: 0.1em;
    left: 0;
    transition: opacity 0.4s ease;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.04);
}

.secret-text {
    display: inline-block;
    color: var(--accent-secondary);
    font-style: italic;
    padding: 0 0.3em;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

/* Revealed state */
.secret-phrase.secret-revealed .secret-mask {
    opacity: 0;
}

.secret-phrase.secret-revealed .secret-text {
    opacity: 1;
    text-shadow: 0 0 12px rgba(167, 139, 250, 0.6);
}

/* First-click pulse */
@keyframes secretPulse {
    0%   { box-shadow: 0 0 0 0 rgba(167, 139, 250, 0); }
    40%  { box-shadow: 0 0 6px 2px rgba(167, 139, 250, 0.25); }
    100% { box-shadow: 0 0 0 0 rgba(167, 139, 250, 0); }
}

.secret-phrase.secret-pulse .secret-mask {
    animation: secretPulse 0.4s ease-out forwards;
}


/* ── Scroll-Reveal Animations ────────────────────────────────── */
/*
 * Two-tier architecture:
 *
 * Tier 1 — CSS scroll-driven (Chrome 115+, Firefox 110+, Safari 18+):
 *   animation-timeline: view() ties each element's animation directly to
 *   its scroll position. Bidirectional wind-back is free — the browser
 *   reverses the keyframes as you scroll back up. Zero JS. Compositor-threaded.
 *
 * Tier 2 — WAAPI fallback (older browsers):
 *   ideas.js IntersectionObserver + el.animate() with reverse() for wind-back.
 *   JS detects Tier 1 support and skips the observer entirely when available.
 *
 * --reveal-y (@property <length>) controls the entry travel distance.
 * Override it per-element or per-breakpoint; keyframes pick it up automatically.
 */

/* Reveal keyframes — referenced by both tiers */
@keyframes reveal-up {
    from { opacity: 0; transform: translateY(var(--reveal-y)); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes reveal-left {
    from { opacity: 0; transform: translateX(-30px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes reveal-right {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes reveal-scale {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes reveal-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes reveal-blur {
    from { opacity: 0; filter: blur(6px); transform: translateY(8px); }
    to   { opacity: 1; filter: blur(0); transform: translateY(0); }
}
@keyframes reveal-rise-rotate {
    from { opacity: 0; transform: translateY(24px) rotate(-1.5deg); }
    to   { opacity: 1; transform: translateY(0) rotate(0); }
}

/* ── Tier 2 fallback (class-toggle driven by WAAPI in ideas.js) ── */
.reveal-ready {
    opacity: 0;
    transform: translateY(var(--reveal-y));
    transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo);
    will-change: opacity, transform;
}
.reveal-ready[data-reveal="left"]  { transform: translateX(-30px); }
.reveal-ready[data-reveal="right"] { transform: translateX(30px); }
.reveal-ready[data-reveal="scale"] { transform: scale(0.92); }
.reveal-ready[data-reveal="fade"]  { transform: none; }
.reveal-ready[data-reveal="blur"]  { transform: translateY(8px); filter: blur(6px); }
.reveal-ready[data-reveal="rise-rotate"] { transform: translateY(24px) rotate(-1.5deg); }
.reveal-ready.revealed {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1) rotate(0);
    filter: blur(0);
}

/* Mobile fallback: wider travel */
@media (max-width: 640px) {
    .reveal-ready { --reveal-y: 44px; }
}

/* ── Tier 1 override: browser owns the animation ──────────────── */
@supports (animation-timeline: view()) {
    .reveal-ready {
        /* Undo fallback state — browser controls opacity/transform */
        opacity: unset;
        transform: unset;
        transition: none;
        will-change: auto;

        /* Scroll-linked animation: plays on entry, reverses on scroll-back */
        animation: reveal-up linear both;
        animation-timeline: view();
        animation-range: entry 0% entry 30%;
    }

    .reveal-ready[data-reveal="left"]  { animation-name: reveal-left; }
    .reveal-ready[data-reveal="right"] { animation-name: reveal-right; }
    .reveal-ready[data-reveal="scale"] { animation-name: reveal-scale; }
    .reveal-ready[data-reveal="fade"]  { animation-name: reveal-fade; }
    .reveal-ready[data-reveal="blur"]  { animation-name: reveal-blur; }
    .reveal-ready[data-reveal="rise-rotate"] { animation-name: reveal-rise-rotate; }

    /* .revealed is a no-op here — scroll position owns the state */
    .reveal-ready.revealed { /* intentionally empty */ }

    /* Mobile: extend the active range so slower readers get the full effect */
    @media (max-width: 640px) {
        .reveal-ready {
            --reveal-y: 44px;
            animation-range: entry 0% entry 40%;
        }
    }
}


/* ── Status Badges ───────────────────────────────────────────── */
/*
 * Used in markdown as: <span class="status-badge live">Live</span>
 * Variants: live, built, planned, beta
 */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.25em 0.75em;
    border-radius: 100px;
    white-space: nowrap;
    vertical-align: middle;
}

.status-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-badge.live {
    background: rgba(16, 185, 129, 0.12);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.25);
}
.status-badge.live::before {
    background: var(--accent-green);
    box-shadow: 0 0 6px var(--accent-green);
    animation: pulseGlow 2s ease-in-out infinite;
}

.status-badge.built {
    background: rgba(108, 138, 255, 0.12);
    color: var(--accent-primary);
    border: 1px solid rgba(108, 138, 255, 0.25);
}
.status-badge.built::before { background: var(--accent-primary); }

.status-badge.planned {
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent-warm);
    border: 1px solid rgba(245, 158, 11, 0.25);
}
.status-badge.planned::before { background: var(--accent-warm); }

.status-badge.beta {
    background: rgba(167, 139, 250, 0.12);
    color: var(--accent-secondary);
    border: 1px solid rgba(167, 139, 250, 0.25);
}
.status-badge.beta::before { background: var(--accent-secondary); }

@keyframes pulseGlow {
    0%, 100% { opacity: 1; box-shadow: 0 0 6px currentColor; }
    50%      { opacity: 0.5; box-shadow: 0 0 2px currentColor; }
}


/* ── Stat Grid ───────────────────────────────────────────────── */
/*
 * A row of highlight metrics. Used as:
 * <div class="stat-grid">
 *   <div class="stat"><span class="stat-value">14</span><span class="stat-label">API Endpoints</span></div>
 * </div>
 */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.stat:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.stat-value {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-primary);
    line-height: 1.1;
}

.stat-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-top: 0.4rem;
}


/* ── Icon Labels ─────────────────────────────────────────────── */
/*
 * <span class="icon-label"><span class="material-symbols-outlined">visibility</span> AI Vision</span>
 */

.icon-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    color: var(--text-secondary);
    font-size: 0.92em;
}

.icon-label .material-symbols-outlined {
    font-size: 1.15em;
    color: var(--accent-primary);
}


/* ── Feature Cards (grid of capabilities) ────────────────────── */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.feature-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: border-color 0.3s, transform 0.3s var(--ease-out-expo), box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.feature-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.feature-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, var(--accent-primary), var(--accent-secondary));
    opacity: 0;
    transition: opacity 0.3s;
}

.feature-card:hover::before { opacity: 1; }

.feature-card .card-icon {
    font-size: 1.5rem;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
    display: block;
}

.feature-card h4 {
    margin-top: 0;
    margin-bottom: 0.3rem;
    font-size: 0.95rem;
    color: #fff;
}

.feature-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0;
    line-height: 1.5;
}


/* ── Progress Tracker ────────────────────────────────────────── */
/*
 * Vertical timeline of milestones:
 * <div class="progress-track">
 *   <div class="milestone done"><span class="ms-dot"></span><span class="ms-text">Phase 1</span></div>
 * </div>
 */

.progress-track {
    position: relative;
    padding-left: 2rem;
    margin: 2rem 0;
}

.progress-track::before {
    content: "";
    position: absolute;
    left: 0.55rem;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 2px;
    background: var(--border);
}

.milestone {
    position: relative;
    padding: 0.5rem 0;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.ms-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    flex-shrink: 0;
    margin-left: -2rem;
    margin-top: 0.25rem;
    z-index: 1;
    transition: all 0.3s;
}

.milestone.done .ms-dot {
    background: var(--accent-green);
    border-color: var(--accent-green);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.milestone.active .ms-dot {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 8px rgba(108, 138, 255, 0.4);
    animation: pulseGlow 2s ease-in-out infinite;
}

.milestone.pending .ms-dot {
    background: var(--bg-tertiary);
    border-color: var(--border);
}

.ms-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.milestone.done .ms-text { color: var(--text-primary); }
.milestone.active .ms-text { color: var(--accent-primary); font-weight: 500; }


/* ── Callout Boxes ───────────────────────────────────────────── */
/*
 * <div class="callout callout-insight">...</div>
 * Variants: insight, warning, tech, sa (South Africa)
 */

/* Callout base — flex layout so icon and header sit on the same line */
.callout {
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin: 1.75rem 0;
    border: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;

    /* --glow-alpha is a typed @property — browser interpolates it smoothly.
     * Each variant sets its own glow colour below via box-shadow. */
    transition: --glow-alpha 0.4s ease, border-color 0.35s ease;
}

/* Suppress the old absolute-position icon; .callout-icon span takes over */
.callout::before { display: none; }

.callout-icon {
    flex-shrink: 0;
    font-size: 1.05rem;
    line-height: 1.55;
    opacity: 0.9;
}

.callout-body {
    flex: 1;
    min-width: 0;
    line-height: 1.6;
}

.callout-insight {
    background: linear-gradient(135deg, rgba(108,138,255,0.06) 0%, transparent 100%);
    border-color: rgba(108, 138, 255, 0.2);
    box-shadow: 0 0 28px rgba(108, 138, 255, var(--glow-alpha));
}
.callout-insight:hover { --glow-alpha: 0.12; border-color: rgba(108,138,255,0.4); }
.callout-insight .callout-icon { color: var(--accent-primary); }

.callout-warning {
    background: linear-gradient(135deg, rgba(245,158,11,0.06) 0%, transparent 100%);
    border-color: rgba(245, 158, 11, 0.2);
    box-shadow: 0 0 28px rgba(245, 158, 11, var(--glow-alpha));
}
.callout-warning:hover { --glow-alpha: 0.12; border-color: rgba(245,158,11,0.4); }
.callout-warning .callout-icon { color: var(--accent-warm); }

.callout-tech {
    background: linear-gradient(135deg, rgba(34,211,238,0.06) 0%, transparent 100%);
    border-color: rgba(34, 211, 238, 0.2);
    box-shadow: 0 0 28px rgba(34, 211, 238, var(--glow-alpha));
}
.callout-tech:hover { --glow-alpha: 0.12; border-color: rgba(34,211,238,0.4); }
.callout-tech .callout-icon { color: var(--accent-cyan); }

.callout-sa {
    background: linear-gradient(135deg, rgba(16,185,129,0.06) 0%, transparent 100%);
    border-color: rgba(16, 185, 129, 0.2);
    box-shadow: 0 0 28px rgba(16, 185, 129, var(--glow-alpha));
}
.callout-sa:hover { --glow-alpha: 0.12; border-color: rgba(16,185,129,0.4); }
.callout-sa .callout-icon { color: var(--accent-green); }

/* ── Gold — personal voice, written directly by Kris ─────────── */
/*
 * Use this for blocks that contain Kris's own words verbatim — not
 * AI-generated summary, not paraphrase. The gold marks the source.
 * <div class="callout callout-gold">
 *   <span class="callout-icon">◆</span>
 *   <div class="callout-body">...</div>
 * </div>
 */
.callout-gold {
    background: linear-gradient(135deg, rgba(251,191,36,0.08) 0%, rgba(245,158,11,0.04) 100%);
    border-color: rgba(251, 191, 36, 0.4);
    border-left-width: 3px;
    box-shadow: 0 0 32px rgba(251, 191, 36, var(--glow-alpha));
}
.callout-gold:hover { --glow-alpha: 0.18; border-color: rgba(251,191,36,0.7); }
.callout-gold .callout-icon { color: rgb(251, 191, 36); }

/* ── Red — critical / must-not-miss ──────────────────────────── */
/*
 * Use for information that demands attention as the reader scrolls.
 * Not for every warning — only for the ONE thing they must not miss.
 * <div class="callout callout-red">
 *   <span class="callout-icon">◆</span>
 *   <div class="callout-body">...</div>
 * </div>
 */
.callout-red {
    background: linear-gradient(135deg, rgba(239,68,68,0.09) 0%, rgba(180,20,20,0.04) 100%);
    border-color: rgba(239, 68, 68, 0.4);
    border-left-width: 3px;
    box-shadow: 0 0 28px rgba(239, 68, 68, var(--glow-alpha));
}
.callout-red:hover { --glow-alpha: 0.14; border-color: rgba(239,68,68,0.65); }
.callout-red .callout-icon { color: rgb(239, 68, 68); }


/* ── Animated Counter (will-change for JS counting) ──────────── */

.count-up {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}


/* ── Glow Divider ────────────────────────────────────────────── */

.glow-divider {
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--accent-primary), transparent);
    margin: 3.5rem 0;
    opacity: 0.3;
}


/* ── Browser Chrome ──────────────────────────────────────────── */

::selection {
    background: rgba(108, 138, 255, 0.3);
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}


/* ═══════════════════════════════════════════════════════════════ */
/*  LIVING WEB — Weave Service Components (v2)                    */
/* ═══════════════════════════════════════════════════════════════ */


/* ── Reading Progress Bar ────────────────────────────────────── */

.weave-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    z-index: 9999;
    background: linear-gradient(to right, var(--accent-primary), var(--accent-secondary));
    width: 0;
    transition: width 0.15s linear;
    pointer-events: none;
}


/* ── Kronos Pulse ────────────────────────────────────────────── */

.weave-pulse {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9990;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-family: 'JetBrains Mono', monospace;
}

.weave-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: background 0.5s ease, box-shadow 0.5s ease;
    flex-shrink: 0;
}

.weave-pulse-dot.online {
    background: var(--accent-green);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5), 0 0 20px rgba(16, 185, 129, 0.2);
    animation: pulse-glow 2s ease-in-out infinite;
}

.weave-pulse-dot.offline {
    background: var(--accent-danger);
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 8px rgba(16, 185, 129, 0.5), 0 0 20px rgba(16, 185, 129, 0.2); }
    50% { box-shadow: 0 0 12px rgba(16, 185, 129, 0.7), 0 0 30px rgba(16, 185, 129, 0.3); }
}

.weave-pulse-label {
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    transition: color 0.3s ease;
    opacity: 0.7;
}

.weave-pulse:hover .weave-pulse-label {
    color: var(--text-secondary);
    opacity: 1;
}

.weave-pulse-panel {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 0;
    width: 280px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    opacity: 0;
    transform: translateY(8px) scale(0.95);
    transition: opacity 0.3s var(--ease-out-expo), transform 0.3s var(--ease-out-expo);
    pointer-events: none;
    box-shadow: var(--shadow), var(--shadow-glow);
    overflow: hidden;
}

.weave-pulse.expanded .weave-pulse-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.weave-pulse-header {
    padding: 12px 16px 8px;
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent-primary);
    border-bottom: 1px solid var(--border-light);
}

.weave-pulse-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 16px;
    font-size: 12px;
}

.weave-pulse-key {
    color: var(--text-muted);
}

.weave-pulse-val {
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
}

.weave-pulse-val.online-text {
    color: var(--accent-green);
}

.weave-pulse-divider {
    height: 1px;
    background: var(--border-light);
    margin: 4px 16px;
}

.weave-pulse-freddy {
    padding: 10px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.weave-pulse-freddy-mood {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-cyan);
}

.weave-pulse-freddy-status {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    font-style: italic;
}


/* ── Ambient Particles Canvas ────────────────────────────────── */

.weave-particles {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 1;
}


/* ── Tangent Wire Card ───────────────────────────────────────── */

.weave-tangent {
    position: fixed;
    right: -340px;
    bottom: 80px;
    width: 300px;
    z-index: 9980;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent-cyan);
    border-radius: var(--radius);
    padding: 0;
    box-shadow: var(--shadow), 0 0 40px rgba(34, 211, 238, 0.06);
    transition: right 0.65s var(--spring-gentle), opacity 0.4s ease;
    opacity: 0;
    overflow: hidden;
}

.weave-tangent.visible {
    right: 20px;
    opacity: 1;
}

.weave-tangent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px 6px;
    border-bottom: 1px solid var(--border-light);
}

.weave-tangent-wire {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent-cyan);
}

.weave-tangent-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s ease;
}

.weave-tangent-close:hover {
    color: var(--text-primary);
}

.weave-tangent-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease;
}

.weave-tangent-link:hover {
    background: rgba(108, 138, 255, 0.05);
}

.weave-tangent-thumb {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.weave-tangent-link:hover .weave-tangent-thumb {
    opacity: 1;
}

.weave-tangent-placeholder {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 6px;
    background: linear-gradient(135deg, rgba(108, 138, 255, 0.12) 0%, rgba(167, 139, 250, 0.08) 100%);
}

.weave-tangent-text {
    flex: 1;
    min-width: 0;
}

.weave-tangent-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.weave-tangent-teaser {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.weave-tangent-freddy {
    padding: 8px 14px 12px;
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
    border-top: 1px solid var(--border-light);
    line-height: 1.4;
}

.weave-tangent-freddy-icon {
    font-style: normal;
}


/* ── Freddy Whisper ──────────────────────────────────────────── */

.weave-whisper {
    margin: 2rem 0;
    padding: 16px 20px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: linear-gradient(135deg, rgba(108, 138, 255, 0.04), rgba(34, 211, 238, 0.03));
    border-left: 2px solid var(--accent-primary);
    border-radius: 0 var(--radius) var(--radius) 0;
    opacity: 0;
    transform: translateX(-12px);
    transition: opacity 0.8s ease, transform 0.8s var(--ease-out-expo);
}

.weave-whisper.visible {
    opacity: 1;
    transform: translateX(0);
}

.weave-whisper-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(108, 138, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    margin-top: 2px;
}

.weave-whisper-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    font-style: italic;
}


/* ── Rabbit Hole ─────────────────────────────────────────────── */

.weave-rabbit-hole {
    position: relative;
    margin: 3rem 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.7s ease, transform 0.75s var(--spring-gentle);
}

.weave-rabbit-hole.visible {
    opacity: 1;
    transform: translateY(0);
}

.weave-rabbit-hole-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(167, 139, 250, 0.06) 0%,
        rgba(108, 138, 255, 0.04) 40%,
        rgba(34, 211, 238, 0.06) 100%
    );
    border: 1px solid rgba(167, 139, 250, 0.15);
    border-radius: var(--radius-lg);
    pointer-events: none;
    animation: rabbit-glow 4s ease-in-out infinite alternate;
}

@keyframes rabbit-glow {
    0% { border-color: rgba(167, 139, 250, 0.15); }
    100% { border-color: rgba(34, 211, 238, 0.2); }
}

.weave-rabbit-hole-content {
    position: relative;
    padding: 24px 28px;
    z-index: 1;
}

.weave-rabbit-hole-hook {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent-secondary);
    margin-bottom: 12px;
}

.weave-rabbit-hole-link {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: inherit;
    padding: 0;
    border-radius: var(--radius);
    background: rgba(108, 138, 255, 0.04);
    border: 1px solid var(--border-light);
    transition: background 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
    overflow: hidden;
}

.weave-rabbit-hole-link:hover {
    background: rgba(108, 138, 255, 0.08);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(108, 138, 255, 0.12);
}

.weave-rabbit-hole-thumb {
    flex-shrink: 0;
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: var(--radius) 0 0 var(--radius);
    opacity: 0.85;
    transition: opacity 0.3s ease;
}

.weave-rabbit-hole-link:hover .weave-rabbit-hole-thumb {
    opacity: 1;
}

.weave-rabbit-hole-placeholder {
    flex-shrink: 0;
    width: 120px;
    height: 90px;
    border-radius: var(--radius) 0 0 var(--radius);
    background: linear-gradient(135deg, rgba(108, 138, 255, 0.15) 0%, rgba(167, 139, 250, 0.1) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.weave-rabbit-hole-placeholder::after {
    content: '→';
    font-size: 24px;
    color: var(--accent-primary);
    opacity: 0.4;
}

.weave-rabbit-hole-body {
    flex: 1;
    padding: 12px 16px 12px 0;
    min-width: 0;
}

.weave-rabbit-hole-title {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.weave-rabbit-hole-teaser {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.weave-rabbit-hole-arrow {
    display: inline-block;
    margin-top: 6px;
    font-size: 16px;
    color: var(--accent-primary);
    transition: transform 0.3s ease;
}

.weave-rabbit-hole-link:hover .weave-rabbit-hole-arrow {
    transform: translateX(8px);
}


/* ── Constellation Nodes (idea-link pulse) ───────────────────── */

.constellation-node {
    animation: constellation-pulse 3s ease-in-out infinite;
}

@keyframes constellation-pulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(108, 138, 255, 0.1); }
    50% { box-shadow: 0 2px 16px rgba(108, 138, 255, 0.2), 0 0 30px rgba(108, 138, 255, 0.05); }
}


/* ── Mobile adjustments for living components ────────────────── */

@media (max-width: 768px) {
    .weave-pulse {
        bottom: 12px;
        left: 12px;
    }

    .weave-pulse-panel {
        width: 260px;
    }

    .weave-rabbit-hole-thumb {
        width: 80px;
        height: 70px;
    }

    .weave-rabbit-hole-placeholder {
        width: 80px;
        height: 70px;
    }

    .weave-tangent-thumb {
        width: 44px;
        height: 44px;
    }

    .weave-tangent-placeholder {
        width: 44px;
        height: 44px;
    }

    .weave-tangent {
        width: calc(100vw - 32px);
        right: -100vw;
        bottom: 60px;
    }

    .weave-tangent.visible {
        right: 16px;
    }

    /* Mini pill — after scroll threshold */
    .weave-tangent.mini {
        width: auto;
        right: 16px;
        bottom: 20px;
        border-radius: 24px;
        cursor: pointer;
        box-shadow: 0 0 20px rgba(34, 211, 238, 0.2);
        transition: right 0.5s var(--spring), bottom 0.4s ease, border-radius 0.3s ease, box-shadow 0.3s ease;
    }

    .weave-tangent.mini .weave-tangent-link,
    .weave-tangent.mini .weave-tangent-freddy {
        display: none;
    }

    .weave-tangent.mini .weave-tangent-header {
        border-bottom: none;
        padding: 10px 16px;
        gap: 10px;
    }

    .weave-tangent.mini .weave-tangent-wire::before {
        content: '↗ ';
    }

    .weave-tangent.mini .weave-tangent-wire {
        font-size: 9px;
        letter-spacing: 0.12em;
        white-space: nowrap;
    }

    .weave-rabbit-hole-content {
        padding: 18px 20px;
    }
}


/* ────────────────────────────────────────────────────────────── */
/* YouTube Community Post Section                                 */
/* ────────────────────────────────────────────────────────────── */

.yt-post {
    margin: 80px 0 48px;
    border-radius: 16px;
    background: linear-gradient(135deg, #160505 0%, #0e0e0e 60%, #0a0a14 100%);
    border: 1px solid rgba(255, 43, 43, 0.25);
    overflow: hidden;
    box-shadow: 0 0 60px rgba(255, 43, 43, 0.06), 0 4px 24px rgba(0, 0, 0, 0.5);
}

.yt-post-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 22px 28px 18px;
    border-bottom: 1px solid rgba(255, 43, 43, 0.12);
    background: rgba(255, 43, 43, 0.04);
}

.yt-logo {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    margin-top: 2px;
}

.yt-post-header-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.yt-post-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #FF2B2B;
}

.yt-post-note {
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.5;
}

.yt-post-body {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 0;
}

.yt-post-image {
    padding: 24px 0 24px 28px;
}

.yt-post-image img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

.yt-post-text {
    padding: 24px 28px;
    border-left: 1px solid rgba(255, 43, 43, 0.08);
}

.yt-post-text pre {
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.78);
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
}

.yt-post-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 28px 20px;
    border-top: 1px solid rgba(255, 43, 43, 0.08);
    flex-wrap: wrap;
}

.yt-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    border-radius: 8px;
    background: rgba(255, 43, 43, 0.15);
    border: 1px solid rgba(255, 43, 43, 0.35);
    color: #FF4444;
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.1s;
    text-decoration: none;
    letter-spacing: 0.02em;
}

.yt-copy-btn:hover {
    background: rgba(255, 43, 43, 0.25);
    border-color: rgba(255, 43, 43, 0.6);
    transform: translateY(-1px);
}

.yt-copy-btn:active {
    transform: translateY(0);
}

.yt-copy-confirm {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: #4ade80;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s;
}

.yt-meta {
    margin-left: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.2);
    letter-spacing: 0.03em;
}

/* No image variant (grid collapses) */
.yt-post-body:not(:has(.yt-post-image)) {
    grid-template-columns: 1fr;
}

.yt-post-body:not(:has(.yt-post-image)) .yt-post-text {
    border-left: none;
}

/* ── Mobile ──────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .yt-post-body {
        grid-template-columns: 1fr;
    }

    .yt-post-image {
        padding: 20px 20px 0;
    }

    .yt-post-image img {
        width: 140px;
    }

    .yt-post-text {
        padding: 16px 20px;
        border-left: none;
        border-top: 1px solid rgba(255, 43, 43, 0.08);
    }

    .yt-post-header {
        padding: 18px 20px 14px;
    }

    .yt-post-footer {
        padding: 14px 20px 18px;
    }

    .yt-meta {
        margin-left: 0;
        width: 100%;
    }
}


/* ═══════════════════════════════════════════════════════════════
   GOLD THEME — THE VITAL LIFE FORCE: KA
   ideas.krisadamstv.com/vital-force-ka
   ═══════════════════════════════════════════════════════════════ */

.theme-gold {
    --accent-primary:    #d4a017;
    --accent-secondary:  #b8860b;
    --accent-warm:       #f5c842;
    --accent-cyan:       #ffe066;
    --accent-green:      #c8a45a;
    --border:            #3a2a0a;
    --border-light:      #2a1e08;
    --bg-secondary:      #0f0d08;
    --bg-tertiary:       #181408;
    --bg-card:           #141008;
}

/* Gold progress bar */
.theme-gold .weave-progress-bar {
    background: linear-gradient(90deg, #b8860b, #f5c842, #ffe066, #f5c842);
    background-size: 200% 100%;
    animation: gold-bar-sweep 3s linear infinite;
}

@keyframes gold-bar-sweep {
    0%   { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

/* Gold shimmer on H1 */
.theme-gold .content h1 {
    background: linear-gradient(
        135deg,
        #b8860b 0%,
        #d4a017 20%,
        #f5c842 45%,
        #ffe8a0 55%,
        #f5c842 65%,
        #d4a017 80%,
        #b8860b 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gold-shimmer 5s linear infinite;
}

@keyframes gold-shimmer {
    0%   { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* Gold H2 accent */
.theme-gold .content h2 {
    border-bottom-color: rgba(212, 160, 23, 0.25);
}

.theme-gold .content h2::before {
    background: linear-gradient(180deg, #d4a017, #b8860b);
}

/* Gold blockquote */
.theme-gold .content blockquote {
    border-left-color: #d4a017;
    background: rgba(212, 160, 23, 0.06);
}

/* Gold section visual glow */
.theme-gold figure.section-visual {
    border-color: rgba(212, 160, 23, 0.18);
    box-shadow: 0 2px 40px rgba(212, 160, 23, 0.07);
    transition: box-shadow 0.4s, border-color 0.4s;
}

.theme-gold figure.section-visual:hover {
    box-shadow: 0 4px 60px rgba(245, 200, 66, 0.14);
    border-color: rgba(245, 200, 66, 0.32);
}

/* Gold callout */
.theme-gold .callout {
    border-color: rgba(212, 160, 23, 0.35);
    background: rgba(212, 160, 23, 0.05);
}

/* Gold idea-link */
.theme-gold .idea-link {
    color: #d4a017;
    border-bottom-color: rgba(212, 160, 23, 0.35);
}

.theme-gold .idea-link:hover {
    color: #f5c842;
    border-bottom-color: rgba(245, 200, 66, 0.65);
}

/* Gold pulse dot */
.theme-gold .weave-pulse-dot.online {
    background: #d4a017;
    box-shadow: 0 0 0 0 rgba(212, 160, 23, 0.7);
}

/* Gold hero overlay */
.theme-gold .hero-overlay {
    background: linear-gradient(
        to bottom,
        rgba(10, 8, 2, 0.25) 0%,
        rgba(10, 8, 2, 0.08) 25%,
        rgba(10, 8, 2, 0.65) 75%,
        #0a0802 100%
    );
}

/* Gold table */
.theme-gold .content table th {
    color: #d4a017;
    border-bottom-color: rgba(212, 160, 23, 0.35);
}

.theme-gold .content table tr:hover td {
    background: rgba(212, 160, 23, 0.04);
}

/* Gold strong */
.theme-gold .content strong {
    color: #f5c842;
}

/* ── KA Series Navigation Cards ─────────────────────────────── */

.ka-nav {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 14px;
    margin: 40px 0;
}

.ka-nav-card {
    background: var(--bg-card);
    border: 1px solid rgba(212, 160, 23, 0.18);
    border-radius: 10px;
    padding: 20px 22px;
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
    position: relative;
    overflow: hidden;
}

.ka-nav-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #d4a017, #f5c842, #d4a017, transparent);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.ka-nav-card:hover {
    border-color: rgba(245, 200, 66, 0.38);
    box-shadow: 0 0 32px rgba(212, 160, 23, 0.1);
    transform: translateY(-2px);
}

.ka-nav-card:hover::after { opacity: 1; }

.ka-nav-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    color: #d4a017;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.ka-nav-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
}

.ka-nav-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-top: 5px;
}

/* ── KA Breadcrumb ───────────────────────────────────────────── */

.ka-breadcrumb {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 36px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ka-breadcrumb a { color: #d4a017; text-decoration: none; transition: color 0.2s; }
.ka-breadcrumb a:hover { color: #f5c842; }
.ka-breadcrumb-sep { opacity: 0.35; }

/* ── KA Page Navigation ──────────────────────────────────────── */

.ka-page-nav {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 72px;
    padding-top: 32px;
    border-top: 1px solid rgba(212, 160, 23, 0.15);
    gap: 16px;
}

.ka-page-nav a {
    font-size: 0.82rem;
    color: #d4a017;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: color 0.2s;
    max-width: 45%;
}

.ka-page-nav a:hover { color: #f5c842; }

.ka-page-nav .ka-nav-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ka-page-nav .ka-nav-link-title {
    font-family: 'Playfair Display', serif;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
}

.ka-page-nav .next-link { text-align: right; margin-left: auto; }

/* ── KA Canvas Hero (index page) ─────────────────────────────── */

.ka-hero {
    position: relative;
    width: 100%;
    height: 80vh;
    min-height: 460px;
    max-height: 680px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    background: #09070200;
}

.ka-hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.ka-hero-content {
    position: relative;
    z-index: 2;
    padding: 0 28px;
    max-width: 680px;
}

.ka-hero-eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: rgba(212, 160, 23, 0.8);
    margin-bottom: 18px;
    opacity: 0;
    animation: ka-fade-up 1s ease 0.5s forwards;
}

.ka-hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.4rem, 7vw, 4.6rem);
    font-weight: 800;
    line-height: 1.08;
    background: linear-gradient(
        135deg,
        #b8860b 0%, #d4a017 20%, #f5c842 42%,
        #ffe8a0 52%, #f5c842 62%, #d4a017 80%, #b8860b 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gold-shimmer 5s linear infinite, ka-fade-up 1s ease 0.7s both;
    margin-bottom: 6px;
}

.ka-hero-sub {
    font-family: 'Playfair Display', serif;
    font-size: clamp(0.9rem, 2vw, 1.25rem);
    font-style: italic;
    color: rgba(245, 200, 66, 0.6);
    margin-bottom: 20px;
    opacity: 0;
    animation: ka-fade-up 1s ease 0.9s forwards;
}

.ka-hero-brief {
    font-size: 0.87rem;
    color: rgba(232, 230, 227, 0.5);
    line-height: 1.8;
    opacity: 0;
    animation: ka-fade-up 1s ease 1.1s forwards;
}

.ka-hero-scroll {
    position: absolute;
    bottom: 26px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    opacity: 0;
    animation: ka-fade-up 1s ease 1.8s forwards;
}

.ka-hero-scroll-line {
    width: 1px;
    height: 34px;
    background: linear-gradient(to bottom, rgba(212,160,23,0.7), transparent);
    animation: ka-scroll-pulse 2s ease-in-out infinite;
}

.ka-hero-scroll-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.14em;
    color: rgba(212, 160, 23, 0.4);
    text-transform: uppercase;
}

@keyframes ka-fade-up {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes ka-scroll-pulse {
    0%, 100% { opacity: 0.4; }
    50%       { opacity: 1; }
}

/* ── KA Thesis Block ─────────────────────────────────────────── */

.ka-thesis {
    background: rgba(212, 160, 23, 0.04);
    border: 1px solid rgba(212, 160, 23, 0.18);
    border-radius: 12px;
    padding: 30px 34px;
    margin: 40px 0;
    position: relative;
    overflow: hidden;
}

.ka-thesis::before {
    content: 'KA';
    position: absolute;
    top: -14px; right: 20px;
    font-family: 'Playfair Display', serif;
    font-size: 6.5rem;
    font-weight: 800;
    color: rgba(212, 160, 23, 0.035);
    line-height: 1;
    pointer-events: none;
    user-select: none;
}

.ka-thesis p {
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.82;
}

/* ── Mobile ──────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .ka-nav { grid-template-columns: 1fr; }

    .ka-hero {
        height: 70vh;
        min-height: 360px;
    }

    .ka-page-nav {
        flex-direction: column;
        gap: 20px;
    }

    .ka-page-nav .next-link {
        text-align: left;
        margin-left: 0;
    }

    .ka-thesis { padding: 22px 20px; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   PACK INDEX — Dynamic member grid (pack_index.py)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Section wrapper ────────────────────────────────────────────────────── */
.pack-index-section {
    margin-top: 3.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--border);
}

.pack-index-section h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.pack-grid-intro {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.pack-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

/* ── Member cards grid ──────────────────────────────────────────────────── */
.pack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.pack-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.4rem;
    text-decoration: none;
    transition: border-color 0.2s var(--ease-out-expo),
                transform 0.2s var(--ease-out-expo),
                box-shadow 0.2s var(--ease-out-expo);
    position: relative;
    overflow: hidden;
}

.pack-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-primary) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
}

.pack-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(108, 138, 255, 0.12);
    text-decoration: none;
}

.pack-card:hover::before { opacity: 0.04; }

.pack-card--featured {
    border-color: var(--border-light);
}

.pack-card--featured:hover {
    border-color: var(--accent-warm);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.1);
}

.pack-card-featured {
    color: var(--accent-warm);
    margin-right: 0.4em;
    font-size: 0.8em;
}

.pack-card-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    position: relative;
}

.pack-card-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.55;
    position: relative;
}

/* ── Draft banner (movie type) ──────────────────────────────────────────── */
.pack-draft-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, transparent 100%);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--radius);
    padding: 0.75rem 1.25rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.pack-draft-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-warm);
    white-space: nowrap;
}

.pack-version-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.15em 0.5em;
    white-space: nowrap;
}

.pack-draft-note {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .pack-grid {
        grid-template-columns: 1fr;
    }

    .pack-draft-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* ── Gold theme overrides ───────────────────────────────────────────────── */
.theme-gold .pack-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 8px 24px rgba(212, 160, 23, 0.15);
}

.theme-gold .pack-card--featured:hover {
    border-color: var(--accent-warm);
}


/* ── View Transitions ────────────────────────────────────────────────────── */
/*
 * MPA page transitions — Chrome 126+, Safari 18+.
 * `navigation: auto` opts every same-origin navigation in automatically.
 * No JavaScript needed.
 *
 * The hero image gets view-transition-name: hero-image so the browser
 * morphs it between pages when both share that name — instant feel of
 * continuity as readers move between ideas.
 */

@view-transition {
    navigation: auto;
}

/* Default transition: new page slides up, old page fades down */
@keyframes vt-slide-in  {
    from { opacity: 0; transform: translateY(14px); }
}
@keyframes vt-slide-out {
    to   { opacity: 0; transform: translateY(-8px); }
}

::view-transition-old(root) {
    animation: 200ms var(--ease-out-expo) both vt-slide-out;
}
::view-transition-new(root) {
    animation: 380ms var(--ease-out-expo) both vt-slide-in;
}

/* Hero image morph — name it, browser handles the in-between */
.hero img {
    view-transition-name: hero-image;
}

::view-transition-group(hero-image) {
    animation-duration: 480ms;
    animation-timing-function: var(--ease-out-expo);
}

/* Reduce motion: respect user preference, just crossfade */
@media (prefers-reduced-motion: reduce) {
    ::view-transition-old(root),
    ::view-transition-new(root) {
        animation-duration: 120ms;
        animation-name: none;
    }
}

/* ═══════════════════════════════════════════════════════════════
   EVERGROVE EXPRESS — Custom Widgets
   ═══════════════════════════════════════════════════════════════ */

/* ── Train Track Divider ───────────────────────────────────────── */
.train-track {
    border: none;
    height: 22px;
    margin: 3rem auto;
    max-width: 640px;
    position: relative;
    overflow: hidden;
    /* Sleeper ties */
    background: repeating-linear-gradient(
        90deg,
        transparent 0px,
        transparent 14px,
        color-mix(in srgb, var(--accent-warm) 22%, transparent) 14px,
        color-mix(in srgb, var(--accent-warm) 22%, transparent) 18px
    );
    /* Fade out at edges */
    mask-image: linear-gradient(90deg, transparent 0%, black 12%, black 88%, transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 12%, black 88%, transparent 100%);
}
.train-track::before {
    /* top rail */
    content: '';
    position: absolute;
    top: 5px; left: 0; right: 0;
    height: 2px;
    background: color-mix(in srgb, var(--accent-warm) 45%, transparent);
}
.train-track::after {
    /* bottom rail */
    content: '';
    position: absolute;
    bottom: 5px; left: 0; right: 0;
    height: 2px;
    background: color-mix(in srgb, var(--accent-warm) 45%, transparent);
}

/* ── Ticket / Boarding Pass Widget ────────────────────────────── */
.ticket {
    display: block;
    max-width: 680px;
    margin: 2.5rem auto;
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--accent-warm) 12%, var(--bg-card)) 0%,
        color-mix(in srgb, var(--accent-gold, #d4a843) 8%, var(--bg-card)) 100%
    );
    border: 1px solid color-mix(in srgb, var(--accent-warm) 35%, transparent);
    border-radius: 10px;
    overflow: visible;
    position: relative;
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--accent-warm) 20%, transparent),
        0 8px 32px color-mix(in srgb, var(--accent-warm) 15%, transparent),
        inset 0 1px 0 color-mix(in srgb, var(--accent-warm) 25%, transparent);
    font-family: 'Courier New', monospace;
}

/* Perforated edge — top and bottom dashes */
.ticket::before,
.ticket::after {
    content: '';
    position: absolute;
    left: 20px;
    right: 20px;
    height: 0;
    border-top: 2px dashed color-mix(in srgb, var(--accent-warm) 30%, transparent);
}
.ticket::before { top: 58px; }
.ticket::after  { bottom: 52px; }

.ticket-header {
    padding: 1rem 1.5rem 0.75rem;
    text-align: center;
}
.ticket-header .ticket-line {
    font-size: 0.6rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--accent-warm) 70%, transparent);
}
.ticket-header .ticket-name {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--accent-warm);
    text-transform: uppercase;
    font-family: var(--font-display, serif);
    text-shadow: 0 0 20px color-mix(in srgb, var(--accent-warm) 40%, transparent);
}

.ticket-body {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0;
    padding: 1.2rem 1.5rem;
}
.ticket-field {
    padding: 0.25rem 0.5rem;
    border-right: 1px dashed color-mix(in srgb, var(--accent-warm) 20%, transparent);
}
.ticket-field:last-child { border-right: none; }
.ticket-field-label {
    font-size: 0.55rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.2rem;
}
.ticket-field-value {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: 0.05em;
}

.ticket-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem 1rem;
    gap: 1rem;
}
.ticket-footer-text {
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--accent-warm) 50%, transparent);
    line-height: 1.6;
}
.ticket-stamp {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid color-mix(in srgb, var(--accent-warm) 50%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--accent-warm);
    box-shadow: 0 0 16px color-mix(in srgb, var(--accent-warm) 25%, transparent);
    flex-shrink: 0;
}

/* ── Route Stop Indicators ─────────────────────────────────────── */
.route-map {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 640px;
    margin: 2rem auto;
    padding-left: 1rem;
}
.route-stop {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0 0 1.5rem 0;
    position: relative;
}
.route-stop:last-child { padding-bottom: 0; }

.route-stop-indicator {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--accent-warm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-warm);
    background: var(--bg-card);
    position: relative;
    z-index: 1;
    font-family: monospace;
}
.route-stop.active .route-stop-indicator {
    background: var(--accent-warm);
    color: var(--bg-primary);
    box-shadow: 0 0 20px color-mix(in srgb, var(--accent-warm) 50%, transparent);
}
.route-stop.upcoming .route-stop-indicator {
    border-color: color-mix(in srgb, var(--accent-warm) 35%, transparent);
    color: color-mix(in srgb, var(--accent-warm) 35%, transparent);
}

/* Connecting line between stops */
.route-stop:not(:last-child) .route-stop-indicator::after {
    content: '';
    position: absolute;
    top: 34px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: calc(1.5rem + 36px);
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--accent-warm) 50%, transparent) 0%,
        color-mix(in srgb, var(--accent-warm) 20%, transparent) 100%
    );
}
.route-stop.upcoming:not(:last-child) .route-stop-indicator::after {
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--accent-warm) 20%, transparent) 0%,
        color-mix(in srgb, var(--accent-warm) 8%, transparent) 100%
    );
    border-left: none;
    border-right: none;
    background-image: repeating-linear-gradient(
        180deg,
        color-mix(in srgb, var(--accent-warm) 20%, transparent) 0px,
        color-mix(in srgb, var(--accent-warm) 20%, transparent) 6px,
        transparent 6px,
        transparent 12px
    );
    background-color: transparent;
}

.route-stop-content {
    padding-top: 0.4rem;
    flex: 1;
}
.route-stop-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}
.route-stop.active .route-stop-title {
    color: var(--accent-warm);
}
.route-stop.upcoming .route-stop-title {
    color: var(--text-secondary);
}
.route-stop-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}
.route-stop-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}
.route-stop.active .route-stop-badge {
    background: color-mix(in srgb, var(--accent-warm) 20%, transparent);
    color: var(--accent-warm);
    border: 1px solid color-mix(in srgb, var(--accent-warm) 40%, transparent);
}
.route-stop.upcoming .route-stop-badge {
    background: color-mix(in srgb, var(--text-secondary) 10%, transparent);
    color: var(--text-secondary);
    border: 1px solid color-mix(in srgb, var(--text-secondary) 20%, transparent);
}

/* ── KaTeX Math ─────────────────────────────────────────────── */

/* Inline math — subtle glow, slightly larger, accent tint */
.katex {
    color: var(--accent-cyan);
    font-size: 1.1em;
    padding: 0.1em 0.25em;
    border-radius: 3px;
    background: rgba(34, 211, 238, 0.06);
}

/* Display math ($$...$$) — full showcase treatment */
.katex-display {
    margin: 2rem 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, rgba(108, 138, 255, 0.06) 0%, rgba(167, 139, 250, 0.06) 100%);
    border: 1px solid rgba(108, 138, 255, 0.15);
    border-left: 3px solid var(--accent-primary);
    border-radius: 8px;
    position: relative;
}
.katex-display > .katex {
    color: var(--accent-primary);
    font-size: 1.35em;
    background: none;
    padding: 0;
}

/* Standalone formula paragraphs — when a <p> contains only a .katex span */
p > .katex:only-child {
    display: block;
    text-align: center;
    font-size: 1.3em;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    background: linear-gradient(135deg, rgba(108, 138, 255, 0.06) 0%, rgba(167, 139, 250, 0.06) 100%);
    border: 1px solid rgba(108, 138, 255, 0.15);
    border-left: 3px solid var(--accent-primary);
    border-radius: 8px;
    color: var(--accent-primary);
}

.katex .mord, .katex .mbin, .katex .mrel,
.katex .mopen, .katex .mclose, .katex .mpunct,
.katex .mop { color: inherit; }
