/* ============================================================================
   TẠ PHÚC LÂM — CINEMATIC INTERACTIVE PORTFOLIO (2026)
   HIGH-PERFORMANCE DESIGN SYSTEM & MOTION ARCHITECTURE (60-120FPS)
   - Native utility foundation (zero Tailwind Play CDN MutationObserver lag)
   - Zero backdrop-filter overdraw on scrolling panels
   - Zero SVG feGaussianBlur / filter:blur(150px) GPU rasterizer stalls
   - Viewport-gated CSS keyframe animations
   ============================================================================ */

:root {
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Space Grotesk', 'Plus Jakarta Sans', sans-serif;
    --font-serif: 'Newsreader', 'Instrument Serif', Georgia, serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Default Dark Theme: Obsidian Editorial Cinema */
    --bg-primary: #06080d;
    --bg-panel: rgba(11, 16, 26, 0.94);
    --bg-panel-hover: rgba(16, 24, 39, 0.98);
    --bg-Subtle: rgba(244, 241, 234, 0.035);
    --text-primary: #f4f1ea;
    --text-secondary: #9ca6b8;
    --text-muted: #647087;
    --accent-primary: #00e5ff;
    --accent-secondary: #ff4d2d;
    --accent-teal: #2dd4bf;
    --border-hairline: rgba(244, 241, 234, 0.14);
    --border-accent: rgba(0, 229, 255, 0.48);
    --grid-line: rgba(244, 241, 234, 0.035);
    --shadow-panel: 0 16px 40px -18px rgba(0, 0, 0, 0.7);
}

/* Warm Ivory / Alabaster Editorial Light Theme */
body.theme-light {
    --bg-primary: #f3efe6;
    --bg-panel: rgba(255, 253, 248, 0.95);
    --bg-panel-hover: #ffffff;
    --bg-Subtle: rgba(11, 15, 23, 0.04);
    --text-primary: #0b0f17;
    --text-secondary: #3f4b5e;
    --text-muted: #64748b;
    --accent-primary: #0284c7;
    --accent-secondary: #dc2626;
    --accent-teal: #0d9488;
    --border-hairline: rgba(11, 15, 23, 0.14);
    --border-accent: rgba(2, 132, 199, 0.48);
    --grid-line: rgba(11, 15, 23, 0.045);
    --shadow-panel: 0 14px 32px -16px rgba(15, 23, 42, 0.1);
}

/* Atmospheric Chapter Background Transitions */
body.theme-dark[data-active-chapter="home"]         { --bg-primary: #06080d; }
body.theme-dark[data-active-chapter="about"]        { --bg-primary: #070b13; }
body.theme-dark[data-active-chapter="activities"]   { --bg-primary: #05070b; }
body.theme-dark[data-active-chapter="publications"] { --bg-primary: #080914; }
body.theme-dark[data-active-chapter="projects"]     { --bg-primary: #050911; }
body.theme-dark[data-active-chapter="awards"]       { --bg-primary: #07090f; }
body.theme-dark[data-active-chapter="contact"]      { --bg-primary: #04060a; }

body.theme-light[data-active-chapter="home"]         { --bg-primary: #f3efe6; }
body.theme-light[data-active-chapter="about"]        { --bg-primary: #eef2f5; }
body.theme-light[data-active-chapter="activities"]   { --bg-primary: #f5f1e8; }
body.theme-light[data-active-chapter="publications"] { --bg-primary: #edf0f7; }
body.theme-light[data-active-chapter="projects"]     { --bg-primary: #ebf1f5; }
body.theme-light[data-active-chapter="awards"]       { --bg-primary: #f4f0e8; }
body.theme-light[data-active-chapter="contact"]      { --bg-primary: #eae6dc; }

/* ============================================================================
   RESET & BASE TYPOGRAPHY
   ============================================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    border-width: 0;
    border-style: solid;
    border-color: var(--border-hairline);
}

html {
    scroll-behavior: smooth;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    transition: background-color 0.55s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, figure {
    margin: 0;
}

ul {
    padding: 0;
}

button {
    font-family: inherit;
    font-size: 100%;
    line-height: inherit;
    color: inherit;
    margin: 0;
    padding: 0;
    background-color: transparent;
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: inherit;
}

img, svg {
    display: block;
    max-width: 100%;
}

/* ============================================================================
   STATIC UTILITY CLASSES (REPLACING TAILWIND PLAY CDN RUNTIME)
   ============================================================================ */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0 { top: 0; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.-top-12 { top: -3rem; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-50 { z-index: 50; }

.block { display: block; }
.hidden { display: none !important; }
.flex { display: flex; }
.grid { display: grid; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-shrink-0 { flex-shrink: 0; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.items-stretch { align-items: stretch; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }

.gap-1\.5 { gap: 0.375rem; }
.gap-2 { gap: 0.5rem; }
.gap-2\.5 { gap: 0.625rem; }
.gap-3 { gap: 0.75rem; }
.gap-3\.5 { gap: 0.875rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.gap-10 { gap: 2.5rem; }

.space-y-1\.5 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.375rem; }
.space-y-2 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.5rem; }
.space-y-4 > :not([hidden]) ~ :not([hidden]) { margin-top: 1rem; }
.space-y-6 > :not([hidden]) ~ :not([hidden]) { margin-top: 1.5rem; }
.divide-y > :not([hidden]) ~ :not([hidden]) { border-top-width: 1px; border-color: var(--border-hairline); }

.w-2 { width: 0.5rem; }
.w-4 { width: 1rem; }
.w-16 { width: 4rem; }
.w-full { width: 100%; }
.min-w-\[640px\] { min-width: 640px; }
.max-w-sm { max-width: 24rem; }
.max-w-xl { max-width: 36rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-full { max-width: 100%; }
.max-w-\[1440px\] { max-width: 1440px; }

.h-1 { height: 0.25rem; }
.h-2 { height: 0.5rem; }
.h-4 { height: 1rem; }
.h-6 { height: 1.5rem; }
.h-16 { height: 4rem; }
.h-24 { height: 6rem; }
.h-28 { height: 7rem; }
.h-auto { height: auto; }
.h-full { height: 100%; }
.max-h-0 { max-height: 0px; }
.max-h-\[80vh\] { max-height: 80vh; }
.max-h-\[85vh\] { max-height: 85vh; }
.min-h-\[94vh\] { min-height: 94vh; }
.min-h-screen { min-height: 100vh; }

.mx-auto { margin-left: auto; margin-right: auto; }
.my-auto { margin-top: auto; margin-bottom: auto; }
.mt-0\.5 { margin-top: 0.125rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-12 { margin-top: 3rem; }
.mr-2 { margin-right: 0.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mb-12 { margin-bottom: 3rem; }
.mb-14 { margin-bottom: 3.5rem; }
.mb-16 { margin-bottom: 4rem; }
.mb-20 { margin-bottom: 5rem; }

.p-2 { padding: 0.5rem; }
.p-3\.5 { padding: 0.875rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-7 { padding: 1.75rem; }
.p-8 { padding: 2rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-3\.5 { padding-top: 0.875rem; padding-bottom: 0.875rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }
.py-24 { padding-top: 6rem; padding-bottom: 6rem; }
.pt-1 { padding-top: 0.25rem; }
.pt-3 { padding-top: 0.75rem; }
.pt-4 { padding-top: 1rem; }
.pt-5 { padding-top: 1.25rem; }
.pt-6 { padding-top: 1.5rem; }
.pt-20 { padding-top: 5rem; }
.pb-3 { padding-bottom: 0.75rem; }
.pb-4 { padding-bottom: 1rem; }
.pb-6 { padding-bottom: 1.5rem; }
.pl-4 { padding-left: 1rem; }
.pl-5 { padding-left: 1.25rem; }

.border { border-width: 1px; }
.border-t { border-top-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-l-2 { border-left-width: 2px; }
.border-current\/15 { border-color: var(--border-hairline); }
.border-current\/20 { border-color: var(--border-hairline); }
.border-current\/25 { border-color: var(--border-hairline); }
.border-white\/20 { border-color: rgba(255, 255, 255, 0.2); }
.border-cyan-400 { border-color: var(--accent-primary); }
.border-cyan-400\/50 { border-color: var(--border-accent); }
.border-cyan-400\/70 { border-color: var(--accent-primary); }

.rounded-full { border-radius: 9999px; }
.bg-black { background-color: #000000; }
.bg-black\/80 { background-color: rgba(0, 0, 0, 0.8); }
.bg-black\/90 { background-color: rgba(0, 0, 0, 0.92); }
.bg-cyan-400 { background-color: var(--accent-primary); }
.bg-current\/10 { background-color: var(--border-hairline); }
.bg-current\/\[0\.03\] { background-color: var(--bg-Subtle); }

.object-contain { object-fit: contain; }
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.overflow-x-clip { overflow-x: clip; }
.pointer-events-none { pointer-events: none; }
.pointer-events-auto { pointer-events: auto; }
.list-disc { list-style-type: disc; }
.break-all { word-break: break-all; }
.not-italic { font-style: normal; }
.uppercase { text-transform: uppercase; }
.text-center { text-align: center; }

.text-\[10px\] { font-size: 10px; }
.text-\[11px\] { font-size: 11px; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.leading-none { line-height: 1; }
.leading-tight { line-height: 1.2; }
.leading-snug { line-height: 1.35; }
.leading-relaxed { line-height: 1.625; }

.tracking-tight { letter-spacing: -0.025em; }
.tracking-wider { letter-spacing: 0.06em; }
.tracking-widest { letter-spacing: 0.12em; }
.tracking-\[0\.2em\] { letter-spacing: 0.2em; }
.tracking-\[0\.22em\] { letter-spacing: 0.22em; }

.text-gray-300 { color: #d1d5db; }
.text-cyan-300 { color: #67e8f9; }
.hover\:text-white:hover { color: #ffffff; }
.hover\:text-cyan-400:hover { color: var(--accent-primary); }
.group:hover .group-hover\:text-cyan-400 { color: var(--accent-primary); }
.hover\:underline:hover { text-decoration: underline; }

.opacity-0 { opacity: 0; }
.opacity-100 { opacity: 1; }
.opacity-50 { opacity: 0.5; }
.opacity-55 { opacity: 0.55; }
.opacity-60 { opacity: 0.6; }
.opacity-65 { opacity: 0.65; }
.opacity-70 { opacity: 0.7; }
.opacity-75 { opacity: 0.75; }
.opacity-80 { opacity: 0.8; }
.opacity-85 { opacity: 0.85; }

.transition { transition: all 0.2s ease; }
.transition-all { transition: all 0.3s ease; }
.transition-opacity { transition: opacity 0.3s ease; }
.duration-300 { transition-duration: 300ms; }

/* Responsive Breakpoints (sm: 640px, md: 768px, lg: 1024px, xl: 1280px) */
@media (min-width: 640px) {
    .sm\:inline { display: inline !important; }
    .sm\:flex-row { flex-direction: row; }
    .sm\:items-center { align-items: center; }
    .sm\:items-end { align-items: flex-end; }
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm\:grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
    .sm\:col-span-5 { grid-column: span 5 / span 5; }
    .sm\:col-span-7 { grid-column: span 7 / span 7; }
    .sm\:gap-5 { gap: 1.25rem; }
    .sm\:p-7 { padding: 1.75rem; }
    .sm\:p-8 { padding: 2rem; }
    .sm\:p-9 { padding: 2.25rem; }
    .sm\:p-10 { padding: 2.5rem; }
    .sm\:px-8 { padding-left: 2rem; padding-right: 2rem; }
    .sm\:px-10 { padding-left: 2.5rem; padding-right: 2.5rem; }
    .sm\:text-xs { font-size: 0.75rem; }
    .sm\:text-sm { font-size: 0.875rem; }
    .sm\:text-base { font-size: 1rem; }
    .sm\:text-lg { font-size: 1.125rem; }
    .sm\:text-xl { font-size: 1.25rem; }
    .sm\:text-2xl { font-size: 1.5rem; }
    .sm\:text-3xl { font-size: 1.875rem; }
    .sm\:text-4xl { font-size: 2.25rem; }
}

@media (min-width: 768px) {
    .md\:block { display: block !important; }
    .md\:flex-row { flex-direction: row; }
    .md\:items-end { align-items: flex-end; }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
    .md\:col-span-5 { grid-column: span 5 / span 5; }
    .md\:col-span-7 { grid-column: span 7 / span 7; }
    .md\:text-3xl { font-size: 1.875rem; }
    .md\:text-4xl { font-size: 2.25rem; }
}

@media (min-width: 1024px) {
    .lg\:block { display: block !important; }
    .lg\:flex-row { flex-direction: row; }
    .lg\:justify-end { justify-content: flex-end; }
    .lg\:grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .lg\:grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
    .lg\:col-span-4 { grid-column: span 4 / span 4; }
    .lg\:col-span-5 { grid-column: span 5 / span 5; }
    .lg\:col-span-7 { grid-column: span 7 / span 7; }
    .lg\:col-span-8 { grid-column: span 8 / span 8; }
    .lg\:gap-8 { gap: 2rem; }
    .lg\:gap-10 { gap: 2.5rem; }
    .lg\:p-10 { padding: 2.5rem; }
    .lg\:px-16 { padding-left: 4rem; padding-right: 4rem; }
    .lg\:py-12 { padding-top: 3rem; padding-bottom: 3rem; }
    .lg\:py-14 { padding-top: 3.5rem; padding-bottom: 3.5rem; }
    .lg\:py-28 { padding-top: 7rem; padding-bottom: 7rem; }
    .lg\:py-32 { padding-top: 8rem; padding-bottom: 8rem; }
    .lg\:py-36 { padding-top: 9rem; padding-bottom: 9rem; }
    .lg\:pb-0 { padding-bottom: 0; }
    .lg\:pr-6 { padding-right: 1.5rem; }
    .lg\:border-b-0 { border-bottom-width: 0; }
    .lg\:border-r { border-right-width: 1px; }
}

@media (min-width: 1280px) {
    .xl\:flex { display: flex !important; }
    .xl\:hidden { display: none !important; }
}

/* ============================================================================
   DESIGN TOKENS & CUSTOM CLASSES
   ============================================================================ */
.font-display { font-family: var(--font-display); }
.font-code    { font-family: var(--font-mono); }

.editorial-serif {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    color: var(--accent-primary);
    padding-right: 0.06em;
}

.accent-text,
.accent-highlight {
    color: var(--accent-primary);
}

/* Pause off-screen CSS animations automatically for 0% idle GPU usage */
.chapter-section:not(.is-in-viewport) * {
    animation-play-state: paused !important;
}

/* ============================================================================
   00. CINEMATIC PRELOADER
   ============================================================================ */
#system-preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #05070c;
    color: #f4f1ea;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    transition: opacity 0.9s ease, visibility 0.9s ease;
}

#system-preloader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-inner {
    width: 100%;
    max-width: 540px;
}

.preloader-top-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(244, 241, 234, 0.15);
    padding-bottom: 0.75rem;
    margin-bottom: 2rem;
}

.preloader-counter-wrap {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    margin-bottom: 0.85rem;
}

.preloader-counter {
    font-family: var(--font-display);
    font-size: clamp(3.2rem, 7vw, 5rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
    color: #00e5ff;
}

.preloader-pct {
    font-family: var(--font-mono);
    font-size: 1rem;
    opacity: 0.6;
}

.preloader-bar-track {
    width: 100%;
    height: 2px;
    background: rgba(244, 241, 234, 0.14);
    overflow: hidden;
}

.preloader-bar-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #00e5ff, #ff4d2d);
    transform: scaleX(0);
    transform-origin: left center;
}

/* ============================================================================
   CUSTOM PRECISION CURSOR
   ============================================================================ */
#cursor-dot,
#cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9000;
    opacity: 0;
    will-change: transform;
}

body.has-custom-cursor #cursor-dot,
body.has-custom-cursor #cursor-ring {
    opacity: 1;
}

#cursor-dot {
    width: 6px;
    height: 6px;
    margin-left: -3px;
    margin-top: -3px;
    border-radius: 50%;
    background: var(--accent-primary);
}

#cursor-ring {
    width: 32px;
    height: 32px;
    margin-left: -16px;
    margin-top: -16px;
    border-radius: 50%;
    border: 1px solid var(--border-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.2s ease, height 0.2s ease, margin 0.2s ease, background-color 0.2s ease;
}

#cursor-ring.is-hover {
    width: 52px;
    height: 52px;
    margin-left: -26px;
    margin-top: -26px;
    background: rgba(0, 229, 255, 0.1);
    border-color: var(--accent-primary);
}

#cursor-ring.has-label {
    width: 72px;
    height: 72px;
    margin-left: -36px;
    margin-top: -36px;
    background: rgba(6, 8, 13, 0.92);
    border-color: var(--accent-primary);
}

#cursor-label {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #00e5ff;
    opacity: 0;
}

#cursor-ring.has-label #cursor-label {
    opacity: 1;
}

/* ============================================================================
   ARCHITECTURAL BACKDROP (ZERO-BLUR GPU RADIAL GRADIENTS) & TELEMETRY HUD
   ============================================================================ */
.architectural-backdrop {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.arch-grid-lines {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
    background-size: 80px 80px;
}

.arch-radial-glow {
    position: absolute;
    width: 680px;
    height: 680px;
    border-radius: 50%;
    pointer-events: none;
}

.arch-radial-glow.glow-a {
    top: -220px;
    right: -180px;
    background: radial-gradient(circle, rgba(0, 229, 255, 0.11) 0%, transparent 70%);
}

.arch-radial-glow.glow-b {
    bottom: -240px;
    left: -180px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.09) 0%, transparent 70%);
}

#chapter-telemetry-hud {
    position: fixed;
    bottom: 1.25rem;
    left: 1.25rem;
    z-index: 45;
    pointer-events: none;
}

.hud-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.85rem;
    background: var(--bg-panel);
    border: 1px solid var(--border-hairline);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hud-pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-primary);
}

.hud-code {
    font-weight: 700;
    color: var(--accent-primary);
}

.hud-sep    { opacity: 0.35; }
.hud-coords { opacity: 0.65; }

/* ============================================================================
   HEADER & NAVIGATION
   ============================================================================ */
.site-header {
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-hairline);
}

.scroll-progress-track {
    width: 100%;
    height: 2px;
    background: transparent;
}

.scroll-progress-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transform: scaleX(0);
    transform-origin: left center;
    will-change: transform;
}

.brand-mark {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.85rem;
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(0, 229, 255, 0.08);
}

.nav-link {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    padding: 0.25rem 0;
    position: relative;
    transition: color 0.2s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 1.5px;
    background: var(--accent-primary);
    transform: scaleX(0);
    transform-origin: right center;
    transition: transform 0.25s ease;
}

.nav-link:hover,
.nav-link.is-active {
    color: var(--accent-primary);
}

.nav-link:hover::after,
.nav-link.is-active::after {
    transform: scaleX(1);
    transform-origin: left center;
}

.lang-switch-group {
    display: inline-flex;
    border: 1px solid var(--border-hairline);
    padding: 2px;
    font-family: var(--font-mono);
    font-size: 11px;
}

.lang-btn {
    padding: 0.2rem 0.55rem;
    min-height: 32px;
    color: var(--text-secondary);
}

.lang-btn.is-active {
    background: var(--accent-primary);
    color: #05070c;
    font-weight: 700;
}

.theme-toggle-btn,
.menu-hamburger-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-hairline);
    color: var(--text-primary);
}

.theme-toggle-btn:hover,
.menu-hamburger-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.mobile-nav-drawer {
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-hairline);
}

/* ============================================================================
   SIGNATURE MASTER MOTION PATH (#master-story-svg)
   ============================================================================ */
#master-story-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 4;
    overflow: visible;
}

#master-path-guide {
    stroke: var(--text-primary);
    stroke-opacity: 0.11;
    stroke-width: 1.2px;
    stroke-dasharray: 5 9;
}

#master-path-echo {
    stroke: var(--accent-primary);
    stroke-opacity: 0.08;
    stroke-width: 1px;
}

#master-path-active {
    stroke-width: 2.2px;
    stroke-linecap: round;
    opacity: 0.9;
}

.master-waypoint .wp-ring {
    fill: var(--bg-primary);
    stroke: var(--text-primary);
    stroke-opacity: 0.28;
    stroke-width: 1.2px;
}

.master-waypoint .wp-dot {
    fill: var(--text-muted);
}

.master-waypoint .wp-label {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.12em;
    fill: var(--text-secondary);
    opacity: 0.55;
}

.master-waypoint.is-reached .wp-ring {
    stroke: var(--accent-primary);
    stroke-opacity: 0.95;
}

.master-waypoint.is-reached .wp-dot {
    fill: var(--accent-primary);
}

.master-waypoint.is-reached .wp-label {
    fill: var(--accent-primary);
    opacity: 0.95;
}

.signal-outer-halo {
    fill: rgba(0, 229, 255, 0.08);
    stroke: var(--accent-primary);
    stroke-width: 1.2px;
    stroke-dasharray: 4 4;
}

.signal-arrow {
    fill: var(--accent-primary);
}

.signal-core-dot {
    fill: #ffffff;
    stroke: var(--accent-primary);
    stroke-width: 2px;
}

.signal-coord-readout {
    font-family: var(--font-mono);
    font-size: 9.5px;
    font-weight: 600;
    fill: var(--accent-primary);
    letter-spacing: 0.08em;
}

/* ============================================================================
   SHARED ARCHITECTURAL PANELS, TYPOGRAPHY & BUTTONS
   ============================================================================ */
.chapter-section {
    position: relative;
    z-index: 10;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent-primary);
}

.eyebrow-line {
    width: 28px;
    height: 1.5px;
    background: var(--accent-primary);
}

.chapter-display-title {
    font-family: var(--font-display);
    font-size: clamp(2.15rem, 4.6vw, 4.2rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.035em;
    color: var(--text-primary);
}

/* Solid/Semi-opaque panel without expensive backdrop-filter blur */
.architectural-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-hairline);
    box-shadow: var(--shadow-panel);
    position: relative;
    transition: border-color 0.25s ease, background-color 0.25s ease;
}

.architectural-panel:hover {
    border-color: var(--border-accent);
    background: var(--bg-panel-hover);
}

.frame-corner {
    position: absolute;
    width: 12px;
    height: 12px;
    border-color: var(--accent-primary);
    pointer-events: none;
    transition: width 0.25s ease, height 0.25s ease;
}

.architectural-panel:hover .frame-corner,
.hero-portrait-stage:hover .frame-corner {
    width: 20px;
    height: 20px;
}

.corner-tl { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; }
.corner-tr { top: -1px; right: -1px; border-top-width: 2px; border-right-width: 2px; }
.corner-bl { bottom: -1px; left: -1px; border-bottom-width: 2px; border-left-width: 2px; }
.corner-br { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; }

.btn-cinematic-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1.6rem;
    background: var(--accent-primary);
    color: #05070c;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid var(--accent-primary);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.btn-cinematic-primary:hover {
    background: var(--text-primary);
    border-color: var(--text-primary);
    color: #05070c;
}

.btn-cinematic-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1.6rem;
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid var(--border-hairline);
    transition: border-color 0.2s ease, color 0.2s ease;
}

.btn-cinematic-outline:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.arch-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.7rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    border: 1px solid var(--border-hairline);
    color: var(--text-secondary);
    background: var(--bg-Subtle);
}

.arch-pill:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* ============================================================================
   CHAPTER 00 — THE ENTRANCE / HERO
   ============================================================================ */
.hero-monumental-title .hero-display-line-1 {
    font-family: var(--font-display);
    font-size: clamp(3rem, 7.6vw, 7rem);
    font-weight: 700;
    line-height: 0.96;
    letter-spacing: -0.04em;
    color: var(--text-primary);
}

.domain-coordinate-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.8rem;
    border: 1px solid var(--border-hairline);
    background: var(--bg-panel);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.05em;
}

.coord-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent-primary);
}

.hero-portrait-stage {
    position: relative;
    width: 100%;
    max-width: 410px;
    background: var(--bg-panel);
    border: 1px solid var(--border-hairline);
    padding: 1rem;
    box-shadow: var(--shadow-panel);
}

.portrait-telemetry-bar,
.portrait-caption-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
}

.portrait-telemetry-bar {
    padding-bottom: 0.65rem;
    margin-bottom: 0.65rem;
    border-bottom: 1px solid var(--border-hairline);
}

.portrait-caption-bar {
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    border-top: 1px solid var(--border-hairline);
}

.portrait-mask-container {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 4.5;
    overflow: hidden;
    background: #0b111e;
}

.hero-portrait-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    cursor: zoom-in;
    transition: transform 0.45s ease;
}

.hero-portrait-stage:hover .hero-portrait-img {
    transform: scale(1.03);
}

.portrait-mask-container.avatar-image-missing .hero-portrait-img {
    display: none;
}

.avatar-fallback {
    display: none;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.portrait-mask-container.avatar-image-missing .avatar-fallback {
    display: flex;
}

.portrait-scanline {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(0, 229, 255, 0.03) 51%);
    background-size: 100% 4px;
    pointer-events: none;
}

.origin-node-marker {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-primary);
}

/* ============================================================================
   CHAPTER 01 — ABOUT, SYSTEM PIPELINE & 3 CAPABILITY PILLARS
   ============================================================================ */
.edu-node-card {
    padding: 1.35rem;
    border: 1px solid var(--border-hairline);
    background: var(--bg-Subtle);
    position: relative;
}

.edu-node-card.is-current {
    border-color: var(--border-accent);
    background: rgba(0, 229, 255, 0.04);
}

.edu-node-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-hairline);
    padding-bottom: 0.6rem;
}

.edu-step-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    opacity: 0.65;
}

.pipeline-stage {
    padding: 1.35rem;
    border: 1px solid var(--border-hairline);
    background: var(--bg-panel);
}

.pipeline-stage.is-active {
    border-color: var(--border-accent);
}

.pipeline-node-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.pipeline-step-num {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.pipeline-connector-line {
    flex: 1;
    height: 2px;
    background: var(--border-hairline);
    overflow: hidden;
}

.pipeline-connector-fill {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--accent-primary);
    transform: scaleX(0);
    transform-origin: left center;
}

.pipeline-code {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    color: var(--accent-primary);
    margin-bottom: 0.35rem;
}

.pipeline-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.pipeline-desc {
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

.tri-path-guide {
    stroke: var(--text-primary);
    stroke-opacity: 0.14;
    stroke-width: 1.25px;
    stroke-dasharray: 4 6;
}

.tri-path-active {
    stroke: var(--accent-primary);
    stroke-width: 2px;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
}

.pillar-card {
    transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}

.skill-viz {
    --viz: #38bdf8;
    position: relative;
    height: 128px;
    border: 1px solid var(--border-hairline);
    background:
        linear-gradient(to right, rgba(0, 229, 255, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 229, 255, 0.04) 1px, transparent 1px),
        #050912;
    background-size: 20px 20px;
    overflow: hidden;
}

.skill-viz.viz-green  { --viz: #2dd4bf; }
.skill-viz.viz-orange { --viz: #fb7185; }

.skill-viz-label {
    position: absolute;
    top: 8px;
    left: 10px;
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 0.1em;
    color: var(--viz);
    z-index: 2;
}

.skill-viz svg {
    width: 100%;
    height: 100%;
}

.graph-edges line,
.neural-edges line {
    stroke: var(--viz);
    stroke-width: 1;
    stroke-opacity: 0.28;
}

.graph-trace,
.neural-pulses line {
    fill: none;
    stroke: var(--viz);
    stroke-width: 2;
    stroke-dasharray: 18 82;
    animation: vizPulseFlow 3.5s linear infinite;
    animation-delay: var(--d, 0s);
}

/* Pure opacity animation instead of SVG r: geometry mutation */
.graph-nodes circle,
.neural-nodes circle {
    fill: var(--viz);
    animation: vizNodePing 2.8s ease-in-out infinite;
    animation-delay: var(--d, 0s);
}

.wave-grid line {
    stroke: rgba(251, 113, 133, 0.14);
    stroke-dasharray: 2 4;
}

.wave-square {
    fill: none;
    stroke: var(--viz);
    stroke-width: 1.8;
}

.wave-resp {
    fill: none;
    stroke: #fda4af;
    stroke-width: 1.4;
    stroke-dasharray: 4 3;
}

.wave-track {
    animation: waveScroll 4.5s linear infinite;
}

.wave-scan {
    fill: var(--viz);
    opacity: 0.65;
    animation: waveScan 3.5s linear infinite;
}

@keyframes vizPulseFlow {
    from { stroke-dashoffset: 100; }
    to   { stroke-dashoffset: 0; }
}

@keyframes vizNodePing {
    0%, 100% { opacity: 0.45; }
    50%      { opacity: 1; }
}

@keyframes waveScroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-160px); }
}

@keyframes waveScan {
    from { transform: translateX(0); }
    to   { transform: translateX(320px); }
}

/* ============================================================================
   CHAPTER 02 — EXPERIENCE / MILESTONES
   ============================================================================ */
.milestone-station.is-focused {
    border-color: var(--border-accent);
}

.station-index-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    padding: 0.2rem 0.55rem;
    border: 1px solid var(--border-accent);
    color: var(--accent-primary);
}

.status-pill {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.22rem 0.65rem;
    border: 1px solid var(--border-hairline);
}

.status-pill.is-verified {
    border-color: rgba(45, 212, 191, 0.5);
    color: var(--accent-teal);
    background: rgba(45, 212, 191, 0.08);
}

.status-pill.is-scholarship {
    border-color: var(--border-accent);
    color: var(--accent-primary);
    background: color-mix(in srgb, var(--accent-primary) 10%, transparent);
}

.station-spotlight {
    background: var(--bg-Subtle);
}

.spotlight-img-frame {
    background: #05070c;
    border: 1px solid var(--border-hairline);
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-in;
}

.seas-logo-frame {
    width: 68px;
    height: 68px;
    background: #ffffff;
    border: 1px solid var(--border-accent);
    padding: 0.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-in;
}

.spotlight-img-frame.img-fallback-active img,
.seas-logo-frame.img-fallback-active img {
    display: none;
}

.spotlight-img-frame.img-fallback-active .img-fallback-text,
.seas-logo-frame.img-fallback-active .img-fallback-text {
    display: inline-block !important;
}

.spotlight-ext-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-primary);
}

.direction-decision-box {
    background: color-mix(in srgb, var(--accent-primary) 6%, transparent);
}

.note-kicker {
    display: block;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-primary);
    margin-bottom: 0.25rem;
}
.station-spotlight > .note-kicker { margin-bottom: 0.75rem; }
.station-spotlight ul { line-height: 1.7; }

/* ============================================================================
   CHAPTER 03 — RESEARCH / LATENT SPACE THEATRE
   ============================================================================ */
.latent-floating-token {
    display: inline-flex;
    padding: 0.25rem 0.65rem;
    font-family: var(--font-mono);
    font-size: 11px;
    border: 1px solid var(--border-hairline);
    background: var(--bg-Subtle);
}

.latent-floating-token.accent {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.latent-layer-axis {
    stroke: var(--text-primary);
    stroke-opacity: 0.14;
    stroke-dasharray: 3 5;
}

.latent-axis-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    fill: var(--text-primary);
    letter-spacing: 0.06em;
}

.latent-axis-sub {
    font-family: var(--font-mono);
    font-size: 9px;
    fill: var(--text-secondary);
}

.latent-translate-zone {
    fill: rgba(0, 229, 255, 0.06);
    stroke: var(--accent-primary);
    stroke-opacity: 0.35;
    stroke-dasharray: 4 4;
}

.latent-probe-line {
    stroke: var(--accent-secondary);
    stroke-width: 1.5px;
    stroke-dasharray: 3 3;
}

.latent-probe-badge {
    fill: #05070c;
    stroke: var(--accent-secondary);
    stroke-width: 1px;
}

.latent-probe-text {
    font-family: var(--font-mono);
    font-size: 8.5px;
    font-weight: 700;
    fill: var(--accent-secondary);
    letter-spacing: 0.08em;
}

.latent-curve-base {
    fill: none;
    stroke: var(--text-primary);
    stroke-opacity: 0.16;
    stroke-width: 1.25px;
}

.latent-curve-active {
    fill: none;
    stroke: var(--accent-primary);
    stroke-width: 2px;
    stroke-dasharray: 22 78;
    animation: vizPulseFlow 4s linear infinite;
    animation-delay: var(--delay, 0s);
}

.latent-node {
    fill: var(--bg-primary);
    stroke: var(--accent-primary);
    stroke-width: 1.5px;
}

.latent-node-critical {
    fill: var(--accent-secondary);
    stroke: #ffffff;
    stroke-width: 1.5px;
}

.pub-badge-arch {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.28rem 0.7rem;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--border-hairline);
}

.pub-badge-arch.is-rank {
    background: var(--accent-primary);
    color: #05070c;
    border-color: var(--accent-primary);
    font-weight: 700;
}

.pub-badge-arch.is-role {
    color: var(--accent-primary);
    border-color: var(--border-accent);
}

.review-pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #f59e0b;
    animation: vizNodePing 1.6s ease-in-out infinite;
}

.wip-slot-box {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--border-hairline);
    background: var(--bg-Subtle);
}

.wip-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.wip-dot.dot-cyan   { background: var(--accent-primary); }
.wip-dot.dot-orange { background: var(--accent-secondary); }

/* ============================================================================
   CHAPTER 04 — INTERACTIVE SPATIAL PROJECT SHOWCASE & LEDGER
   ============================================================================ */
.github-profile-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    border: 1px solid var(--border-accent);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.github-profile-pill:hover {
    background: color-mix(in srgb, var(--accent-primary) 12%, transparent);
}

.stage-step-btn {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-hairline);
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-primary);
}

.stage-step-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(0, 229, 255, 0.08);
}

.proj-tab-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 0.9rem;
    text-align: left;
    border: 1px solid var(--border-hairline);
    background: transparent;
    color: var(--text-secondary);
}

.proj-tab-btn:hover {
    border-color: var(--border-accent);
    color: var(--text-primary);
}

.proj-tab-btn.is-active {
    border-color: var(--accent-primary);
    background: rgba(0, 229, 255, 0.07);
    color: var(--text-primary);
}

.proj-tab-num {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.proj-tab-meta {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.proj-tab-title {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.proj-tab-type {
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 0.08em;
    opacity: 0.65;
}

.project-blueprint-stage {
    width: 100%;
    aspect-ratio: 16 / 10;
    background:
        linear-gradient(to right, rgba(0, 229, 255, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 229, 255, 0.04) 1px, transparent 1px),
        #050811;
    background-size: 24px 24px;
    border: 1px solid var(--border-hairline);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.proj-blueprint-svg {
    width: 100%;
    height: 100%;
    color: #f4f1ea;
}

.bp-stroke-primary { stroke: #f4f1ea; }
.bp-stroke-dim     { stroke: rgba(244, 241, 234, 0.25); }
.bp-stroke-accent  { stroke: #00e5ff; }
.bp-fill-accent    { fill: #00e5ff; }
.bp-corridor-fill  { fill: rgba(0, 229, 255, 0.05); }

.bp-bbox {
    fill: rgba(0, 229, 255, 0.06);
    stroke: #00e5ff;
}

.bp-signal-path {
    fill: none;
    stroke: #00e5ff;
    stroke-width: 2.2px;
    stroke-dasharray: 24 76;
    animation: vizPulseFlow 3.2s linear infinite;
}

.bp-mono-label {
    font-family: var(--font-mono);
    font-size: 9.5px;
    fill: #00e5ff;
    letter-spacing: 0.08em;
}

.bp-interactive-pupil,
.bp-cursor-node {
    transition: transform 0.15s ease-out;
}

.stage-giant-num {
    font-family: var(--font-display);
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1;
    color: var(--accent-primary);
}

.stage-type-badge,
.ledger-type-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 0.22rem 0.6rem;
    border: 1px solid var(--border-accent);
    color: var(--accent-primary);
}

.stage-tag-pill,
.ledger-tag {
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 0.2rem 0.55rem;
    border: 1px solid var(--border-hairline);
    color: var(--text-secondary);
}

.project-ledger-item {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 1.65rem 0.75rem;
    transition: background-color 0.2s ease;
}

@media (min-width: 768px) {
    .project-ledger-item {
        grid-template-columns: 140px 1fr 240px;
        align-items: start;
    }
}

.project-ledger-item:hover {
    background: var(--bg-Subtle);
}

.ledger-col-index {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
}

.ledger-num {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: var(--accent-primary);
}

.ledger-domain {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.ledger-title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.ledger-desc {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.ledger-arch {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.45rem;
}

.ledger-col-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

@media (min-width: 768px) {
    .ledger-col-meta {
        align-items: flex-end;
        text-align: right;
    }
}

.ledger-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.ledger-git-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--border-accent);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.ledger-git-link:hover {
    background: var(--accent-primary);
    color: #05070c;
}

/* ============================================================================
   CHAPTER 05 — ACHIEVEMENTS / MONUMENTAL NUMBERED SCENES
   ============================================================================ */
.achievement-scene {
    background: var(--bg-panel);
    border: 1px solid var(--border-hairline);
    padding: 1.65rem 1.85rem;
    transition: border-color 0.25s ease, transform 0.25s ease;
}

.achievement-scene:hover {
    border-color: var(--accent-primary);
    transform: translateX(4px);
}

.ach-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    align-items: center;
}

@media (min-width: 768px) {
    .ach-inner {
        grid-template-columns: 160px 1fr 72px;
    }
}

.ach-index-col {
    display: flex;
    flex-direction: column;
}

.ach-step-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    opacity: 0.55;
}

.ach-giant-medal {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 4.2vw, 3.6rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--accent-primary);
}

.ach-code-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.ach-code {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    opacity: 0.6;
}

.ach-discipline {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-primary);
}

.ach-title {
    font-family: var(--font-display);
    font-size: clamp(1.15rem, 2vw, 1.5rem);
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.ach-context {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

/* ============================================================================
   CHAPTER 06 — CONTACT / THE NEXT CONNECTION
   ============================================================================ */
.contact-monumental-statement {
    font-family: var(--font-display);
    font-size: clamp(2.3rem, 6vw, 5.5rem);
    font-weight: 700;
    line-height: 0.98;
    letter-spacing: -0.04em;
    max-width: 16ch;
    margin-left: auto;
    margin-right: auto;
}

.copy-email-pill {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--border-accent);
    color: var(--accent-primary);
}

.copy-email-pill:hover,
.copy-email-pill.is-copied {
    background: var(--accent-primary);
    color: #05070c;
}

/* ============================================================================
   00 — INTRODUCTION: SCROLL-DRIVEN 3D ROAD (js/road-intro.js)
   ============================================================================ */
.road-intro {
    --ri-bg: #050a0d;
    --ri-glow: rgba(0, 229, 255, 0.07);
    position: relative;
    z-index: 6;
    height: 1900vh;
    margin-top: -5rem;
    background: transparent;
}

body.theme-light .road-intro {
    --ri-bg: #f3efe6;
    --ri-glow: rgba(2, 132, 199, 0.07);
}

.road-intro__stage {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    overflow: hidden;
    background:
        radial-gradient(120% 55% at 50% 58%, var(--ri-glow), transparent 62%),
        var(--ri-bg);
}

.road-intro__canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.ri-block {
    position: absolute;
    z-index: 2;
    visibility: hidden;
    pointer-events: none;
    will-change: opacity, transform;
}

.ri-center {
    left: 50%;
    top: 50%;
    width: min(92vw, 980px);
    margin-left: calc(min(92vw, 980px) / -2);
    text-align: center;
    translate: 0 -50%;
}

.ri-center.ri-high { top: 30%; }
.ri-b5 { top: 38%; }

.ri-side {
    left: 60%;
    top: 50%;
    width: min(36vw, 560px);
    translate: 0 -38%;
}

.ri-kicker {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.42em;
    text-transform: uppercase;
    color: var(--accent-primary);
    margin-bottom: 1.25rem;
}

.ri-title {
    font-family: var(--font-sans);
    font-weight: 400;
    font-size: clamp(1.9rem, 3.6vw, 3.4rem);
    line-height: 1.14;
    letter-spacing: -0.025em;
    color: var(--text-primary);
    text-shadow: 0 0 28px var(--ri-bg), 0 0 8px var(--ri-bg);
}
.ri-title--xl { font-size: clamp(2.2rem, 4.6vw, 4.4rem); }
.ri-title em {
    font-style: normal;
    color: var(--accent-primary);
}

/* Give the opening statement room for two lines and keep its key phrase intact. */
.ri-b0.ri-center {
    width: min(92vw, 1120px);
    margin-left: calc(min(92vw, 1120px) / -2);
}

.ri-b0 .ri-title--xl {
    font-size: clamp(1.75rem, 4vw, 4rem);
    font-weight: 500;
    line-height: 1.24;
    letter-spacing: -0.035em;
    text-wrap: balance;
}

.ri-b0 .ri-title em {
    display: inline-block;
    white-space: nowrap;
}

.ri-w {
    display: inline-block;
    opacity: 0;
    will-change: transform, opacity;
}

.ri-desc {
    margin-top: 1.75rem;
    max-width: 34rem;
    font-size: clamp(0.95rem, 1.15vw, 1.1rem);
    line-height: 1.75;
    color: var(--text-secondary);
}

.ri-scroll-hint {
    left: 50%;
    bottom: 5vh;
    translate: -50% 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.4em;
    color: var(--text-muted);
}

.ri-scroll-line {
    position: relative;
    width: 1px;
    height: 56px;
    overflow: hidden;
    background: var(--border-hairline);
}
.ri-scroll-line span {
    position: absolute;
    left: 0;
    top: -40%;
    width: 1px;
    height: 40%;
    background: var(--accent-primary);
    animation: riScrollRun 1.8s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

@keyframes riScrollRun {
    to { top: 100%; }
}

.ri-skip {
    position: absolute;
    z-index: 3;
    right: clamp(16px, 3vw, 40px);
    bottom: clamp(16px, 4vh, 36px);
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.3em;
    color: var(--text-muted);
    padding: 8px 2px;
    border-bottom: 1px solid var(--border-hairline);
    transition: color 0.25s ease, border-color 0.25s ease;
}
.ri-skip:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* Introduction pages: content laid over the road, revealed card by card */
.road-intro__anchor {
    position: absolute;
    left: 0;
    top: calc(0.308 * (100% - 100vh));
    width: 1px;
    height: 1px;
}

.road-intro__scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0;
    pointer-events: none;
    background:
        radial-gradient(90% 70% at 50% 48%, color-mix(in srgb, var(--ri-bg) 78%, transparent), color-mix(in srgb, var(--ri-bg) 38%, transparent) 75%),
        linear-gradient(to bottom, transparent 55%, color-mix(in srgb, var(--ri-bg) 60%, transparent));
}

.ri-block [data-ri-item] { opacity: 0; }

.ri-page {
    --ri-card-bg: rgba(9, 17, 23, 0.74);
    --ri-card-border: rgba(244, 241, 234, 0.09);
    left: 50%;
    top: calc(50% + 32px);
    width: min(1220px, 90vw);
    translate: -50% -50%;
}
body.theme-light .ri-page {
    --ri-card-bg: rgba(255, 253, 248, 0.82);
    --ri-card-border: rgba(11, 15, 23, 0.1);
}

.ri-page__split {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: clamp(40px, 6vw, 96px);
    align-items: center;
}
.ri-page__split--even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

.ri-page__head {
    text-align: center;
    margin-bottom: clamp(28px, 4.5vh, 48px);
}
.ri-page__head .ri-kicker { margin-bottom: 0.9rem; }

.ri-heading {
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: clamp(2.3rem, 4.2vw, 3.9rem);
    line-height: 1.05;
    letter-spacing: -0.035em;
    color: var(--text-primary);
}

.ri-lead {
    margin-top: 1.4rem;
    font-size: clamp(1.05rem, 1.45vw, 1.3rem);
    line-height: 1.55;
    color: var(--text-primary);
    opacity: 0.88;
    max-width: 36rem;
}
.ri-lead .editorial-serif { color: var(--accent-primary); }

.ri-body {
    margin-top: 1rem;
    font-size: clamp(0.92rem, 1.05vw, 1.02rem);
    line-height: 1.75;
    color: var(--text-secondary);
    max-width: 36rem;
}

.ri-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 1.6rem;
}
.ri-tags span {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    padding: 6px 13px;
    border-radius: 999px;
    border: 1px solid var(--ri-card-border);
    background: color-mix(in srgb, var(--accent-primary) 6%, transparent);
    color: var(--text-secondary);
}
.ri-tags--sm { margin-top: auto; padding-top: 1rem; }
.ri-tags--sm span { font-size: 10.5px; padding: 4px 10px; }

/* Portrait + name */
.ri-portrait {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 22px;
}
.ri-portrait__frame {
    position: relative;
    width: min(340px, 28vw);
    aspect-ratio: 4 / 5;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--border-accent);
    box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.7), 0 0 60px -20px var(--border-accent);
    background: var(--ri-card-bg);
}
.ri-portrait__frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ri-portrait__fallback {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 700;
    color: var(--accent-primary);
}
.ri-portrait__frame.is-missing img { display: none; }
.ri-portrait__frame.is-missing .ri-portrait__fallback { display: flex; }

.ri-portrait figcaption {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.ri-portrait__name {
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 2.5vw, 2.3rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--text-primary);
}
.ri-portrait__role {
    font-size: clamp(0.98rem, 1.2vw, 1.12rem);
    font-weight: 500;
    color: var(--accent-primary);
}
.ri-portrait__meta {
    margin-top: 4px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.14em;
    color: var(--text-muted);
}

/* Shared soft card */
.ri-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 22px 24px;
    border-radius: 18px;
    border: 1px solid var(--ri-card-border);
    background: var(--ri-card-bg);
    box-shadow: 0 24px 60px -32px rgba(0, 0, 0, 0.65);
}
.ri-card.is-current { border-color: var(--border-accent); }
.ri-card__bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--ri-card-border);
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.ri-card__bar strong { color: var(--accent-primary); font-weight: 600; white-space: nowrap; }
.ri-card__title {
    font-family: var(--font-sans);
    font-size: clamp(1.05rem, 1.35vw, 1.3rem);
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}
.ri-card__text {
    margin-top: 8px;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
}
.ri-card__text .accent-highlight { color: var(--accent-primary); font-weight: 600; }

/* Education timeline */
.ri-timeline {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding-left: 30px;
    list-style: none;
}
.ri-timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 26px;
    bottom: 26px;
    width: 1px;
    background: linear-gradient(to bottom, var(--border-hairline), var(--accent-primary));
}
.ri-timeline .ri-card::before {
    content: '';
    position: absolute;
    left: -29px;
    top: 26px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    border: 1px solid var(--accent-primary);
    background: var(--ri-bg);
}
.ri-timeline .ri-card.is-current::before {
    background: var(--accent-primary);
    box-shadow: 0 0 14px var(--accent-primary);
}

/* Pipeline: one signal line with five nodes */
.ri-flow {
    position: relative;
    padding-top: 6px;
}
.ri-flow__track {
    position: absolute;
    left: 10%;
    right: 10%;
    top: 34px;
    height: 2px;
    background: var(--ri-card-border);
    border-radius: 2px;
}
.ri-flow__fill {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(to right, color-mix(in srgb, var(--accent-primary) 25%, transparent), var(--accent-primary));
    box-shadow: 0 0 14px var(--border-accent);
    transform: scaleX(var(--k, 0));
    transform-origin: left center;
}
.ri-flow__pulse {
    position: absolute;
    top: 50%;
    left: 0;
    width: 70px;
    height: 2px;
    margin-top: -1px;
    background: linear-gradient(to right, transparent, #fff, transparent);
    opacity: 0.9;
    animation: riFlowPulse 2.6s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}
@keyframes riFlowPulse {
    from { left: -70px; }
    to { left: 100%; }
}
.ri-flow__nodes {
    position: relative;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px;
    list-style: none;
}
.ri-flow__node {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.ri-flow__dot {
    position: relative;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin-bottom: 20px;
    border-radius: 50%;
    border: 1px solid var(--border-accent);
    background: var(--ri-bg);
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--ri-bg) 85%, transparent), 0 0 28px -6px var(--accent-primary);
}
.ri-flow__dot::after {
    content: '';
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--accent-primary) 12%, transparent);
}
.ri-flow__dot span {
    position: relative;
    z-index: 1;
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent-primary);
}
.ri-flow__title {
    margin-top: 4px;
    font-size: clamp(1rem, 1.25vw, 1.15rem);
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}
.ri-flow__text {
    margin-top: 8px;
    max-width: 15rem;
    font-size: 0.86rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Skill pillars */
.ri-pillars {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}
.ri-pillars .ri-card { min-height: 250px; }

/* Live diagrams on the skill cards (js/skill-viz.js) */
.ri-viz {
    height: 112px;
    margin: -4px -6px 14px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--accent-primary) 4%, transparent);
    overflow: hidden;
}
.ri-viz svg {
    display: block;
    width: 100%;
    height: 100%;
}
.sv-edge {
    stroke: var(--text-primary);
    stroke-opacity: 0.12;
    stroke-width: 1;
    transition: stroke 0.3s ease, stroke-opacity 0.3s ease;
}
.sv-edge.is-active {
    stroke: var(--accent-primary);
    stroke-opacity: 0.55;
}
.sv-node {
    fill: var(--ri-bg);
    stroke: var(--text-primary);
    stroke-opacity: 0.35;
    stroke-width: 1.2;
    transition: fill 0.3s ease, stroke 0.3s ease, stroke-opacity 0.3s ease;
}
.sv-node.is-done {
    stroke: var(--accent-primary);
    stroke-opacity: 0.7;
}
.sv-node.is-active {
    fill: var(--accent-primary);
    stroke: var(--accent-primary);
    stroke-opacity: 1;
}
.sv-node.is-out { filter: drop-shadow(0 0 6px var(--accent-primary)); }
.sv-label {
    font-family: var(--font-mono);
    font-size: 8.5px;
    fill: var(--text-secondary);
    pointer-events: none;
}
.sv-packet { fill: var(--accent-primary); }
.sv-bar {
    fill: var(--text-primary);
    fill-opacity: 0.22;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), fill 0.2s ease, fill-opacity 0.2s ease;
}
.sv-bar.is-done { fill: var(--accent-primary); fill-opacity: 0.45; }
.sv-bar.is-active { fill: var(--accent-secondary); fill-opacity: 0.95; }
.sv-axis {
    stroke: var(--text-primary);
    stroke-opacity: 0.14;
}
.sv-setpoint {
    fill: none;
    stroke: var(--text-primary);
    stroke-opacity: 0.4;
    stroke-width: 1;
    stroke-dasharray: 3 4;
}
.sv-response {
    fill: none;
    stroke: var(--accent-primary);
    stroke-width: 1.8;
    stroke-linejoin: round;
}
.sv-pwm {
    fill: none;
    stroke: var(--accent-secondary);
    stroke-opacity: 0.75;
    stroke-width: 1.1;
}

.ri-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    margin-top: 2.4rem;
}

/* Header melts into the introduction while it is on screen */
.site-header {
    transition: background-color 0.4s ease, border-color 0.4s ease;
}
body.is-in-intro .site-header {
    background: transparent;
    border-bottom-color: transparent;
}

@media (max-width: 1100px) {
    .ri-flow__text { display: none; }
}

@media (max-width: 767px) {
    .road-intro { height: 1700vh; }
    .ri-center.ri-high { top: 24%; }
    .ri-side {
        left: 6vw;
        right: 6vw;
        top: auto;
        bottom: 9vh;
        width: auto;
        translate: none;
    }
    .ri-desc { font-size: 0.9rem; line-height: 1.65; margin-top: 1rem; }
    .ri-kicker { margin-bottom: 0.8rem; letter-spacing: 0.3em; font-size: 10px; }

    .ri-page { width: 90vw; top: calc(50% + 34px); }
    .ri-page__split,
    .ri-page__split--even { grid-template-columns: 1fr; gap: 22px; }
    .ri-heading { font-size: 2rem; }
    .ri-lead { margin-top: 0.8rem; font-size: 0.98rem; }
    .ri-body { display: none; }
    .ri-tags { margin-top: 1rem; gap: 6px; }
    .ri-tags span { font-size: 10px; padding: 4px 10px; }
    .ri-page__head { margin-bottom: 18px; }

    .ri-portrait {
        order: -1;
        flex-direction: row;
        text-align: left;
        gap: 16px;
    }
    .ri-portrait__frame { width: 96px; border-radius: 16px; }
    .ri-portrait figcaption { align-items: flex-start; gap: 2px; }
    .ri-portrait__name { font-size: 1.4rem; }
    .ri-portrait__role { font-size: 0.9rem; }
    .ri-portrait__meta { font-size: 9px; letter-spacing: 0.08em; }

    .ri-card { padding: 14px 16px; border-radius: 14px; }
    .ri-card__bar { padding-bottom: 8px; margin-bottom: 8px; font-size: 9.5px; }
    .ri-card__title { font-size: 1rem; }
    .ri-card__text { font-size: 0.82rem; margin-top: 4px; }
    .ri-timeline { gap: 12px; padding-left: 24px; }
    .ri-timeline .ri-card::before { left: -23px; top: 18px; width: 11px; height: 11px; }
    .ri-timeline::before { left: 5px; }
    .ri-page__split--even .ri-tags { display: none; }

    /* Flow turns vertical: line on the left, nodes stacked */
    .ri-flow__track {
        left: 28px;
        right: auto;
        top: 28px;
        bottom: 28px;
        width: 2px;
        height: auto;
    }
    .ri-flow__fill {
        background: linear-gradient(to bottom, color-mix(in srgb, var(--accent-primary) 25%, transparent), var(--accent-primary));
        transform: scaleY(var(--k, 0));
        transform-origin: center top;
    }
    .ri-flow__pulse { display: none; }
    .ri-flow__nodes { grid-template-columns: 1fr; gap: 14px; }
    .ri-flow__node {
        display: grid;
        grid-template-columns: 58px 1fr;
        column-gap: 16px;
        align-items: center;
        text-align: left;
    }
    .ri-flow__dot { width: 56px; height: 56px; margin: 0; }
    .ri-flow__title { font-size: 1rem; }

    .ri-pillars { grid-template-columns: 1fr; gap: 10px; }
    .ri-pillars .ri-card { min-height: 0; }
    .ri-pillars .ri-card__text { display: none; }
    .ri-viz { height: 74px; margin: -2px -4px 8px; }
    .ri-pillars .ri-tags { display: none; }
    .ri-actions { margin-top: 1.6rem; }
}

/* ============================================================================
   CHAPTERS — SOFT CARD REVEAL, PAPER, PROJECTS, ACHIEVEMENTS
   ============================================================================ */
.architectural-panel { border-radius: 18px; }
.architectural-panel > .frame-corner { display: none; }

/* Cards stand up out of the floor: they start tipped back on their bottom edge */
#after-space {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
}

.warp-gap { height: 95vh; }
@media (max-width: 767px) {
    .warp-gap { height: 80vh; }
    #warp-title { top: 84%; }
}

/* Chapter name shown during the fly-through: the chapter's eyebrow, larger */
#warp-title {
    position: fixed;
    left: 50%;
    top: 89%;
    z-index: 2;
    gap: 1rem;
    font-size: clamp(0.95rem, 1.45vw, 1.25rem);
    font-weight: 700;
    letter-spacing: 0.32em;
    color: color-mix(in srgb, var(--accent-primary) 70%, #ffffff);
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    white-space: nowrap;
    text-shadow: 0 0 14px color-mix(in srgb, var(--accent-primary) 70%, transparent), 0 0 3px var(--bg-primary), 0 0 22px var(--bg-primary);
    transform: translate(-50%, -50%);
    will-change: transform, opacity;
}
#warp-title .eyebrow-line { width: 3.2em; height: 2px; background: currentColor; box-shadow: 0 0 10px var(--accent-primary); }

/* ============================================================================
   CHAPTER COLOURS: each later chapter has its own accent, matching its subject.
   js/after-space.js reads these to colour the gate, body and corridor.
   ============================================================================ */
#publications {   /* research, latent space: violet */
    --accent-primary: #a78bfa;
    --border-accent: rgba(167, 139, 250, 0.5);
}
#projects {       /* engineering, building things: the signature cyan */
    --accent-primary: #00e5ff;
    --border-accent: rgba(0, 229, 255, 0.48);
}
#activities {     /* the journey, growth: emerald */
    --accent-primary: #34d399;
    --border-accent: rgba(52, 211, 153, 0.48);
}
#awards {         /* trophies and medals: gold */
    --accent-primary: #f5c442;
    --border-accent: rgba(245, 196, 66, 0.5);
}
#contact {        /* reaching out, warmth: coral */
    --accent-primary: #ff7a59;
    --border-accent: rgba(255, 122, 89, 0.5);
}
body.theme-light #publications { --accent-primary: #7c3aed; --border-accent: rgba(124, 58, 237, 0.45); }
body.theme-light #projects     { --accent-primary: #0284c7; --border-accent: rgba(2, 132, 199, 0.48); }
body.theme-light #activities   { --accent-primary: #059669; --border-accent: rgba(5, 150, 105, 0.45); }
body.theme-light #awards       { --accent-primary: #b7791f; --border-accent: rgba(183, 121, 31, 0.45); }
body.theme-light #contact      { --accent-primary: #dc5a3a; --border-accent: rgba(220, 90, 58, 0.45); }

/* Calm reveal: each card fades in and rises a short distance, one after another */
[data-reveal] {
    opacity: 0;
    transform: translate3d(0, 24px, 0);
    transition:
        opacity 0.9s ease-out,
        transform 0.9s cubic-bezier(0.22, 1, 0.36, 1),
        border-color 0.25s ease,
        background-color 0.25s ease;
}
[data-reveal].is-revealed {
    opacity: 1;
    transform: none;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}
.project-card {
    display: flex;
    flex-direction: column;
    padding: 28px;
    border-radius: 18px;
    border: 1px solid var(--border-hairline);
    background: var(--bg-panel);
    box-shadow: var(--shadow-panel);
}
.project-card {
    cursor: pointer;
}
.project-card:hover,
.project-card:focus-visible {
    border-color: var(--border-accent);
    background: var(--bg-panel-hover);
    outline: none;
}
.project-card:hover .project-card__link,
.project-card:focus-visible .project-card__link {
    background: var(--accent-primary);
    color: #05070c;
}
.project-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}
.project-card__num {
    font-family: var(--font-display);
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1;
    color: var(--accent-primary);
}
.project-card__type,
.award-card__note {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-hairline);
    color: var(--text-secondary);
}
.project-card__title {
    margin-top: 2px;
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}
.project-card__desc {
    margin-top: 10px;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-secondary);
}
.project-card__foot {
    margin-top: auto;
    padding-top: 18px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}
.project-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.project-card__tags span {
    font-family: var(--font-mono);
    font-size: 10px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--bg-Subtle);
    color: var(--text-secondary);
}
.project-card__link {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid var(--border-accent);
    color: var(--accent-primary);
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Achievements: 3 cards on the first row, 2 wider ones on the second */
.awards-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 22px;
}
.award-card {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 28px;
    border-radius: 18px;
    border: 1px solid var(--border-hairline);
    background: var(--bg-panel);
    box-shadow: var(--shadow-panel);
}
.award-card:nth-child(n + 4) { grid-column: span 3; }
.award-card:hover {
    border-color: var(--border-accent);
    background: var(--bg-panel-hover);
}
.award-card__medal {
    margin-bottom: 8px;
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--accent-primary);
}
.award-card__title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}
.award-card__note { align-self: flex-start; margin-top: auto; }

/* SEAS key project: project name on the left, role in the right corner */
.seas-project {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
}
.seas-project__name {
    flex: 1 1 220px;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-primary);
    transition: color 0.2s ease;
}
.seas-project__name:hover { color: var(--accent-primary); }
.seas-project__name svg { flex-shrink: 0; color: var(--accent-primary); }
.seas-project__role {
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid var(--border-accent);
    color: var(--accent-primary);
}

/* Research: published paper on one row, manuscripts in progress on the next */
.research-rows {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.research-wip {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 32px;
    align-items: center;
}
.research-wip__slots {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Milestones: one station per row along a vertical timeline */
.milestones-track {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding-left: 44px;
}
.milestones-track::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 36px;
    bottom: 36px;
    width: 1px;
    background: linear-gradient(to bottom, var(--accent-primary), var(--border-hairline));
}
.milestones-track .milestone-station::before {
    content: '';
    position: absolute;
    left: -40px;
    top: 38px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 1px solid var(--accent-primary);
    background: var(--bg-primary);
    box-shadow: 0 0 0 5px var(--bg-primary), 0 0 16px -2px var(--accent-primary);
}
.milestones-track .milestone-station:first-child::before { background: var(--accent-primary); }

@media (min-width: 1024px) {
    .milestones-track .milestone-station {
        display: grid;
        grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
        gap: 40px;
        align-items: start;
    }
}

/* Later chapters use the same type as the introduction pages:
   sans-serif, medium weight, compact sizes (see .ri-heading / .ri-card__title) */
.chapter-section .eyebrow {
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.32em;
}
.chapter-display-title {
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: clamp(1.8rem, 3.1vw, 2.75rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
}
.chapter-section .font-display,
.chapter-section .font-bold.font-display {
    font-family: var(--font-sans);
    font-weight: 600;
    letter-spacing: -0.015em;
}
.chapter-section .text-2xl { font-size: 1.2rem; line-height: 1.3; }
.chapter-section .sm\:text-3xl { font-size: clamp(1.2rem, 1.55vw, 1.4rem); line-height: 1.3; }
.chapter-section .text-xl { font-size: 1.08rem; }
.chapter-section .sm\:text-base { font-size: 0.9rem; }
.chapter-section .text-sm { font-size: 0.84rem; }
.chapter-section .text-lg { font-size: 1rem; }
@media (min-width: 640px) {
    .chapter-section .sm\:p-10 { padding: 2rem; }
    .chapter-section .sm\:p-9 { padding: 1.85rem; }
}
.chapter-section .mb-14 { margin-bottom: 2.5rem; }
.chapter-section .mb-12 { margin-bottom: 2.25rem; }

.project-card__title,
.award-card__title {
    font-family: var(--font-sans);
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
}
.project-card__title { font-size: clamp(1.02rem, 1.25vw, 1.18rem); }
.project-card__desc { font-size: 0.86rem; line-height: 1.6; }
.award-card__title { font-size: clamp(0.98rem, 1.15vw, 1.1rem); }
.project-card,
.award-card { padding: 24px; }
.project-card__num { font-size: 2rem; }
.award-card__medal { font-size: 2.5rem; }
.project-card__num,
.award-card__medal { font-weight: 600; }
.seas-project__name { font-family: var(--font-sans); font-weight: 600; font-size: 0.95rem; }

.contact-monumental-statement {
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: clamp(1.9rem, 3.8vw, 3.2rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
}


/* README viewer */
.readme-modal {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(3, 6, 10, 0.72);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}
.readme-modal.is-open {
    opacity: 1;
    visibility: visible;
}
/* README stays centred; the summary card sits in the right-hand gutter */
.readme-modal__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 860px) minmax(0, 1fr);
    align-items: center;
    gap: 24px;
    width: 100%;
}
.readme-modal__layout .readme-modal__panel { grid-column: 2; }
.readme-side {
    grid-column: 3;
    justify-self: start;
    width: min(290px, 100%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 22px;
    border-radius: 18px;
    border: 1px solid var(--border-hairline);
    background: var(--bg-panel);
    box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
    opacity: 0;
    transform: translate3d(-24px, 0, 0);
    transition: opacity 0.45s ease 0.12s, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.12s;
}
.readme-modal.is-open .readme-side {
    opacity: 1;
    transform: none;
}
.readme-side__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.readme-side__num {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: var(--accent-primary);
}
.readme-side__type {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-hairline);
    color: var(--text-secondary);
}
.readme-side__title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
}
.readme-side__desc {
    font-size: 0.86rem;
    line-height: 1.6;
    color: var(--text-secondary);
}
.readme-side__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.readme-side__tags span {
    font-family: var(--font-mono);
    font-size: 10px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--bg-Subtle);
    color: var(--text-secondary);
}
.readme-side__git {
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border-accent);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-primary);
    transition: background-color 0.2s ease, color 0.2s ease;
}
.readme-side__git:hover {
    background: var(--accent-primary);
    color: #05070c;
}
.readme-modal__panel {
    display: flex;
    flex-direction: column;
    width: min(860px, 100%);
    max-height: min(82vh, 900px);
    border-radius: 20px;
    border: 1px solid var(--border-hairline);
    background: var(--bg-primary);
    box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    transform: translate3d(0, 30px, 0) scale(0.97);
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.readme-modal.is-open .readme-modal__panel { transform: none; }
.readme-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-hairline);
}
.readme-modal__file {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
}
.readme-modal__title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}
.readme-modal__close {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-hairline);
    color: var(--text-secondary);
    transition: color 0.2s ease, border-color 0.2s ease;
}
.readme-modal__close:hover {
    color: var(--accent-primary);
    border-color: var(--border-accent);
}
.readme-modal__body {
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 24px 28px 32px;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-secondary);
}
.readme-modal__state {
    padding: 40px 0;
    text-align: center;
    color: var(--text-muted);
}
.readme-modal__body h1,
.readme-modal__body h2,
.readme-modal__body h3,
.readme-modal__body h4 {
    margin: 1.6em 0 0.6em;
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
}
.readme-modal__body h1 { font-size: 1.6rem; margin-top: 0; }
.readme-modal__body h2 { font-size: 1.3rem; padding-bottom: 0.3em; border-bottom: 1px solid var(--border-hairline); }
.readme-modal__body h3 { font-size: 1.1rem; }
.readme-modal__body p,
.readme-modal__body ul,
.readme-modal__body ol,
.readme-modal__body table,
.readme-modal__body pre,
.readme-modal__body blockquote { margin: 0 0 1em; }
.readme-modal__body ul { list-style: disc; padding-left: 1.4em; }
.readme-modal__body ol { list-style: decimal; padding-left: 1.4em; }
.readme-modal__body li + li { margin-top: 0.3em; }
.readme-modal__body strong { color: var(--text-primary); }
.readme-modal__body a { color: var(--accent-primary); text-decoration: underline; text-underline-offset: 2px; }
.readme-modal__body img { max-width: 100%; height: auto; border-radius: 10px; }
.readme-modal__body hr { margin: 1.6em 0; border-top: 1px solid var(--border-hairline); }
.readme-modal__body code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    padding: 0.15em 0.4em;
    border-radius: 6px;
    background: var(--bg-Subtle);
}
.readme-modal__body pre {
    overflow-x: auto;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--bg-Subtle);
}
.readme-modal__body pre code { padding: 0; background: none; }
.readme-modal__body blockquote {
    padding-left: 1em;
    border-left: 2px solid var(--border-accent);
    color: var(--text-muted);
}
.readme-modal__body table { display: block; overflow-x: auto; border-collapse: collapse; }
.readme-modal__body th,
.readme-modal__body td { padding: 6px 12px; border: 1px solid var(--border-hairline); }
.readme-modal__body .markdown-heading { position: relative; }

@media (max-width: 1100px) {
    .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .awards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .award-card,
    .award-card:nth-child(n + 4) { grid-column: span 1; }
}

/* Not enough room for a centred README plus a gutter card: put them side by side, then stack */
@media (max-width: 1500px) {
    .readme-modal__layout {
        grid-template-columns: minmax(0, 1fr) 270px;
        max-width: 1160px;
    }
    .readme-modal__layout .readme-modal__panel { grid-column: 1; width: auto; }
    .readme-side { grid-column: 2; width: 100%; }
}
@media (max-width: 900px) {
    .readme-modal__layout {
        grid-template-columns: 1fr;
        gap: 12px;
        max-height: 100%;
    }
    .readme-modal__layout .readme-modal__panel { grid-row: 1; }
    .readme-side {
        grid-column: 1;
        grid-row: 2;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        padding: 14px 16px;
        transform: translate3d(0, 16px, 0);
    }
    .readme-side__top,
    .readme-side__desc,
    .readme-side__tags { display: none; }
    .readme-side__title { flex: 1; font-size: 1rem; }
    .readme-side__git { margin: 0; padding: 10px 14px; }
}

@media (max-width: 860px) {
    .research-wip { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 680px) {
    .milestones-track { padding-left: 30px; gap: 20px; }
    .milestones-track::before { left: 6px; }
    .milestones-track .milestone-station::before { left: -31px; width: 13px; height: 13px; }
    .project-grid,
    .awards-grid { grid-template-columns: 1fr; }
    .project-card,
    .award-card { padding: 22px; }
    .readme-modal { padding: 12px; }
    .readme-modal__panel { max-height: 72vh; }
    .readme-modal__body { padding: 18px 18px 26px; }
}

/* ============================================================================
   PHONES & SHORT SCREENS
   ============================================================================ */
@media (max-width: 767px) {
    /* No blur on cards: it is costly to composite while a phone is scrolling */
    [data-reveal] { transform: translate3d(0, 18px, 0); }

    .ri-heading--flow {
        font-size: clamp(1.15rem, 6.2vw, 1.7rem);
        letter-spacing: -0.02em;
        white-space: nowrap;
    }
    .lang-btn { min-width: 36px; min-height: 36px; }

    .milestone-station ul { font-size: 0.84rem; line-height: 1.6; }
    .milestone-station ul li + li { margin-top: 0.6rem; }
    .seas-project__role { font-size: 10px; }
    .chapter-display-title { font-size: clamp(1.9rem, 9vw, 2.6rem); }
    .contact-monumental-statement { word-break: break-word; }

    .site-footer > div { text-align: center; }
}

/* Landscape phones and other short windows: the intro pages shrink to fit the height */
@media (max-height: 560px) {
    .ri-page { top: calc(50% + 24px); width: min(1100px, 94vw); }
    .ri-title { font-size: clamp(1.4rem, 7vh, 2.2rem); }
    .ri-title--xl { font-size: clamp(1.6rem, 9vh, 2.8rem); }
    .ri-kicker { margin-bottom: 0.5rem; font-size: 10px; }
    .ri-desc { margin-top: 0.8rem; font-size: 0.85rem; line-height: 1.55; }
    .ri-side { top: 56%; width: min(34vw, 520px); }
    .ri-center.ri-high { top: 36%; }
    .ri-b5 { top: 44%; }
    .ri-actions { margin-top: 1.2rem; }

    .ri-heading { font-size: clamp(1.5rem, 8vh, 2.2rem); }
    .ri-lead { margin-top: 0.7rem; font-size: 0.9rem; line-height: 1.5; }
    .ri-body { display: none; }
    .ri-tags { margin-top: 0.8rem; gap: 6px; }
    .ri-tags span { font-size: 10px; padding: 3px 9px; }
    .ri-page__split,
    .ri-page__split--even { gap: 28px; }
    .ri-page__split--even { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); }
    .ri-page__split--even .ri-lead { font-size: 0.82rem; }
    .ri-page__split--even .ri-tags { display: none; }
    .ri-timeline .ri-card__title { font-size: 0.9rem; }
    .ri-timeline .ri-card__text { font-size: 0.74rem; line-height: 1.4; margin-top: 2px; }
    .ri-timeline .ri-card::before { top: 18px; }
    .ri-page__head { margin-bottom: 14px; }
    .ri-page__head .ri-kicker { margin-bottom: 0.4rem; }

    .ri-portrait { flex-direction: row; text-align: left; gap: 16px; }
    .ri-portrait__frame { width: auto; height: 42vh; border-radius: 14px; }
    .ri-portrait figcaption { align-items: flex-start; }
    .ri-portrait__name { font-size: 1.3rem; }
    .ri-portrait__meta { display: none; }

    .ri-card { padding: 12px 14px; border-radius: 14px; }
    .ri-card__bar { padding-bottom: 8px; margin-bottom: 8px; font-size: 9.5px; }
    .ri-card__title { font-size: 0.98rem; }
    .ri-card__text { font-size: 0.78rem; margin-top: 4px; }
    .ri-timeline { gap: 10px; }

    .ri-flow__track { top: 22px; }
    .ri-flow__dot { width: 44px; height: 44px; margin-bottom: 10px; }
    .ri-flow__dot span { font-size: 0.95rem; }
    .ri-flow__text { display: none; }
    .ri-flow__title { font-size: 0.85rem; }

    .ri-pillars { gap: 12px; }
    .ri-pillars .ri-card { min-height: 0; }
    .ri-pillars .ri-card__text { display: none; }
    .ri-pillars .ri-tags { display: none; }
    .ri-viz { height: 64px; margin: 0 0 8px; }
}

/* ============================================================================
   ACCESSIBILITY & REDUCED MOTION
   ============================================================================ */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    #cursor-dot, #cursor-ring {
        display: none !important;
    }
}
