:root {
  color-scheme: dark;
  --navy: #0c1928;
  --blueprint-navy: #09182e;
  --qr-royal: #012a8a;
  --white: #f5f8fc;
  --muted: #c4d3df;
  --gutter: clamp(20px, 4.1vw, 90px);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--white);
  background: var(--navy);
}
@font-face {
  font-family: "IBM Plex Mono"; src: url("./fonts/IBMPlexMono-Regular.woff2") format("woff2");
  font-style: normal; font-weight: 400; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono"; src: url("./fonts/IBMPlexMono-Medium.woff2") format("woff2");
  font-style: normal; font-weight: 500; font-display: swap;
}
* { box-sizing: border-box; }
body { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 2px solid #b5e2ff; outline-offset: 4px; }
a { color: #d1e9fb; text-underline-offset: .2em; }
svg { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

.hero {
  position: relative; isolation: isolate; min-height: 410px; height: 100vh; height: 100svh;
  overflow: hidden; background: var(--navy);
}
#viewer { position: absolute; inset: 0; overflow: hidden; touch-action: pan-y; outline: none; }
.still, #poster, #viewer canvas { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
.still { z-index: 1; overflow: hidden; pointer-events: none; opacity: 1; transition: opacity 180ms ease; }
#poster { object-fit: cover; object-position: calc(50% + clamp(0px,calc(7.99svh - 3.714vw),1.3vw)) 50%; user-select: none; }
@media (max-aspect-ratio: 9/5) {
  /* Match the wider optical center of the 3D camera and use the tall beauty
     render to supply real sky and ground above and below its street cut. */
  #poster { width: 119.45%; height: auto; min-height: 100%; left: 51.3%; top: 50%; transform: translate(-50%,-50%); object-position: center; }
}
#viewer canvas { opacity: 0; }
.ready #viewer canvas { opacity: 1; }
.ready .still { opacity: 0; }
.fallback .still { opacity: 1; }
.fallback #viewer canvas { visibility: hidden; }

.caption {
  position: absolute; z-index: 2; inset: auto 0 0; display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; padding: clamp(55px, 9svh, 140px) var(--gutter) max(32px,env(safe-area-inset-bottom));
  pointer-events: none;
  background: radial-gradient(ellipse 76% 99% at -2% 103%,
                #071521f5 5%, #081622d4 35%, #091723a8 53%,
                #09172354 72%, #09172319 86%, #09172300 100%),
              radial-gradient(ellipse 38% 93% at 103% 105%,
                #091725ca 0%, #09172578 48%, #09172518 82%, #09172500 100%);
}
h1 { margin: 0; font-size: clamp(2.4rem,4.8vw,5.4rem); font-weight: 550; letter-spacing: -.068em; line-height: 1.05; }
h1 span { color: #beddf4; }
@media (max-width: 700px) and (orientation: portrait) {
  .hero {
    display: grid; grid-template-rows: auto auto minmax(min(54svh,142vw),1fr) auto;
    height: auto; min-height: 100vh; min-height: 100svh; overflow: visible;
  }
  .caption { display: contents; }
  .caption-text {
    grid-row: 2; padding: clamp(18px,3.8svh,35px) var(--gutter) clamp(15px,2.5svh,24px);
    pointer-events: none;
  }
  h1 { font-size: clamp(2.3rem,8.9vw,3.6rem); }
  #viewer { position: relative; grid-row: 3; width: 100%; height: 100%; min-height: min(54svh,142vw); max-height: 142vw; align-self: center; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .hero { min-height: 265px; }
  .caption { padding-top: 38px; padding-bottom: max(13px,env(safe-area-inset-bottom)); }
  h1 { font-size: clamp(1.9rem,5vw,2.5rem); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto; transition-duration: 0s !important; }
}
