/* FORK Series Bible - Complete Styles */
/* Clinical cheerfulness masking existential horror */

:root {
    /* Color palette - sterile pastels and corporate warmth */
    --primary-white: #ffffff;
    --soft-white: #fafbfc;
    --pale-blue: #f0f4f8;
    --clinical-blue: #e3f2fd;
    --amber-glow: #fff3e0;
    --scanner-blue: #2196f3;
    --desert-beige: #f5f1ed;

    /* Corporate colors */
    --corporate-teal: #00897b;
    --warm-gray: #757575;
    --soft-gray: #e0e0e0;
    --text-dark: #333333;
    --text-light: #666666;

    /* Pod/tech colors */
    --pod-amber: #ffb74d;
    --growth-green: #81c784;
    --danger-red: #e57373;

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'IBM Plex Mono', 'SF Mono', Monaco, monospace;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-xxl: 4rem;

    /* Effects */
    --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-pod: 0 4px 20px rgba(255, 183, 77, 0.3);
    --blur-bg: blur(20px);
}

/* Reset and base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    color-scheme: light only;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(135deg, var(--soft-white) 0%, var(--pale-blue) 100%);
    overflow-x: hidden;
    position: relative;
    scroll-padding-top: 100px;
    -webkit-text-size-adjust: 100%;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 300;
    letter-spacing: -0.02em;
}

/* Header / Hero Section */
.hero {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f4f8 0%, #e8f0e8 30%, #fff3e0 70%, #f0f4f8 100%);
    position: relative;
    overflow: hidden;
}

.hero-ambient {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 60% at 50% 50%, rgba(0, 137, 123, 0.04) 0%, transparent 70%),
        radial-gradient(ellipse 40% 40% at 80% 30%, rgba(255, 183, 77, 0.06) 0%, transparent 60%);
}

.hero-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 137, 123, 0.03) 0%, transparent 70%);
    animation: heroPulse 4s ease-in-out infinite;
}

@keyframes heroPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="%23ffffff20"/><circle cx="80" cy="40" r="1.5" fill="%23ffffff15"/><circle cx="40" cy="80" r="1" fill="%23ffffff10"/></svg>');
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(180deg); }
}

.corporate-header-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: var(--space-lg);
    opacity: 0.7;
}

.nli-wordmark {
    font-size: 1rem;
    font-weight: 600;
    color: var(--corporate-teal);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.nli-divider {
    width: 1px;
    height: 16px;
    background: var(--soft-gray);
}

.nli-tagline-header {
    font-size: 0.8rem;
    font-style: italic;
    color: var(--warm-gray);
    letter-spacing: 0.05em;
}

.logo-container {
    text-align: center;
    z-index: 1;
    position: relative;
}

.main-title {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 100;
    letter-spacing: 0.5em;
    color: var(--text-dark);
    margin-bottom: var(--space-xs);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tagline {
    font-size: 1.1rem;
    color: var(--text-light);
    font-style: italic;
    margin-bottom: var(--space-xs);
    letter-spacing: 0.03em;
}

.subtitle {
    font-size: 0.8rem;
    color: var(--warm-gray);
    margin-bottom: var(--space-md);
    font-weight: 400;
    font-family: var(--font-mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.created-by {
    font-size: 0.85rem;
    color: var(--warm-gray);
    font-family: var(--font-mono);
    margin-bottom: var(--space-sm);
}

.hero-clearance {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--corporate-teal);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.4em 1em;
    border: 1px solid rgba(0, 137, 123, 0.2);
    border-radius: 20px;
    background: rgba(0, 137, 123, 0.04);
}

.clearance-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--corporate-teal);
    animation: clearancePulse 2s ease-in-out infinite;
}

@keyframes clearancePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.version-info {
    font-size: 0.8rem;
    color: var(--warm-gray);
    font-family: var(--font-mono);
    opacity: 0.7;
}

/* Navigation */
.nav-container {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: var(--blur-bg);
    -webkit-backdrop-filter: var(--blur-bg);
    border-bottom: 1px solid var(--soft-gray);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    transform: translateZ(0); /* Force GPU acceleration */
    will-change: transform;
    pointer-events: auto;
}

.nav-container.collapsed {
    transform: translateY(-100%);
}

/* Floating toggle buttons that appear when elements are collapsed */
.floating-nav-toggle,
.floating-toc-toggle {
    position: fixed;
    border: none;
    background: var(--scanner-blue);
    color: white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    font-size: 18px;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    transition: all 0.3s ease;
}

.floating-nav-toggle {
    top: 15px;
    left: 15px;
}

.floating-toc-toggle {
    display: none !important; /* Hide TOC toggle */
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

.floating-nav-toggle:hover,
.floating-toc-toggle:hover {
    background: var(--accent-blue);
    transform: scale(1.1);
}

.floating-toc-toggle:hover {
    transform: translateY(-50%) scale(1.1);
}

/* Show floating TOC button when sidebar is collapsed */
body:has(.toc-sidebar.collapsed) .floating-toc-toggle {
    display: flex;
}


.nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-sm) var(--space-lg);
}

.nav-toggle {
    border: none;
    background: var(--corporate-teal);
    color: white;
    border-radius: 6px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    font-size: 18px;
    display: none;
    align-items: center;
    justify-content: center;
    margin-right: var(--space-md);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    touch-action: manipulation;
}

.nav-toggle:hover {
    background: #00796b;
}


.nav-tabs {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
}

.nav-tab {
    padding: var(--space-xs) var(--space-md);
    border: none;
    background: none;
    color: var(--text-light);
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 400;
    position: relative;
    white-space: nowrap;
}

.nav-tab[data-section="container"] {
    color: var(--danger-red);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    letter-spacing: 0.02em;
}

.nav-tab[data-section="container"]:hover {
    background: rgba(229, 115, 115, 0.08);
    color: var(--danger-red);
}

.nav-tab[data-section="container"].active {
    background: var(--danger-red);
    color: white;
}

/* Classified Tab */
.nav-tab[data-section="classified"] {
    color: #b388ff;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
}

.nav-tab[data-section="classified"]:hover {
    background: rgba(179, 136, 255, 0.08);
    color: #b388ff;
}

.nav-tab[data-section="classified"].active {
    background: linear-gradient(135deg, #7c4dff, #536dfe);
    color: white;
}

.nav-tab:hover {
    background: var(--pale-blue);
    color: var(--text-dark);
}

.nav-tab.active {
    background: var(--corporate-teal);
    color: white;
    box-shadow: var(--shadow-soft);
}

.nav-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--scanner-blue);
    border-radius: 50%;
    animation: scanner-pulse 2s ease-in-out infinite;
}

@keyframes scanner-pulse {
    0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.2); }
}

/* Search */
.search-container {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.search-input {
    padding: var(--space-xs) var(--space-md);
    border: 2px solid var(--soft-gray);
    border-radius: 20px;
    background: var(--primary-white);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    width: 300px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--scanner-blue);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.search-btn {
    padding: var(--space-xs);
    border: none;
    background: var(--scanner-blue);
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: none;
}

.search-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-soft);
}

/* Breadcrumb - Hidden on desktop, only shown on mobile */
.breadcrumb {
    display: none; /* Hide on desktop since active section is highlighted in nav */
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-xs) var(--space-lg);
    font-size: 0.85rem;
    color: var(--text-light);
    font-family: var(--font-mono);
}

.breadcrumb-item {
    opacity: 0.6;
}

.breadcrumb-item.active {
    opacity: 1;
    color: var(--corporate-teal);
}

/* Table of Contents Sidebar */
.toc-sidebar {
    display: none !important; /* Hide TOC completely */
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 300px;
    max-height: 70vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: var(--blur-bg);
    border-radius: 16px 0 0 16px;
    border: 1px solid var(--soft-gray);
    border-right: none;
    z-index: 50;
    transition: transform 0.3s ease;
}

.toc-sidebar.collapsed {
    transform: translateY(-50%) translateX(100%);
}



.toc-sidebar.collapsed ~ .content-container,
body:has(.toc-sidebar.collapsed) .content-container {
    margin-right: auto;
    margin-left: auto;
}

.toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    border-bottom: 1px solid var(--soft-gray);
}

.toc-header h3 {
    font-size: 1rem;
    color: var(--text-dark);
    margin: 0;
}

.toc-toggle {
    border: none;
    background: var(--scanner-blue);
    color: white;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 0.9rem;
}

.toc-content {
    padding: var(--space-sm);
    max-height: calc(70vh - 80px);
    overflow-y: auto;
}

.toc-item {
    padding: var(--space-xs) var(--space-sm);
    margin-bottom: var(--space-xs);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-light);
    transition: all 0.2s ease;
}

.toc-item:hover {
    background: var(--pale-blue);
    color: var(--text-dark);
}

.toc-item.active {
    background: var(--corporate-teal);
    color: white;
}

/* Character Sub-Navigation */
.character-sub-nav {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    border-bottom: 1px solid var(--soft-gray);
    padding-bottom: var(--space-sm);
}

.character-sub-tab {
    border: none;
    background: transparent;
    color: var(--text-light);
    padding: var(--space-sm) var(--space-md);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.character-sub-tab:hover {
    color: var(--scanner-blue);
    background: rgba(33, 150, 243, 0.1);
}

.character-sub-tab.active {
    color: var(--scanner-blue);
    background: rgba(33, 150, 243, 0.15);
    border-bottom: 2px solid var(--scanner-blue);
}

.character-subsection {
    display: none;
    animation: fadeIn 0.6s ease-in-out;
}

.character-subsection.active {
    display: block;
}

/* FORK Dialog Styling - VR/Glassy Aesthetic */
.fork-dialog-container {
    display: flex;
    justify-content: center;
    margin: var(--space-lg) 0;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(50px) scale(0.9);
    perspective: 1000px;
}

.fork-dialog-container.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.fork-dialog-container.collapsed {
    max-height: 0;
    margin: 0;
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
}

.fork-dialog {
    background: linear-gradient(135deg,
        #1a3a3a 0%,
        #0d2f2f 50%,
        #1a3a3a 100%);
    border: 1px solid rgba(0, 137, 123, 0.3);
    border-radius: 20px;
    padding: var(--space-xl);
    text-align: center;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 2px 16px rgba(0, 137, 123, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    position: relative;
    max-width: 500px;
    width: 100%;
}

.fork-dialog::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
        rgba(0, 137, 123, 0.08) 0%,
        rgba(0, 137, 123, 0.03) 50%,
        rgba(255, 183, 77, 0.05) 100%);
    border-radius: 20px;
    z-index: -1;
}

.fork-dialog h4 {
    margin: 0 0 var(--space-lg) 0;
    color: var(--corporate-teal);
    font-size: 1.8rem;
    font-weight: 200;
    letter-spacing: 8px;
    text-transform: uppercase;
}

.fork-dialog-actions {
    display: flex;
    gap: var(--space-lg);
    justify-content: center;
}

.fork-btn {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    padding: var(--space-md) var(--space-xl);
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 400;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 120px;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.1em;
    position: relative;
    overflow: hidden;
}

.fork-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent);
    transition: left 0.5s ease;
}

.fork-btn:hover::before {
    left: 100%;
}

.fork-btn-yes:hover {
    background: rgba(0, 137, 123, 0.3);
    border-color: var(--corporate-teal);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 137, 123, 0.25);
}

.fork-btn-no:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Background Gradient System */
body {
    background: linear-gradient(135deg, var(--soft-white) 0%, var(--pale-blue) 100%);
    transition: background 2s cubic-bezier(0.4, 0, 0.2, 1);
}

.container-19-active {
    background: linear-gradient(135deg, #f5f0f0 0%, #f0eaea 50%, #ede8e8 100%) !important;
}

/* Classified section atmosphere */
.classified-active {
    background: linear-gradient(135deg, #f0eef5 0%, #ece8f4 50%, #e8e4f0 100%) !important;
}

/* Classified Badge */
.classified-badge {
    background: linear-gradient(135deg, #7c4dff, #536dfe);
    color: white;
    padding: 4px 16px;
    border-radius: 20px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    animation: classifiedPulse 3s ease-in-out infinite;
}

@keyframes classifiedPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(124, 77, 255, 0); }
    50% { box-shadow: 0 0 12px 2px rgba(124, 77, 255, 0.15); }
}

/* Classified Section Content Styles */
#classified .classified-intro {
    padding: var(--space-md);
    background: linear-gradient(135deg, rgba(124, 77, 255, 0.04), rgba(83, 109, 254, 0.03));
    border-left: 3px solid rgba(124, 77, 255, 0.3);
    border-radius: 0 8px 8px 0;
    margin-bottom: var(--space-md);
}

#classified .full-tech-section {
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    background: rgba(124, 77, 255, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(124, 77, 255, 0.06);
}

#classified .full-tech-section h4 {
    font-family: var(--font-mono);
    font-size: 1rem;
    letter-spacing: 0.02em;
    color: #5c3d99;
    margin-bottom: var(--space-sm);
}

#classified .legal-ruling,
#classified .legal-timebomb,
#classified .legal-engineering,
#classified .rule-science,
#classified .rule-cap,
#classified .rule-breadcrumb,
#classified .rule-malfunction,
#classified .multiverse-premise,
#classified .multiverse-macguffin,
#classified .multiverse-collision,
#classified .shadow-subsidiary,
#classified .shadow-bootstrap,
#classified .shadow-pipeline,
#classified .shadow-whistleblower {
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    background: rgba(124, 77, 255, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(124, 77, 255, 0.06);
}

#classified .legal-timebomb,
#classified .rule-malfunction,
#classified .multiverse-collision,
#classified .shadow-pipeline,
#classified .shadow-whistleblower {
    border-left: 3px solid rgba(229, 115, 115, 0.4);
    background: rgba(229, 115, 115, 0.03);
}

#classified .multiverse-macguffin {
    border-left: 3px solid rgba(255, 183, 77, 0.5);
    background: rgba(255, 183, 77, 0.03);
}

#classified h4 {
    font-family: var(--font-mono);
    font-size: 1rem;
    letter-spacing: 0.02em;
    color: #5c3d99;
    margin-bottom: var(--space-sm);
}

/* Redacted Document Styles */
.redacted-document {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: var(--space-lg);
}

.redacted-header {
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
    padding: var(--space-md) var(--space-lg);
    border-bottom: 2px solid rgba(229, 115, 115, 0.3);
}

.redacted-classification {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--danger-red);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: var(--space-xs);
}

.redacted-note {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
}

.redacted-note a.classified-link {
    color: #b388ff;
    text-decoration: none;
    border-bottom: 1px dashed rgba(179, 136, 255, 0.4);
    transition: all 0.2s ease;
}

.redacted-note a.classified-link:hover {
    color: #d1c4ff;
    border-bottom-color: rgba(179, 136, 255, 0.8);
}

.redacted-section {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    background: var(--soft-white);
}

.redacted-section:last-child {
    border-bottom: none;
}

.redacted-section h4 {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-dark);
    letter-spacing: 0.02em;
    margin-bottom: var(--space-xs);
}

span.redacted {
    background: #1a1a1a;
    color: #1a1a1a;
    border-radius: 2px;
    padding: 0 2px;
    letter-spacing: -0.02em;
    user-select: none;
    cursor: not-allowed;
    transition: all 0.3s ease;
}

span.redacted:hover {
    background: #2a2a2a;
    color: #2a2a2a;
    box-shadow: 0 0 4px rgba(229, 115, 115, 0.2);
}

.redacted-footer {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px dashed rgba(0, 0, 0, 0.1);
}

.corporate-fine-print {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-light);
    font-style: italic;
    margin-top: var(--space-sm);
}

/* Spinoff Grid (continued) */
.spinoff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-md);
}

.spinoff-item {
    padding: var(--space-md);
    background: rgba(124, 77, 255, 0.03);
    border: 1px solid rgba(124, 77, 255, 0.08);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.spinoff-item:hover {
    border-color: rgba(124, 77, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 77, 255, 0.08);
}

.spinoff-item h4 {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: #5c3d99;
    margin-bottom: var(--space-xs);
}

/* ================================================
   FORK DECISION — VISCERAL FEEDBACK
   ================================================ */

@keyframes forkFlashYes {
    0% { opacity: 1; background: rgba(0, 137, 123, 0.2); }
    40% { opacity: 1; background: rgba(255, 255, 255, 0.3); }
    100% { opacity: 0; }
}

@keyframes scanDown {
    0% { top: 0; opacity: 1; }
    100% { top: 100vh; opacity: 0; }
}

@keyframes staticBurst {
    0% { opacity: 0.8; }
    25% { opacity: 0.4; background-position: 0 1px; }
    50% { opacity: 0.6; background-position: 0 -1px; }
    75% { opacity: 0.3; background-position: 0 2px; }
    100% { opacity: 0; }
}

.fork-shake {
    animation: shakeDecision 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shakeDecision {
    0%, 100% { transform: translateX(0); }
    10% { transform: translateX(-4px) rotate(-0.3deg); }
    20% { transform: translateX(4px) rotate(0.3deg); }
    30% { transform: translateX(-3px) rotate(-0.2deg); }
    40% { transform: translateX(3px) rotate(0.2deg); }
    50% { transform: translateX(-2px); }
    60% { transform: translateX(2px); }
    70% { transform: translateX(-1px); }
    80% { transform: translateX(1px); }
}

/* Post-decision color states */
.fork-yes-state {
    background: linear-gradient(135deg, #eef6f5 0%, #e8f4f2 50%, #f0f8f7 100%) !important;
}

.fork-no-state {
    background: linear-gradient(135deg, #f2f0f0 0%, #eceaea 50%, #e8e6e6 100%) !important;
}

/* Main Content */
.content-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-lg);
    /* Removed margin-right since TOC is hidden */
    transition: all 0.3s ease;
    padding-top: 100px; /* Account for fixed nav - reduced from 120px */
}

.nav-container.collapsed ~ .content-container,
body:has(.nav-container.collapsed) .content-container {
    padding-top: var(--space-md);
}

.content-section {
    display: none;
    animation: fadeIn 0.6s ease-in-out;
}

.content-section.active {
    display: block;
}

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

/* Section Headers */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-md);
    border-bottom: 2px solid var(--soft-gray);
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--text-dark);
}

/* Badges */
.new-life-badge,
.tech-badge,
.facility-badge,
.format-badge,
.mystery-badge,
.bible-badge,
.reference-badge {
    padding: var(--space-xs) var(--space-md);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.new-life-badge {
    background: var(--corporate-teal);
    color: white;
}

.tech-badge {
    background: var(--scanner-blue);
    color: white;
}

.facility-badge {
    background: var(--pod-amber);
    color: var(--text-dark);
}

.format-badge {
    background: var(--growth-green);
    color: white;
}

.mystery-badge {
    background: var(--danger-red);
    color: white;
}

.bible-badge {
    background: var(--warm-gray);
    color: white;
}

.reference-badge {
    background: var(--text-dark);
    color: white;
}

/* Quick Access Cards */
.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.quick-card {
    background: var(--primary-white);
    padding: var(--space-lg);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.quick-card:hover {
    transform: translateY(-4px);
    border-color: var(--scanner-blue);
    box-shadow: 0 8px 24px rgba(33, 150, 243, 0.2);
}

.quick-card h3 {
    font-size: 1.2rem;
    color: var(--corporate-teal);
    margin-bottom: var(--space-sm);
}

.quick-card p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Expandable Content */
.expandable-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.content-block {
    background: var(--primary-white);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    transition: all 0.3s ease;
}

.block-header {
    padding: var(--space-lg);
    background: var(--pale-blue);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.block-header:hover {
    background: var(--clinical-blue);
}

.block-header h3 {
    font-size: 1.4rem;
    color: var(--text-dark);
    margin: 0;
}

.expand-icon {
    font-size: 1.2rem;
    color: var(--corporate-teal);
    transition: transform 0.3s ease;
}

.block-header[data-expanded="true"] .expand-icon {
    transform: rotate(180deg);
}

.block-content {
    padding: 0 var(--space-lg);
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.block-content.expanded {
    padding: var(--space-lg);
    max-height: none;
}

/* Logline */
.logline {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text-dark);
    background: var(--soft-white);
    padding: var(--space-xl);
    border-radius: 12px;
    border-left: 4px solid var(--scanner-blue);
    box-shadow: var(--shadow-soft);
    font-weight: 300;
}

/* Detail Cards Grid */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.detail-card {
    background: var(--soft-white);
    padding: var(--space-lg);
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s ease;
}

.detail-card:hover {
    transform: translateY(-4px);
}

.detail-card h4 {
    font-size: 1.2rem;
    color: var(--corporate-teal);
    margin-bottom: var(--space-sm);
    font-weight: 500;
}

.detail-card p {
    color: var(--text-light);
    line-height: 1.6;
}

/* Corporate Message */
.corporate-message {
    background: linear-gradient(135deg, var(--amber-glow) 0%, var(--clinical-blue) 100%);
    padding: var(--space-xl);
    border-radius: 16px;
    margin-top: var(--space-xl);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.corporate-logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--corporate-teal);
}

.corporate-tagline {
    font-style: italic;
    color: var(--text-light);
    font-family: var(--font-mono);
}

/* Technology Section */
.tech-intro {
    background: var(--soft-white);
    padding: var(--space-lg);
    border-radius: 12px;
    margin-bottom: var(--space-xl);
}

.fork-process {
    margin-bottom: var(--space-xl);
}

.fork-process h4 {
    font-size: 1.8rem;
    color: var(--text-dark);
    margin-bottom: var(--space-md);
    text-align: center;
}

.phase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
    margin-top: var(--space-xl);
}

.phase-card {
    background: var(--primary-white);
    padding: var(--space-xl);
    border-radius: 16px;
    box-shadow: var(--shadow-pod);
    position: relative;
    transition: all 0.3s ease;
}

.phase-card.detailed {
    grid-column: span 2;
}

.phase-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 32px rgba(255, 183, 77, 0.4);
}

.phase-number {
    position: absolute;
    top: -15px;
    right: var(--space-md);
    background: var(--pod-amber);
    color: var(--text-dark);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.3rem;
}

.phase-card h4 {
    font-size: 1.4rem;
    color: var(--corporate-teal);
    margin-bottom: var(--space-md);
    margin-top: var(--space-sm);
}

.phase-card p {
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: var(--space-md);
}

.phase-description {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.fork-prompt {
    background: var(--text-dark);
    color: var(--primary-white);
    padding: var(--space-md) var(--space-lg);
    border-radius: 8px;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: 600;
    margin: var(--space-lg) 0;
    box-shadow: var(--shadow-soft);
}

.content-sub-block {
    background: var(--pale-blue);
    padding: var(--space-lg);
    border-radius: 12px;
    margin-top: var(--space-lg);
}

.content-sub-block h5 {
    color: var(--corporate-teal);
    font-size: 1.1rem;
    margin-bottom: var(--space-sm);
}

/* Theme List */
.theme-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

.theme-item {
    background: var(--soft-white);
    padding: var(--space-md) var(--space-lg);
    border-radius: 8px;
    border-left: 4px solid var(--scanner-blue);
    color: var(--text-dark);
    font-style: italic;
    transition: all 0.3s ease;
}

.theme-item:hover {
    background: var(--clinical-blue);
    border-left-color: var(--corporate-teal);
}

/* Memory Manifest */
.manifest-description {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--corporate-teal);
    margin-bottom: var(--space-lg);
    font-style: italic;
}

.manifest-types {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.manifest-type {
    background: var(--soft-white);
    padding: var(--space-lg);
    border-radius: 12px;
    border-left: 4px solid var(--pod-amber);
}

.manifest-type h5 {
    color: var(--corporate-teal);
    font-size: 1.2rem;
    margin-bottom: var(--space-sm);
}

.manifest-type p {
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: var(--space-sm);
}

.manifest-type:last-child {
    border-left-color: var(--danger-red);
}

/* Watermark Section */
.watermark-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--space-xl);
}

.watermark-card {
    background: var(--primary-white);
    padding: var(--space-xl);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
}

.watermark-card.detailed {
    padding: var(--space-xxl);
}

.watermark-card:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.iris-icon,
.signal-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto var(--space-md) auto;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.iris-icon.large,
.signal-icon.large {
    width: 80px;
    height: 80px;
    margin-bottom: var(--space-lg);
}

.iris-icon {
    background: linear-gradient(135deg, var(--scanner-blue), var(--clinical-blue));
}

.signal-icon {
    background: linear-gradient(135deg, var(--pod-amber), var(--amber-glow));
}

.iris-icon::before {
    content: '👁';
    font-size: 2rem;
    animation: iris-scan 3s ease-in-out infinite;
}

.signal-icon::before {
    content: '📡';
    font-size: 2rem;
    animation: signal-pulse 2s ease-in-out infinite;
}

@keyframes iris-scan {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; filter: brightness(1.5); }
}

@keyframes signal-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.watermark-card h4 {
    font-size: 1.4rem;
    color: var(--text-dark);
    margin-bottom: var(--space-md);
}

.watermark-description {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.vulnerability-note,
.signal-consequence {
    background: var(--pale-blue);
    padding: var(--space-md);
    border-radius: 8px;
    margin-top: var(--space-md);
}

.vulnerability-note h5,
.signal-consequence h5 {
    color: var(--corporate-teal);
    font-size: 1rem;
    margin-bottom: var(--space-xs);
}

/* Institution Profiles */
.institution-profile {
    background: var(--soft-white);
    padding: var(--space-xl);
    border-radius: 12px;
    margin-bottom: var(--space-lg);
}

.institution-profile.dark {
    background: var(--text-dark);
    color: var(--primary-white);
}

.institution-profile h4 {
    font-size: 1.6rem;
    color: var(--corporate-teal);
    margin-bottom: var(--space-sm);
}

.institution-profile.dark h4 {
    color: var(--danger-red);
}

.institution-tagline {
    font-style: italic;
    color: var(--warm-gray);
    margin-bottom: var(--space-md);
    font-family: var(--font-mono);
}

.franchise-model {
    margin-top: var(--space-lg);
}

.franchise-model h5 {
    color: var(--corporate-teal);
    font-size: 1.2rem;
    margin-bottom: var(--space-sm);
}

.our-location {
    background: var(--pale-blue);
    padding: var(--space-md);
    border-radius: 8px;
    margin-top: var(--space-md);
}

.our-location h6 {
    color: var(--corporate-teal);
    font-size: 1rem;
    margin-bottom: var(--space-xs);
}

/* Character Grid */
.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
}

.character-card {
    background: var(--primary-white);
    padding: var(--space-lg);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    text-align: center;
    transition: all 0.3s ease;
}

.character-card.clickable {
    cursor: pointer;
}

.character-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.character-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto var(--space-md) auto;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center top;
}

.character-avatar.asha {
    background-image: url('dr-asha-kline.jpg');
}

.character-avatar.greer {
    background-image: url('martin-greer.jpg');
}

.character-avatar.liz {
    background-image: url('liz-calder.jpg');
}

.character-avatar.bryn {
    background-image: url('bryn-sato.jpg');
}

.character-avatar.sam {
    background-image: url('sam-37.jpg');
}

.character-avatar.declan {
    background-image: url('declan-trent-iv.jpg');
}

.character-card h4 {
    font-size: 1.2rem;
    color: var(--text-dark);
    margin-bottom: var(--space-xs);
}

.role {
    color: var(--corporate-teal);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.character-card p:last-child {
    color: var(--text-light);
    line-height: 1.6;
    font-size: 0.9rem;
}

.ensemble-description {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: var(--space-xl);
    text-align: center;
    font-style: italic;
}

/* Character Bible Styles */
.bible-intro {
    background: var(--soft-white);
    padding: var(--space-lg);
    border-radius: 12px;
    margin-bottom: var(--space-xl);
    border-left: 4px solid var(--corporate-teal);
    box-shadow: var(--shadow-soft);
}

.bible-intro p {
    color: var(--text-light);
    line-height: 1.7;
    font-size: 1rem;
}

.character-profiles {
    display: flex;
    flex-direction: column;
    gap: var(--space-xxl);
}

.character-profile {
    background: var(--primary-white);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    transition: all 0.3s ease;
}

.character-profile:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.profile-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-lg);
    padding: var(--space-xl);
    background: linear-gradient(135deg, var(--pale-blue) 0%, var(--amber-glow) 100%);
    border-bottom: 1px solid var(--soft-gray);
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center top;
}

.profile-avatar.liz-profile {
    background-image: url('liz-calder.jpg');
}

.profile-avatar.asha-profile {
    background-image: url('dr-asha-kline.jpg');
}

.profile-avatar.greer-profile {
    background-image: url('martin-greer.jpg');
}

.profile-avatar.sam-profile {
    background-image: url('sam-37.jpg');
}

.profile-avatar.declan-profile {
    background-image: url('declan-trent-iv.jpg');
}

.profile-title {
    flex: 1;
}

.profile-title h3 {
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: var(--space-xs);
    font-weight: 400;
}

.profile-role {
    color: var(--corporate-teal);
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.profile-quote {
    font-style: italic;
    color: var(--text-light);
    font-size: 1.1rem;
    line-height: 1.5;
    position: relative;
    padding-left: var(--space-md);
    border-left: 3px solid var(--scanner-blue);
}

.profile-content {
    padding: var(--space-xl);
}

.profile-section {
    margin-bottom: var(--space-xl);
}

.profile-section h4 {
    font-size: 1.3rem;
    color: var(--text-dark);
    margin-bottom: var(--space-md);
    font-weight: 500;
    position: relative;
    padding-left: var(--space-md);
}

.profile-section h4::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: var(--scanner-blue);
    border-radius: 50%;
    opacity: 0.6;
}

.profile-section p {
    color: var(--text-light);
    line-height: 1.7;
    font-size: 0.95rem;
    margin-bottom: var(--space-md);
}

.profile-section.backstory {
    background: var(--soft-white);
    padding: var(--space-lg);
    border-radius: 12px;
}

.backstory-component {
    margin-bottom: var(--space-lg);
}

.backstory-component:last-child {
    margin-bottom: 0;
}

.backstory-component h5 {
    color: var(--corporate-teal);
    font-size: 1.1rem;
    margin-bottom: var(--space-sm);
    font-weight: 600;
}

.dynamic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-md);
}

.dynamic-item {
    background: var(--pale-blue);
    padding: var(--space-md);
    border-radius: 8px;
}

.dynamic-item h5 {
    color: var(--corporate-teal);
    font-size: 1rem;
    margin-bottom: var(--space-xs);
    font-weight: 600;
}

.dynamic-item p {
    margin: 0;
    font-size: 0.9rem;
}

.sample-dialogue {
    background: var(--pale-blue);
    padding: var(--space-lg);
    border-radius: 12px;
    margin-top: var(--space-lg);
}

.sample-dialogue h4 {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: var(--space-md);
    font-weight: 500;
}

.sample-dialogue h4::before {
    display: none;
}

.dialogue-samples {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.dialogue-samples p {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--primary-white);
    padding: var(--space-sm) var(--space-md);
    border-radius: 8px;
    border-left: 3px solid var(--corporate-teal);
    margin: 0;
}

.dialogue-samples p strong {
    color: var(--scanner-blue);
    font-weight: 600;
}

.dialogue-samples p em {
    color: var(--warm-gray);
    font-style: italic;
}

/* Episode Structure */
.structure-detail {
    background: var(--soft-white);
    padding: var(--space-lg);
    border-radius: 12px;
    margin-bottom: var(--space-xl);
}

.structure-detail h4 {
    color: var(--corporate-teal);
    font-size: 1.4rem;
    margin-bottom: var(--space-md);
}

.template-breakdown {
    margin-top: var(--space-xl);
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-lg);
}

.template-item {
    background: var(--pale-blue);
    padding: var(--space-lg);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.template-item:hover {
    background: var(--clinical-blue);
    transform: translateY(-2px);
}

.template-item h5 {
    color: var(--corporate-teal);
    font-size: 1.1rem;
    margin-bottom: var(--space-sm);
    font-weight: 600;
}

.template-item p {
    color: var(--text-light);
    line-height: 1.6;
    margin: 0;
}

/* Season Arc */
.arc-title {
    font-size: 2rem;
    text-align: center;
    color: var(--corporate-teal);
    font-style: italic;
    margin-bottom: var(--space-xl);
}

.arc-engines {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.arc-engine {
    background: var(--soft-white);
    padding: var(--space-xl);
    border-radius: 12px;
    border-left: 4px solid var(--scanner-blue);
}

.arc-engine h4 {
    color: var(--corporate-teal);
    font-size: 1.3rem;
    margin-bottom: var(--space-md);
}

.arc-engine p {
    color: var(--text-light);
    line-height: 1.7;
}

/* Episode List */
.episode-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.episode-card {
    display: flex;
    background: var(--primary-white);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    transition: all 0.3s ease;
}

.episode-card.detailed {
    flex-direction: column;
}

.episode-card:hover {
    transform: translateX(8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.episode-card.pilot {
    border-left: 4px solid var(--corporate-teal);
}

.episode-card.finale {
    border-left: 4px solid var(--danger-red);
}

.episode-number {
    background: var(--pale-blue);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    min-width: 80px;
}

.episode-content {
    padding: var(--space-lg);
    flex: 1;
}

.episode-content h4 {
    font-size: 1.3rem;
    color: var(--text-dark);
    margin-bottom: var(--space-sm);
}

.episode-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.story-thread {
    background: var(--soft-white);
    padding: var(--space-md);
    border-radius: 8px;
}

.story-thread.breadcrumb {
    background: var(--amber-glow);
}

.story-thread.finale-moment {
    background: var(--danger-red);
    color: white;
}

.story-thread h5 {
    color: var(--corporate-teal);
    font-size: 1rem;
    margin-bottom: var(--space-xs);
    font-weight: 600;
}

.story-thread.finale-moment h5 {
    color: white;
}

.story-thread p {
    color: var(--text-light);
    line-height: 1.6;
    margin: 0;
}

.story-thread.finale-moment p {
    color: white;
    opacity: 0.9;
}

/* Pilot Detail */
.pilot-concept {
    background: var(--soft-white);
    padding: var(--space-lg);
    border-radius: 12px;
}

.pilot-concept h4 {
    color: var(--corporate-teal);
    font-size: 1.4rem;
    margin-bottom: var(--space-md);
}

/* Container Section */
.container-story {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--space-xxl);
    align-items: start;
}

.container-story.detailed {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
}

.container-visual {
    position: sticky;
    top: 120px;
}

.container-visual.large {
    position: static;
    text-align: center;
}

.container-box {
    background: var(--text-dark);
    color: var(--primary-white);
    padding: var(--space-xl);
    border-radius: 16px;
    text-align: center;
    position: relative;
    overflow: hidden;
    max-width: 400px;
    margin: 0 auto;
}

.container-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: scanner-sweep 3s ease-in-out infinite;
}

@keyframes scanner-sweep {
    0% { left: -100%; }
    100% { left: 100%; }
}

.container-seal {
    background: var(--danger-red);
    color: white;
    padding: var(--space-xs) var(--space-md);
    border-radius: 20px;
    display: inline-block;
    margin-bottom: var(--space-md);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.1em;
}

.container-id {
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
    letter-spacing: 0.2em;
}

.container-manifest {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    opacity: 0.8;
    line-height: 1.4;
    margin-bottom: var(--space-md);
}

.container-status {
    background: var(--danger-red);
    color: white;
    padding: var(--space-xs) var(--space-md);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.container-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.container-section {
    background: var(--soft-white);
    padding: var(--space-lg);
    border-radius: 12px;
}

.container-section h4 {
    color: var(--corporate-teal);
    font-size: 1.4rem;
    margin-bottom: var(--space-md);
}

.container-section p {
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: var(--space-md);
}

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

.container-section strong {
    color: var(--text-dark);
}

/* Timeline */
.timeline {
    margin-top: var(--space-xl);
}

.timeline.detailed {
    background: var(--soft-white);
    padding: var(--space-lg);
    border-radius: 12px;
}

.timeline h4 {
    color: var(--corporate-teal);
    font-size: 1.4rem;
    margin-bottom: var(--space-md);
    text-align: center;
}

.timeline-detailed {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    margin-top: var(--space-lg);
}

.timeline-item {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    position: relative;
}

.timeline-item.detailed {
    background: var(--pale-blue);
    padding: var(--space-md);
    border-radius: 8px;
    margin-bottom: 0;
}

.timeline-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 10px;
    top: 32px;
    width: 2px;
    height: calc(100% + var(--space-md));
    background: var(--soft-gray);
}

.timeline-item.detailed:not(:last-child)::after {
    display: none;
}

.timeline-marker {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--scanner-blue);
    flex-shrink: 0;
    margin-top: 2px;
    box-shadow: 0 0 0 4px var(--primary-white), 0 0 0 6px var(--soft-gray);
    animation: timeline-pulse 2s ease-in-out infinite;
}

.timeline-marker.episode-1 { background: var(--corporate-teal); }
.timeline-marker.episode-2 { background: var(--scanner-blue); }
.timeline-marker.episode-3 { background: var(--pod-amber); }
.timeline-marker.episode-5 { background: var(--danger-red); }
.timeline-marker.episode-8 { background: var(--growth-green); }
.timeline-marker.episode-9 { background: var(--warm-gray); }
.timeline-marker.episode-10 { background: var(--text-dark); }

@keyframes timeline-pulse {
    0%, 100% { box-shadow: 0 0 0 4px var(--primary-white), 0 0 0 6px var(--soft-gray); }
    50% { box-shadow: 0 0 0 4px var(--primary-white), 0 0 0 10px rgba(33, 150, 243, 0.3); }
}

.timeline-content h5 {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: var(--space-xs);
}

.timeline-content p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.6;
}

/* Future Seasons */
.future-seasons {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.season-preview {
    background: var(--soft-white);
    padding: var(--space-xl);
    border-radius: 12px;
    border-left: 4px solid var(--corporate-teal);
}

.season-preview h4 {
    color: var(--corporate-teal);
    font-size: 1.4rem;
    margin-bottom: var(--space-xs);
}

.season-tagline {
    font-style: italic;
    color: var(--warm-gray);
    margin-bottom: var(--space-md);
    font-family: var(--font-mono);
}

.season-preview p {
    color: var(--text-light);
    line-height: 1.7;
}

/* Likeness Clause */
.clause-text {
    background: var(--soft-white);
    padding: var(--space-lg);
    border-radius: 12px;
    margin: var(--space-lg) 0;
}

.clause-text blockquote {
    background: var(--text-dark);
    color: var(--primary-white);
    padding: var(--space-lg);
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: var(--space-md) 0;
    border-left: 4px solid var(--danger-red);
}

/* Story Seeds */
.story-seeds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--space-xl);
}

.seed-category {
    background: var(--soft-white);
    padding:.25rem;
    border-radius: 3px;
    border-left: 4px solid #fbbf24;
}

.seed-category h4 {
    color: var(--corporate-teal);
    font-size: 1.3rem;
    margin-bottom: var(--space-md);
}

.seed-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.seed-item {
    background: var(--pale-blue);
    padding: var(--space-sm) var(--space-md);
    border-radius: 6px;
    color: var(--text-dark);
    font-size: 0.9rem;
    line-height: 1.5;
    transition: all 0.3s ease;
    cursor: pointer;
}

.seed-item:hover {
    background: var(--clinical-blue);
    transform: translateX(4px);
}

/* Declan's Forks */
.declan-categories {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.declan-category {
    background: var(--soft-white);
    padding: var(--space-lg);
    border-radius: 12px;
}

.declan-category.existential {
    border-left: 4px solid var(--danger-red);
}

.declan-category h4 {
    color: var(--corporate-teal);
    font-size: 1.3rem;
    margin-bottom: var(--space-md);
}

.declan-category.existential h4 {
    color: var(--danger-red);
}

.category-note {
    font-style: italic;
    color: var(--warm-gray);
    margin-bottom: var(--space-md);
    font-size: 0.9rem;
}

.declan-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.declan-item {
    background: var(--pale-blue);
    padding: var(--space-sm) var(--space-md);
    border-radius: 6px;
    color: var(--text-dark);
    font-size: 0.9rem;
    line-height: 1.5;
    transition: all 0.3s ease;
}

.declan-item.devastating {
    background: rgba(229, 115, 115, 0.1);
    border-left: 3px solid var(--danger-red);
}

.declan-item:hover {
    background: var(--clinical-blue);
}

.declan-item.devastating:hover {
    background: rgba(229, 115, 115, 0.2);
}

.declan-problem {
    background: var(--text-dark);
    color: var(--primary-white);
    padding: var(--space-xl);
    border-radius: 12px;
    margin-top: var(--space-xl);
}

.declan-problem h4 {
    color: var(--danger-red);
    font-size: 1.3rem;
    margin-bottom: var(--space-md);
}

.declan-problem p {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.7;
    margin-bottom: var(--space-md);
}

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

.declan-problem strong {
    color: var(--primary-white);
}

/* Search Results */
.search-results {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: var(--space-xxl) var(--space-lg);
    overflow-y: auto;
}

.search-results.active {
    display: flex;
}

.search-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    background: var(--corporate-teal);
    color: white;
}

.search-results-content {
    background: var(--primary-white);
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.close-search {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-search:hover {
    background: rgba(255, 255, 255, 0.2);
}

.search-result-item {
    padding: var(--space-md);
    border-bottom: 1px solid var(--soft-gray);
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-result-item:hover {
    background: var(--pale-blue);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-title {
    font-size: 1.1rem;
    color: var(--corporate-teal);
    margin-bottom: var(--space-xs);
}

.search-result-excerpt {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.5;
}

.search-result-section {
    font-size: 0.8rem;
    color: var(--warm-gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-xs);
}

/* Footer */
.footer {
    background: var(--text-dark);
    color: var(--primary-white);
    padding: var(--space-xxl) var(--space-lg);
    margin-top: var(--space-xxl);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
}

.footer-navigation {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.footer-section h4 {
    color: var(--corporate-teal);
    margin-bottom: var(--space-md);
    font-size: 1.1rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section li {
    margin-bottom: var(--space-xs);
}

.footer-section a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.9rem;
}

.footer-section a:hover {
    color: var(--primary-white);
}

.disclaimer {
    text-align: center;
    margin-bottom: var(--space-xl);
    padding: var(--space-lg);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.disclaimer p {
    font-family: var(--font-mono);
    opacity: 0.8;
    margin-bottom: var(--space-xs);
}

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

.business-docs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.doc-section {
    background: rgba(255, 255, 255, 0.05);
    padding: var(--space-lg);
    border-radius: 12px;
    border-left: 4px solid var(--danger-red);
}

.doc-section h4 {
    color: var(--danger-red);
    margin-bottom: var(--space-sm);
    font-size: 1rem;
    font-family: var(--font-mono);
}

.doc-section p {
    opacity: 0.9;
    line-height: 1.6;
    font-size: 0.85rem;
    font-style: italic;
}

.copyright-info {
    text-align: center;
    padding: var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: var(--space-lg);
}

.copyright-info p {
    margin-bottom: var(--space-xs);
    opacity: 0.8;
}

.copyright-info .version-text {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    opacity: 0.6;
}

/* Responsive Design */
/* ================================================
   CONTAINER 19 — RESTRICTED ACCESS TREATMENT
   When you're in C-19, the UI shifts. Tighter.
   Darker. Monospace. You shouldn't be here.
   ================================================ */

#container .section-header {
    border-bottom-color: var(--danger-red);
}

#container .section-header h2 {
    font-family: var(--font-mono);
    letter-spacing: 0.08em;
    font-weight: 400;
}

#container .mystery-badge {
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

#container .block-header {
    background: #f8f4f4;
    border-left: 3px solid var(--danger-red);
}

#container .block-header:hover {
    background: #f4eeee;
}

#container .content-block {
    border: 1px solid rgba(229, 115, 115, 0.1);
}

#container .container-section h4 {
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.95rem;
    color: var(--danger-red);
}

/* ================================================
   PERSONNEL — EMPLOYEE BADGE TREATMENT
   Character avatars styled as NLI employee badges
   ================================================ */

.profile-header {
    border-bottom: 1px solid var(--soft-gray);
    position: relative;
}

.profile-header::before {
    content: 'NEW LIFE INC.';
    position: absolute;
    top: var(--space-sm);
    right: var(--space-lg);
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    color: var(--corporate-teal);
    opacity: 0.5;
}

.profile-avatar {
    border-radius: 8px;
    border: 2px solid var(--soft-gray);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    background-size: cover;
    background-position: center top;
}

.profile-role {
    font-family: var(--font-mono);
    letter-spacing: 0.05em;
}

/* ================================================
   FOOTER — CORPORATE DOCUMENT TREATMENT
   ================================================ */

footer {
    border-top: 2px solid var(--corporate-teal);
}

/* Make footer links touch-friendly on mobile */
footer a {
    display: inline-block;
    padding: 0.25rem 0;
    -webkit-tap-highlight-color: transparent;
}

@media (max-width: 768px) {
    footer a {
        padding: 0.5rem 0;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

.back-to-hub {
    display: block;
    text-align: center;
    padding: var(--space-md) 0;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--warm-gray);
    letter-spacing: 0.05em;
    transition: color 0.3s;
}

.back-to-hub:hover {
    color: var(--corporate-teal);
}

@media (max-width: 1200px) {
    .content-container {
        padding-right: var(--space-lg);
        margin-right: 0 !important; /* Override any inline styles */
    }

    .toc-sidebar {
        transform: translateY(-50%) translateX(100%);
    }

    .toc-sidebar.visible {
        transform: translateY(-50%) translateX(0);
    }
}

@media (max-width: 768px) {
    /* Nav — slim bar: hamburger left, section right */
    .nav-container {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        overflow: visible; /* Allow dropdown to show */
    }

    .nav-header {
        position: relative;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0;
        padding: var(--space-xs) var(--space-sm);
        min-height: 60px;
        height: 60px;
        overflow: visible;
    }

    .nav-toggle {
        display: flex;
        order: -1;
        z-index: 1002;
        position: relative;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        user-select: none;
        -webkit-user-select: none;
    }

    .nav-toggle:active {
        background: #00796b;
        transform: scale(0.95);
    }

    /* Display breadcrumb inline with hamburger on mobile */
    .breadcrumb {
        display: block !important;
        position: absolute;
        right: var(--space-sm);
        top: 50%;
        transform: translateY(-50%);
        padding: 0;
        font-size: 0.75rem;
        margin: 0;
        border: none;
        max-width: none;
        pointer-events: none; /* Don't interfere with clicks */
        line-height: 1;
    }

    .nav-tabs {
        display: none;
        flex-direction: column;
        gap: 2px;
        padding: var(--space-xs) var(--space-sm);
        width: 100%;
        position: absolute;
        top: 60px; /* Below the nav-header */
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        border-top: 1px solid var(--soft-gray);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .nav-tabs.mobile-visible {
        display: flex;
    }

    .nav-tab {
        font-size: 0.85rem;
        padding: 0.6rem 1rem;
        text-align: left;
        border-radius: 8px;
        width: 100%;
    }

    .search-container {
        width: 100%;
        display: none;
        order: 3;
    }

    .search-input {
        width: 100%;
    }

    /* When nav is expanded, wrap to column */
    /* Removed :has selector for better compatibility
    .nav-header:has(.nav-tabs.mobile-visible) {
        flex-wrap: wrap;
    } */

    /* Hide floating buttons on mobile */
    .floating-nav-toggle {
        display: none !important;
    }

    .floating-toc-toggle {
        top: auto;
        bottom: var(--space-md);
        right: var(--space-md);
        width: 44px;
        height: 44px;
        font-size: 16px;
        z-index: 1002;
    }

    /* Content — kill TOC margin, tight padding */
    .content-container {
        padding: var(--space-xs) var(--space-xs) !important;
        margin-right: 0 !important;
        padding-top: 70px !important;
    }

    /* Hero — compact, don't let nav cover it */
    .hero {
        min-height: 40vh;
        padding: var(--space-xl) var(--space-sm) var(--space-md);
        margin-top: 44px;
    }

    .main-title {
        font-size: 2.2rem;
        letter-spacing: 0.25em;
    }

    .corporate-header-logo {
        flex-direction: column;
        gap: 0.3rem;
    }

    .nli-divider { display: none; }
    .tagline { font-size: 0.9rem; }
    .subtitle { font-size: 0.65rem; }
    .hero-clearance { font-size: 0.6rem; }

    /* Section headers */
    .section-header {
        flex-direction: column;
        gap: var(--space-sm);
        text-align: center;
        margin-bottom: var(--space-md);
        padding-bottom: var(--space-sm);
    }

    .section-header h2 {
        font-size: 1.6rem;
    }

    /* ===== NESTED CARD FLATTENING ===== */
    /* Strip excessive padding from all nested containers */
    .block-header {
        padding: var(--space-sm) var(--space-md);
    }

    .block-header h3 {
        font-size: 1.05rem;
    }

    .block-content.expanded {
        padding: var(--space-sm);
    }

    /* Inner cards lose their own padding/margin when nested */
    .block-content .detail-card,
    .block-content .tech-intro,
    .block-content .content-sub-block,
    .block-content .vulnerability-note,
    .block-content .signal-consequence,
    .block-content .our-location,
    .block-content .clause-text,
    .block-content .institution-profile,
    .block-content .watermark-card,
    .block-content .corporate-message {
        padding: var(--space-sm);
        margin: var(--space-sm) 0;
        border-radius: 8px;
    }

    /* Story threads inside episode cards */
    .episode-details {
        padding: 0;
    }

    .story-thread {
        padding: var(--space-sm);
        margin-bottom: var(--space-xs);
        border-radius: 6px;
    }

    /* Phase cards inside expanded blocks */
    .phase-card, .phase-card.detailed {
        grid-column: span 1;
        padding: var(--space-sm);
    }

    .phase-number {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
        top: -8px;
        right: var(--space-xs);
    }

    .phase-card h4 {
        font-size: 1.1rem;
    }

    .quick-access-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xs);
    }

    .quick-card {
        padding: var(--space-sm);
    }

    .detail-card {
        padding: var(--space-sm);
    }

    .details-grid {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }

    .logline {
        padding: var(--space-sm);
        font-size: 1rem;
    }

    .phase-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    /* Fork dialog */
    .fork-dialog-container {
        margin: var(--space-sm) 0;
    }

    .fork-dialog {
        padding: var(--space-md) var(--space-sm);
        margin: 0;
    }

    .fork-dialog h4 {
        font-size: 1.3rem;
        letter-spacing: 4px;
    }

    .fork-dialog-actions {
        gap: var(--space-sm);
    }

    .fork-btn {
        min-width: 90px;
        padding: var(--space-sm) var(--space-md);
        font-size: 0.9rem;
    }

    /* Character profiles */
    .character-grid {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }

    .character-card {
        padding: var(--space-sm);
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: var(--space-sm);
        padding: var(--space-sm);
    }

    .profile-header::before {
        position: static;
        display: block;
        text-align: right;
        margin-bottom: var(--space-xs);
    }

    .profile-content {
        padding: var(--space-sm);
    }

    .sample-dialogue {
        padding: var(--space-xs);
    }

    .dialogue-line {
        padding: var(--space-xs);
        font-size: 0.85rem;
    }

    /* Character bible sections */
    .bible-intro {
        padding: var(--space-sm);
    }

    .character-profile {
        border-radius: 10px;
    }

    /* Episodes */
    .episode-card {
        flex-direction: column;
    }

    .episode-number {
        min-width: auto;
        padding: var(--space-xs) var(--space-sm);
    }

    .episode-content {
        padding: var(--space-sm);
    }

    /* Container 19 */
    .container-story {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .container-visual {
        position: static;
    }

    .container-box {
        max-width: 100%;
        padding: var(--space-md);
    }

    .container-section h4 {
        font-size: 1rem !important;
    }

    /* Seeds */
    .story-seeds-grid {
        grid-template-columns: 1fr;
    }

    .seeds-grid {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }

    .seed-card {
        padding: var(--space-sm);
    }

    .seed-header {
        flex-direction: row;
        align-items: flex-start;
        gap: var(--space-xs);
    }

    .seed-preview p {
        font-size: 0.85rem;
    }

    /* Watermarks */
    .watermark-grid {
        grid-template-columns: 1fr;
    }

    .watermark-card {
        padding: var(--space-sm);
    }

    /* Institution profiles */
    .institution-profile {
        padding: var(--space-sm);
    }

    .franchise-model {
        margin-top: var(--space-sm);
    }

    /* Dark blocks */
    .fork-prompt {
        padding: var(--space-xs) var(--space-sm);
        font-size: 0.9rem;
    }

    .clause-text {
        padding: var(--space-sm);
    }

    .clause-text blockquote {
        padding: var(--space-sm);
        font-size: 0.78rem;
    }

    .content-sub-block {
        padding: var(--space-sm);
    }

    .content-block {
        border-radius: 10px;
    }

    /* Clinical outcomes — tighter on mobile */
    .clinical-outcomes {
        padding: var(--space-sm);
    }

    .outcome-case {
        padding: var(--space-sm);
    }

    /* Breadcrumb */
    .breadcrumb {
        padding: var(--space-xs) var(--space-sm);
        font-size: 0.75rem;
    }

    /* TOC — full overlay on mobile */
    .toc-sidebar {
        width: 85vw;
        max-width: 320px;
    }

    /* Footer */
    .footer-navigation {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .doc-section {
        padding: var(--space-sm);
    }

    .corporate-message {
        padding: var(--space-sm);
    }

    .tech-intro {
        padding: var(--space-sm);
    }

    /* Declan categories */
    .declan-categories {
        gap: var(--space-sm);
    }

    .declan-category {
        padding: var(--space-sm);
    }

    /* Search results — full-screen on mobile */
    .search-results {
        padding: var(--space-sm);
        align-items: flex-start;
    }

    .search-results-content {
        max-width: 100%;
        max-height: 90vh;
        border-radius: 12px;
    }

    .search-results-header {
        padding: var(--space-sm) var(--space-md);
    }

    .search-result-item {
        padding: var(--space-sm);
    }

    .search-result-title {
        font-size: 1rem;
    }

    .search-result-excerpt {
        font-size: 0.82rem;
        line-height: 1.4;
    }

    /* Seed card inner white cards — reduce padding */
    .seed-header .client-id,
    .seed-header .seed-category {
        font-size: 0.7rem;
    }
}

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

/* Focus states */
.nav-tab:focus-visible,
.search-input:focus-visible,
.search-btn:focus-visible,
button:focus-visible {
    outline: 2px solid var(--scanner-blue);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .nav-container,
    .toc-sidebar,
    .footer,
    .search-results {
        display: none !important;
    }

    .content-section {
        display: block !important;
        page-break-after: always;
    }

    .content-section:last-child {
        page-break-after: auto;
    }

    .content-container {
        padding-right: var(--space-lg);
        max-width: none;
    }

    .block-content {
        max-height: none;
        padding: var(--space-lg);
    }

    .expand-icon {
        display: none;
    }
}

/* ============================================ */
/* NEW COMPONENT STYLES FOR INTEGRATED CONTENT */
/* ============================================ */

/* Clinical Outcomes & Failure Modes */
.clinical-outcomes {
    background: linear-gradient(135deg, #fff5f5, #fef5e7);
    border: 1px solid #fed7d7;
    border-radius: 12px;
    padding: var(--space-lg);
    margin: var(--space-lg) 0;
}

.clinical-outcomes h4 {
    color: #c53030;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.clinical-outcomes h4::before {
    content: "⚠️";
    font-size: 1.2rem;
}

.outcome-grid {
    display: grid;
    gap: var(--space-md);
}

.outcome-case {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #f56565;
    border-radius: 8px;
    padding: var(--space-md);
    transition: all 0.3s ease;
}

.outcome-case:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 101, 101, 0.15);
}

.case-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.case-header h5 {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    color: #c53030;
    font-size: 1rem;
    margin: 0;
}

.diagnostic-icon {
    font-size: 1.1rem;
}

.case-frequency {
    font-size: 0.8rem;
    color: #e53e3e;
    font-weight: 600;
    background: rgba(229, 62, 62, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: var(--font-mono);
}

.case-content p {
    margin-bottom: var(--space-sm);
    line-height: 1.6;
}

.phantom-revelation {
    text-align: center;
    font-size: 1.1rem;
    color: #c53030;
    margin: var(--space-md) 0;
    padding: var(--space-sm);
    background: rgba(197, 48, 48, 0.05);
    border-radius: 6px;
}

/* Enhanced Episode Cards */
.cold-open-note {
    background: linear-gradient(135deg, #e8f5e8, #f0f8ff);
    border: 1px solid #81c784;
    border-radius: 6px;
    padding: var(--space-sm);
    margin-bottom: var(--space-md);
    font-size: 0.9rem;
}

.episode-card.climax {
    border: 2px solid #ff6b35;
    background: linear-gradient(135deg, #fff5f0, #fef2f2);
}

.episode-card.finale {
    border: 2px solid #8b5cf6;
    background: linear-gradient(135deg, #faf5ff, #f3e8ff);
}

.story-thread.breadcrumb.critical {
    border-left: 4px solid #ff6b35;
    background: rgba(255, 107, 53, 0.05);
}

.story-thread.breadcrumb.finale-moment {
    border-left: 4px solid #8b5cf6;
    background: rgba(139, 92, 246, 0.12);
    color: var(--text-dark);
}

.story-thread.breadcrumb.finale-moment h5 {
    color: #7c3aed;
}

.story-thread.breadcrumb.finale-moment p {
    color: var(--text-dark);
    opacity: 1;
}

/* Pilot Episode Styles */
.pilot-objectives ul {
    list-style: none;
    padding: 0;
}

.pilot-objectives li {
    padding: var(--space-xs) 0;
    padding-left: var(--space-md);
    position: relative;
}

.pilot-objectives li::before {
    content: "🎬";
    position: absolute;
    left: 0;
    top: var(--space-xs);
}

.beat-sheet {
    margin-top: var(--space-lg);
}

.pilot-day {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid #e0e7ff;
    border-radius: 8px;
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    border-left: 4px solid var(--scanner-blue);
}

.pilot-day h5 {
    color: var(--scanner-blue);
    margin-bottom: var(--space-sm);
    font-size: 1.1rem;
}

.narrative-note,
.breadcrumb-note {
    background: linear-gradient(135deg, #fff7ed, #fef3c7);
    border: 1px solid #fbbf24;
    border-radius: 6px;
    padding: var(--space-sm);
    margin: var(--space-sm) 0;
    font-style: italic;
    color: #92400e;
}

.fork-moment-display {
    background: #000;
    color: #fff;
    text-align: center;
    padding: var(--space-md);
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 1.2rem;
    margin: var(--space-md) 0;
    letter-spacing: 0.1em;
}

.dialogue-block {
    background: rgba(0, 0, 0, 0.02);
    border-left: 4px solid #666;
    padding: var(--space-md);
    margin: var(--space-md) 0;
    font-family: var(--font-mono);
    line-height: 1.8;
}

.dialogue-block p {
    margin: 0;
    padding: 0.2rem 0;
}

/* Story Seeds Collection */
.story-seeds-collection {
    margin-top: var(--space-lg);
}

.seeds-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.seed-filter {
    padding: var(--space-xs) var(--space-sm);
    border: 1px solid #ddd;
    background: white;
    color: var(--text-dark);
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.seed-filter:hover {
    background: var(--pale-blue);
    border-color: var(--scanner-blue);
}

.seed-filter.active {
    background: var(--scanner-blue);
    color: white;
    border-color: var(--scanner-blue);
}

.seeds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-md);
}

.seed-card {
    background: linear-gradient(135deg, #1e2a2a, #1a2626);
    border: 1px solid #c9943d;
    border-radius: 8px;
    padding: var(--space-md);
    transition: all 0.3s ease;
    cursor: pointer;
}

.seed-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(201, 148, 61, 0.25);
}

.seed-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-sm);
    gap: var(--space-sm);
}

.client-id {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #fbbf24;
    font-weight: 600;
    background: none;
    padding: 0;
    border-radius: 0;
    letter-spacing: 0.03em;
}

.seed-category {
    font-size: 0.7rem;
    color: #fbbf24;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: right;
    opacity: 0.8;
}

.seed-preview p {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #d4cfc7;
    margin: 0;
}

.seed-expand {
    margin-top: var(--space-sm);
    font-size: 0.8rem;
    color: var(--corporate-teal);
    cursor: pointer;
}

/* Declan's Forks Styles */
.declans-intro {
    margin-bottom: var(--space-lg);
}

.character-note {
    background: linear-gradient(135deg, #f0f9ff, #ecfdf5);
    border: 1px solid #93c5fd;
    border-radius: 8px;
    padding: var(--space-md);
    margin: var(--space-md) 0;
    border-left: 4px solid var(--scanner-blue);
}

.declan-categories {
    display: grid;
    gap: var(--space-lg);
}

.declan-category {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: var(--space-md);
}

.declan-category h4 {
    color: var(--corporate-teal);
    margin-bottom: var(--space-md);
    font-size: 1.1rem;
}

.declan-category.existential {
    background: linear-gradient(135deg, #fef2f2, #fff7ed);
    border-color: #fca5a5;
}

.declan-category.existential h4 {
    color: #dc2626;
}

.declan-category.existential .declan-item {
    background: rgba(255, 255, 255, 0.7);
    border-color: #fca5a5;
    color: #7f1d1d;
}

.declan-category.existential .declan-item:hover {
    background: rgba(255, 255, 255, 0.9);
}

.declan-category.existential .declan-item.heavy {
    background: rgba(220, 38, 38, 0.08);
    border-color: #f87171;
    color: #6b1a1a;
}

.category-note {
    background: rgba(220, 38, 38, 0.05);
    padding: var(--space-sm);
    border-radius: 6px;
    margin-bottom: var(--space-md);
    font-size: 0.9rem;
    color: var(--text-dark);
}

.declan-list {
    display: grid;
    gap: var(--space-xs);
}

.declan-item {
    background: linear-gradient(135deg, #f0fff4, #f7fafc);
    border: 1px solid #68d391;
    border-radius: 6px;
    padding: var(--space-sm);
    font-size: 0.9rem;
    color: #1a4731;
    line-height: 1.4;
    transition: all 0.2s ease;
}

.declan-item:hover {
    background: linear-gradient(135deg, #ecfdf5, #f0f9ff);
    transform: translateX(2px);
}

.declan-item.heavy {
    background: linear-gradient(135deg, #fef2f2, #fff7ed);
    border-color: #f87171;
    color: #6b1a1a;
    font-weight: 500;
}

.declan-revelation {
    background: linear-gradient(135deg, #1e293b, #334155);
    color: white;
    padding: var(--space-lg);
    border-radius: 12px;
    margin-top: var(--space-lg);
    border: 1px solid #475569;
}

.declan-revelation h4 {
    color: #fbbf24;
    margin-bottom: var(--space-md);
}

.declan-revelation p {
    line-height: 1.6;
    margin-bottom: var(--space-md);
}

/* Responsive Design for New Components */
@media (max-width: 768px) {
    .seeds-filters {
        justify-content: center;
    }

    .seed-filter {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    .seeds-grid {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }

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

    .case-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-xs);
    }

    .clinical-outcomes {
        padding: var(--space-md);
        margin: var(--space-md) 0;
    }

    .declan-categories {
        gap: var(--space-md);
    }

    .pilot-day {
        padding: var(--space-sm);
    }

    .fork-moment-display {
        font-size: 1rem;
        padding: var(--space-sm);
    }
}

/* Dark mode disabled - site uses light theme only */