:root {
    --amber: #f0a500;
    --amber-dim: #c48800;
    --amber-glow: #f0a50033;
    --amber-bright: #ffd166;
    --bg-deep: #07080c;
    --bg-card: #0d0f14;
    --bg-surface: #12151c;
    --border: #1e2230;
    --border-light: #2a2f40;
    --text: #c8cad0;
    --text-dim: #6b7084;
    --text-bright: #e8eaf0;
    --green-term: #4ae08a;
    --red-soft: #e05858;
}

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

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) var(--bg-deep);
}

body {
    background: var(--bg-deep);
    color: var(--text);
    font-family: 'Spectral', Georgia, serif;
    font-size: 18px;
    line-height: 1.75;
    overflow-x: hidden;
}

/* ═══════════════════════════════════════════
   GRID BACKGROUND
   ═══════════════════════════════════════════ */
.grid-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.12;
}

.scanline {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.06) 2px,
        rgba(0, 0, 0, 0.06) 4px
    );
}

/* ═══════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════ */
.content {
    position: relative;
    z-index: 2;
    max-width: 820px;
    margin: 0 auto;
    padding: 0 24px;
}

section {
    padding: 80px 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ═══════════════════════════════════════════
   HEADER / HERO
   ═══════════════════════════════════════════ */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 1;
    transform: none;
    position: relative;
}

.hero-addr {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    letter-spacing: 0.15em;
    color: var(--text-dim);
    margin-bottom: 16px;
}

.hero-addr span {
    color: var(--amber);
}

.hero-title {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(48px, 10vw, 96px);
    font-weight: 600;
    color: var(--amber);
    letter-spacing: -0.02em;
    line-height: 1;
    margin-bottom: 8px;
    text-shadow: 0 0 40px var(--amber-glow), 0 0 80px rgba(240, 165, 0, 0.1);
    animation: flicker 4s ease-in-out infinite;
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
    92% { opacity: 1; }
    93% { opacity: 0.8; }
    94% { opacity: 1; }
    96% { opacity: 0.9; }
    97% { opacity: 1; }
}

.hero-reg {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(14px, 2.5vw, 18px);
    color: var(--text-dim);
    margin-bottom: 40px;
    letter-spacing: 0.05em;
}

.hero-reg code {
    color: var(--amber-dim);
    background: rgba(240, 165, 0, 0.08);
    padding: 2px 8px;
    border-radius: 3px;
    border: 1px solid rgba(240, 165, 0, 0.15);
}

.hero-subtitle {
    font-size: 20px;
    color: var(--text);
    max-width: 540px;
    font-weight: 300;
    line-height: 1.8;
}

.hero-subtitle em {
    color: var(--text-bright);
    font-style: italic;
}

.led-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--amber);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--amber), 0 0 20px var(--amber-glow);
    margin-right: 10px;
    animation: led-pulse 3s ease-in-out infinite;
    vertical-align: middle;
}

@keyframes led-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--amber), 0 0 20px var(--amber-glow); }
    50% { opacity: 0.7; box-shadow: 0 0 4px var(--amber), 0 0 10px var(--amber-glow); }
}

.scroll-hint {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    animation: scroll-fade 2.5s ease-in-out infinite;
}

.scroll-hint::after {
    content: '';
    display: block;
    width: 1px;
    height: 24px;
    background: var(--text-dim);
    margin: 8px auto 0;
}

@keyframes scroll-fade {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* ═══════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════ */
.site-nav {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    letter-spacing: 0.08em;
    padding: 24px 0;
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.site-nav a {
    color: var(--text-dim);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    padding-bottom: 2px;
}

.site-nav a:hover,
.site-nav a.active {
    color: var(--amber);
    border-bottom-color: var(--amber-dim);
}

.site-nav .nav-sep {
    color: var(--border-light);
}

.site-nav .lang-link {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.12em;
}

/* ═══════════════════════════════════════════
   SECTION HEADERS
   ═══════════════════════════════════════════ */
.section-header {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 48px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
}

.section-addr {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: var(--amber-dim);
    letter-spacing: 0.1em;
    white-space: nowrap;
    flex-shrink: 0;
}

.section-title {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(22px, 4vw, 30px);
    font-weight: 500;
    color: var(--text-bright);
    letter-spacing: -0.01em;
}

/* ═══════════════════════════════════════════
   PROSE
   ═══════════════════════════════════════════ */
.prose p {
    margin-bottom: 24px;
    max-width: 640px;
}

.prose p.wide {
    max-width: 100%;
}

.prose strong {
    color: var(--text-bright);
    font-weight: 500;
}

.prose code {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.88em;
    color: var(--amber);
    background: rgba(240, 165, 0, 0.07);
    padding: 1px 6px;
    border-radius: 3px;
    border: 1px solid rgba(240, 165, 0, 0.1);
}

.prose a {
    color: var(--amber);
    text-decoration: none;
    border-bottom: 1px solid rgba(240, 165, 0, 0.3);
    transition: border-color 0.2s;
}

.prose a:hover {
    border-bottom-color: var(--amber);
}

/* ═══════════════════════════════════════════
   MEMORY DIAGRAM
   ═══════════════════════════════════════════ */
.mem-block {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    line-height: 1.7;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--amber-dim);
    padding: 20px 24px;
    margin: 32px 0;
    overflow-x: auto;
    border-radius: 0 4px 4px 0;
    white-space: pre;
}

.mem-block .label {
    color: var(--amber);
}

.mem-block .comment {
    color: var(--text-dim);
}

.mem-block .val {
    color: var(--green-term);
}

.mem-block .dim {
    color: var(--text-dim);
}

.mem-block .keyword {
    color: var(--amber-bright);
}

/* ═══════════════════════════════════════════
   MACHINE TIMELINE
   ═══════════════════════════════════════════ */
.timeline {
    position: relative;
    padding-left: 32px;
    margin: 40px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 8px;
    bottom: 8px;
    width: 1px;
    background: linear-gradient(to bottom, var(--amber-dim), var(--border), var(--amber-dim));
}

.timeline-item {
    position: relative;
    margin-bottom: 48px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
}

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

.timeline-item::before {
    content: '';
    position: absolute;
    left: -29px;
    top: 10px;
    width: 9px;
    height: 9px;
    border: 2px solid var(--amber-dim);
    border-radius: 50%;
    background: var(--bg-deep);
}

.timeline-item.active::before {
    background: var(--amber);
    box-shadow: 0 0 8px var(--amber-glow);
}

.timeline-age {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: var(--amber-dim);
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}

.timeline-machine {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 18px;
    font-weight: 500;
    color: var(--text-bright);
    margin-bottom: 10px;
}

.timeline-machine .spec {
    font-weight: 300;
    font-size: 14px;
    color: var(--text-dim);
}

.timeline-desc {
    font-size: 17px;
    color: var(--text);
    max-width: 560px;
}

.timeline-desc p {
    margin-bottom: 12px;
}

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

.timeline-desc code {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.88em;
    color: var(--amber);
    background: rgba(240, 165, 0, 0.07);
    padding: 1px 6px;
    border-radius: 3px;
    border: 1px solid rgba(240, 165, 0, 0.1);
}

/* ═══════════════════════════════════════════
   COGNITIVE MAP
   ═══════════════════════════════════════════ */
.cog-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    margin: 32px 0;
    background: var(--border);
    border: 1px solid var(--border);
}

.cog-cell {
    background: var(--bg-card);
    padding: 20px 24px;
}

.cog-cell.header {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-dim);
    padding: 12px 24px;
}

.cog-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.cog-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.cog-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 1.2s ease;
    width: 0;
}

.cog-bar-fill.strong {
    background: var(--amber);
    box-shadow: 0 0 6px var(--amber-glow);
}

.cog-bar-fill.weak {
    background: var(--text-dim);
}

.cog-value {
    font-family: 'Spectral', serif;
    font-size: 16px;
    color: var(--text-bright);
}

.visible .cog-bar-fill {
    width: var(--fill);
}

/* ═══════════════════════════════════════════
   SNAPSHOT MEMORIES
   ═══════════════════════════════════════════ */
.snapshot {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 28px 32px;
    margin: 32px 0;
    position: relative;
    border-radius: 4px;
}

.snapshot::before {
    content: '▪ SNAPSHOT';
    position: absolute;
    top: -10px;
    left: 20px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.15em;
    color: var(--amber-dim);
    background: var(--bg-deep);
    padding: 0 8px;
}

.snapshot p {
    font-style: italic;
    color: var(--text);
    font-size: 17px;
    max-width: 100%;
}

.snapshot .snapshot-meta {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 16px;
    font-style: normal;
}

/* ═══════════════════════════════════════════
   QUOTE BLOCKS
   ═══════════════════════════════════════════ */
.pullquote {
    border-left: 2px solid var(--amber-dim);
    padding: 8px 0 8px 24px;
    margin: 40px 0;
    font-size: 21px;
    font-weight: 300;
    color: var(--text-bright);
    font-style: italic;
    line-height: 1.7;
    max-width: 580px;
}

/* ═══════════════════════════════════════════
   REGISTER BLOCK (BFE001 explanation)
   ═══════════════════════════════════════════ */
.register-block {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    padding: 32px;
    margin: 40px 0;
    position: relative;
    font-family: 'IBM Plex Mono', monospace;
    border-radius: 4px;
}

.register-block .reg-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--amber);
    margin-bottom: 16px;
}

.register-block .reg-row {
    display: flex;
    gap: 16px;
    padding: 6px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}

.register-block .reg-row:last-child {
    border-bottom: none;
}

.register-block .reg-field {
    color: var(--text-dim);
    min-width: 100px;
}

.register-block .reg-val {
    color: var(--text);
}

.register-block .reg-val .highlight {
    color: var(--amber-bright);
}

/* ═══════════════════════════════════════════
   SEPARATOR
   ═══════════════════════════════════════════ */
.sep {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 0;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 0.2em;
}

.sep::before, .sep::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ═══════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════ */
footer {
    border-top: 1px solid var(--border);
    padding: 40px 0 60px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: var(--text-dim);
    text-align: center;
    letter-spacing: 0.1em;
}

footer .led-indicator {
    width: 6px;
    height: 6px;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 640px) {
    body { font-size: 16px; }

    section { padding: 60px 0; }

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

    .section-header {
        flex-direction: column;
        gap: 4px;
    }

    .snapshot { padding: 20px; }

    .register-block { padding: 20px; }

    .register-block .reg-row {
        flex-direction: column;
        gap: 2px;
    }

    .timeline { padding-left: 24px; }

    .mem-block { padding: 16px; font-size: 13px; }

    .site-nav { gap: 16px; }
}
