:root { color-scheme: dark; font-family: Arial, sans-serif; color: #f0f6fc; background: #101821; }
* { box-sizing: border-box; }
body { margin: 0; }
.journey { height: 700vh; }
.stage { position: sticky; top: 0; height: 100vh; min-height: 480px; overflow: hidden; background: #101821; }
#map, .shade { position: absolute; inset: 0; }
.shade { pointer-events: none; background: linear-gradient(180deg, rgba(8,15,25,.72), rgba(8,15,25,.06) 48%, rgba(8,15,25,.62)); }
header { position: absolute; top: 0; width: 100%; display: flex; justify-content: space-between; padding: 28px 5%; font-size: 11px; font-weight: bold; letter-spacing: .12em; }
.intro { position: absolute; top: 13%; left: 50%; transform: translateX(-50%); width: min(90%, 850px); text-align: center; pointer-events: none; }
.eyebrow { font-size: 11px; font-weight: bold; letter-spacing: .16em; text-transform: uppercase; }
h1 { font-size: clamp(42px, 6.5vw, 88px); letter-spacing: -.065em; line-height: .98; margin: 18px 0; }
.intro > p:last-child { max-width: 500px; margin: 0 auto; font-size: 18px; line-height: 1.5; }
.route-label { position: absolute; bottom: 9%; left: 5%; display: grid; gap: 7px; pointer-events: none; text-shadow: 0 1px 12px #081019; }
.route-kicker, .route-context { font-size: 10px; font-weight: bold; letter-spacing: .12em; text-transform: uppercase; }
.current-place { font-size: clamp(22px, 3vw, 34px); letter-spacing: -.04em; }
.hint { position: absolute; bottom: 4%; left: 50%; transform: translateX(-50%); font-size: 10px; letter-spacing: .12em; white-space: nowrap; }
.hint span { color: #e9363c; }
.map-message { position: absolute; bottom: 13%; left: 5%; background: #192432; color: #f0f6fc; padding: 12px; }
.end { min-height: 80vh; background: #102235; color: #f2f7f7; padding: 15vh 7%; }
.end h2 { font-size: clamp(42px, 7vw, 90px); letter-spacing: -.06em; margin: 20px 0; }
.end p { line-height: 1.5; }
.end a { display: inline-block; color: inherit; margin-top: 28px; }
.maplibregl-ctrl-attrib { font-size: 10px; }
@media (max-width: 600px) { header { font-size: 9px; } .intro { top: 14%; } .intro > p:last-child { font-size: 14px; } }
@media (prefers-reduced-motion: reduce) { .journey { height: 100vh; } .hint { display: none; } }

/* Reference-inspired hero entrance: same perspective, timing, and stagger. */
@media (prefers-reduced-motion: no-preference) {
  .has-animation .intro h1, .has-animation .intro > p:last-child {
    opacity: 0;
    transform: perspective(1000px) translate(50%) translate3d(-222.2px, 88px, 0) rotateY(60deg) rotateX(35deg);
    transition: opacity 1.5s cubic-bezier(.16, 1, .3, 1), transform 1.5s cubic-bezier(.16, 1, .3, 1);
  }
  .has-animation .intro > p:last-child { transition-delay: .3s; }
  .has-animation .intro.entered h1, .has-animation .intro.entered > p:last-child {
    opacity: 1;
    transform: perspective(1000px) translate(0) translateZ(0) rotateY(0) rotateX(0);
  }
  .has-animation .intro.scrolling h1, .has-animation .intro.scrolling > p:last-child { transition: none; }
}

/* Opening sequence: draw the orbits, then reveal the map and text. */
.opening { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.opening-bg { position: absolute; inset: 0; background: #aebfcb; transition: opacity 1s ease; }
.opening-orbits { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity .9s ease; }
.orbit-mask { fill: none; stroke: white; stroke-width: 4; stroke-dasharray: 100; stroke-dashoffset: 100; animation: draw-orbit 1.8s ease-out forwards; }
.orbit-mask-inner { animation-delay: .15s; }
.opening-mark { position: absolute; left: 50%; top: 50%; color: #193c96; font-family: Georgia, "Times New Roman", serif; font-style: italic; font-weight: 400; font-size: clamp(38px, 5vw, 60px); letter-spacing: -.065em; transform: translate(-50%, -50%); animation: mark-enter .65s ease-out backwards; transition: opacity .35s ease; }
.opening.mark-out .opening-mark, .opening.leaving .opening-bg, .opening.leaving .opening-orbits, .opening.leaving .opening-mark { opacity: 0; }
@keyframes draw-orbit { to { stroke-dashoffset: 0; } }
@keyframes mark-enter { from { opacity: 0; transform: translate(-50%, -50%) scale(.7) rotate(-25deg); } to { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); } }
@media (prefers-reduced-motion: reduce) { .opening { display: none; } }

/* A scroll-driven, illustrative traffic moment. */
.traffic-note { position: absolute; left: 50%; top: 17%; width: min(520px, 88%); text-align: center; opacity: 0; transform: translate(-50%, 24px); pointer-events: none; color: #f0f6fc; text-shadow: 0 2px 18px rgba(5,12,20,.95); }
.traffic-note.is-visible { pointer-events: auto; }
.traffic-kicker { font-size: 10px; font-weight: bold; letter-spacing: .15em; }
.traffic-note p { margin: 10px 0 12px; font-size: clamp(32px, 4vw, 56px); font-weight: 700; letter-spacing: -.055em; line-height: 1.02; }
.traffic-note > span:last-child { font-size: clamp(14px, 1.4vw, 17px); line-height: 1.4; }
.traffic-note a { color: inherit; text-underline-offset: 3px; }

/* NYC finale; the heart and message belong to the project, not map data. */
.nyc-finale { position: absolute; top: 8%; left: 50%; width: min(820px, 88%); transform: translate(-50%, 24px); text-align: center; color: #f6f9fd; text-shadow: 0 2px 22px rgba(5,12,20,.95); opacity: 0; pointer-events: none; }
.nyc-kicker { font-size: 10px; font-weight: bold; letter-spacing: .16em; }
.nyc-finale h2 { margin: 16px 0 22px; font-size: clamp(32px, 4vw, 52px); line-height: 1.02; letter-spacing: -.055em; }
.nyc-finale > p:not(.nyc-kicker) { max-width: 680px; margin: 12px auto; font-size: clamp(14px, 1.4vw, 17px); line-height: 1.4; }
.nyc-heart { color: white; font-family: Georgia, serif; font-weight: normal; }
@media (max-width: 600px) { .nyc-finale { top: 7%; } .nyc-finale h2 { font-size: clamp(30px, 8vw, 42px); } }

.credits { padding: 18px 7%; background: #102235; color: #b8c7d5; font-size: 11px; line-height: 1.5; }
.credits a { color: inherit; }

/* Video preview appears within the NYC map scene. */
.nyc-finale.is-interactive { pointer-events: auto; }
.video-frame { position: relative; height: min(48vh, 430px); aspect-ratio: 9 / 16; margin: 18px auto 0; overflow: hidden; border-radius: 14px; background: #1a2835; box-shadow: 0 18px 60px rgba(0,0,0,.55); opacity: 0; transform: translateY(24px) scale(.96); }
.video-frame video { display: block; width: 100%; height: 100%; object-fit: contain; }
.video-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: grid; place-items: center; width: 58px; height: 58px; padding: 0; border: 1px solid rgba(255,255,255,.8); border-radius: 50%; background: rgba(12,22,35,.78); color: white; cursor: pointer; font-size: 20px; }
.video-play[hidden] { display: none; }
.video-play span { margin-left: 3px; }
.video-play:focus-visible { outline: 3px solid #9bd9ff; outline-offset: 4px; }
@media (max-width: 600px) { .video-frame { height: min(40vh, 340px); margin-top: 10px; } }

.map-credits { position: absolute; right: 10px; bottom: 8px; color: #d2deeb; font-size: 10px; text-shadow: 0 1px 4px #000; }
.map-credits a { color: inherit; }

.hint { transition: opacity .35s ease; }
.hint.is-hidden { opacity: 0; }

/* Give the portrait video more room without obscuring the NYC message. */
.nyc-finale { top: 10%; width: min(1050px, 90%); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: clamp(24px, 5vw, 72px); text-align: left; }
.nyc-copy { max-width: 650px; }
.nyc-copy > p:not(.nyc-kicker) { max-width: 620px; margin: 12px 0; font-size: clamp(14px, 1.4vw, 17px); line-height: 1.4; }
.video-frame { height: min(70vh, 620px); margin: 0; }
@media (max-width: 700px) {
  .nyc-finale { top: 8%; width: 88%; display: flex; flex-direction: column; gap: 12px; text-align: center; }
  .nyc-copy { width: 100%; }
  .nyc-copy .nyc-kicker { margin: 0 0 8px; }
  .nyc-copy h2 { font-size: clamp(26px, 7vw, 36px); margin: 0 0 10px; }
  .nyc-copy > p:not(.nyc-kicker) { margin: 7px auto; font-size: 13px; line-height: 1.35; }
  .video-frame { height: min(48vh, 410px); margin: 0; }
}

.email-button { display: inline-flex; align-items: center; justify-content: center; gap: 18px; min-height: 58px; margin-top: 20px; padding: 15px 28px; border: 1px solid #fff; border-radius: 999px; color: #fff; background: transparent; text-decoration: none; font-size: 16px; font-weight: 600; transition: background-color .2s ease, color .2s ease; }
.email-button:hover { background: #fff; color: #101821; }
.email-button:focus-visible { outline: 3px solid #9bd9ff; outline-offset: 4px; }
@media (max-width: 700px) { .email-button { min-height: 48px; margin-top: 8px; padding: 10px 22px; font-size: 14px; } }
