/* gamelicens.ing — Y2K Chrome Bureau
   Six-chamber horizontal procession.
   Palette: chrome-metallic + candy-bright + navy-metallic.
*/

:root {
    --floor-chrome: #C8CDD6;
    --mercury-light: #EEF2F7;
    --mercury-shadow: #5C6878;
    --mercury-mid: #9AA5B4;
    --magenta: #FF2D95;
    --cyan: #00E8FF;
    --lavender: #C7B5FF;
    --foil: #FFD23F;
    --ink: #0B0E14;
    --hex-tint: #9AA5B4;

    --cursor-x: 0.5;
    --cursor-y: 0.5;
    --lattice-rot: 0deg;
    --scroll-x: 0;
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--floor-chrome);
    color: var(--ink);
    font-family: 'Space Grotesk', sans-serif;
    -webkit-font-smoothing: antialiased;
    cursor: default;
}

body {
    position: fixed;
    inset: 0;
    overflow: hidden;
}

/* ========== HEX LATTICE BACKGROUND ========== */
.hex-lattice {
    position: fixed;
    inset: -10vmax;
    width: calc(100% + 20vmax);
    height: calc(100% + 20vmax);
    z-index: 0;
    pointer-events: none;
    transform: rotate(var(--lattice-rot));
    transform-origin: center center;
    transition: transform 0.4s ease-out;
    color: var(--hex-tint);
}

.hex-lattice svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* ========== HUD STRIP ========== */
.hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 36px;
    background: linear-gradient(180deg, rgba(255, 45, 149, 0.18), rgba(255, 45, 149, 0.06));
    border-bottom: 1px solid rgba(255, 45, 149, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.12em;
    color: var(--ink);
    text-transform: uppercase;
}

.hud-left,
.hud-center,
.hud-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hud-bureau-name {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    letter-spacing: 0.22em;
    font-size: 11px;
}

.hud-crest {
    display: inline-flex;
    align-items: center;
    width: 22px;
    height: 22px;
}

.hud-step {
    color: var(--magenta);
    font-weight: 500;
}

.hud-chamber-name {
    font-family: 'Major Mono Display', monospace;
    letter-spacing: 0.18em;
    font-size: 12px;
}

.hud-divider {
    color: var(--mercury-shadow);
}

.hud-license {
    color: var(--cyan);
    font-feature-settings: "tnum";
}

.hud-clock {
    color: var(--ink);
    font-feature-settings: "tnum";
    min-width: 70px;
    text-align: right;
}

/* ========== BUREAU (horizontal scroller) ========== */
.bureau {
    position: relative;
    display: flex;
    flex-direction: row;
    height: 100vh;
    will-change: transform;
    transform: translate3d(0, 0, 0);
    z-index: 1;
}

/* ========== CHAMBER (full viewport) ========== */
.chamber {
    position: relative;
    width: 100vw;
    height: 100vh;
    flex-shrink: 0;
    overflow: hidden;
    padding: 70px 7vw 70px 7vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
}

.chamber-floor {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(90deg,
        var(--floor-chrome) calc(var(--cursor-x) * 8%),
        var(--mercury-light) calc(20% + var(--cursor-x) * 12%),
        var(--mercury-shadow) calc(46% + var(--cursor-x) * 6%),
        var(--mercury-light) calc(70% + var(--cursor-x) * 10%),
        var(--floor-chrome) 100%);
    opacity: 0.85;
}

.chamber-floor::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at calc(var(--cursor-x) * 100%) calc(var(--cursor-y) * 100%),
        rgba(255, 255, 255, 0.18),
        rgba(0, 0, 0, 0) 60%);
    pointer-events: none;
}

.chamber-content {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 18px;
    justify-content: center;
}

/* Chamber-specific tinted floors */
.chamber-1 .chamber-floor {
    background: linear-gradient(90deg,
        #5C6878 calc(var(--cursor-x) * 6%),
        var(--floor-chrome) calc(18% + var(--cursor-x) * 10%),
        var(--mercury-light) 50%,
        var(--floor-chrome) calc(70% + var(--cursor-x) * 8%),
        var(--mercury-shadow) 100%);
}

.chamber-2 .chamber-floor {
    background: linear-gradient(90deg,
        var(--floor-chrome) calc(var(--cursor-x) * 8%),
        var(--mercury-light) 30%,
        rgba(199, 181, 255, 0.55) 55%,
        var(--mercury-light) 75%,
        var(--floor-chrome) 100%);
}

.chamber-3 .chamber-floor {
    background: linear-gradient(90deg,
        var(--mercury-shadow) 0%,
        var(--floor-chrome) calc(20% + var(--cursor-x) * 8%),
        var(--mercury-light) calc(48% + var(--cursor-x) * 6%),
        var(--floor-chrome) 75%,
        var(--mercury-shadow) 100%);
}

.chamber-4 .chamber-floor {
    background: linear-gradient(90deg,
        var(--floor-chrome) 0%,
        rgba(255, 210, 63, 0.18) 30%,
        var(--mercury-light) calc(50% + var(--cursor-x) * 6%),
        rgba(255, 45, 149, 0.18) 70%,
        var(--floor-chrome) 100%);
}

.chamber-5 .chamber-floor {
    background: linear-gradient(90deg,
        var(--mercury-shadow) 0%,
        var(--floor-chrome) 22%,
        var(--mercury-light) 50%,
        var(--floor-chrome) 78%,
        var(--mercury-shadow) 100%);
}

.chamber-6 .chamber-floor {
    background: linear-gradient(90deg,
        var(--mercury-shadow) 0%,
        var(--floor-chrome) 18%,
        rgba(255, 45, 149, 0.22) 40%,
        rgba(0, 232, 255, 0.22) 60%,
        var(--floor-chrome) 82%,
        var(--mercury-shadow) 100%);
}

/* ========== PLAQUE (chamber numeral) ========== */
.plaque {
    display: inline-flex;
    align-items: baseline;
    gap: 14px;
    padding: 6px 14px;
    border: 1px solid var(--mercury-shadow);
    border-radius: 2px;
    background: linear-gradient(180deg, var(--mercury-light), var(--floor-chrome));
    box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 var(--mercury-shadow);
    width: fit-content;
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
}

.plaque-num {
    color: var(--cyan);
    font-weight: 700;
    font-size: 28px;
    letter-spacing: 0.22em;
    text-shadow: -1.2px 0 0 var(--cyan), 1.2px 0 0 var(--magenta);
}

.plaque-label {
    color: var(--ink);
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.32em;
}

/* ========== CHAMBER TITLE (chromatic aberration) ========== */
.chamber-title {
    font-family: 'Major Mono Display', monospace;
    font-weight: 400;
    font-size: clamp(2.6rem, 6vw, 5.4rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink);
    line-height: 1;
    text-shadow:
        -2.4px 0 0 var(--cyan),
        2.4px 0 0 var(--magenta),
        0 1px 0 #fff;
    transition: text-shadow 0.6s ease;
}

.chamber-title:hover {
    text-shadow:
        -4px 0 0 var(--cyan),
        4px 0 0 var(--magenta),
        0 1px 0 #fff;
    animation: title-wobble 0.6s ease-in-out;
}

@keyframes title-wobble {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-1.5px); }
    75%      { transform: translateX(1.5px); }
}

/* ========== QUOTE (Syne italic) ========== */
.chamber-quote {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-style: italic;
    font-size: clamp(1.4rem, 2.8vw, 2.2rem);
    color: var(--magenta);
    line-height: 1.25;
    max-width: 780px;
    text-shadow:
        -1.2px 0 0 var(--cyan),
        1.2px 0 0 var(--magenta);
}

/* ========== NARRATION (Space Grotesk body) ========== */
.chamber-narration {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.55;
    color: var(--ink);
    max-width: 640px;
    border-left: 2px solid var(--magenta);
    padding-left: 14px;
}

/* ========== DIAGONAL CORRIDORS ========== */
.diagonal-section {
    flex-shrink: 0;
    width: 14vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

.corridor-stripe {
    position: absolute;
    inset: -10% -20%;
    transform: skewX(-7deg);
    transform-origin: center;
}

.corridor-1-2 { background: linear-gradient(90deg, var(--mercury-shadow), var(--floor-chrome), rgba(199, 181, 255, 0.6)); }
.corridor-2-3 { background: linear-gradient(90deg, rgba(199, 181, 255, 0.6), var(--mercury-light), var(--mercury-shadow)); }
.corridor-3-4 { background: linear-gradient(90deg, var(--mercury-shadow), var(--floor-chrome), rgba(255, 210, 63, 0.4)); }
.corridor-4-5 { background: linear-gradient(90deg, rgba(255, 45, 149, 0.4), var(--floor-chrome), var(--mercury-shadow)); }
.corridor-5-6 { background: linear-gradient(90deg, var(--mercury-shadow), var(--floor-chrome), rgba(0, 232, 255, 0.45)); }

/* ========== CHAMBER 1: THRESHOLD ========== */
.chamber-1 .chamber-content {
    align-items: center;
    text-align: center;
}

.chamber-1 .plaque {
    align-self: center;
}

.threshold-stage {
    position: relative;
    width: min(640px, 80vw);
    height: min(520px, 60vh);
    margin: 0 auto;
}

.door {
    position: absolute;
    top: 50%;
    width: 38%;
    height: 90%;
    transform-origin: center;
    transform: translateY(-50%);
    box-shadow: 0 18px 45px -10px rgba(0, 0, 0, 0.45);
    transition: transform 2.4s cubic-bezier(.34, 1.56, .64, 1);
}

.door svg {
    width: 100%;
    height: 100%;
    display: block;
}

.door-left {
    left: 0;
    transform-origin: 100% 50%;
    transform: translateY(-50%) perspective(900px) rotateY(0deg);
}

.door-right {
    right: 0;
    transform-origin: 0% 50%;
    transform: translateY(-50%) perspective(900px) rotateY(0deg);
}

.bureau.doors-open .door-left {
    transform: translateY(-50%) perspective(900px) rotateY(-94deg);
}

.bureau.doors-open .door-right {
    transform: translateY(-50%) perspective(900px) rotateY(94deg);
}

.bureau.doors-closing .door-left {
    transform: translateY(-50%) perspective(900px) rotateY(0deg);
}

.bureau.doors-closing .door-right {
    transform: translateY(-50%) perspective(900px) rotateY(0deg);
}

.crest {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    transform: translate(-50%, -50%);
    animation: crest-rotate 1500s linear infinite;
    filter: drop-shadow(0 0 24px rgba(0, 232, 255, 0.5));
}

.crest svg {
    width: 100%;
    height: 100%;
    display: block;
}

@keyframes crest-rotate {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ========== CHAMBER 2: INTAKE COUNTER ========== */
.chamber-2 .chamber-content {
    align-items: stretch;
}

.intake-stage {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 50px;
    align-items: center;
    margin-top: 20px;
}

.intake-text {
    position: relative;
    padding: 24px 28px;
    background: linear-gradient(180deg, rgba(238, 242, 247, 0.55), rgba(200, 205, 214, 0.55));
    border-left: 3px solid var(--magenta);
    border-right: 1px solid var(--mercury-shadow);
    border-radius: 2px;
}

.typewriter {
    font-family: 'Syne', sans-serif;
    font-style: italic;
    font-weight: 700;
    font-size: clamp(1.6rem, 2.6vw, 2.2rem);
    color: var(--magenta);
    line-height: 1.3;
    min-height: 5em;
    text-shadow: -1.2px 0 0 var(--cyan), 1.2px 0 0 var(--magenta);
}

.caret {
    display: inline-block;
    width: 10px;
    height: 1.2em;
    margin-left: 4px;
    background: var(--magenta);
    vertical-align: text-bottom;
    animation: caret-blink 0.83s steps(2) infinite;
    box-shadow: 0 0 8px var(--magenta);
}

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

.kiosk {
    position: relative;
    justify-self: center;
    width: min(380px, 36vw);
    aspect-ratio: 3 / 4;
    animation: kiosk-pulse 4s ease-in-out infinite;
}

@keyframes kiosk-pulse {
    0%, 100% { filter: drop-shadow(0 0 18px rgba(199, 181, 255, 0.45)); }
    50%      { filter: drop-shadow(0 0 36px rgba(199, 181, 255, 0.85)); }
}

.kiosk-bezel-outer,
.kiosk-bezel-mid,
.kiosk-bezel-inner {
    border-radius: 8px;
    border: 1px solid var(--mercury-shadow);
}

.kiosk-bezel-outer {
    background: linear-gradient(180deg, var(--mercury-light), var(--floor-chrome) 50%, var(--mercury-shadow));
    box-shadow:
        inset 1px 1px 0 rgba(255, 255, 255, 0.7),
        inset -1px -1px 0 rgba(0, 0, 0, 0.3),
        0 18px 30px -6px rgba(0, 0, 0, 0.35);
    padding: 12px;
    height: 100%;
}

.kiosk-bezel-mid {
    background: linear-gradient(180deg, var(--mercury-shadow), var(--floor-chrome) 50%, var(--mercury-light));
    padding: 10px;
    height: 100%;
    box-shadow:
        inset 1px 1px 0 rgba(255, 255, 255, 0.5),
        inset -1px -1px 0 rgba(0, 0, 0, 0.25);
}

.kiosk-bezel-inner {
    background: linear-gradient(180deg, var(--mercury-light), var(--floor-chrome));
    padding: 12px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: inset 0 0 0 1px var(--mercury-shadow);
}

.kiosk-screen {
    position: relative;
    flex: 1;
    background: radial-gradient(ellipse at top, rgba(199, 181, 255, 0.85), rgba(199, 181, 255, 0.5)),
                linear-gradient(180deg, #2a2638, #14111f);
    border-radius: 4px;
    padding: 14px 12px;
    overflow: hidden;
    border: 1px solid var(--ink);
    box-shadow: inset 0 0 24px rgba(199, 181, 255, 0.6);
}

.kiosk-scanline {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--cyan), transparent);
    opacity: 0.85;
    animation: scanline 2.4s linear infinite;
    pointer-events: none;
}

@keyframes scanline {
    0%   { transform: translateY(0); }
    100% { transform: translateY(220px); }
}

.kiosk-readout {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--lavender);
    text-shadow: 0 0 6px rgba(199, 181, 255, 0.85);
    letter-spacing: 0.06em;
}

.kiosk-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed rgba(199, 181, 255, 0.4);
    padding-bottom: 3px;
}

.kiosk-key {
    color: var(--cyan);
}

.kiosk-val {
    color: var(--lavender);
    font-feature-settings: "tnum";
}

.kiosk-blink {
    color: var(--magenta);
    animation: blink 1.4s steps(2) infinite;
}

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

.kiosk-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding: 8px 0 4px;
}

.kiosk-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--mercury-shadow);
    box-shadow:
        inset 2px 2px 4px rgba(255, 255, 255, 0.6),
        inset -2px -2px 4px rgba(0, 0, 0, 0.3);
}

.kiosk-btn-magenta { background: radial-gradient(circle at 35% 35%, #ff8ac9, var(--magenta)); }
.kiosk-btn-cyan    { background: radial-gradient(circle at 35% 35%, #aef6ff, var(--cyan)); }
.kiosk-btn-yellow  { background: radial-gradient(circle at 35% 35%, #fff0a3, var(--foil)); }

.kiosk-foot {
    display: block;
    position: absolute;
    left: 50%;
    bottom: -22px;
    transform: translateX(-50%);
    width: 60%;
    height: 18px;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.55), transparent 70%);
}

/* ========== CHAMBER 3: INSPECTION HALL ========== */
.chamber-3 .chamber-content {
    align-items: stretch;
}

.specimen-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: 1fr;
    gap: 16px;
    margin: 14px 0;
    perspective: 1200px;
}

.specimen-card {
    --mx: 0deg;
    --my: 0deg;
    position: relative;
    aspect-ratio: 5 / 7;
    background: linear-gradient(160deg, rgba(238, 242, 247, 0.85), rgba(200, 205, 214, 0.7));
    border: 1px solid var(--mercury-shadow);
    border-radius: 4px;
    padding: 14px 12px;
    box-shadow:
        inset 1px 1px 0 rgba(255, 255, 255, 0.85),
        inset -1px -1px 0 rgba(92, 104, 120, 0.5),
        0 12px 24px -6px rgba(0, 0, 0, 0.35);
    transform: perspective(720px) rotateY(var(--mx)) rotateX(var(--my)) translateY(0);
    transition: transform 0.18s ease-out, box-shadow 0.2s;
    overflow: hidden;
    cursor: crosshair;
}

.specimen-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--mercury-shadow), var(--mercury-light), var(--mercury-shadow));
    box-shadow: inset 1px 0 0 #fff;
    transition: background 0.3s, box-shadow 0.3s;
}

.specimen-card:hover {
    z-index: 5;
    box-shadow:
        inset 1px 1px 0 rgba(255, 255, 255, 0.95),
        inset -1px -1px 0 rgba(92, 104, 120, 0.5),
        0 0 0 1px var(--cyan),
        0 18px 40px -10px rgba(0, 232, 255, 0.55);
}

.specimen-card:hover::before {
    background: linear-gradient(180deg, var(--cyan), var(--magenta));
    box-shadow: 0 0 12px var(--cyan);
}

.specimen-card-num {
    font-family: 'Orbitron', sans-serif;
    font-weight: 500;
    font-size: 10px;
    letter-spacing: 0.22em;
    color: var(--mercury-shadow);
    margin-bottom: 6px;
    display: block;
}

.specimen-card-icon {
    width: 100%;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 6px 0 10px;
}

.specimen-card-icon svg {
    width: 56px;
    height: 56px;
    color: var(--ink);
}

.specimen-card-name {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 12px;
    line-height: 1.2;
    color: var(--ink);
    text-align: center;
    text-shadow: -0.6px 0 0 var(--cyan), 0.6px 0 0 var(--magenta);
}

.specimen-card-code {
    position: absolute;
    bottom: 6px;
    right: 8px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    color: var(--mercury-shadow);
    letter-spacing: 0.08em;
}

/* ========== CHAMBER 4: SEAL FOUNDRY ========== */
.chamber-4 .chamber-content {
    align-items: center;
    text-align: center;
}

.foundry-stage {
    position: relative;
    width: min(640px, 70vw);
    height: min(420px, 50vh);
    margin: 0 auto;
}

.foundry-caption {
    position: absolute;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.16em;
    color: var(--ink);
    text-transform: uppercase;
    background: rgba(238, 242, 247, 0.6);
    padding: 4px 10px;
    border: 1px solid var(--mercury-shadow);
    border-radius: 2px;
    text-shadow: -0.6px 0 0 var(--cyan), 0.6px 0 0 var(--magenta);
}

.foundry-cap-tl { top: 8%; left: 0; transform: rotate(-8deg); }
.foundry-cap-tr { top: 8%; right: 0; transform: rotate(8deg); }
.foundry-cap-bl { bottom: 4%; left: 0; transform: rotate(6deg); }
.foundry-cap-br { bottom: 4%; right: 0; transform: rotate(-6deg); }

.foundry-arm {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    width: 120px;
    height: 60%;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: stamp-cycle 6s cubic-bezier(.55, .05, .55, .95) infinite;
}

@keyframes stamp-cycle {
    0%       { transform: translateX(-50%) translateY(0); }
    35%      { transform: translateX(-50%) translateY(80px); }
    45%      { transform: translateX(-50%) translateY(82px); }
    55%      { transform: translateX(-50%) translateY(80px); }
    100%     { transform: translateX(-50%) translateY(0); }
}

.foundry-shaft {
    width: 22px;
    flex: 1;
    background: linear-gradient(90deg, var(--mercury-shadow), var(--mercury-light), var(--mercury-shadow));
    box-shadow: inset 1px 0 0 #fff, 0 0 12px rgba(0, 0, 0, 0.4);
}

.foundry-stamp {
    width: 120px;
    height: 110px;
    margin-top: -2px;
    filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.5));
}

.foundry-stamp svg {
    width: 100%;
    height: 100%;
    display: block;
}

.foundry-paper {
    position: absolute;
    bottom: 8%;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    max-width: 420px;
    aspect-ratio: 5 / 3;
    background: linear-gradient(180deg, var(--mercury-light), var(--floor-chrome));
    border: 1px solid var(--mercury-shadow);
    border-radius: 2px;
    box-shadow: 0 14px 30px -8px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    overflow: hidden;
}

.foundry-foil {
    position: absolute;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--foil), var(--magenta), var(--cyan), var(--lavender));
    animation: holo-shift 1.8s linear infinite, foil-pop 6s ease-in-out infinite;
    opacity: 0;
    box-shadow: 0 0 24px rgba(255, 210, 63, 0.6);
    mix-blend-mode: screen;
    pointer-events: none;
    filter: hue-rotate(0deg);
}

@keyframes holo-shift {
    to { filter: hue-rotate(360deg); }
}

@keyframes foil-pop {
    0%, 60% { opacity: 0; transform: scale(0.6); }
    65%     { opacity: 1; transform: scale(1.05); }
    85%     { opacity: 0.85; transform: scale(1); }
    100%    { opacity: 0; transform: scale(0.6); }
}

.paper-line {
    font-family: 'Major Mono Display', monospace;
    font-size: 13px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink);
    text-shadow: -0.6px 0 0 var(--cyan), 0.6px 0 0 var(--magenta);
    z-index: 2;
}

.paper-mono {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.14em;
    color: var(--magenta);
}

/* ========== CHAMBER 5: LEDGER ========== */
.chamber-5 .chamber-content {
    align-items: stretch;
}

.ledger-frame {
    position: relative;
    background: linear-gradient(180deg, var(--mercury-light), var(--floor-chrome));
    border: 1px solid var(--mercury-shadow);
    border-radius: 4px;
    padding: 28px 0;
    margin: 18px 0;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7), 0 18px 40px -10px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    height: 240px;
    background-image:
        linear-gradient(180deg, var(--mercury-light), var(--floor-chrome)),
        repeating-linear-gradient(135deg, transparent 0 8px, rgba(154, 165, 180, 0.08) 8px 9px);
    background-blend-mode: multiply;
}

.ledger-rail {
    position: absolute;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--mercury-shadow), var(--mercury-light), var(--mercury-shadow));
}

.ledger-rail-top    { top: 0; }
.ledger-rail-bottom { bottom: 0; }

.ledger-track {
    position: relative;
    height: 100%;
    overflow: hidden;
    width: 100%;
}

.ledger-strip {
    position: absolute;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 0 40px;
    will-change: transform;
    width: max-content;
}

.ledger-entry {
    display: grid;
    grid-template-columns: auto auto auto;
    gap: 14px;
    align-items: baseline;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: var(--ink);
    font-feature-settings: "tnum";
    border-right: 1px dashed var(--mercury-shadow);
    padding-right: 32px;
    white-space: nowrap;
}

.ledger-num   { color: var(--magenta); letter-spacing: 0.08em; }
.ledger-date  { color: var(--mercury-shadow); }
.ledger-title { color: var(--ink); font-style: italic; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }

.ledger-marginalia {
    position: absolute;
    pointer-events: none;
    opacity: 0.55;
}

.ledger-doodle-1 { top: 8px; right: 80px; }
.ledger-doodle-2 { bottom: 18px; left: 60px; opacity: 0.45; }

/* ========== CHAMBER 6: EXIT GLYPH ========== */
.chamber-6 .chamber-content {
    align-items: center;
    text-align: center;
}

.exit-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    margin-top: 10px;
}

.exit-portal {
    position: relative;
    width: min(360px, 38vw);
    height: min(360px, 38vw);
    animation: portal-breath 5s ease-in-out infinite;
    filter: drop-shadow(0 0 30px rgba(255, 45, 149, 0.45));
}

.exit-portal svg {
    width: 100%;
    height: 100%;
    display: block;
}

.portal-holo {
    animation: holo-shift 3s linear infinite;
    transform-origin: center;
}

@keyframes portal-breath {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.04); }
}

.exit-quote {
    color: var(--cyan);
    text-shadow: -1.2px 0 0 var(--cyan), 1.2px 0 0 var(--magenta);
}

.exit-stamp {
    display: inline-flex;
    align-items: baseline;
    gap: 14px;
    padding: 8px 18px;
    border: 1px solid var(--mercury-shadow);
    border-radius: 2px;
    background: linear-gradient(180deg, var(--mercury-light), var(--floor-chrome));
    font-family: 'IBM Plex Mono', monospace;
    box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 var(--mercury-shadow);
}

.exit-stamp-key {
    color: var(--magenta);
    font-weight: 500;
    letter-spacing: 0.22em;
    font-size: 12px;
}

.exit-stamp-num {
    color: var(--ink);
    font-feature-settings: "tnum";
    font-size: 13px;
    letter-spacing: 0.1em;
}

/* ========== HEXAGONAL MINIMAP ========== */
.minimap {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 140px;
    height: 140px;
    z-index: 90;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.35));
}

.minimap svg {
    width: 100%;
    height: 100%;
    display: block;
}

.minimap-hex {
    cursor: pointer;
    fill: var(--floor-chrome);
    stroke: var(--mercury-shadow);
    stroke-width: 1;
    transition: fill 0.3s, stroke 0.3s, transform 0.3s;
    transform-origin: center;
    transform-box: fill-box;
}

.minimap-hex:hover {
    fill: var(--cyan);
}

.minimap-hex.active {
    fill: var(--magenta);
    stroke: var(--cyan);
    stroke-width: 1.6;
}

.minimap-hex-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 8px;
    fill: var(--ink);
    letter-spacing: 0.12em;
    pointer-events: none;
}

/* ========== EDGE NUDGES ========== */
.edge-nudge {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 80;
    color: var(--magenta);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: none;
    transition: opacity 0.4s;
}

.edge-nudge-right { right: 24px; }

.edge-nudge-arrow {
    font-size: 28px;
    line-height: 1;
    color: var(--cyan);
    text-shadow: -1.4px 0 0 var(--cyan), 1.4px 0 0 var(--magenta);
    animation: nudge-bounce 1.6s ease-in-out infinite;
}

@keyframes nudge-bounce {
    0%, 100% { transform: translateX(0); }
    50%      { transform: translateX(8px); }
}

.edge-nudge.fade-out {
    opacity: 0;
}

/* ========== RESPONSIVE / MOBILE FALLBACK ========== */
@media (max-width: 720px) {
    html, body {
        position: relative;
        overflow-y: auto;
        overflow-x: hidden;
        height: auto;
        min-height: 100%;
    }
    body { position: relative; }

    .bureau {
        flex-direction: column;
        height: auto;
        transform: none !important;
    }

    .chamber {
        width: 100vw;
        height: auto;
        min-height: 100vh;
        padding: 70px 20px 50px;
    }

    .diagonal-section {
        width: 100vw;
        height: 80px;
    }

    .corridor-stripe {
        transform: skewY(-7deg);
        inset: -20% -10%;
    }

    .threshold-stage,
    .foundry-stage {
        width: 100%;
    }

    .intake-stage {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .specimen-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hud-center,
    .hud-right .hud-license {
        display: none;
    }

    .minimap {
        width: 28px;
        height: 240px;
        bottom: 50%;
        right: 8px;
        transform: translateY(50%);
    }

    .minimap svg {
        display: none;
    }

    .minimap::before {
        content: "";
        position: absolute;
        right: 8px;
        top: 0;
        bottom: 0;
        width: 2px;
        background: var(--mercury-shadow);
    }

    .edge-nudge { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001s !important;
        transition-duration: 0.05s !important;
    }
    html, body {
        position: relative;
        overflow-y: auto;
        overflow-x: auto;
        height: auto;
    }
    .bureau {
        transform: none !important;
    }
}
