/* aiice.dev — horizontal scroll narrative
   Palette:
     Glacial White     #E8EDF2
     Deep Space Ink    #0B1328
     Cerulean Frost    #3A7CA5
     Violet Static     #5C4B8A
     Cyan Spark        #48D1CC
     Warm Amber        #D4915E
     Rime Gray         #8B95A3
      Crystal Clear     #F4F7FA
   Compliance tokens: Interactive (Chamber effects respond primary darkest contrast Ink:**
 */

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

:root {
    --font-compliance-ink: "Ink:** Ink: Ink*";
    --c-white: #E8EDF2;
    --c-ink: #0B1328;
    --c-cerulean: #3A7CA5;
    --c-violet: #5C4B8A;
    --c-cyan: #48D1CC;
    --c-amber: #D4915E;
    --c-rime: #8B95A3;
    --c-crystal: #F4F7FA;
}

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

html {
    background: var(--c-white);
}

body {
    overflow-x: scroll;
    overflow-y: hidden;
    background: linear-gradient(180deg, var(--c-white) 0%, #dce4ec 55%, var(--c-white) 100%);
    color: var(--c-ink);
    font-family: "Recursive", "Inter", system-ui, sans-serif;
    font-variation-settings: "wght" 400, "CASL" 0, "MONO" 0, "slnt" 0;
    font-size: 16px;
    line-height: 1.55;
    letter-spacing: 0.01em;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

/* Subtle grain overlay for the whole viewport */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 12% 18%, rgba(11,19,40,0.04) 0 0.8px, transparent 1px),
        radial-gradient(circle at 58% 42%, rgba(11,19,40,0.04) 0 0.7px, transparent 1px),
        radial-gradient(circle at 91% 74%, rgba(11,19,40,0.04) 0 0.8px, transparent 1px),
        radial-gradient(circle at 33% 96%, rgba(11,19,40,0.04) 0 0.6px, transparent 1px);
    background-size: 140px 140px;
    mix-blend-mode: multiply;
    z-index: 3000;
    opacity: 0.5;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 3001;
    box-shadow: inset 0 0 280px 60px rgba(11,19,40,0.18);
}

/* ================================================================
   CORRIDOR — flex row of 7 chambers
   ================================================================ */
#corridor {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    height: 100vh;
    width: max-content;
    will-change: transform;
}

.chamber {
    position: relative;
    min-width: 100vw;
    height: 100vh;
    overflow: hidden;
    flex-shrink: 0;
    border-right: 1px solid rgba(58,124,165,0.18);
    background: var(--c-white);
}

.chamber-wide {
    min-width: 120vw;
}

.chamber-narrow {
    min-width: 80vw;
    border-right: none;
}

/* Seam ripples at edges */
.chamber::before,
.chamber::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    pointer-events: none;
    z-index: 40;
}
.chamber::before {
    left: 0;
    background: linear-gradient(90deg, rgba(58,124,165,0.22), transparent);
}
.chamber::after {
    right: 0;
    background: linear-gradient(270deg, rgba(58,124,165,0.22), transparent);
}

/* Chamber index and label — common framing */
.chamber-index {
    position: absolute;
    top: 28px;
    left: 36px;
    font-variation-settings: "wght" 400, "CASL" 0, "MONO" 1;
    font-size: 0.78rem;
    letter-spacing: 0.35em;
    color: var(--c-rime);
    z-index: 20;
}

.chamber-label {
    position: absolute;
    top: 28px;
    right: 36px;
    font-variation-settings: "wght" 500, "CASL" 0, "MONO" 0;
    font-size: 0.82rem;
    letter-spacing: 0.5em;
    text-transform: uppercase;
    color: var(--c-cerulean);
    z-index: 20;
}

/* Display title — Anybody variable font */
.display-title {
    font-family: "Anybody", "Inter", sans-serif;
    font-variation-settings: "wdth" 100, "wght" 700;
    font-size: 12vw;
    line-height: 1;
    color: var(--c-ink);
    text-transform: lowercase;
    letter-spacing: -0.02em;
    text-shadow:
        0 0 0px rgba(72,209,204,0),
        0 0 0px rgba(58,124,165,0);
    transition: text-shadow 1.2s ease;
}

.display-title span {
    display: inline-block;
    transition: transform 0.8s cubic-bezier(0.16,0.84,0.44,1), opacity 0.8s ease;
}

.chamber.in-view .display-title {
    text-shadow:
        0 0 2px rgba(72,209,204,0.55),
        0 0 10px rgba(58,124,165,0.28),
        0 1px 0px rgba(244,247,250,0.8);
}

/* Prose / narrative text */
.prose-block {
    position: absolute;
    max-width: 420px;
    padding: 22px 26px;
    background: linear-gradient(180deg, rgba(244,247,250,0.82), rgba(232,237,242,0.72));
    backdrop-filter: blur(4px);
    border: 1px solid rgba(58,124,165,0.25);
    border-radius: 2px;
    z-index: 15;
    box-shadow:
        0 1px 0 rgba(255,255,255,0.6) inset,
        0 18px 40px -20px rgba(11,19,40,0.35);
}

.prose-block .narrative {
    font-variation-settings: "wght" 400, "CASL" 0.3, "MONO" 0;
    font-size: 1.02rem;
    line-height: 1.65;
    color: var(--c-ink);
}

.prose-block .mono-line {
    margin-top: 14px;
    font-variation-settings: "wght" 400, "CASL" 0, "MONO" 1;
    font-size: 0.88rem;
    color: var(--c-cerulean);
    letter-spacing: 0.04em;
}

.prose-block .cursive-line {
    margin-top: 14px;
    font-family: "Caveat", cursive;
    font-size: 1.35rem;
    color: var(--c-amber);
    line-height: 1.2;
}

.prose-block em {
    font-style: normal;
    font-variation-settings: "wght" 500, "CASL" 0.7, "MONO" 0;
    color: var(--c-cerulean);
}

.prose-bottom-left { bottom: 70px; left: 56px; }
.prose-bottom-right { bottom: 70px; right: 56px; }
.prose-center-right { top: 50%; transform: translateY(-50%); right: 56px; }
.prose-center-left { top: 50%; transform: translateY(-50%); left: 56px; }
.prose-lower-left { bottom: 120px; left: 8%; }

/* Marginalia — handwritten asides */
.marginalia {
    position: absolute;
    font-family: "Caveat", cursive;
    font-size: 1.15rem;
    color: var(--c-amber);
    opacity: 0.82;
    max-width: 300px;
    line-height: 1.25;
    transform: rotate(-2.5deg);
    z-index: 18;
    pointer-events: none;
}

.marg-top-right { top: 120px; right: 80px; transform: rotate(2deg); }
.marg-top-left { top: 120px; left: 80px; }
.marg-top-center { top: 140px; left: 50%; transform: translateX(-50%) rotate(-1deg); text-align: center; }
.marg-bottom-center { bottom: 120px; left: 50%; transform: translateX(-50%) rotate(1.5deg); text-align: center; }
.marg-bottom-left { bottom: 110px; left: 90px; transform: rotate(-3deg); }
.marg-upper-right { top: 80px; right: 10%; transform: rotate(3deg); }

/* ================================================================
   CHAMBER 1 — The Threshold
   ================================================================ */
#chamber-0 {
    background: radial-gradient(ellipse at 50% 50%, var(--c-crystal) 0%, var(--c-white) 60%, #d4dce6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

#chamber-0 #frostCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 6;
    mix-blend-mode: screen;
    opacity: 0.9;
}

#chamber-0 .display-title {
    font-size: 18vw;
    font-variation-settings: "wdth" 110, "wght" 800;
    color: var(--c-ink);
    position: relative;
    z-index: 10;
    display: flex;
    gap: 0.05em;
}

#chamber-0 .display-title span {
    display: inline-block;
    animation: frostGrow 2.6s ease forwards;
    animation-delay: calc(var(--i, 0) * 0.16s);
    opacity: 0;
    transform: translateY(18px);
}
#chamber-0 .display-title span:nth-child(1) { --i: 0; }
#chamber-0 .display-title span:nth-child(2) { --i: 1; color: var(--c-cerulean); }
#chamber-0 .display-title span:nth-child(3) { --i: 2; color: var(--c-cerulean); }
#chamber-0 .display-title span:nth-child(4) { --i: 3; }
#chamber-0 .display-title span:nth-child(5) { --i: 4; color: var(--c-amber); }

@keyframes frostGrow {
    0% { opacity: 0; transform: translateY(18px); filter: blur(6px); }
    60% { opacity: 1; transform: translateY(0); filter: blur(0); }
    100% { opacity: 1; transform: translateY(0); filter: blur(0);
           text-shadow: 0 0 2px rgba(72,209,204,0.5), 0 0 14px rgba(58,124,165,0.35); }
}

#chamber-0 .instruction {
    position: absolute;
    bottom: 18%;
    left: 50%;
    transform: translateX(-50%);
    font-variation-settings: "wght" 400, "CASL" 0, "MONO" 1;
    font-size: 0.92rem;
    letter-spacing: 0.45em;
    text-transform: uppercase;
    color: var(--c-cerulean);
    z-index: 10;
    animation: pulseText 3.4s ease-in-out infinite;
}

@keyframes pulseText {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 0.95; }
}

.seam-arrow {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.2rem;
    color: var(--c-cerulean);
    z-index: 12;
    animation: arrowSlide 2s ease-in-out infinite;
}

@keyframes arrowSlide {
    0%, 100% { transform: translate(0, -50%); opacity: 0.35; }
    50% { transform: translate(12px, -50%); opacity: 1; }
}

/* Crystal watermarks */
.crystal-watermark {
    position: absolute;
    width: 240px;
    height: 240px;
    opacity: 0.45;
    z-index: 4;
    pointer-events: none;
    animation: crystalPulse 4s ease-in-out infinite;
}

@keyframes crystalPulse {
    0%, 100% { opacity: 0.3; transform: scale(1) rotate(0deg); }
    50% { opacity: 0.6; transform: scale(1.04) rotate(3deg); }
}

.cw-one { bottom: 10%; left: 8%; width: 180px; height: 180px; }
.cw-hex-a { top: 12%; left: 7%; width: 120px; height: 120px; animation-delay: 0s; }
.cw-hex-b { bottom: 14%; right: 12%; width: 160px; height: 160px; animation-delay: 1.5s; }

/* ================================================================
   CHAMBER 2 — The Mirror Room
   ================================================================ */
#chamber-1 {
    background: linear-gradient(180deg, #d8e1ea 0%, var(--c-white) 50%, #cfd9e4 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

#chamber-1 .display-title {
    position: absolute;
    top: 12%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9vw;
    color: var(--c-violet);
    letter-spacing: 0.25em;
    font-variation-settings: "wdth" 130, "wght" 800;
    text-transform: uppercase;
    opacity: 0.92;
}

.mirror-grid {
    position: relative;
    width: 80%;
    max-width: 1200px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto;
    gap: 18px;
    z-index: 10;
    margin-top: 4vh;
}

.mirror-panel {
    border: 1px solid rgba(58,124,165,0.5);
    background: var(--c-crystal);
    box-shadow:
        0 14px 30px -18px rgba(11,19,40,0.5),
        0 1px 0 rgba(255,255,255,0.9) inset,
        0 0 0 4px rgba(244,247,250,0.35);
    overflow: hidden;
    position: relative;
    transition: transform 0.8s cubic-bezier(0.2,0.8,0.2,1);
}

.mirror-panel svg {
    display: block;
    width: 100%;
    height: auto;
}

.mirror-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(244,247,250,0.3), transparent 40%, rgba(11,19,40,0.18));
    pointer-events: none;
}

.mirror-panel.flip-h svg { transform: scaleX(-1); }
.mirror-panel.flip-v svg { transform: scaleY(-1); }

.mirror-panel:hover {
    transform: translateY(-4px) scale(1.02);
}

/* ================================================================
   CHAMBER 3 — The Glacier
   ================================================================ */
#chamber-2 {
    background: linear-gradient(180deg, #2a3a5a 0%, #3a5a7a 40%, var(--c-white) 100%);
    color: var(--c-white);
}

#chamber-2 #rippleCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 12;
    pointer-events: none;
}

.glacier-geometry {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 4;
}

#chamber-2 .display-title {
    position: absolute;
    top: 14%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14vw;
    color: var(--c-crystal);
    letter-spacing: 0.15em;
    text-shadow:
        0 0 12px rgba(72,209,204,0.55),
        0 0 36px rgba(58,124,165,0.45);
    font-variation-settings: "wdth" 150, "wght" 900;
    z-index: 8;
}

#chamber-2 .chamber-index { color: var(--c-crystal); opacity: 0.55; }
#chamber-2 .chamber-label { color: var(--c-cyan); }

#chamber-2 .prose-block {
    background: rgba(11,19,40,0.55);
    border-color: rgba(72,209,204,0.45);
    color: var(--c-crystal);
}

#chamber-2 .prose-block .narrative { color: var(--c-crystal); }

#chamber-2 .marginalia { color: var(--c-amber); }

/* ================================================================
   CHAMBER 4 — The Rabbit Hole (wider)
   ================================================================ */
#chamber-3 {
    background: linear-gradient(180deg, var(--c-white) 0%, #e6ddee 30%, #d8cfe6 60%, var(--c-white) 100%);
}

.rabbit-title {
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 15vw;
    color: var(--c-violet);
    font-variation-settings: "wdth" 70, "wght" 700;
    display: flex;
    gap: 0.02em;
    z-index: 8;
    letter-spacing: -0.01em;
}

.rabbit-title span {
    display: inline-block;
    animation: rabbitDrift 5s ease-in-out infinite;
}
.rabbit-title span:nth-child(1) { animation-delay: 0.0s; color: var(--c-violet); }
.rabbit-title span:nth-child(2) { animation-delay: 0.2s; color: var(--c-cerulean); }
.rabbit-title span:nth-child(3) { animation-delay: 0.4s; color: var(--c-cerulean); }
.rabbit-title span:nth-child(4) { animation-delay: 0.6s; color: var(--c-amber); }
.rabbit-title span:nth-child(5) { animation-delay: 0.8s; color: var(--c-violet); }

@keyframes rabbitDrift {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-14px) rotate(-2deg); }
}

.parallax-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.parallax-layer svg {
    width: 100%;
    height: 100%;
    display: block;
}

.layer-back { opacity: 0.7; z-index: 3; }
.layer-mid { opacity: 0.85; z-index: 5; }
.layer-front { z-index: 9; }

.falling-items {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.falling-item {
    position: absolute;
    font-family: "Recursive", sans-serif;
    font-size: 1.6rem;
    color: var(--c-ink);
    opacity: 0.7;
    animation: fallDrift 6s linear infinite;
    font-variation-settings: "wght" 500, "CASL" 0.5, "MONO" 0;
}

.fi-1 { left: 14%; top: 0%; animation-delay: 0s; color: var(--c-amber); font-size: 2.2rem; font-variation-settings: "wght" 700; }
.fi-2 { left: 28%; top: 0%; animation-delay: 1.1s; color: var(--c-cerulean); font-variation-settings: "wght" 400, "MONO" 1; }
.fi-3 { left: 42%; top: 0%; animation-delay: 2.2s; color: var(--c-cyan); font-size: 2.4rem; }
.fi-4 { left: 58%; top: 0%; animation-delay: 0.6s; color: var(--c-violet); font-variation-settings: "wght" 500, "MONO" 1; }
.fi-5 { left: 72%; top: 0%; animation-delay: 3.3s; color: var(--c-ink); font-variation-settings: "wght" 400, "CASL" 1; font-family: "Caveat", cursive; font-size: 2rem; }
.fi-6 { left: 85%; top: 0%; animation-delay: 1.8s; color: var(--c-cerulean); font-size: 2rem; }
.fi-7 { left: 94%; top: 0%; animation-delay: 4s; color: var(--c-amber); font-size: 2.3rem; }

@keyframes fallDrift {
    0% { transform: translateY(-60px) rotate(-8deg); opacity: 0; }
    10% { opacity: 0.8; }
    90% { opacity: 0.8; }
    100% { transform: translateY(110vh) rotate(18deg); opacity: 0; }
}

/* ================================================================
   CHAMBER 5 — The Engine Room
   ================================================================ */
#chamber-4 {
    background:
        repeating-linear-gradient(90deg, rgba(58,124,165,0.05) 0 1px, transparent 1px 60px),
        repeating-linear-gradient(0deg, rgba(58,124,165,0.05) 0 1px, transparent 1px 60px),
        linear-gradient(180deg, #0e1a30 0%, #132547 50%, #0b1a34 100%);
    color: var(--c-crystal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 80px;
}

#chamber-4 .chamber-index { color: var(--c-cyan); opacity: 0.8; }
#chamber-4 .chamber-label { color: var(--c-cyan); }

.mono-title {
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    font-variation-settings: "wdth" 140, "wght" 800;
    color: var(--c-cyan);
    text-shadow:
        0 0 20px rgba(72,209,204,0.5),
        0 0 40px rgba(72,209,204,0.25);
    font-size: 11vw;
    letter-spacing: 0.1em;
    z-index: 8;
}

.engine-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 32px;
    width: 90%;
    max-width: 1200px;
    margin-top: 6vh;
    z-index: 10;
    position: relative;
}

.terminal-panel {
    background: rgba(11,19,40,0.88);
    border: 1px solid rgba(72,209,204,0.35);
    border-radius: 4px;
    box-shadow:
        0 0 0 1px rgba(72,209,204,0.1) inset,
        0 20px 50px -20px rgba(0,0,0,0.8);
    overflow: hidden;
}

.term-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(58,124,165,0.18);
    border-bottom: 1px solid rgba(72,209,204,0.25);
}

.term-dot {
    width: 10px; height: 10px; border-radius: 50%;
    display: inline-block;
}
.td-r { background: #D4915E; }
.td-a { background: #8B95A3; }
.td-g { background: #48D1CC; }

.term-path {
    margin-left: 14px;
    font-variation-settings: "wght" 400, "MONO" 1;
    font-size: 0.78rem;
    color: var(--c-rime);
    letter-spacing: 0.05em;
}

.term-body {
    padding: 18px 22px;
    font-family: "Recursive", monospace;
    font-variation-settings: "wght" 400, "MONO" 1, "CASL" 0;
    font-size: 0.86rem;
    line-height: 1.8;
    color: var(--c-crystal);
    min-height: 320px;
    white-space: pre-wrap;
}

.term-body code {
    color: var(--c-crystal);
    display: block;
}

.readout-panel {
    background: rgba(11,19,40,0.7);
    border: 1px solid rgba(58,124,165,0.4);
    border-radius: 4px;
    padding: 26px 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.readout-row {
    display: grid;
    grid-template-columns: 90px 1fr 60px;
    align-items: center;
    gap: 12px;
}

.ro-label {
    font-variation-settings: "wght" 500, "MONO" 1;
    font-size: 0.72rem;
    color: var(--c-cyan);
    letter-spacing: 0.22em;
}

.ro-bar {
    position: relative;
    height: 4px;
    background: rgba(58,124,165,0.25);
    border-radius: 2px;
    overflow: hidden;
}

.ro-fill {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 0;
    background: linear-gradient(90deg, var(--c-cerulean), var(--c-cyan));
    transition: width 1.8s cubic-bezier(0.16,0.84,0.44,1);
    box-shadow: 0 0 8px rgba(72,209,204,0.5);
}

.ro-val {
    font-variation-settings: "wght" 500, "MONO" 1;
    font-size: 0.82rem;
    color: var(--c-crystal);
    text-align: right;
}

.osc-wrap {
    margin-top: 12px;
    position: relative;
    padding: 8px 4px;
    border-top: 1px solid rgba(72,209,204,0.22);
}

.osc-svg {
    width: 100%;
    height: 80px;
    display: block;
}

.osc-label {
    font-variation-settings: "wght" 400, "MONO" 1;
    font-size: 0.68rem;
    color: var(--c-rime);
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

#chamber-4 .prose-block {
    background: rgba(11,19,40,0.65);
    border-color: rgba(72,209,204,0.4);
    color: var(--c-crystal);
}
#chamber-4 .prose-block .narrative { color: var(--c-crystal); }
#chamber-4 .marginalia { color: var(--c-cyan); opacity: 0.85; }

/* ================================================================
   CHAMBER 6 — The Garden
   ================================================================ */
#chamber-5 {
    background: linear-gradient(180deg, #c8d3e0 0%, var(--c-white) 40%, #dfe6ee 100%);
}

#chamber-5 #garden-ripple {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 12;
    pointer-events: none;
}

.garden-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
}

#chamber-5 .display-title {
    position: absolute;
    top: 12%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 13vw;
    color: var(--c-violet);
    font-variation-settings: "wdth" 90, "wght" 700;
    letter-spacing: 0.04em;
    z-index: 8;
}

/* ================================================================
   CHAMBER 7 — The Return (narrow)
   ================================================================ */
#chamber-6 {
    background: radial-gradient(ellipse at 50% 50%, var(--c-crystal) 0%, var(--c-white) 55%, #cfd6de 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.return-wrap {
    text-align: center;
    max-width: 70%;
    z-index: 10;
    position: relative;
}

.typewriter {
    font-family: "Recursive", sans-serif;
    font-variation-settings: "wght" 400, "CASL" 0.4, "MONO" 0;
    font-size: 2.2vw;
    line-height: 1.5;
    color: var(--c-ink);
    min-height: 3.3vw;
    display: inline;
}

.cursor-blink {
    display: inline-block;
    font-family: "Recursive", monospace;
    font-variation-settings: "MONO" 1;
    color: var(--c-cerulean);
    font-size: 2.2vw;
    animation: blink 0.9s steps(2) infinite;
    vertical-align: baseline;
}

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

.return-signature {
    margin-top: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: var(--c-rime);
    font-variation-settings: "wght" 400, "MONO" 1;
    font-size: 0.78rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
}

.sig-line {
    display: block;
    width: 80px;
    height: 1px;
    background: var(--c-cerulean);
    opacity: 0.6;
}

.frost-fade {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 50%, transparent 0%, rgba(244,247,250,0) 40%, rgba(244,247,250,0.85) 100%);
    pointer-events: none;
    z-index: 14;
    opacity: 0.9;
}

/* ================================================================
   PROGRESS TRACK — Alice walker at bottom
   ================================================================ */
#progress-track {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 40px;
    z-index: 2000;
    pointer-events: none;
}

#progress-line {
    position: absolute;
    bottom: 14px;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(58,124,165,0.25);
}

#progress-fill {
    position: absolute;
    bottom: 14px;
    left: 0;
    width: 0%;
    height: 2px;
    background: linear-gradient(90deg, var(--c-cerulean), var(--c-cyan));
    box-shadow: 0 0 8px rgba(72,209,204,0.7);
    transition: width 0.18s linear;
}

#chamber-markers {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    height: 10px;
}

.chamber-mark {
    position: absolute;
    bottom: 0;
    width: 10px;
    height: 10px;
    transform: translateX(-50%) rotate(45deg);
    background: var(--c-white);
    border: 1px solid var(--c-cerulean);
    pointer-events: auto;
    cursor: pointer;
    transition: background 0.3s ease;
}

.chamber-mark.passed {
    background: var(--c-cyan);
    border-color: var(--c-cyan);
}

.chamber-mark.current {
    background: var(--c-amber);
    border-color: var(--c-amber);
    box-shadow: 0 0 10px rgba(212,145,94,0.6);
}

#alice-walker {
    position: absolute;
    bottom: 10px;
    left: 0;
    transform: translateX(-50%);
    pointer-events: none;
    transition: left 0.18s linear;
    filter: drop-shadow(0 1px 2px rgba(11,19,40,0.3));
}

.alice-leg {
    transform-origin: 50% 22px;
    animation: legStep 0.45s steps(4) infinite paused;
}
.alice-leg-b { animation-delay: -0.22s; }

#alice-walker.walking .alice-leg { animation-play-state: running; }

@keyframes legStep {
    0% { transform: rotate(-18deg); }
    25% { transform: rotate(-6deg); }
    50% { transform: rotate(18deg); }
    75% { transform: rotate(6deg); }
    100% { transform: rotate(-18deg); }
}

/* ================================================================
   CRYSTAL NAV — top right waypoints
   ================================================================ */
#crystal-nav {
    position: fixed;
    top: 22px;
    right: 22px;
    z-index: 2100;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

#crystal-icon {
    width: 46px;
    height: 46px;
    background: rgba(244,247,250,0.75);
    border: 1px solid rgba(58,124,165,0.45);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.4s ease, background 0.4s ease;
    box-shadow: 0 6px 18px -10px rgba(11,19,40,0.4);
}

#crystal-icon:hover {
    background: var(--c-crystal);
    transform: rotate(6deg) scale(1.05);
}

#waypoint-list {
    list-style: none;
    background: rgba(244,247,250,0.92);
    border: 1px solid rgba(58,124,165,0.35);
    padding: 10px 14px;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    min-width: 220px;
    border-radius: 3px;
    box-shadow: 0 18px 40px -18px rgba(11,19,40,0.4);
}

#crystal-nav:hover #waypoint-list,
#crystal-nav.open #waypoint-list {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#waypoint-list li {
    padding: 6px 4px;
    font-variation-settings: "wght" 500, "CASL" 0, "MONO" 0;
    font-size: 0.82rem;
    letter-spacing: 0.05em;
    color: var(--c-ink);
    cursor: pointer;
    display: flex;
    gap: 10px;
    align-items: baseline;
    transition: color 0.2s ease, padding-left 0.2s ease;
    border-bottom: 1px dashed rgba(58,124,165,0.2);
}

#waypoint-list li:last-child { border-bottom: none; }

#waypoint-list li:hover {
    color: var(--c-cerulean);
    padding-left: 8px;
}

#waypoint-list li.active {
    color: var(--c-amber);
    font-variation-settings: "wght" 700;
}

.way-num {
    font-variation-settings: "wght" 400, "MONO" 1;
    font-size: 0.7rem;
    color: var(--c-rime);
    letter-spacing: 0.15em;
}

/* ================================================================
   Mobile — fallback to vertical stacking
   ================================================================ */
@media (max-width: 760px) {
    body { overflow-x: hidden; overflow-y: auto; }
    #corridor { flex-direction: column; width: 100%; height: auto; }
    .chamber, .chamber-wide, .chamber-narrow {
        min-width: 100vw;
        width: 100vw;
        height: 100vh;
        border-right: none;
        border-bottom: 1px solid rgba(58,124,165,0.2);
    }
    .display-title { font-size: 22vw; }
    .mono-title, #chamber-2 .display-title, #chamber-5 .display-title { font-size: 22vw; }
    .engine-grid { grid-template-columns: 1fr; gap: 20px; }
    .mirror-grid { grid-template-columns: 1fr 1fr; }
    .prose-block { max-width: 86%; font-size: 0.92rem; }
    #progress-track { display: none; }
    #crystal-nav { top: 12px; right: 12px; }
}
