:root {
    /* Commissioner (Google Fonts) / IBM Plex Sans" (Google Fonts) / IBM Plex Mono" (Google Fonts). IntersectionObserver on the horizontal scroll axis. Elements slide in from the right (translateX(80px to translateX(0)). */
    --bunker-black: #0d0f14;
    --midnight-steel: #141820;
    --graphite-smoke: #1e2430;
    --amber-signal: #d4a843;
    --phosphor-green: #39ff7a;
    --crimson-warning: #c23b22;
    --phosphor-mist: #a8b8c0;
    --slate-fog: #6b7a82;
    --vacuum-amber-glow: #f5c44e;
    --ghost-white: #e8eff4;
}

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

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: "IBM Plex Sans", Inter, sans-serif;
    background: var(--bunker-black);
    color: var(--phosphor-mist);
    line-height: 1.65;
    letter-spacing: 0.01em;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, rgba(30, 36, 48, 0.5) 1px, transparent 1px);
    background-size: 4px 4px;
    opacity: 0.38;
}

.scanline-overlay,
.vignette-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.scanline-overlay {
    z-index: 90;
    background-image: repeating-linear-gradient(0deg, rgba(232, 239, 244, 0.03) 0, rgba(232, 239, 244, 0.03) 1px, transparent 1px, transparent 2px);
    animation: scan-drift 4s linear infinite;
}

.vignette-overlay {
    z-index: 89;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(13, 15, 20, 0.18) 46%, rgba(13, 15, 20, 0.6) 100%);
}

@keyframes scan-drift { to { transform: translateY(2px); } }

.scroll-container {
    position: relative;
    z-index: 2;
    display: flex;
    width: 500vw;
    height: 100vh;
    overflow-x: scroll;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    background: var(--bunker-black);
}

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

.chamber {
    position: relative;
    width: 100vw;
    height: 100vh;
    flex-shrink: 0;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: clamp(1.4rem, 3vw, 3rem);
    background:
        radial-gradient(circle at 52% 48%, rgba(245, 196, 78, 0.1), transparent 19rem),
        linear-gradient(135deg, var(--bunker-black) 0%, var(--midnight-steel) 52%, var(--graphite-smoke) 100%);
}

.chamber::before {
    content: "";
    position: absolute;
    inset: 9vh 6vw;
    border: 1px solid rgba(107, 122, 130, 0.18);
    box-shadow: inset 0 0 44px rgba(13, 15, 20, 0.65);
}

.chamber::after {
    content: "";
    position: absolute;
    left: -10vw;
    right: -10vw;
    top: 50%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 168, 67, 0.24), transparent);
}

.chamber-content {
    position: relative;
    z-index: 3;
    width: min(92vw, 1080px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    text-align: center;
}

.decoder-layout {
    display: grid;
    grid-template-columns: minmax(260px, 0.85fr) minmax(320px, 1.15fr);
    gap: clamp(1.4rem, 5vw, 5rem);
    align-items: center;
    text-align: left;
}

.waveform-layout,
.archive-layout,
.oath-layout { max-width: 1100px; }

.reveal-item {
    opacity: 0;
    transform: translateX(80px);
    transition: opacity 800ms cubic-bezier(0.16, 1, 0.3, 1), transform 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

.chamber-content.revealed .reveal-item { opacity: 1; transform: translateX(0); }
.chamber-content.revealed .reveal-item:nth-child(2) { transition-delay: 120ms; }
.chamber-content.revealed .reveal-item:nth-child(3) { transition-delay: 240ms; }
.chamber-content.revealed .reveal-item:nth-child(4) { transition-delay: 360ms; }
.chamber-content.revealed .reveal-item:nth-child(5) { transition-delay: 480ms; }
.chamber-content.revealed .reveal-item:nth-child(6) { transition-delay: 600ms; }

.eyebrow,
.chamber-subtitle,
.chamber-label,
.terminal-label,
.scope-header {
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.eyebrow {
    color: var(--amber-signal);
    font-size: 0.75rem;
}

.chamber-title {
    font-family: Commissioner, Inter, sans-serif;
    font-size: clamp(2.8rem, 6vw, 5.6rem);
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.02;
    text-transform: uppercase;
    color: var(--amber-signal);
    text-shadow: 0 0 26px rgba(212, 168, 67, 0.16);
}

.korean-title {
    font-family: "Noto Sans KR", sans-serif;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.chamber-subtitle {
    color: var(--phosphor-green);
    font-size: 0.95rem;
    text-transform: lowercase;
}

.chamber-prompt,
.chamber-reflection {
    color: var(--phosphor-mist);
    font-size: clamp(1rem, 1.5vw, 1.16rem);
    max-width: 650px;
}

.chamber-label {
    color: var(--slate-fog);
    font-size: 0.78rem;
    text-transform: lowercase;
}

.background-hangul,
.seal-stamp {
    position: absolute;
    font-family: "Noto Sans KR", sans-serif;
    font-weight: 300;
    color: rgba(212, 168, 67, 0.045);
    pointer-events: none;
}

.background-hangul {
    font-size: 28vw;
    letter-spacing: -0.12em;
    top: 10vh;
}

.seal-stamp {
    right: 12vw;
    bottom: 13vh;
    color: rgba(194, 59, 34, 0.18);
    border: 3px double rgba(194, 59, 34, 0.22);
    font-size: clamp(2.8rem, 8vw, 7rem);
    padding: 0.2em 0.3em;
    transform: rotate(-9deg);
}

.wireframe-stage {
    width: clamp(190px, 25vw, 320px);
    aspect-ratio: 1.15;
    display: grid;
    place-items: center;
    filter: drop-shadow(0 0 22px rgba(245, 196, 78, 0.17));
    perspective: 900px;
}

.mouth-wireframe {
    width: 100%;
    animation: wire-rotate 60s linear infinite;
    transform-style: preserve-3d;
}

@keyframes wire-rotate {
    from { transform: rotateX(30deg) rotateY(45deg) rotateZ(0deg); }
    to { transform: rotateX(30deg) rotateY(405deg) rotateZ(0deg); }
}

.scroll-indicator {
    position: fixed;
    left: 50%;
    bottom: 2rem;
    width: min(260px, 42vw);
    height: 2px;
    transform: translateX(-50%);
    background: rgba(107, 122, 130, 0.25);
    overflow: hidden;
}

.scroll-indicator span {
    display: block;
    width: 35%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--amber-signal), transparent);
    animation: slide-right 1.8s ease-in-out infinite;
}

@keyframes slide-right { 50% { transform: translateX(190%); } }

.isometric-console {
    position: relative;
    transform: rotateX(58deg) rotateZ(-35deg);
    transform-style: preserve-3d;
    perspective: 1200px;
}

.console-top,
.console-display,
.console-base {
    border: 1px solid rgba(212, 168, 67, 0.74);
    background: var(--midnight-steel);
    box-shadow: inset 0 0 24px rgba(212, 168, 67, 0.08), 0 28px 52px rgba(0, 0, 0, 0.45);
}

.console-top,
.console-base { height: 74px; transform: translateZ(-22px); }
.console-top { display: flex; align-items: center; justify-content: space-between; padding: 0 1rem; }
.console-base { display: flex; gap: 1rem; padding: 1rem; }
.console-base b { flex: 1; background: var(--bunker-black); border: 1px solid var(--slate-fog); }

.console-display {
    transform: translateZ(24px);
    padding: 1.1rem;
    min-height: 350px;
}

.console-display > * { transform: rotateZ(35deg) rotateX(-58deg); transform-origin: center; }

.terminal-label { display: block; color: var(--amber-signal); font-size: 0.7rem; margin-bottom: 0.7rem; }

.input-field {
    width: 100%;
    height: 128px;
    resize: none;
    outline: none;
    border: 1px solid var(--slate-fog);
    background: var(--bunker-black);
    color: var(--phosphor-green);
    caret-color: var(--phosphor-green);
    font: 400 0.96rem/1.45 "IBM Plex Mono", monospace;
    padding: 1rem;
    box-shadow: inset 0 0 20px rgba(57, 255, 122, 0.05);
}

.input-field:focus { border-color: var(--phosphor-green); box-shadow: 0 0 18px rgba(57, 255, 122, 0.16), inset 0 0 20px rgba(57, 255, 122, 0.06); }
.input-field::placeholder { color: var(--slate-fog); }

.ticker-frame {
    margin-top: 1rem;
    border: 1px dashed var(--slate-fog);
    background: #0d0f14;
    overflow: hidden;
}

.ticker-tape {
    min-height: 42px;
    color: var(--phosphor-green);
    font: 400 0.8rem/42px "IBM Plex Mono", monospace;
    letter-spacing: 0.08em;
    white-space: nowrap;
    padding-left: 0.65rem;
}

@keyframes tape-advance { from { transform: translateX(-14px); opacity: 0.45; } to { transform: translateX(0); opacity: 1; } }

.punch-card-strip { display: flex; gap: 0.48rem; margin-top: 1rem; }
.punch-card-strip span { width: 24px; height: 12px; border: 1px solid var(--slate-fog); background: rgba(212, 168, 67, 0.08); }
.punch-card-strip span:nth-child(2n) { background: transparent; }

.reel-bank { display: flex; align-items: center; gap: 0.8rem; }
.reel { width: 58px; height: 58px; border: 2px solid var(--amber-signal); border-radius: 50%; background: radial-gradient(circle, var(--bunker-black) 10%, transparent 11%), conic-gradient(from 0deg, transparent, rgba(212, 168, 67, 0.38), transparent 25%); animation: spool 6s linear infinite; }
.reel-small { width: 42px; height: 42px; animation-duration: 4s; }
.tape-line { width: 56px; border-top: 2px dashed var(--amber-signal); animation: dash 1.7s linear infinite; }
@keyframes spool { to { transform: rotate(360deg); } }
@keyframes dash { to { filter: hue-rotate(35deg); } }
.tube-row { display: flex; gap: 0.5rem; }
.tube-row i { width: 14px; height: 42px; border-radius: 9px; border: 1px solid var(--amber-signal); background: radial-gradient(circle at 50% 70%, rgba(245, 196, 78, 0.5), transparent 58%); animation: tube-pulse 2s ease-in-out infinite; }
.tube-row i:nth-child(2) { animation-delay: 0.55s; }
.tube-row i:nth-child(3) { animation-delay: 1.1s; }
@keyframes tube-pulse { 50% { box-shadow: 0 0 22px rgba(245, 196, 78, 0.38); } }

.phosphor-screen {
    width: min(92vw, 960px);
    border: 2px solid var(--phosphor-green);
    background: var(--bunker-black);
    padding: 1rem;
    box-shadow: inset 0 0 44px rgba(57, 255, 122, 0.12), 0 0 34px rgba(57, 255, 122, 0.18);
}

.scope-header { display: flex; justify-content: space-between; color: var(--phosphor-green); font-size: 0.72rem; margin-bottom: 0.7rem; }
#waveform-canvas { width: 100%; height: auto; display: block; background: var(--bunker-black); }

.dossier-grid {
    width: min(84vw, 900px);
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    gap: 1.4rem;
    margin: 1rem 0 0.5rem;
    perspective: 1000px;
    transform: rotateX(55deg) rotateZ(-45deg);
    transform-style: preserve-3d;
}

.dossier-card {
    position: relative;
    min-height: 178px;
    padding: 1rem;
    border: 1px solid var(--slate-fog);
    border-radius: 4px;
    background: linear-gradient(135deg, rgba(212, 168, 67, 0.08), transparent 50%), var(--midnight-steel);
    box-shadow: inset 0 0 18px rgba(232, 239, 244, 0.035), 0 18px 38px rgba(0, 0, 0, 0.46);
    transform: rotateZ(45deg) rotateX(-55deg) translateY(40px);
    opacity: 0;
    animation: card-rise 700ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
    overflow: hidden;
}

.dossier-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(232, 239, 244, 0.05) 1px, transparent 1px);
    background-size: 5px 5px;
    opacity: 0.55;
    pointer-events: none;
}

.dossier-card:nth-child(2) { animation-delay: 150ms; }
.dossier-card:nth-child(3) { animation-delay: 300ms; }
.dossier-card:nth-child(4) { animation-delay: 450ms; }
.dossier-card:nth-child(5) { animation-delay: 600ms; }
.dossier-card:nth-child(6) { animation-delay: 750ms; }

@keyframes card-rise { to { opacity: 1; transform: rotateZ(45deg) rotateX(-55deg) translateY(0); } }

.card-label { font: 400 0.68rem "IBM Plex Mono", monospace; color: var(--slate-fog); letter-spacing: 0.08em; text-transform: uppercase; }
.card-word { position: relative; z-index: 1; color: var(--phosphor-mist); font-weight: 500; font-size: 1.08rem; margin: 0.4rem 0; word-break: break-word; }
.gauge { position: relative; width: 118px; height: 70px; margin: 0.7rem auto 0; overflow: hidden; }
.gauge-arc { position: absolute; left: 7px; top: 8px; width: 104px; height: 104px; border-radius: 50%; border: 10px solid transparent; border-top-color: var(--phosphor-green); border-left-color: var(--phosphor-green); border-right-color: var(--crimson-warning); transform: rotate(45deg); box-shadow: 0 0 14px rgba(57, 255, 122, 0.1); }
.gauge-needle { position: absolute; left: 58px; bottom: 4px; width: 2px; height: 56px; background: var(--amber-signal); transform-origin: 50% 100%; transform: rotate(var(--needle-angle)); box-shadow: 0 0 12px rgba(212, 168, 67, 0.65); transition: transform 650ms cubic-bezier(0.16, 1, 0.3, 1); }
.gauge-center { position: absolute; left: 52px; bottom: 0; width: 14px; height: 14px; border-radius: 50%; background: var(--amber-signal); }
.rating-text { font: 400 0.7rem "IBM Plex Mono", monospace; color: var(--amber-signal); text-align: center; }

.infinite-line { width: 300vw; height: 2px; margin-top: 1.8rem; background: linear-gradient(90deg, transparent, var(--amber-signal) 10%, rgba(212, 168, 67, 0.45) 48%, transparent 100%); transform: translateX(36vw); }

.progress-dots {
    position: fixed;
    z-index: 95;
    left: 50%;
    bottom: 0.8rem;
    transform: translateX(-50%);
    display: flex;
    gap: 0.85rem;
}

.progress-dots button {
    width: 8px;
    height: 8px;
    border: 1px solid rgba(107, 122, 130, 0.7);
    background: var(--graphite-smoke);
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
}

.progress-dots button.active { background: var(--amber-signal); border-color: var(--amber-signal); box-shadow: 0 0 16px rgba(212, 168, 67, 0.75); }

.particle-system { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.particle { position: absolute; width: 1px; height: 1px; background: var(--amber-signal); opacity: 0.2; animation: drift-right linear infinite; }
@keyframes drift-right { from { transform: translateX(-5vw); } to { transform: translateX(105vw); } }

.flicker { animation: flicker-drop 100ms linear; }
@keyframes flicker-drop { 50% { opacity: 0.97; } }

@media (max-width: 860px) {
    .decoder-layout { grid-template-columns: 1fr; text-align: center; gap: 1.2rem; }
    .isometric-console { transform: scale(0.82) rotateX(58deg) rotateZ(-35deg); margin: -2rem 0; }
    .dossier-grid { grid-template-columns: repeat(2, minmax(130px, 1fr)); gap: 1rem; transform: rotateX(50deg) rotateZ(-35deg); }
    .dossier-card { min-height: 158px; animation-name: card-rise-mobile; }
    @keyframes card-rise-mobile { to { opacity: 1; transform: rotateZ(35deg) rotateX(-50deg) translateY(0); } }
    .chamber::before { inset: 6vh 4vw; }
}
