:root {
    /* first interaction invite exploration—“place sparingly calibration tags */
    --coral: #FF6B5E;
    --mint: #7EF0C1;
    --lavender: #B9A7FF;
    --navy: #13243A;
    --cream: #FFF4D8;
    --blue: #D8F3FF;
    --plum: #3A214D;
    --headline: "Fraunces", serif;
    --body: "Noto Sans", sans-serif;
    --mono: "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    background: var(--blue);
}

body {
    margin: 0;
    color: var(--navy);
    font-family: var(--body);
    overflow-x: hidden;
    background:
        radial-gradient(circle at 18% 12%, rgba(255,244,216,0.95), transparent 28rem),
        radial-gradient(circle at 82% 18%, rgba(185,167,255,0.42), transparent 25rem),
        linear-gradient(130deg, var(--blue), #eefcff 47%, var(--cream));
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(19,36,58,0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(19,36,58,0.045) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(circle at center, black, transparent 78%);
    z-index: 0;
}

main, .route-nav, .atmosphere { position: relative; z-index: 1; }

.atmosphere {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(2px);
    opacity: 0.55;
    animation: drift 18s ease-in-out infinite alternate;
}

.orb-one { width: 34vw; height: 34vw; left: -8vw; top: 10vh; background: rgba(126,240,193,0.42); }
.orb-two { width: 27vw; height: 27vw; right: -4vw; top: 34vh; background: rgba(255,107,94,0.22); animation-delay: -5s; }
.orb-three { width: 22vw; height: 22vw; left: 44vw; bottom: -7vw; background: rgba(185,167,255,0.32); animation-delay: -9s; }

.scanline {
    position: absolute;
    inset: -30% 0 auto;
    height: 22%;
    background: linear-gradient(180deg, transparent, rgba(255,255,255,0.22), transparent);
    animation: scan 8s linear infinite;
}

.route-nav {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    gap: 14px;
    z-index: 5;
}

.nav-dot {
    width: 48px;
    height: 48px;
    border: 1px solid rgba(58,33,77,0.22);
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--plum);
    text-decoration: none;
    font-family: var(--mono);
    font-size: 11px;
    background: rgba(255,244,216,0.58);
    box-shadow: 0 10px 30px rgba(19,36,58,0.08);
    transition: transform 240ms ease, background 240ms ease, color 240ms ease;
}

.nav-dot.is-active, .nav-dot:hover {
    transform: scale(1.12) rotate(-8deg);
    background: var(--coral);
    color: var(--cream);
}

.room {
    min-height: 100vh;
    position: relative;
    display: grid;
    align-items: center;
    padding: 8vh 8vw;
    isolation: isolate;
}

.eyebrow, .route-label, .stamp, .customs-note span, .board-row, .passport span, .passport em {
    font-family: var(--mono);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.eyebrow {
    color: var(--coral);
    font-size: clamp(0.76rem, 1vw, 0.94rem);
    font-weight: 600;
    margin: 0 0 1rem;
}

h1, h2 {
    font-family: var(--headline);
    color: var(--plum);
    line-height: 0.92;
    margin: 0;
    font-weight: 760;
    font-variation-settings: "SOFT" 80, "WONK" 1;
}

h1 { font-size: clamp(4.4rem, 9vw, 10rem); max-width: 9ch; }
h2 { font-size: clamp(3rem, 6.8vw, 7.8rem); max-width: 10.8ch; }
p { font-size: clamp(1rem, 1.25vw, 1.35rem); line-height: 1.65; }

.terminal-grid {
    display: grid;
    grid-template-columns: minmax(360px, 1.08fr) minmax(320px, 0.92fr);
    align-items: center;
    gap: 3vw;
    width: 100%;
}

.compass-wrap {
    position: relative;
    min-height: 650px;
    display: grid;
    place-items: center;
}

.voice-compass {
    width: min(72vw, 690px);
    max-height: 78vh;
    overflow: visible;
    filter: drop-shadow(0 30px 60px rgba(58,33,77,0.18));
    animation: floatCompass 7s ease-in-out infinite;
}

.curved-wordmark {
    font-family: var(--headline);
    font-size: 34px;
    fill: var(--plum);
    letter-spacing: 0.04em;
}

.compass-needle { transform-origin: 260px 260px; animation: needle 7s ease-in-out infinite; }

.sentence-ribbon, .tuned-strip {
    background: var(--cream);
    border: 2px solid rgba(58,33,77,0.22);
    color: var(--plum);
    box-shadow: 0 22px 45px rgba(19,36,58,0.16);
    font-family: var(--headline);
}

.main-ribbon {
    position: absolute;
    left: -15vw;
    top: 51%;
    width: min(46vw, 560px);
    padding: 19px 34px;
    border-radius: 999px;
    transform: rotate(-7deg);
    font-size: clamp(1.25rem, 2.2vw, 2rem);
    animation: ribbonOrbit 10s ease-in-out infinite;
}

.main-ribbon.is-launched { animation: ribbonLaunch 2s ease-in-out; }

.route-label {
    position: absolute;
    padding: 10px 14px;
    border: 1px solid rgba(19,36,58,0.16);
    border-radius: 999px;
    background: rgba(216,243,255,0.72);
    color: var(--navy);
    font-size: 12px;
    animation: blink 3.4s ease-in-out infinite;
}

.route-label-a { left: 7vw; top: 12vh; }
.route-label-b { right: 20vw; top: 16vh; animation-delay: -1s; }
.route-label-c { left: 44vw; bottom: 12vh; animation-delay: -2.2s; }
.terminal-copy { transform: translateX(-2vw); }
.terminal-copy p:not(.eyebrow), .dial-copy p, .map-panel p, .sendoff-copy p { max-width: 38rem; }

.primary-control {
    border: 0;
    background: var(--plum);
    color: var(--cream);
    font-family: var(--mono);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 18px 24px;
    border-radius: 999px;
    box-shadow: 0 18px 38px rgba(58,33,77,0.24);
    cursor: pointer;
    transition: transform 220ms ease, background 220ms ease;
}

.primary-control:hover { transform: translateY(-4px); background: var(--coral); }
.ghost-control { background: var(--coral); }

.customs-room { background: linear-gradient(160deg, rgba(255,244,216,0.8), rgba(216,243,255,0.55)); }
.orbit-heading { position: absolute; left: 8vw; top: 9vh; }
.customs-stage { width: 100%; min-height: 72vh; position: relative; }

.belt-track {
    position: absolute;
    left: -10vw;
    right: 4vw;
    top: 48%;
    height: 132px;
    transform: rotate(-5deg);
    border-radius: 999px;
    background: rgba(58,33,77,0.12);
    border: 2px solid rgba(58,33,77,0.18);
    overflow: hidden;
}

.belt-lines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(90deg, transparent 0 34px, rgba(19,36,58,0.13) 34px 40px);
    animation: beltMove 2s linear infinite;
}

.tray {
    position: absolute;
    top: 28px;
    min-width: 128px;
    padding: 20px 24px;
    border-radius: 24px;
    background: var(--cream);
    border: 2px solid rgba(58,33,77,0.25);
    font-family: var(--headline);
    font-size: 1.35rem;
    animation: trayTravel 9s linear infinite;
}

.tray-one { left: 4%; }
.tray-two { left: 35%; animation-delay: -3s; }
.tray-three { left: 66%; animation-delay: -6s; }

.scanner-gate {
    position: absolute;
    left: 47%;
    top: 29%;
    width: 220px;
    height: 350px;
    border: 7px solid var(--plum);
    border-bottom: 0;
    border-radius: 120px 120px 0 0;
    display: grid;
    place-items: start center;
    padding-top: 38px;
    color: var(--plum);
    font-family: var(--mono);
    font-size: 12px;
}

.scanner-beam {
    position: absolute;
    top: 60px;
    bottom: 0;
    width: 78px;
    background: linear-gradient(90deg, transparent, rgba(126,240,193,0.55), transparent);
    animation: beamSweep 2.7s ease-in-out infinite;
}

.stamp-cloud {
    position: absolute;
    right: 8vw;
    top: 18vh;
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 18px;
}

.stamp {
    border: 3px solid var(--coral);
    color: var(--coral);
    background: rgba(255,244,216,0.65);
    border-radius: 14px;
    padding: 17px 21px;
    transform: rotate(-7deg);
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(19,36,58,0.1);
}

.stamp:nth-child(2), .stamp:nth-child(4) { transform: rotate(8deg); border-color: var(--mint); color: var(--plum); }
.stamp.is-selected { background: var(--coral); color: var(--cream); }

.customs-note {
    position: absolute;
    left: 10vw;
    bottom: 7vh;
    width: min(420px, 80vw);
    padding: 28px;
    border-radius: 32px;
    background: rgba(216,243,255,0.78);
    border: 1px solid rgba(58,33,77,0.22);
    box-shadow: 0 26px 60px rgba(19,36,58,0.12);
}

.weather-room {
    grid-template-columns: 0.75fr 1.25fr;
    gap: 5vw;
    background: radial-gradient(circle at 62% 45%, rgba(126,240,193,0.30), transparent 31rem);
}

.weather-map {
    position: relative;
    height: min(72vh, 680px);
    border-radius: 52px;
    background: rgba(216,243,255,0.54);
    border: 1px solid rgba(58,33,77,0.18);
    overflow: hidden;
    box-shadow: inset 0 0 80px rgba(255,244,216,0.68), 0 28px 65px rgba(19,36,58,0.12);
}

.weather-map::before {
    content: "";
    position: absolute;
    inset: 9%;
    border-radius: 50%;
    border: 2px solid rgba(58,33,77,0.18);
    background:
        linear-gradient(transparent 48%, rgba(58,33,77,0.16) 49% 51%, transparent 52%),
        linear-gradient(90deg, transparent 48%, rgba(58,33,77,0.16) 49% 51%, transparent 52%);
}

.front-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.front { fill: none; stroke-width: 8; stroke-linecap: round; stroke-dasharray: 18 22; animation: frontMove 7s linear infinite; }
.front-a { stroke: var(--coral); }
.front-b { stroke: var(--mint); animation-delay: -2s; }
.front-c { stroke: var(--lavender); animation-delay: -4s; }

.weather-bubble {
    position: absolute;
    border-radius: 999px 999px 999px 26px;
    background: var(--cream);
    border: 1px solid rgba(58,33,77,0.24);
    padding: 15px 18px;
    font-family: var(--mono);
    color: var(--plum);
    animation: bob 5s ease-in-out infinite;
}

.bubble-one { left: 12%; top: 24%; }
.bubble-two { right: 18%; top: 32%; animation-delay: -1.3s; }
.bubble-three { left: 38%; bottom: 18%; animation-delay: -2.6s; }

.tone-thermometer {
    position: absolute;
    right: 34px;
    bottom: 32px;
    height: 220px;
    width: 48px;
    border-radius: 999px;
    border: 2px solid var(--plum);
    background: rgba(255,244,216,0.78);
    display: flex;
    align-items: end;
    justify-content: center;
    padding: 6px;
}

.tone-thermometer span {
    width: 100%;
    height: 62%;
    border-radius: 999px;
    background: linear-gradient(var(--coral), var(--mint));
    animation: temp 4s ease-in-out infinite;
}

.tone-thermometer b {
    position: absolute;
    right: 58px;
    bottom: 15px;
    width: 100px;
    font-family: var(--mono);
    font-size: 12px;
    text-transform: uppercase;
}

.dial-room { grid-template-columns: 0.85fr 1.15fr; gap: 5vw; background: linear-gradient(135deg, rgba(58,33,77,0.09), rgba(255,244,216,0.58)); }
.dial-console { display: grid; grid-template-columns: repeat(2, minmax(190px, 1fr)); gap: 28px; transform: rotate(-4deg); }

.dial {
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, var(--cream) 0 45%, rgba(216,243,255,0.72) 46% 100%);
    border: 3px solid rgba(58,33,77,0.28);
    display: grid;
    place-items: center;
    position: relative;
    box-shadow: 0 24px 54px rgba(19,36,58,0.13);
    cursor: pointer;
}

.dial::before { content: ""; position: absolute; inset: 16px; border-radius: 50%; border: 1px dashed rgba(58,33,77,0.32); }
.dial-hand { width: 4px; height: 38%; background: var(--coral); position: absolute; top: 16%; left: calc(50% - 2px); transform-origin: bottom center; transform: rotate(calc((var(--dial-value, 50) - 50) * 1.8deg)); transition: transform 380ms ease; }
.dial b { font-family: var(--headline); font-size: clamp(1.4rem, 2vw, 2rem); color: var(--plum); }
.dial em { position: absolute; bottom: 20%; font-family: var(--mono); color: var(--navy); font-style: normal; }
.dial.is-turning .dial-hand { transform: rotate(calc((var(--dial-value, 50) - 50) * 1.8deg + 28deg)); }

.tuned-strip {
    position: absolute;
    left: 19vw;
    bottom: 9vh;
    max-width: 62vw;
    padding: 20px 32px;
    border-radius: 999px;
    font-size: clamp(1.35rem, 2.4vw, 2.6rem);
    transform: rotate(2deg);
}

.gate-room {
    grid-template-columns: 1fr 0.8fr;
    gap: 5vw;
    background:
        radial-gradient(circle at 78% 42%, rgba(255,107,94,0.22), transparent 23rem),
        linear-gradient(145deg, rgba(216,243,255,0.88), rgba(255,244,216,0.82));
}

.gate-board {
    background: var(--navy);
    color: var(--cream);
    border-radius: 34px;
    padding: 22px;
    box-shadow: 0 30px 70px rgba(19,36,58,0.28);
    transform: rotate(-3deg);
}

.board-row {
    display: grid;
    grid-template-columns: 0.5fr 1fr 1.2fr 0.8fr;
    gap: 16px;
    padding: 18px 16px;
    border-bottom: 1px solid rgba(216,243,255,0.18);
    font-size: clamp(0.78rem, 1.4vw, 1.08rem);
}

.board-header { color: var(--mint); }
.board-row:not(.board-header) span { animation: flipText 4s steps(1) infinite; }
.sendoff-copy { align-self: start; padding-top: 9vh; }

.passport {
    position: absolute;
    right: 10vw;
    bottom: 10vh;
    width: 250px;
    height: 330px;
    border-radius: 24px;
    background: var(--plum);
    color: var(--cream);
    padding: 28px;
    display: grid;
    align-content: space-between;
    transform: rotate(8deg);
    box-shadow: 0 24px 60px rgba(19,36,58,0.25);
}

.passport strong {
    justify-self: center;
    border: 4px double var(--coral);
    color: var(--coral);
    padding: 18px 15px;
    border-radius: 50%;
    transform: rotate(-13deg);
    font-family: var(--mono);
}

.passport em { color: var(--mint); font-style: normal; }

@keyframes drift { to { transform: translate3d(4vw, -3vh, 0) scale(1.08); } }
@keyframes scan { to { transform: translateY(160vh); } }
@keyframes floatCompass { 50% { transform: translateY(-18px) rotate(2deg); } }
@keyframes needle { 50% { transform: rotate(16deg); } }
@keyframes ribbonOrbit { 50% { transform: translateX(13vw) translateY(-3vh) rotate(6deg); } }
@keyframes ribbonLaunch { 0% { transform: translateX(-8vw) rotate(-7deg); } 60% { transform: translateX(44vw) rotate(9deg); } 100% { transform: translateX(0) rotate(-7deg); } }
@keyframes blink { 50% { opacity: 0.38; transform: translateY(-3px); } }
@keyframes beltMove { to { transform: translateX(80px); } }
@keyframes trayTravel { to { transform: translateX(22vw); } }
@keyframes beamSweep { 50% { transform: translateX(56px); opacity: 0.42; } }
@keyframes frontMove { to { stroke-dashoffset: -160; } }
@keyframes bob { 50% { transform: translateY(-18px) rotate(3deg); } }
@keyframes temp { 50% { height: 82%; } }
@keyframes flipText { 50% { color: var(--mint); } }

@media (max-width: 900px) {
    .route-nav { right: 10px; }
    .room { padding: 8vh 6vw; }
    .terminal-grid, .weather-room, .dial-room, .gate-room { grid-template-columns: 1fr; }
    .compass-wrap { min-height: 520px; }
    .terminal-copy { transform: none; }
    .orbit-heading { position: relative; left: auto; top: auto; margin-bottom: 2rem; }
    .customs-stage { min-height: 78vh; }
    .stamp-cloud { right: 10vw; top: 10vh; grid-template-columns: 1fr; }
    .scanner-gate { left: 35%; }
    .dial-console { transform: none; grid-template-columns: 1fr 1fr; }
    .tuned-strip, .passport { position: relative; left: auto; right: auto; bottom: auto; max-width: 100%; margin-top: 2rem; }
}

@media (max-width: 620px) {
    h1 { font-size: 4rem; }
    h2 { font-size: 3.2rem; }
    .route-nav { display: none; }
    .main-ribbon { left: -22vw; width: 82vw; }
    .dial-console { grid-template-columns: 1fr; }
    .board-row { grid-template-columns: 1fr 1fr; }
    .weather-map { height: 62vh; }
}
