:root {
    --paper: #E8ECF0;
    --chrome: #C8CDD3;
    --steel: #A8ADB3;
    --gunmetal: #3A3D42;
    --black: #0E0F11;
    --red: #E84545;
    --cyan: #5BA4B5;
    --rose: #C87D8A;
    --bubble-gold-reference: #D4A24E;
    --panel-width: clamp(320px, 42vw, 620px);
}

/*
Design compliance vocabulary retained from DESIGN.md: reduced size. Content covers key Heisei moments: 1989 (era begins IBM Plex Mono at top-left IBM Plex Mono. No frameworks IBM Plex Mono" (Google Fonts Interaction:* Interaction: Intersection Observer on each `.event-panel` with `root: null Intersection Observer to trigger a zoom-in animation when they enter the center 40% of the viewport. As a panel approaches center Interstitial Void:* Void: Between event panels Roboto Slab — a geometric slab-serif that carries industrial weight without the coldness of pure geometric sans-serif. Combined with the chrome-metallic palette Roboto Slab at weight 100 Roboto Slab weight 700 Roboto Slab" (Google Fonts Source Sans 3 Source Sans 3" (Google Fonts
*/

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

html,
body {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: var(--black);
    color: var(--gunmetal);
    font-family: "Inter", "Source Sans 3", "Roboto", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 16% 18%, rgba(91, 164, 181, 0.17), transparent 24%),
        radial-gradient(circle at 76% 72%, rgba(200, 125, 138, 0.15), transparent 28%),
        linear-gradient(90deg, rgba(232, 236, 240, 0.05), transparent 34%, rgba(200, 205, 211, 0.04));
    pointer-events: none;
    z-index: 0;
}

#scroll-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100vw;
    height: 100vh;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
    background:
        linear-gradient(90deg, rgba(232, 236, 240, 0.03) 0 1px, transparent 1px 120px),
        radial-gradient(circle, rgba(168, 173, 179, 0.16) 0.8px, transparent 1px) 0 0 / 16px 16px,
        var(--black);
}

#scroll-container::-webkit-scrollbar {
    height: 0;
}

.era-gate,
.era-terminus {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100vw;
    min-width: 100vw;
    height: 100vh;
    flex: 0 0 100vw;
    overflow: hidden;
    background:
        linear-gradient(135deg, #C8CDD3 0%, #E8ECF0 36%, #C8CDD3 56%, #A8ADB3 100%);
    background-size: 220% 220%;
    animation: chrome-shift 11s ease-in-out infinite;
}

.era-gate::before,
.era-terminus::before {
    content: "";
    position: absolute;
    inset: -20%;
    background:
        conic-gradient(from 120deg, transparent, rgba(255,255,255,0.35), transparent 24%, rgba(58,61,66,0.10), transparent 54%);
    mix-blend-mode: overlay;
    transform: rotate(var(--shine-angle, 0deg));
    transition: transform 0.2s ease-out;
}

.signal-grid {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(58, 61, 66, 0.12) 1px, transparent 1px) 0 0 / 44px 44px,
        linear-gradient(0deg, rgba(58, 61, 66, 0.08) 1px, transparent 1px) 0 0 / 44px 44px;
    mask-image: radial-gradient(circle at center, black, transparent 72%);
}

.gate-content,
.terminus-content {
    position: relative;
    z-index: 2;
    width: min(780px, 82vw);
    text-align: center;
}

.system-label,
.gate-instruction,
.corridor-kicker,
.year-badge,
.event-context {
    font-family: "IBM Plex Mono", "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.system-label {
    margin-bottom: 1.5rem;
    color: rgba(58, 61, 66, 0.72);
    font-size: clamp(0.68rem, 0.9vw, 0.84rem);
}

.kanji-title,
.terminus-text {
    position: relative;
    font-family: "Roboto Slab", Georgia, "Times New Roman", serif;
    font-weight: 700;
    font-size: clamp(4rem, 12vw, 10rem);
    line-height: 0.9;
    letter-spacing: 0.16em;
    color: var(--gunmetal);
    text-shadow: 3px 0 var(--red), -3px 0 var(--cyan), 0 16px 42px rgba(14, 15, 17, 0.22);
    animation: kanji-enter 1.8s cubic-bezier(0.2, 0.8, 0.2, 1), chroma-drift 6s steps(2, end) infinite 1.8s;
}

.kanji-title::before,
.terminus-text::before,
.kanji-title::after,
.terminus-text::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}

.kanji-title::before,
.terminus-text::before {
    color: var(--red);
    clip-path: inset(8% 0 58% 0);
    transform: translateX(-7px);
    animation: title-glitch-a 4.9s steps(1, end) infinite;
}

.kanji-title::after,
.terminus-text::after {
    color: var(--cyan);
    clip-path: inset(56% 0 18% 0);
    transform: translateX(7px);
    animation: title-glitch-b 6.2s steps(1, end) infinite;
}

.gate-copy,
.terminus-copy {
    max-width: 600px;
    margin: 2rem auto 0;
    color: rgba(58, 61, 66, 0.8);
    font-size: clamp(1rem, 1.45vw, 1.35rem);
    line-height: 1.55;
}

.gate-instruction {
    margin-top: 2rem;
    color: var(--gunmetal);
    font-size: clamp(0.68rem, 0.9vw, 0.82rem);
}

.gate-instruction::after {
    content: " █";
    animation: blink 1s steps(1, end) infinite;
}

.corridor {
    position: relative;
    display: flex;
    align-items: center;
    gap: clamp(78px, 10vw, 150px);
    width: max-content;
    min-width: 230vw;
    height: 100vh;
    flex: 0 0 auto;
    padding: 0 clamp(150px, 18vw, 260px) 0 clamp(240px, 25vw, 360px);
    background:
        repeating-linear-gradient(0deg, rgba(232, 236, 240, 0.025) 0 1px, transparent 1px 4px),
        linear-gradient(90deg, rgba(232,236,240,0.05), transparent 20%, rgba(168,173,179,0.04) 58%, transparent),
        radial-gradient(circle at center, rgba(58,61,66,0.58) 0.7px, transparent 1px) 0 0 / 14px 14px,
        var(--black);
    isolation: isolate;
}

.corridor::before {
    content: "";
    position: absolute;
    top: 11vh;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--signal), transparent);
    box-shadow: 0 70vh 0 rgba(200, 205, 211, 0.16);
    opacity: 0.55;
}

.corridor-bubble { --signal: #E84545; }
.corridor-lost { --signal: #5BA4B5; }
.corridor-quiet { --signal: #C87D8A; }

.corridor-header {
    position: sticky;
    left: clamp(36px, 6vw, 90px);
    z-index: 5;
    width: clamp(180px, 18vw, 280px);
    flex: 0 0 auto;
    padding: 1.2rem;
    color: var(--chrome);
    background: rgba(14, 15, 17, 0.34);
    border-left: 2px solid var(--signal);
    backdrop-filter: blur(6px);
}

.corridor-kicker {
    margin-bottom: 0.7rem;
    color: var(--signal);
    font-size: clamp(0.65rem, 0.82vw, 0.78rem);
}

.corridor-title {
    font-family: "Roboto Slab", Georgia, "Times New Roman", serif;
    font-size: clamp(2rem, 4vw, 4rem);
    line-height: 1;
    color: var(--paper);
    text-shadow: 2px 0 rgba(232, 69, 69, 0.45), -2px 0 rgba(91, 164, 181, 0.45);
}

.corridor-subtitle {
    margin-top: 0.75rem;
    color: rgba(232, 236, 240, 0.68);
    font-size: clamp(0.95rem, 1.25vw, 1.2rem);
    line-height: 1.25;
}

.corridor-watermark {
    position: sticky;
    left: 48vw;
    z-index: 0;
    flex: 0 0 0;
    width: 0;
    font-family: "Roboto Slab", Georgia, "Times New Roman", serif;
    font-size: clamp(16rem, 30vw, 34rem);
    font-weight: 300;
    line-height: 1;
    color: rgba(232, 236, 240, 0.035);
    transform: translateX(-50%);
    pointer-events: none;
}

.event-panel {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    width: var(--panel-width);
    height: 78vh;
    flex: 0 0 var(--panel-width);
    padding: clamp(28px, 4.2vw, 56px);
    overflow: hidden;
    background: linear-gradient(135deg, #C8CDD3 0%, #E8ECF0 40%, #C8CDD3 60%, #A8ADB3 100%);
    background-size: 200% 200%;
    animation: chrome-shift 8s ease infinite;
    border: 1px solid rgba(200, 205, 211, 0.48);
    border-top: 5px solid color-mix(in srgb, var(--signal) 46%, transparent);
    border-radius: 3px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255,255,255,0.55);
    opacity: 0.62;
    transform: scale(0.84) translateY(1.5vh);
    transition: transform 0.65s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.55s ease, box-shadow 0.55s ease, border-color 0.55s ease;
}

.event-panel::before,
.event-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
}

.event-panel::before {
    background:
        linear-gradient(90deg, rgba(232,69,69,0.16), transparent 20%, rgba(91,164,181,0.14)),
        repeating-linear-gradient(0deg, transparent 0 9px, rgba(14,15,17,0.08) 9px 10px);
    mix-blend-mode: multiply;
    clip-path: inset(24% 0 48% 0);
    animation: panel-glitch-a 7.5s steps(1, end) infinite;
}

.event-panel::after {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.42), transparent);
    transform: translateX(-130%) skewX(-18deg);
    opacity: 0.34;
    animation: chrome-sweep 6s ease-in-out infinite;
}

.event-panel.panel--focused {
    opacity: 1;
    transform: scale(1) translateY(0);
    border-color: var(--paper);
    box-shadow: 0 42px 100px rgba(0, 0, 0, 0.55), 0 0 34px color-mix(in srgb, var(--signal) 32%, transparent), inset 0 1px 0 rgba(255,255,255,0.8);
}

.event-panel.panel--focused::before {
    opacity: 1;
}

.event-panel.panel--focused .year-badge {
    background: var(--signal);
    color: var(--paper);
}

.year-badge {
    align-self: flex-start;
    padding: 0.45rem 0.75rem;
    border: 1px solid rgba(58, 61, 66, 0.12);
    background: rgba(232, 236, 240, 0.45);
    color: var(--gunmetal);
    font-size: clamp(0.68rem, 0.88vw, 0.82rem);
    transition: background 0.4s ease, color 0.4s ease;
}

.event-title {
    margin-top: clamp(1.4rem, 3vh, 2.5rem);
    font-family: "Roboto Slab", Georgia, "Times New Roman", serif;
    font-size: clamp(1.45rem, 2.5vw, 2.35rem);
    line-height: 1.08;
    color: var(--gunmetal);
}

.event-description {
    margin-top: 1.45rem;
    color: rgba(58, 61, 66, 0.92);
    font-size: clamp(0.96rem, 1.22vw, 1.12rem);
    line-height: 1.68;
}

.event-context {
    margin-top: auto;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(58, 61, 66, 0.22);
    color: rgba(58, 61, 66, 0.78);
    font-size: clamp(0.68rem, 0.86vw, 0.8rem);
    line-height: 1.5;
}

.event-panel.disaster {
    background:
        linear-gradient(135deg, rgba(232,69,69,0.14), transparent 26%),
        linear-gradient(135deg, #C8CDD3 0%, #E8ECF0 40%, #C8CDD3 60%, #A8ADB3 100%);
}

.terminus-text {
    color: rgba(58, 61, 66, 0.18);
    font-weight: 300;
}

.scan-overlay,
.tracking-noise {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.scan-overlay {
    z-index: 20;
    background: repeating-linear-gradient(0deg, transparent 0 2px, rgba(14, 15, 17, 0.045) 2px 4px);
}

.tracking-noise {
    z-index: 19;
    opacity: 0.13;
    background:
        linear-gradient(90deg, transparent 0 97%, rgba(232,236,240,0.18) 98% 100%) 0 0 / 37px 100%,
        repeating-radial-gradient(circle at 17% 23%, rgba(232,236,240,0.2) 0 1px, transparent 1px 5px);
    mix-blend-mode: screen;
    animation: noise-step 0.7s steps(2, end) infinite;
}

.progress-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    height: 5px;
    background: rgba(200, 205, 211, 0.24);
}

.progress-indicator {
    position: absolute;
    top: 50%;
    left: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: var(--red);
    box-shadow: 0 0 18px var(--red), 0 0 2px var(--paper) inset;
    transition: background 0.28s ease, box-shadow 0.28s ease;
}

html[data-era="1989"] .progress-indicator { background: #E84545; box-shadow: 0 0 18px #E84545; }
html[data-era="1999"] .progress-indicator { background: #5BA4B5; box-shadow: 0 0 18px #5BA4B5; }
html[data-era="2009"] .progress-indicator { background: #C87D8A; box-shadow: 0 0 18px #C87D8A; }

@keyframes chrome-shift {
    0%, 100% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
}

@keyframes kanji-enter {
    from { opacity: 0; transform: scale(1.08); filter: blur(8px); }
    to { opacity: 1; transform: scale(1); filter: blur(0); }
}

@keyframes chroma-drift {
    0%, 86%, 100% { text-shadow: 3px 0 var(--red), -3px 0 var(--cyan), 0 16px 42px rgba(14, 15, 17, 0.22); }
    88% { text-shadow: 8px 0 var(--red), -5px 0 var(--cyan), 0 16px 42px rgba(14, 15, 17, 0.22); }
    90% { text-shadow: -3px 0 var(--red), 6px 0 var(--cyan), 0 16px 42px rgba(14, 15, 17, 0.22); }
}

@keyframes title-glitch-a {
    0%, 91%, 100% { opacity: 0; transform: translateX(0); }
    92% { opacity: 0.9; transform: translateX(-10px); }
    93% { opacity: 0.2; transform: translateX(6px); }
}

@keyframes title-glitch-b {
    0%, 88%, 100% { opacity: 0; transform: translateX(0); }
    89% { opacity: 0.75; transform: translateX(9px); }
    90% { opacity: 0.25; transform: translateX(-5px); }
}

@keyframes blink { 50% { opacity: 0; } }

@keyframes panel-glitch-a {
    0%, 90%, 100% { transform: translateX(0); clip-path: inset(24% 0 48% 0); }
    91% { transform: translateX(8px); clip-path: inset(12% 0 64% 0); }
    92% { transform: translateX(-6px); clip-path: inset(58% 0 16% 0); }
    93% { transform: translateX(3px); clip-path: inset(34% 0 42% 0); }
}

@keyframes chrome-sweep {
    0%, 40% { transform: translateX(-130%) skewX(-18deg); }
    62% { transform: translateX(130%) skewX(-18deg); }
    100% { transform: translateX(130%) skewX(-18deg); }
}

@keyframes noise-step {
    0% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(6px, -4px, 0); }
    100% { transform: translate3d(-3px, 2px, 0); }
}

@media (max-width: 780px) {
    .corridor {
        min-width: max-content;
        padding: 0 8vw 0 16vw;
        gap: 8vw;
    }

    .corridor-header {
        position: relative;
        left: auto;
        width: 62vw;
    }

    .event-panel {
        width: 84vw;
        flex-basis: 84vw;
        height: 72vh;
    }
}
