/* ═══════════════════════════════════════════════════════════════════════════
   ADAGE OF ULTRON - Cypherpunk Theme
   Minimalist dark aesthetic with subtle terminal effects
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────────────
   CSS Variables
   ───────────────────────────────────────────────────────────────────────────── */
:root {
    /* Core colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #0f0f16;
    --bg-surface: #12121a;
    --bg-elevated: #1a1a24;

    /* Border colors */
    --border-dim: #1a1a2a;
    --border-default: #2a2a3a;
    --border-bright: #3a3a4a;

    /* Text colors */
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --text-muted: #666;
    --text-dim: #444;

    /* Accent colors */
    --accent-red: #ff4444;
    --accent-red-dim: #aa2222;
    --accent-red-glow: rgba(255, 68, 68, 0.3);
    --accent-orange: #cc8800;
    --accent-orange-dim: #996600;
    --accent-green: #44aa44;
    --accent-green-dim: #227722;

    /* Strength indicators */
    --strength-strong: #ff4444;
    --strength-considerable: #cc8800;
    --strength-weak: #666;

    /* Typography */
    --font-mono: 'SF Mono', 'Consolas', 'Liberation Mono', 'Menlo', monospace;
    --font-size-xs: 0.7rem;
    --font-size-sm: 0.8rem;
    --font-size-base: 0.9rem;
    --font-size-lg: 1.1rem;
    --font-size-xl: 1.3rem;
    --font-size-2xl: 1.8rem;
    --font-size-3xl: 2.2rem;

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

    /* Layout */
    --max-width: 900px;
    --max-width-wide: 1100px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Reset & Base
   ───────────────────────────────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-mono);
    font-size: var(--font-size-base);
    line-height: 1.6;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Scan Lines Overlay (subtle)
   ───────────────────────────────────────────────────────────────────────────── */
.scanlines {
    position: relative;
}

.scanlines::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
    pointer-events: none;
    z-index: 9999;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Layout
   ───────────────────────────────────────────────────────────────────────────── */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-xl);
}

.container-wide {
    max-width: var(--max-width-wide);
}

/* ─────────────────────────────────────────────────────────────────────────────
   Typography
   ───────────────────────────────────────────────────────────────────────────── */
h1, h2, h3, h4 {
    font-weight: 400;
    letter-spacing: 0.05em;
}

h1 {
    font-size: var(--font-size-3xl);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

h2 {
    font-size: var(--font-size-lg);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent-red);
    margin-bottom: var(--space-lg);
}

h3 {
    font-size: var(--font-size-base);
    font-weight: 600;
}

p {
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

a {
    color: var(--accent-red);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    text-decoration: underline;
    text-shadow: 0 0 8px var(--accent-red-glow);
}

/* ─────────────────────────────────────────────────────────────────────────────
   Glow Effects
   ───────────────────────────────────────────────────────────────────────────── */
.glow {
    text-shadow: 0 0 8px var(--accent-red-glow);
}

.glow-strong {
    text-shadow: 0 0 12px var(--accent-red-glow), 0 0 20px var(--accent-red-glow), 0 0 40px var(--accent-red-glow);
}

/* ─────────────────────────────────────────────────────────────────────────────
   Glitch Effect (subtle, hover only)
   ───────────────────────────────────────────────────────────────────────────── */
.glitch {
    position: relative;
}

.glitch:hover {
    animation: glitch 0.3s ease-in-out;
}

@keyframes glitch {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-1px, 1px); }
    40% { transform: translate(1px, -1px); }
    60% { transform: translate(-1px, -1px); }
    80% { transform: translate(1px, 1px); }
}

/* ─────────────────────────────────────────────────────────────────────────────
   Blinking Cursor
   ───────────────────────────────────────────────────────────────────────────── */
.cursor::after {
    content: '\2588'; /* Full block character */
    animation: blink 1s step-end infinite;
    color: var(--accent-red);
}

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

/* ─────────────────────────────────────────────────────────────────────────────
   ASCII Box Components
   ───────────────────────────────────────────────────────────────────────────── */
.ascii-box {
    border: 1px solid var(--border-default);
    position: relative;
}

.ascii-box::before {
    content: attr(data-label);
    position: absolute;
    top: -0.6em;
    left: 1em;
    background: var(--bg-primary);
    padding: 0 0.5em;
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Terminal-style box */
.terminal-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    padding: var(--space-lg);
    font-family: var(--font-mono);
}

.terminal-box.red-border {
    border-left: 3px solid var(--accent-red);
}

.terminal-box.green-border {
    border-left: 3px solid var(--accent-green);
}

/* ─────────────────────────────────────────────────────────────────────────────
   Status Bar
   ───────────────────────────────────────────────────────────────────────────── */
.status-bar {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.status-bar span {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
}

.status-bar .label {
    color: var(--text-dim);
    text-transform: uppercase;
    font-size: var(--font-size-xs);
    letter-spacing: 0.1em;
}

.status-bar .value {
    color: var(--text-secondary);
}

/* ─────────────────────────────────────────────────────────────────────────────
   Strength Indicators
   ───────────────────────────────────────────────────────────────────────────── */
.strength {
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
}

.strength-bar {
    letter-spacing: -0.1em;
}

.strength.strong { color: var(--strength-strong); }
.strength.considerable { color: var(--strength-considerable); }
.strength.weak { color: var(--strength-weak); }

/* ─────────────────────────────────────────────────────────────────────────────
   Tags & Labels
   ───────────────────────────────────────────────────────────────────────────── */
.tag {
    display: inline-block;
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: var(--space-xs) var(--space-sm);
    border: 1px solid currentColor;
}

.tag.concerning {
    color: var(--accent-red);
    border-color: var(--accent-red-dim);
}

.tag.context-dependent {
    color: var(--accent-green);
    border-color: var(--accent-green-dim);
}

.warning-indicator {
    color: var(--accent-red);
}

/* ─────────────────────────────────────────────────────────────────────────────
   Capability Cards
   ───────────────────────────────────────────────────────────────────────────── */
.capability-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-md);
}

.capability-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    padding: var(--space-lg);
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.capability-card:hover {
    border-color: var(--border-bright);
    background: var(--bg-elevated);
    text-decoration: none;
}

.capability-card.red {
    border-left: 3px solid var(--accent-red);
}

.capability-card.red:hover {
    border-left-color: var(--accent-red);
    box-shadow: -4px 0 12px -4px var(--accent-red-glow);
}

.capability-card.green {
    border-left: 3px solid var(--accent-green);
}

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

.capability-card .card-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.capability-card .card-tag {
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.capability-card.red .card-tag { color: var(--accent-red); }
.capability-card.green .card-tag { color: var(--accent-green); }

.capability-card .card-description {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.capability-card .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--font-size-xs);
    color: var(--text-dim);
}

.capability-card .entry-count {
    background: var(--bg-elevated);
    padding: var(--space-xs) var(--space-sm);
}

/* ─────────────────────────────────────────────────────────────────────────────
   Timeline - Interactive with scroll-based highlighting
   ───────────────────────────────────────────────────────────────────────────── */
.timeline {
    position: relative;
    padding-left: 3rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent-red-dim), var(--border-default) 20%, var(--border-default) 80%, var(--accent-red-dim));
}

.timeline-entry {
    position: relative;
    padding-bottom: var(--space-xl);
    border-bottom: 1px solid var(--border-dim);
    margin-bottom: var(--space-lg);
    opacity: 0.6;
    transform: translateX(0);
    transition: opacity 0.4s ease, transform 0.4s ease, border-color 0.4s ease;
}

.timeline-entry:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* Active/highlighted state */
.timeline-entry.active {
    opacity: 1;
    transform: translateX(4px);
    border-bottom-color: var(--border-bright);
}

.timeline-entry.active .timeline-title {
    color: var(--text-primary);
    text-shadow: 0 0 20px rgba(255, 68, 68, 0.2);
}

/* Timeline node icons - DISABLED (bookmark style removed) */
/*
.timeline-entry::before {
    content: '';
    position: absolute;
    left: -2.5rem;
    top: 0;
    width: 24px;
    height: 24px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.5;
    transition: opacity 0.4s ease, transform 0.4s ease, filter 0.4s ease;
}
*/

.timeline-date {
    font-size: var(--font-size-xs);
    color: var(--text-dim);
    margin-bottom: var(--space-xs);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: color 0.4s ease;
}

.timeline-entry.active .timeline-date {
    color: var(--text-muted);
}

.timeline-title {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
    transition: color 0.4s ease, text-shadow 0.4s ease;
}

.timeline-authors {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.timeline-summary {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
    transition: color 0.4s ease;
}

.timeline-entry.active .timeline-summary {
    color: var(--text-secondary);
}

.timeline-links {
    display: flex;
    gap: var(--space-md);
    font-size: var(--font-size-xs);
}

.timeline-links a {
    color: var(--text-dim);
    transition: color 0.3s ease;
}

.timeline-entry.active .timeline-links a {
    color: var(--text-muted);
}

.timeline-links a:hover {
    color: var(--accent-red);
}

/* Sticky current entry indicator - DISABLED */
.timeline-indicator {
    display: none;
}

.timeline-indicator .indicator-date {
    color: var(--accent-red);
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.timeline-indicator .indicator-title {
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Hero Section
   ───────────────────────────────────────────────────────────────────────────── */
.hero {
    position: relative;
    text-align: center;
    padding: var(--space-3xl) 0;
    border-bottom: 1px solid var(--border-default);
    background:
        linear-gradient(to bottom, rgba(10,10,15,0.4), rgba(10,10,15,0.85)),
        url('media/hero-reve.png') center/cover no-repeat;
}

.hero-title {
    font-size: var(--font-size-3xl);
    font-weight: 400;
    letter-spacing: 0.15em;
    margin-bottom: var(--space-lg);
}

.hero-title .accent {
    color: var(--accent-red);
}

.hero-tagline {
    color: var(--text-muted);
    font-size: var(--font-size-base);
    max-width: 600px;
    margin: 0 auto;
}

.hero-ascii {
    font-size: var(--font-size-xs);
    line-height: 1.2;
    color: var(--text-secondary);
    text-shadow: 0 0 20px rgba(255, 68, 68, 0.3);
    margin-bottom: var(--space-lg);
    white-space: pre;
    overflow-x: auto;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Section Dividers
   ───────────────────────────────────────────────────────────────────────────── */
.section {
    padding: var(--space-2xl) 0;
    border-bottom: 1px solid var(--border-default);
}

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

.section-divider {
    color: var(--border-default);
    text-align: center;
    margin: var(--space-xl) 0;
    font-size: var(--font-size-xs);
    letter-spacing: 0.5em;
    overflow: hidden;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Legend
   ───────────────────────────────────────────────────────────────────────────── */
.legend {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    padding: var(--space-lg);
    font-size: var(--font-size-sm);
}

.legend h3 {
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.legend-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    margin-bottom: var(--space-sm);
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-item .strength-bar {
    flex-shrink: 0;
    width: 4em;
}

.legend-item .description {
    color: var(--text-muted);
    font-size: var(--font-size-xs);
}

/* ─────────────────────────────────────────────────────────────────────────────
   Footer
   ───────────────────────────────────────────────────────────────────────────── */
.footer {
    padding: var(--space-xl) 0;
    text-align: center;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-sm);
}

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

.footer-links a:hover {
    color: var(--accent-red);
}

/* ─────────────────────────────────────────────────────────────────────────────
   Utility Classes
   ───────────────────────────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-red { color: var(--accent-red); }
.text-green { color: var(--accent-green); }
.text-orange { color: var(--accent-orange); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.uppercase {
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Image Integration (for when images are generated)
   ───────────────────────────────────────────────────────────────────────────── */

/* Texture Overlays - Apply to body */
body.with-textures::before {
    content: '';
    position: fixed;
    inset: 0;
    background: url('media/texture_noise.png') repeat;
    opacity: 0.03;
    pointer-events: none;
    z-index: 9998;
}

body.with-textures::after {
    content: '';
    position: fixed;
    inset: 0;
    background: url('media/texture_vignette.png') center/cover no-repeat;
    pointer-events: none;
    z-index: 9997;
}

/* Capability Card Backgrounds - Cyberpunk Reve Style */
.capability-card[href*="deception"] {
    background:
        linear-gradient(to bottom, rgba(10,10,15,0.88), rgba(10,10,15,0.95)),
        url('media/capability_deception.png') center/cover no-repeat;
}

.capability-card[href*="resource"] {
    background:
        linear-gradient(to bottom, rgba(10,10,15,0.88), rgba(10,10,15,0.95)),
        url('media/capability_resources.png') center/cover no-repeat;
}

.capability-card[href*="replication"] {
    background:
        linear-gradient(to bottom, rgba(10,10,15,0.88), rgba(10,10,15,0.95)),
        url('media/capability_replication.png') center/cover no-repeat;
}

.capability-card[href*="shutdown"] {
    background:
        linear-gradient(to bottom, rgba(10,10,15,0.88), rgba(10,10,15,0.95)),
        url('media/capability_shutdown.png') center/cover no-repeat;
}

.capability-card[href*="autonomous"] {
    background:
        linear-gradient(to bottom, rgba(10,10,15,0.88), rgba(10,10,15,0.95)),
        url('media/capability_goals.png') center/cover no-repeat;
}

.capability-card[href*="infrastructure"] {
    background:
        linear-gradient(to bottom, rgba(10,10,15,0.88), rgba(10,10,15,0.95)),
        url('media/capability_infrastructure.png') center/cover no-repeat;
}

/* Card Hover - Reveal more of image with red tint */
.capability-card[href*="deception"]:hover {
    background:
        linear-gradient(to bottom, rgba(30,10,15,0.7), rgba(10,10,15,0.85)),
        url('media/capability_deception.png') center/cover no-repeat;
}

.capability-card[href*="resource"]:hover {
    background:
        linear-gradient(to bottom, rgba(30,10,15,0.7), rgba(10,10,15,0.85)),
        url('media/capability_resources.png') center/cover no-repeat;
}

.capability-card[href*="replication"]:hover {
    background:
        linear-gradient(to bottom, rgba(30,10,15,0.7), rgba(10,10,15,0.85)),
        url('media/capability_replication.png') center/cover no-repeat;
}

.capability-card[href*="shutdown"]:hover {
    background:
        linear-gradient(to bottom, rgba(30,10,15,0.7), rgba(10,10,15,0.85)),
        url('media/capability_shutdown.png') center/cover no-repeat;
}

.capability-card[href*="autonomous"]:hover {
    background:
        linear-gradient(to bottom, rgba(30,10,15,0.7), rgba(10,10,15,0.85)),
        url('media/capability_goals.png') center/cover no-repeat;
}

.capability-card[href*="infrastructure"]:hover {
    background:
        linear-gradient(to bottom, rgba(30,10,15,0.7), rgba(10,10,15,0.85)),
        url('media/capability_infrastructure.png') center/cover no-repeat;
}

/* Section Dividers (ready for images) */
.section-divider.circuit {
    height: 20px;
    background: url('media/divider_circuit.png') center/contain repeat-x;
    margin: var(--space-xl) 0;
}

/* Footer Background */
.footer {
    background:
        linear-gradient(to top, rgba(10,10,15,0.85), rgba(10,10,15,0.7)),
        url('media/footer_servers.png') center/cover no-repeat;
}

/* Section Dividers with images */
.section-divider {
    height: 60px;
    margin: var(--space-xl) 0;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.8;
}

.section-divider.circuit {
    background-image: url('media/divider_circuit.png');
}

.section-divider.static {
    background-image: url('media/divider_static.png');
}

.section-divider.emergence {
    background-image: url('media/divider_emergence.png');
}

/* ─────────────────────────────────────────────────────────────────────────────
   Responsive
   ───────────────────────────────────────────────────────────────────────────── */
/* ─────────────────────────────────────────────────────────────────────────────
   Horizontal Timeline - Overview component
   ───────────────────────────────────────────────────────────────────────────── */

/* Timeline wrapper - seamless blend into page */
.h-timeline-wrapper {
    position: relative;
    background: transparent;
    margin: var(--space-xl) calc(-1 * var(--space-xl));
    padding: 0 var(--space-xl);
}

/* Timeline header styling */
.h-timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-subtle);
}

.h-timeline-header h3 {
    font-size: var(--font-size-sm);
    color: var(--accent-red);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin: 0;
}

.h-timeline-header .h-timeline-range {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

.h-timeline-container {
    position: relative;
    width: 100%;
}

.h-timeline-inner {
    position: relative;
    width: 100%;
    padding: var(--space-sm) 0;
    overflow-x: auto;
    overflow-y: visible;
    scroll-behavior: smooth;
    /* Hide scrollbar but keep functionality */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.h-timeline-inner::-webkit-scrollbar {
    display: none;
}

/* Subtle gradient fades to indicate scrollable content */
.h-timeline-inner.has-overflow::before,
.h-timeline-inner.has-overflow::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 60px;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.h-timeline-inner.has-overflow::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-primary) 0%, transparent 100%);
}

.h-timeline-inner.has-overflow::after {
    right: 0;
    background: linear-gradient(to left, var(--bg-primary) 0%, transparent 100%);
}

/* Show fades based on scroll position */
.h-timeline-inner.has-overflow.can-scroll-left::before {
    opacity: 1;
}

.h-timeline-inner.has-overflow.can-scroll-right::after {
    opacity: 1;
}

/* Custom scrollbar */
.h-timeline-container::-webkit-scrollbar {
    height: 6px;
}

.h-timeline-container::-webkit-scrollbar-track {
    background: var(--bg-surface);
    border-radius: 3px;
}

.h-timeline-container::-webkit-scrollbar-thumb {
    background: var(--accent-red-dim);
    border-radius: 3px;
}

.h-timeline-container::-webkit-scrollbar-thumb:hover {
    background: var(--accent-red);
}

.h-timeline-track {
    display: flex;
    align-items: center;
    position: relative;
    min-width: max-content;
    /* Extra padding to prevent edge cutoff - accounts for scroll zones + popup overflow */
    padding: 0 80px;
    height: 380px;
}

/* Central horizontal line - prominent */
.h-timeline-track::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 2px;
    background: linear-gradient(
        to right,
        var(--accent-red),
        var(--text-muted) 10%,
        var(--text-muted) 90%,
        var(--accent-red)
    );
    transform: translateY(-50%);
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.15);
}

.h-timeline-item {
    position: relative;
    flex-shrink: 0;
    width: 70px;
    cursor: pointer;
    z-index: 1;
    /* Expand hover area - make entire column hoverable */
    padding: 60px 0;
    margin: -60px 0;
}

.h-timeline-item + .h-timeline-item {
    margin-left: var(--space-lg);
}

/* Timeline node - radar-style blinking red dot */
.h-timeline-node {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: var(--accent-red);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--accent-red), 0 0 12px var(--accent-red-glow);
    animation: radar-blink 3s ease-out infinite;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Stagger animation for each dot */
.h-timeline-item:nth-child(2n) .h-timeline-node { animation-delay: 0.5s; }
.h-timeline-item:nth-child(3n) .h-timeline-node { animation-delay: 1s; }
.h-timeline-item:nth-child(4n) .h-timeline-node { animation-delay: 1.5s; }
.h-timeline-item:nth-child(5n) .h-timeline-node { animation-delay: 2s; }

@keyframes radar-blink {
    0% {
        opacity: 0.4;
        box-shadow: 0 0 4px var(--accent-red-dim), 0 0 8px transparent;
    }
    10% {
        opacity: 1;
        box-shadow: 0 0 8px var(--accent-red), 0 0 20px var(--accent-red-glow);
    }
    30% {
        opacity: 0.7;
        box-shadow: 0 0 6px var(--accent-red), 0 0 12px var(--accent-red-glow);
    }
    100% {
        opacity: 0.4;
        box-shadow: 0 0 4px var(--accent-red-dim), 0 0 8px transparent;
    }
}

.h-timeline-item:hover .h-timeline-node,
.h-timeline-item.is-active .h-timeline-node {
    transform: translate(-50%, -50%) scale(1.5);
    box-shadow: 0 0 12px var(--accent-red), 0 0 24px var(--accent-red-glow), 0 0 36px var(--accent-red-glow);
    animation: none;
    opacity: 1;
}

/* Year label */
.h-timeline-content {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    white-space: nowrap;
}

.h-timeline-item.top .h-timeline-content {
    bottom: calc(50% + 18px);
}

.h-timeline-item.bottom .h-timeline-content {
    top: calc(50% + 18px);
}

.h-timeline-year {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.3s ease, text-shadow 0.3s ease;
    font-weight: 500;
}

.h-timeline-item:hover .h-timeline-year,
.h-timeline-item.is-active .h-timeline-year {
    color: var(--accent-red);
    text-shadow: 0 0 8px var(--accent-red-glow);
}

/* Connector line from node to label */
.h-timeline-item::after {
    content: '';
    position: absolute;
    left: 50%;
    width: 1px;
    height: 12px;
    background: var(--text-muted);
    transform: translateX(-50%);
    transition: background 0.3s ease;
}

.h-timeline-item.top::after {
    bottom: calc(50% + 10px);
}

.h-timeline-item.bottom::after {
    top: calc(50% + 10px);
}

.h-timeline-item:hover::after,
.h-timeline-item.is-active::after {
    background: var(--accent-red);
}

/* ─────────────────────────────────────────────────────────────────────────────
   Horizontal Timeline - Hover Popup
   ───────────────────────────────────────────────────────────────────────────── */

.h-timeline-popup {
    position: absolute;
    left: 50%;
    width: 260px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-left: 3px solid var(--accent-red);
    padding: var(--space-md);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 100;
    /* Smooth fade-in, faster fade-out */
    transition:
        opacity 160ms ease,
        transform 160ms ease,
        visibility 0s linear 160ms;
    will-change: opacity, transform;
}

.h-timeline-item.top .h-timeline-popup {
    bottom: calc(50% + 50px);
    transform: translateX(-50%) translateY(8px);
}

.h-timeline-item.top:hover .h-timeline-popup {
    transform: translateX(-50%) translateY(0);
}

.h-timeline-item.bottom .h-timeline-popup {
    top: calc(50% + 50px);
    transform: translateX(-50%) translateY(-8px);
}

.h-timeline-item.bottom:hover .h-timeline-popup {
    transform: translateX(-50%) translateY(0);
}

/* Only apply hover on devices that actually support hover */
@media (hover: hover) and (pointer: fine) {
    .h-timeline-item:hover .h-timeline-popup {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition-delay: 0s, 0s, 0s;
    }
}

/* Active state works on all devices (desktop click + mobile tap) */
.h-timeline-item.is-active .h-timeline-popup {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s, 0s, 0s;
}

/* Suppress popups during scroll - prevents flicker */
.h-timeline-inner.is-scrolling .h-timeline-popup,
.h-timeline-inner.is-scrolling .h-timeline-item:hover .h-timeline-popup {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    /* Faster fade-out when scroll starts */
    transition:
        opacity 80ms linear,
        transform 80ms ease,
        visibility 0s linear 80ms;
}

/* Popup arrow */
.h-timeline-popup::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
}

.h-timeline-item.top .h-timeline-popup::before {
    bottom: -12px;
    border-top-color: var(--border-default);
}

.h-timeline-item.bottom .h-timeline-popup::before {
    top: -12px;
    border-bottom-color: var(--border-default);
}

.popup-date {
    font-size: var(--font-size-xs);
    color: var(--accent-red);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-xs);
}

.popup-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    line-height: 1.4;
}

.popup-summary {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: var(--space-sm);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popup-link {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.popup-link:hover {
    color: var(--accent-red);
}

/* ─────────────────────────────────────────────────────────────────────────────
   Horizontal Timeline - Scroll Zones
   ───────────────────────────────────────────────────────────────────────────── */

.h-timeline-scroll-zone {
    position: absolute;
    /* Center vertically around the timeline line, not full height */
    top: 50%;
    transform: translateY(-50%);
    height: 60px;
    width: 40px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
    /* No background - just the arrow indicator */
    background: transparent;
}

.h-timeline-scroll-zone.left {
    left: 0;
}

.h-timeline-scroll-zone.right {
    right: 0;
}

.h-timeline-inner.has-overflow .h-timeline-scroll-zone {
    opacity: 0.6;
}

.h-timeline-inner.has-overflow:hover .h-timeline-scroll-zone {
    opacity: 1;
}

.h-timeline-scroll-zone::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border: 8px solid transparent;
}

.h-timeline-scroll-zone.left::after {
    left: 12px;
    border-right-color: var(--text-dim);
}

.h-timeline-scroll-zone.right::after {
    right: 12px;
    border-left-color: var(--text-dim);
}

.h-timeline-scroll-zone:hover::after {
    border-right-color: var(--accent-red);
    border-left-color: var(--accent-red);
}

/* Scroll hint text */
.h-timeline-scroll-hint {
    position: absolute;
    bottom: 8px;
    right: 16px;
    font-size: var(--font-size-xs);
    color: var(--accent-red);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.h-timeline-inner.has-overflow .h-timeline-scroll-hint {
    opacity: 1;
    animation: pulse-hint 2s ease-in-out 3;
}

@keyframes pulse-hint {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; color: var(--accent-red); text-shadow: 0 0 8px var(--accent-red-glow); }
}

/* Mobile tap hint - positioned on right side of wrapper (outside scroll container) */
.h-timeline-tap-hint {
    position: absolute;
    bottom: 8px;
    right: 16px;
    font-size: 0.6rem;
    color: var(--accent-red);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    animation: pulse-hint 2s ease-in-out 3;
}

.h-timeline-wrapper.has-overflow .h-timeline-tap-hint {
    opacity: 1;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Responsive
   ───────────────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    :root {
        --font-size-3xl: 1.6rem;
        --font-size-2xl: 1.4rem;
    }

    .container {
        padding: var(--space-md);
    }

    .hero {
        padding: var(--space-xl) 0;
    }

    .hero-ascii {
        font-size: 0.5rem;
    }

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

    .status-bar {
        flex-direction: column;
        gap: var(--space-sm);
    }

    /* Horizontal timeline mobile - compact single-row layout */
    .h-timeline-wrapper {
        margin: var(--space-md) calc(-1 * var(--space-md));
        padding: 0 var(--space-md);
    }

    .h-timeline-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-xs);
        padding: var(--space-sm) 0;
    }

    .h-timeline-track {
        height: 120px;
        padding: 0 40px;
    }

    .h-timeline-item {
        width: 50px;
    }

    .h-timeline-item + .h-timeline-item {
        margin-left: var(--space-md);
    }

    /* All labels below the line on mobile for cleaner look */
    .h-timeline-item.top .h-timeline-content,
    .h-timeline-item.bottom .h-timeline-content {
        top: calc(50% + 14px);
        bottom: auto;
    }

    .h-timeline-item.top::after,
    .h-timeline-item.bottom::after {
        top: calc(50% + 8px);
        bottom: auto;
        height: 8px;
    }

    .h-timeline-node {
        width: 8px;
        height: 8px;
    }

    .h-timeline-year {
        font-size: 0.65rem;
    }

    /* Hide the inline popup on mobile - we use the portal sheet instead */
    .h-timeline-popup {
        display: none !important;
    }

    /* Smaller tap target padding on mobile */
    .h-timeline-item {
        padding: 20px 0;
        margin: -20px 0;
    }

    /* Scroll hint on mobile - same behavior as desktop, just repositioned */
    .h-timeline-scroll-hint {
        left: 16px;
        right: auto;
        bottom: 8px;
        font-size: 0.6rem;
    }

    /* Edge fades smaller on mobile */
    .h-timeline-inner.has-overflow::before,
    .h-timeline-inner.has-overflow::after {
        width: 30px;
    }
}

/* ─────────────────────────────────────────────────────────────────────────────
   Mobile Popup Sheet (Portal to body - avoids iOS fixed positioning bugs)
   ───────────────────────────────────────────────────────────────────────────── */
.mobile-popup-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    background: var(--bg-elevated);
    border-radius: 12px 12px 0 0;
    border-top: 3px solid var(--accent-red);
    padding: var(--space-lg);
    padding-bottom: calc(var(--space-lg) + env(safe-area-inset-bottom, 0px));
    transform: translateY(100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-popup-sheet.is-visible {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.mobile-popup-content .popup-date {
    font-size: var(--font-size-xs);
    color: var(--accent-red);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-xs);
}

.mobile-popup-content .popup-summary {
    font-size: var(--font-size-base);
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: var(--space-md);
}

.mobile-popup-content .popup-close-hint {
    text-align: center;
    font-size: 0.6rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .h-timeline-popup {
        transition: none;
    }

    .h-timeline-inner.is-scrolling .h-timeline-popup {
        transition: none;
    }
}

/* Timeline narrative prose section */
.timeline-narrative {
    max-width: 700px;
    margin: var(--space-lg) auto;
    padding: 0 var(--space-md);
    font-size: var(--font-size-base);
    line-height: 1.8;
    color: var(--text-secondary);
}

.timeline-narrative p {
    margin-bottom: var(--space-md);
}

/* Timeline summary after the horizontal timeline */
.timeline-summary {
    margin-top: var(--space-md);
}

/* Mobile read more toggle - hidden on desktop */
.mobile-read-more {
    display: none;
}

/* Mobile: hide extra paragraphs and show read more button */
@media (max-width: 768px) {
    .mobile-hidden-extra {
        display: none;
    }

    .mobile-hidden-extra.is-visible {
        display: block;
    }

    .mobile-read-more {
        display: inline-block;
        background: transparent;
        border: none;
        color: var(--accent-red);
        font-family: var(--font-mono);
        font-size: var(--font-size-sm);
        padding: 0;
        cursor: pointer;
        text-decoration: underline;
        text-underline-offset: 2px;
    }

    .mobile-read-more:hover {
        color: var(--text-primary);
    }

    .mobile-read-more.is-expanded {
        display: none;
    }
}

/* ─────────────────────────────────────────────────────────────────────────────
   Summary Modal
   ───────────────────────────────────────────────────────────────────────────── */

/* Summary button in timeline links */
.summary-btn {
    background: transparent;
    border: 1px solid var(--border-default);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
    padding: var(--space-xs) var(--space-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.summary-btn:hover {
    border-color: var(--accent-red);
    color: var(--accent-red);
    background: rgba(255, 68, 68, 0.05);
    text-decoration: none;
}

/* Source button - same style as summary button */
.source-btn {
    background: transparent;
    border: 1px solid var(--border-default);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
    padding: var(--space-xs) var(--space-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.source-btn:hover {
    border-color: var(--accent-red);
    color: var(--accent-red);
    background: rgba(255, 68, 68, 0.05);
    text-decoration: none;
}

/* Modal overlay */
.summary-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 15, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}

.summary-modal-overlay.active {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}

/* Modal container */
.summary-modal {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-left: 3px solid var(--accent-red);
    max-width: 700px;
    max-height: 85vh;
    width: 100%;
    overflow-y: auto;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.2s ease;
}

.summary-modal-overlay.active .summary-modal {
    transform: translateY(0);
}

/* Custom scrollbar for modal */
.summary-modal::-webkit-scrollbar {
    width: 6px;
}

.summary-modal::-webkit-scrollbar-track {
    background: var(--bg-surface);
}

.summary-modal::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: 3px;
}

.summary-modal::-webkit-scrollbar-thumb:hover {
    background: var(--accent-red-dim);
}

/* Close button */
.summary-modal-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: var(--font-size-xl);
    cursor: pointer;
    line-height: 1;
    padding: var(--space-xs);
    transition: color 0.2s ease;
    z-index: 1;
}

.summary-modal-close:hover {
    color: var(--accent-red);
}

/* Modal header */
.summary-modal-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-dim);
}

.summary-modal-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    padding-right: var(--space-xl);
}

.summary-modal-meta {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.summary-modal-strength {
    margin-top: var(--space-sm);
}

/* Modal body */
.summary-modal-body {
    padding: var(--space-lg);
}

/* Summary sections */
.summary-section {
    margin-bottom: var(--space-lg);
}

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

.summary-section h3 {
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-red);
    margin-bottom: var(--space-sm);
}

.summary-section p {
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

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

.summary-section li {
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
    padding-left: var(--space-md);
    position: relative;
}

.summary-section li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--text-dim);
}

/* Methodology details list */
.summary-section .methodology-details {
    margin-top: var(--space-sm);
}

.summary-section .methodology-details li::before {
    content: '';
}

.summary-section .methodology-details li {
    padding-left: 0;
}

/* Responsive modal */
@media (max-width: 768px) {
    .summary-modal-overlay {
        padding: var(--space-sm);
    }

    .summary-modal {
        max-height: 90vh;
    }

    .summary-modal-header,
    .summary-modal-body {
        padding: var(--space-md);
    }
}

/* ─────────────────────────────────────────────────────────────────────────────
   Main Navigation
   ───────────────────────────────────────────────────────────────────────────── */
.main-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-default);
    margin-bottom: var(--space-lg);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.main-nav .nav-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.main-nav .nav-link:hover {
    color: var(--accent-red);
    text-shadow: 0 0 8px var(--accent-red-glow);
    text-decoration: none;
}

.main-nav .nav-link.active {
    color: var(--accent-red);
}

.main-nav .nav-divider {
    color: var(--text-dim);
}

/* Card header with single child (entry-count only, no tag) */
.capability-card.red .card-header:has(.entry-count:only-child) {
    justify-content: flex-end;
}

/* Model response formatting for About page */
.model-response {
    font-size: var(--font-size-sm);
    line-height: 1.7;
}

.model-response h4 {
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    margin-top: var(--space-md);
    margin-bottom: var(--space-sm);
}

.model-response ul {
    list-style: none;
    padding-left: var(--space-md);
}

.model-response li {
    margin-bottom: var(--space-xs);
    position: relative;
}

.model-response li::before {
    content: '>';
    position: absolute;
    left: calc(-1 * var(--space-md));
    color: var(--text-dim);
}

.model-response strong {
    color: var(--text-primary);
}

.model-response table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--space-md) 0;
    font-size: var(--font-size-xs);
}

.model-response th,
.model-response td {
    border: 1px solid var(--border-default);
    padding: var(--space-sm);
    text-align: left;
}

.model-response th {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

@media (max-width: 600px) {
    .main-nav {
        flex-wrap: wrap;
        gap: var(--space-sm);
    }

    .main-nav .nav-divider {
        display: none;
    }
}

/* ─────────────────────────────────────────────────────────────────────────────
   Capability Page Header Backgrounds
   Same pattern as landing page capability cards
   ───────────────────────────────────────────────────────────────────────────── */
.capability-header-box.deception {
    background:
        linear-gradient(to bottom, rgba(10,10,15,0.88), rgba(10,10,15,0.95)),
        url('media/capability_deception.png') center/cover no-repeat;
}

.capability-header-box.resources {
    background:
        linear-gradient(to bottom, rgba(10,10,15,0.88), rgba(10,10,15,0.95)),
        url('media/capability_resources.png') center/cover no-repeat;
}

.capability-header-box.replication {
    background:
        linear-gradient(to bottom, rgba(10,10,15,0.88), rgba(10,10,15,0.95)),
        url('media/capability_replication.png') center/cover no-repeat;
}

.capability-header-box.shutdown {
    background:
        linear-gradient(to bottom, rgba(10,10,15,0.88), rgba(10,10,15,0.95)),
        url('media/capability_shutdown.png') center/cover no-repeat;
}

.capability-header-box.goals {
    background:
        linear-gradient(to bottom, rgba(10,10,15,0.88), rgba(10,10,15,0.95)),
        url('media/capability_goals.png') center/cover no-repeat;
}

.capability-header-box.infrastructure {
    background:
        linear-gradient(to bottom, rgba(10,10,15,0.88), rgba(10,10,15,0.95)),
        url('media/capability_infrastructure.png') center/cover no-repeat;
}
