/* ============================================================
   historygrapher.com v2 — wabi-sabi horizontal-scroll emakimono
   ============================================================ */

:root {
    --sumi: #2A2620;
    --bone: #F1ECE0;
    --off-bone: #FBF7EE;
    --washi: #EAE2D0;
    --pale-tea: #E8DCBA;
    --indigo: #3A4858;
    --clay: #3F3530;
    --seaweed: #4A5450;
    --rust: #8C4A38;
    --mustard: #B8893D;
    --tealeaf: #5C5232;
    --soft-warm: #6B5F4A;
    --warm-bone: #E6DCC8;

    --font-display: 'Schibsted Grotesk', system-ui, sans-serif;
    --font-italic: 'Newsreader', Georgia, serif;
    --font-body: 'Newsreader', Georgia, serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bone);
    color: var(--sumi);
    font-family: var(--font-body);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    cursor: none;
}

body {
    position: relative;
    overscroll-behavior: none;
}

/* ============================================================
   Custom cursor — slow-breath sumi dot
   ============================================================ */
.cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sumi);
    pointer-events: none;
    z-index: 10000;
    mix-blend-mode: multiply;
    transform: translate3d(-50%, -50%, 0) scaleX(1);
    transform-origin: center center;
    transition: opacity 600ms ease-out;
    opacity: 0;
    will-change: transform;
}

.cursor.is-ready { opacity: 1; }

.cursor.is-light {
    background: var(--bone);
    mix-blend-mode: screen;
}

.cursor::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    transform: translate(-50%, -50%) scale(1);
    animation: cursorBreath 3s ease-in-out infinite alternate;
}

@keyframes cursorBreath {
    from { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    to   { transform: translate(-50%, -50%) scale(1.06); opacity: 0.92; }
}

/* ============================================================
   Page-wide grain overlay (washi paper tooth)
   ============================================================ */
.grain-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9000;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.92' numOctaves='2' seed='4'/><feColorMatrix values='0 0 0 0 0.16  0 0 0 0 0.15  0 0 0 0 0.13  0 0 0 0.7 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.85'/></svg>");
    background-repeat: repeat;
    mix-blend-mode: multiply;
    opacity: 0.18;
}

/* ============================================================
   Progress rail (very subtle, bottom edge)
   ============================================================ */
.progress-rail {
    position: fixed;
    bottom: 18px;
    left: 5vw;
    right: 5vw;
    height: 2px;
    background: transparent;
    pointer-events: none;
    z-index: 9100;
}
.progress-rail__fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, transparent 0, var(--sumi) 8%, var(--sumi) 92%, transparent 100%);
    opacity: 0.35;
    transition: width 60ms linear;
}

/* ============================================================
   Room indicator (top-right small dots)
   ============================================================ */
.room-indicator {
    position: fixed;
    top: 28px;
    right: 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9200;
}
.room-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--sumi);
    opacity: 0.18;
    transition: opacity 500ms ease-out, transform 500ms ease-out;
}
.room-dot.is-active {
    opacity: 0.85;
    transform: scale(1.4);
}

/* ============================================================
   Canvas — 700vw horizontal expanse
   ============================================================ */
.canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 700vw;
    height: 100vh;
    display: flex;
    flex-direction: row;
    will-change: transform;
    transform: translate3d(0, 0, 0);
}

.room {
    position: relative;
    flex: 0 0 100vw;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Per-room paper grain */
.room::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(ellipse at 30% 20%, rgba(42, 38, 32, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(42, 38, 32, 0.05) 0%, transparent 60%);
    pointer-events: none;
    z-index: 1;
}

.room__label {
    position: absolute;
    bottom: 36px;
    left: 36px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--soft-warm);
    z-index: 5;
    opacity: 0.7;
}

.room__label--light {
    color: rgba(241, 236, 224, 0.55);
}

/* ============================================================
   ROOM 1 — The Gate
   ============================================================ */
.room--gate {
    background: var(--bone);
}

.gate__centerpiece {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 720px;
    padding: 0 4vw;
}

.logotype {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2rem, 4.2vw, 5.5rem);
    letter-spacing: 0.005em;
    line-height: 1.0;
    color: var(--sumi);
    margin-bottom: 38px;
}

.logotype__type {
    display: inline-block;
    min-height: 1em;
    white-space: nowrap;
}

.logotype__type::after {
    content: "|";
    display: inline-block;
    font-weight: 300;
    margin-left: 4px;
    color: var(--rust);
    animation: caretBlink 1.2s steps(2, end) infinite;
}

.logotype__type.is-typed::after { display: none; }

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

.gate__rule {
    height: 3px;
    width: 0%;
    margin: 0 auto 22px;
    background: linear-gradient(90deg, var(--sumi) 0%, var(--sumi) 92%, transparent 100%);
    transition: width 900ms cubic-bezier(.22, .61, .36, 1);
    max-width: 32%;
}
.gate__rule.is-drawn { width: 32%; }

.gate__tagline {
    font-family: var(--font-italic);
    font-style: italic;
    font-size: clamp(1rem, 1.3vw, 1.35rem);
    color: var(--soft-warm);
    letter-spacing: 0.02em;
    line-height: 1.6;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 1000ms ease-out 1800ms, transform 1000ms ease-out 1800ms;
}
.is-loaded .gate__tagline { opacity: 1; transform: translateY(0); }

.gate__hint {
    position: absolute;
    bottom: 72px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    color: var(--soft-warm);
    opacity: 0;
    z-index: 5;
    animation: hintFade 4s ease-in-out 3.6s infinite;
}

@keyframes hintFade {
    0%, 100% { opacity: 0; }
    20%, 80% { opacity: 0.55; }
}

/* ============================================================
   Enso (imperfect ink circle)
   ============================================================ */
.enso {
    position: absolute;
    z-index: 2;
    overflow: visible;
    will-change: transform;
}

.enso__stroke {
    fill: none;
    stroke: var(--sumi);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 0.5px rgba(42, 38, 32, 0.3));
}

.enso--giant {
    bottom: -90px;
    right: -90px;
    width: 540px;
    height: 540px;
    opacity: 0;
    transition: opacity 1400ms ease-out;
}
.is-loaded .enso--giant { opacity: 0.07; }

.enso--giant .enso__stroke {
    stroke-width: 10;
    stroke: var(--sumi);
}

.enso--small {
    bottom: 36px;
    right: 36px;
    width: 64px;
    height: 64px;
    opacity: 0;
    transition: opacity 800ms ease-out 3200ms;
    animation: ensoBreath 8s ease-in-out infinite alternate;
}
.is-loaded .enso--small { opacity: 1; }

.enso--small .enso__stroke {
    stroke-width: 4;
    stroke: var(--sumi);
}

.enso--watermark {
    top: 50%;
    left: 8%;
    transform: translateY(-50%);
    width: 480px;
    height: 480px;
    opacity: 0.05;
    z-index: 1;
}
.enso--watermark .enso__stroke {
    stroke-width: 14;
    stroke: var(--bone);
}

.enso--final {
    bottom: 72px;
    right: 72px;
    width: 220px;
    height: 220px;
    z-index: 4;
}

.enso__stroke--final {
    stroke-dasharray: 580;
    stroke-dashoffset: 580;
    transition: stroke-dashoffset 1400ms cubic-bezier(.22, .61, .36, 1);
    stroke-width: 5;
}

.enso__stroke--final.is-drawn {
    /* deliberate incomplete: leaves a 14-degree gap at start of stroke */
    stroke-dashoffset: 60;
}

@keyframes ensoBreath {
    from { transform: scale(0.98); }
    to   { transform: scale(1.02); }
}

/* ============================================================
   ROOM 2 — The Long Desk
   ============================================================ */
.room--desk {
    background: var(--indigo);
    color: var(--bone);
}

.desk__intro {
    position: absolute;
    top: 18vh;
    right: 8vw;
    z-index: 3;
    max-width: 32ch;
    text-align: right;
}

.haiku {
    font-family: var(--font-italic);
    font-style: italic;
    font-size: clamp(1.05rem, 1.3vw, 1.4rem);
    line-height: 1.9;
    color: rgba(241, 236, 224, 0.86);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.desk__surface {
    position: absolute;
    top: 62%;
    left: 0;
    right: 0;
    height: 12px;
    background: linear-gradient(180deg, rgba(230, 220, 200, 0) 0%, var(--warm-bone) 30%, var(--warm-bone) 70%, rgba(230, 220, 200, 0) 100%);
    box-shadow: 0 1px 0 rgba(42, 38, 32, 0.15);
    z-index: 4;
}

.artifact {
    position: absolute;
    bottom: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    z-index: 5;
    cursor: none;
    transition: transform 600ms ease-out;
}

.artifact::after {
    content: "";
    position: absolute;
    top: -120px;
    left: -120px;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(42, 38, 32, 0.18) 0%, rgba(42, 38, 32, 0) 65%);
    opacity: 0;
    transition: opacity 1200ms ease-out;
    pointer-events: none;
    z-index: -1;
}

.artifact.is-bleeding::after { opacity: 1; }

.artifact--crane { left: 18%; }
.artifact--cup    { left: 45%; }
.artifact--inkstone { left: 72%; }

.artifact__caption {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(241, 236, 224, 0.6);
}

/* Crane */
.crane {
    position: relative;
    width: 92px;
    height: 64px;
}
.crane__body {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 92px 50px 0;
    border-color: transparent var(--bone) transparent transparent;
    filter: drop-shadow(0 1px 0 rgba(42, 38, 32, 0.3));
}
.crane__wing {
    position: absolute;
    top: 0;
    left: 26px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 36px 56px;
    border-color: transparent transparent var(--washi) transparent;
    transform-origin: bottom left;
    transition: transform 320ms cubic-bezier(.34, 1.56, .64, 1);
}
.crane.is-flicking .crane__wing { transform: rotate(-4deg); }
.crane__head {
    position: absolute;
    top: 28px;
    left: -8px;
    width: 14px;
    height: 4px;
    background: var(--bone);
    transform: rotate(-18deg);
}
.crane__crease {
    position: absolute;
    top: 6px;
    left: 0;
    width: 86px;
    height: 1px;
    background: rgba(42, 38, 32, 0.4);
    transform: rotate(-12deg);
    transform-origin: left center;
}

/* Tea cup with chipped rim */
.cup {
    position: relative;
    width: 88px;
    height: 64px;
    filter: drop-shadow(0 2px 0 rgba(42, 38, 32, 0.25));
}
.cup__body {
    position: absolute;
    top: 8px;
    left: 4px;
    width: 80px;
    height: 56px;
    background: var(--washi);
    border-radius: 4px 4px 28px 28px;
    /* deliberate chip: clip-path subtracts a small triangle from the rim */
    clip-path: polygon(
        0 0, 30% 0, 36% 6px, 38% 0, 52% 0, 58% 5px, 62% 0,
        100% 0, 100% 100%, 0 100%
    );
}
.cup__rim {
    position: absolute;
    top: 4px;
    left: 0;
    width: 88px;
    height: 14px;
    background: var(--bone);
    border-radius: 50%;
    box-shadow: inset 0 -1px 0 rgba(42, 38, 32, 0.25);
}
.cup__interior {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 76px;
    height: 10px;
    background: radial-gradient(ellipse at center, rgba(92, 82, 50, 0.6) 0%, rgba(92, 82, 50, 0.3) 70%);
    border-radius: 50%;
}

/* Inkstone with wet pool */
.inkstone {
    position: relative;
    width: 110px;
    height: 50px;
    filter: drop-shadow(0 2px 0 rgba(42, 38, 32, 0.25));
}
.inkstone__slate {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #3A352F 0%, #2A2620 100%);
    transform: skewX(-8deg);
    border-radius: 3px;
}
.inkstone__pool {
    position: absolute;
    top: 8px;
    right: 14px;
    width: 36px;
    height: 24px;
    background: radial-gradient(ellipse at center, #0d0a08 0%, #1a1612 70%);
    border-radius: 50%;
    transform: skewX(-8deg);
    overflow: hidden;
}
.inkstone__highlight {
    position: absolute;
    top: 4px;
    left: 8px;
    width: 8px;
    height: 4px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    animation: inkGlisten 6s ease-in-out infinite alternate;
}
@keyframes inkGlisten {
    from { transform: translate(0, 0); opacity: 0.18; }
    to   { transform: translate(4px, 2px); opacity: 0.28; }
}

/* ============================================================
   ROOM 3 — The Ink Bleed
   ============================================================ */
.room--bleed {
    background: var(--washi);
}

.bleed__map {
    position: absolute;
    top: 50%;
    left: 6%;
    transform: translateY(-50%);
    width: 60vh;
    height: 60vh;
    max-width: 760px;
    max-height: 760px;
    z-index: 3;
}

.bleed__svg {
    width: 100%;
    height: 100%;
    display: block;
}

.bleed__halo {
    transform-origin: center;
    transition: transform 800ms ease-out, opacity 800ms ease-out;
    opacity: 0.7;
}

.bleed__halo:hover {
    transform: scale(1.4);
    opacity: 1;
}

.bleed__node {
    transition: r 320ms ease-out;
}

.bleed__node:hover {
    r: 9;
}

.bleed__captions text {
    text-anchor: middle;
}

.bleed__whisper {
    position: absolute;
    top: 50%;
    right: 8vw;
    transform: translateY(-50%);
    max-width: 28ch;
    z-index: 3;
}

.bleed__whisper p {
    font-family: var(--font-italic);
    font-style: italic;
    font-size: clamp(1rem, 1.15vw, 1.25rem);
    line-height: 1.7;
    color: var(--sumi);
    margin-bottom: 2.6rem;
    opacity: 0.78;
}

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

/* ============================================================
   ROOM 4 — The Wall Scroll
   ============================================================ */
.room--scroll {
    background: var(--clay);
    color: var(--off-bone);
}

.kakemono {
    position: relative;
    width: 40vw;
    max-width: 460px;
    height: 80vh;
    max-height: 720px;
    z-index: 3;
    transform-origin: top center;
    animation: scrollSway 12s ease-in-out infinite alternate;
}

@keyframes scrollSway {
    from { transform: rotateZ(-0.4deg); }
    to   { transform: rotateZ(0.4deg); }
}

.kakemono__paper {
    position: absolute;
    top: 28px;
    bottom: 28px;
    left: 0;
    right: 0;
    background:
        linear-gradient(180deg, var(--washi) 0%, var(--bone) 50%, var(--washi) 100%);
    box-shadow:
        0 0 0 1px rgba(42, 38, 32, 0.2),
        0 6px 22px rgba(0, 0, 0, 0.35),
        inset 0 0 60px rgba(42, 38, 32, 0.1);
    padding: 56px 36px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}

.kakemono__rod {
    position: absolute;
    left: -14px;
    right: -14px;
    height: 14px;
    background: linear-gradient(180deg, #5C5232 0%, #3F3530 50%, #2A2620 100%);
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}
.kakemono__rod--top { top: 0; }
.kakemono__rod--bottom { bottom: 0; }

.kakemono__chapters {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
    height: 100%;
    justify-content: space-around;
}

.chapter {
    position: relative;
    text-align: center;
    cursor: none;
    transition: opacity 600ms ease-out;
}

.chapter__title {
    font-family: var(--font-italic);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(2rem, 3.2vw, 3.6rem);
    color: var(--sumi);
    line-height: 1.0;
    margin-bottom: 16px;
    transition: color 400ms ease-out;
}

.chapter__rule {
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--sumi) 8%, var(--sumi) 92%, transparent 100%);
    margin: 0 auto;
    opacity: 0.5;
    transition: width 600ms ease-out, opacity 600ms ease-out;
}

.chapter:hover .chapter__rule {
    width: 80%;
    opacity: 0.85;
}

.chapter:hover .chapter__title {
    color: var(--rust);
}

.kakemono__captions {
    position: absolute;
    top: 50%;
    left: calc(50% + 24vw);
    transform: translateY(-50%);
    width: 30vw;
    max-width: 380px;
    z-index: 4;
}

.caption {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 1400ms ease-out, transform 1400ms ease-out;
    pointer-events: none;
}

.caption.is-revealed {
    opacity: 1;
    transform: translateX(0);
}

.caption p {
    font-family: var(--font-italic);
    font-style: italic;
    font-size: clamp(1.05rem, 1.25vw, 1.4rem);
    line-height: 1.7;
    color: rgba(251, 247, 238, 0.86);
}

/* ============================================================
   ROOM 5 — The Stations (yatsuhashi)
   ============================================================ */
.room--stations {
    background: var(--pale-tea);
}

.stations__intro {
    position: absolute;
    top: 14vh;
    left: 8vw;
    font-family: var(--font-italic);
    font-style: italic;
    font-size: clamp(1.1rem, 1.4vw, 1.5rem);
    color: var(--sumi);
    opacity: 0.78;
    z-index: 3;
    max-width: 32ch;
}

.stations__bridge {
    position: relative;
    width: 84vw;
    height: 70vh;
    max-width: 1500px;
    z-index: 3;
}

.station {
    position: absolute;
    width: 220px;
    height: 220px;
    /* yatsuhashi diagonal layout: bottom-left to top-right */
    bottom: calc(var(--n) * 8vh);
    left: calc(var(--n) * 11vw);
    cursor: none;
    transition: transform 600ms ease-out;
}

.station__frame {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 600ms cubic-bezier(.34, 1.56, .64, 1);
}

.station:hover .station__frame {
    transform: scale(1.04) rotate(-0.6deg);
}

/* Four imperfect rules forming a non-closing rectangle */
.station__rule {
    position: absolute;
    background: var(--sumi);
    transform-origin: center center;
    opacity: 0.85;
}

.station__rule--top {
    top: 4px;
    left: 6px;
    right: 12px;
    height: 1.5px;
    transform: rotate(-0.8deg);
    background: linear-gradient(90deg, transparent 0%, var(--sumi) 6%, var(--sumi) 94%, transparent 100%);
}
.station__rule--right {
    top: 8px;
    bottom: 14px;
    right: 4px;
    width: 1.5px;
    transform: rotate(1.2deg);
    background: linear-gradient(180deg, transparent 0%, var(--sumi) 6%, var(--sumi) 94%, transparent 100%);
}
.station__rule--bottom {
    bottom: 6px;
    left: 14px;
    right: 8px;
    height: 1.5px;
    transform: rotate(0.6deg);
    background: linear-gradient(90deg, transparent 0%, var(--sumi) 6%, var(--sumi) 94%, transparent 100%);
}
.station__rule--left {
    top: 12px;
    bottom: 4px;
    left: 4px;
    width: 1.5px;
    transform: rotate(-1.0deg);
    background: linear-gradient(180deg, transparent 0%, var(--sumi) 6%, var(--sumi) 94%, transparent 100%);
}

.station:hover .station__rule--top { left: 0; right: 6px; }
.station:hover .station__rule--right { top: 4px; bottom: 8px; }
.station:hover .station__rule--bottom { left: 8px; right: 2px; }
.station:hover .station__rule--left { top: 6px; bottom: 0; }
.station__rule {
    transition: top 500ms ease-out, bottom 500ms ease-out, left 500ms ease-out, right 500ms ease-out;
}

.station__title {
    font-family: var(--font-italic);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.4rem, 1.8vw, 2.2rem);
    color: var(--sumi);
    letter-spacing: -0.005em;
}

.station__date {
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    color: var(--soft-warm);
    opacity: 0;
    transition: opacity 320ms ease-out, transform 320ms ease-out;
    white-space: nowrap;
}
.station:hover .station__date {
    opacity: 1;
    transform: translateX(-50%) translateY(4px);
}

/* ============================================================
   ROOM 6 — The Workshop
   ============================================================ */
.room--workshop {
    background: var(--seaweed);
    color: var(--off-bone);
}

.workshop__instruction {
    position: absolute;
    top: 14vh;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.3rem, 2.2vw, 2.4rem);
    color: var(--off-bone);
    letter-spacing: 0.005em;
    opacity: 0.94;
    z-index: 3;
}

.workshop__canvas-wrap {
    position: relative;
    width: 70vw;
    height: 60vh;
    max-width: 1200px;
    z-index: 3;
    background: var(--bone);
    box-shadow:
        0 0 0 1px rgba(42, 38, 32, 0.2),
        0 8px 28px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.workshop__canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: none;
    display: block;
}

.workshop__hint {
    position: absolute;
    bottom: 18px;
    right: 24px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    color: var(--soft-warm);
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 1200ms ease-out;
}
.workshop__hint.is-faded { opacity: 0; }

.workshop__caption {
    position: absolute;
    bottom: 12vh;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-italic);
    font-style: italic;
    font-size: clamp(0.95rem, 1.1vw, 1.2rem);
    color: rgba(251, 247, 238, 0.7);
    z-index: 3;
}

/* Drifting bubbles */
.bubbles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.bubble {
    position: absolute;
    bottom: -10px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--off-bone);
    opacity: 0.3;
    will-change: transform, opacity;
}

/* ============================================================
   ROOM 7 — The Open Door
   ============================================================ */
.room--door {
    background: var(--bone);
}

.door__center {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 700px;
    padding: 0 4vw;
}

.door__farewell {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.6rem, 3.2vw, 3.8rem);
    line-height: 1.3;
    color: var(--sumi);
    letter-spacing: 0.005em;
    margin-bottom: 56px;
}

.door__farewell em {
    font-family: var(--font-italic);
    font-style: italic;
    color: var(--rust);
}

.door__links {
    display: inline-flex;
    align-items: center;
    gap: 0;
}

.door__link {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 0.95rem;
    color: var(--soft-warm);
    text-decoration: none;
    letter-spacing: 0.04em;
    padding: 6px 16px;
    transition: color 320ms ease-out;
}

.door__link:hover {
    color: var(--sumi);
}

.door__sep {
    display: inline-block;
    width: var(--w, 16px);
    height: 1.5px;
    background: linear-gradient(90deg, transparent 0%, var(--sumi) 12%, var(--sumi) 88%, transparent 100%);
    opacity: 0.45;
    margin: 0 4px;
}

.door__fade {
    position: absolute;
    top: 0;
    right: 0;
    width: 18vw;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, var(--off-bone) 70%);
    z-index: 2;
    pointer-events: none;
}

/* ============================================================
   Slide-reveal entry animation (added by JS via class)
   ============================================================ */
.reveal-target {
    opacity: 0;
    transform: translate3d(40px, 0, 0);
    transition: opacity 800ms ease-out, transform 800ms ease-out;
}

.reveal-target.is-revealed {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.reveal-target.reveal-from-left {
    transform: translate3d(-40px, 0, 0);
}
.reveal-target.reveal-from-left.is-revealed {
    transform: translate3d(0, 0, 0);
}

/* ============================================================
   Mobile fallback
   ============================================================ */
@media (max-width: 720px) {
    .canvas {
        flex-direction: column;
        width: 100vw;
        height: auto;
        position: relative;
    }
    html, body { overflow-y: auto; overflow-x: hidden; cursor: auto; }
    .cursor { display: none; }
    .room { flex: 0 0 100vh; height: 100vh; }
    .progress-rail, .room-indicator { display: none; }
    .desk__intro { right: 4vw; top: 8vh; max-width: 60ch; }
    .bleed__map { width: 86vw; height: 50vh; left: 7vw; top: 30vh; }
    .bleed__whisper { right: 4vw; top: 76vh; }
    .kakemono__captions { display: none; }
    .stations__bridge { width: 90vw; height: 80vh; }
    .station {
        position: relative;
        width: 80vw;
        height: 100px;
        bottom: auto;
        left: auto;
        margin-bottom: 18px;
    }
}
