/* SubVysion look, as in mapping-web's app.css: black, white, one teal accent, Noto Sans. */
:root { --vh: 1vh; color-scheme: dark; --bg: #000; --panel: rgb(10 10 10 / .72); --line: rgb(255 255 255 / .12);
  --muted: rgb(255 255 255 / .6); --teal: #14b8a6; }
@supports (height: 1dvh) { :root { --vh: 1dvh; } }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: #fff;
  font: 15px/1.35 "Noto Sans", system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overscroll-behavior: none;
  -webkit-user-select: none; user-select: none; }
canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#feed { z-index: 0; visibility: hidden; }
body.mode-ar #feed { visibility: visible; }
#view { z-index: 1; }

/* ── in-scene chrome (no buttons) ───────────────────────────────────── */
#legend { position: fixed; z-index: 3; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom));
  display: flex; gap: 14px; align-items: center; white-space: nowrap; font-size: 12px; padding: 8px 14px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  pointer-events: none; transition: opacity .6s; }
#legend i { display: inline-block; width: 16px; height: 5px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
#legend .dim { opacity: .6; }
body.pipes-off #legend span:not(.dim) { opacity: .25; }
#hint { position: fixed; z-index: 3; left: 50%; top: calc(18% + env(safe-area-inset-top)); transform: translateX(-50%); max-width: 82%;
  text-align: center; padding: 10px 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); pointer-events: none; }
#hint:empty { display: none; }
#credit { position: fixed; z-index: 3; left: calc(14px + env(safe-area-inset-left)); top: calc(16px + env(safe-area-inset-top)); font-size: 11px; color: #fff; opacity: .45; }
/* Always there, the intro included: opens the contact panel. */
#more { -webkit-appearance: none; appearance: none; margin: 0; font: inherit; position: fixed; z-index: 11; right: calc(12px + env(safe-area-inset-right)); top: calc(10px + env(safe-area-inset-top)); padding: 8px 14px;
  font-size: 13px; font-weight: 600; line-height: 1.3; color: #fff; background: rgb(10 10 10 / .8); border: 1px solid rgb(255 255 255 / .28);
  border-radius: 999px; transition: opacity .3s; }
body.lead-open #more { opacity: 0; pointer-events: none; }
body.mode-intro #legend, body.mode-intro #hint, body.mode-intro #credit { opacity: 0; }

/* ── intro: the title, then the page slides up to how the site was scanned ──
   Sizes follow the smaller of the screen's width and height, so both slides fit a small
   iPhone in Safari (toolbars showing) and a phone on its side. */
#intro { position: fixed; z-index: 10; inset: 0; overflow: hidden; background: var(--bg); transition: opacity .8s ease, visibility 0s .8s; }
#intro.out { opacity: 0; visibility: hidden; pointer-events: none; }
#intro .logo { position: absolute; left: calc(22px + env(safe-area-inset-left)); top: calc(18px + env(safe-area-inset-top)); width: 112px;
  animation: fade 1.2s ease both; }
@keyframes fade { from { opacity: 0; } }
.reel { height: 100%; transition: transform 1s cubic-bezier(.65, 0, .2, 1); }
#intro.how .reel { transform: translateY(-100%); }
.slide { height: 100%; display: flex; align-items: center; justify-content: center;
  padding: calc(60px + env(safe-area-inset-top)) max(clamp(22px, 7vw, 110px), env(safe-area-inset-right))
    calc(76px + env(safe-area-inset-bottom)) max(clamp(22px, 7vw, 110px), env(safe-area-inset-left)); }
.slide .copy { max-width: 760px; text-align: center; }
.slide:first-child .copy { animation: fadein 1.4s .25s ease both; }
@keyframes fadein { from { opacity: 0; transform: translateY(14px); } }
.eyebrow { margin: 0 0 calc(2.4 * var(--vh)); font-size: clamp(10px, 2.9vw, 12px); font-weight: 500; letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted); }
#intro h1 { margin: 0; font-size: clamp(26px, min(8.4vw, 9 * var(--vh)), 60px); line-height: 1.1; font-weight: 700; letter-spacing: -.025em;
  text-wrap: balance; }
#intro h1 .glow { display: block; color: var(--teal); }
#intro h2 { margin: 0; font-size: clamp(20px, min(6.4vw, 4.4 * var(--vh)), 44px); line-height: 1.14; font-weight: 700; letter-spacing: -.02em;
  text-wrap: balance; }
#intro .body { margin: calc(2 * var(--vh)) auto 0; max-width: 34em; font-size: clamp(13.5px, min(4vw, 2.5 * var(--vh)), 18px); line-height: 1.45;
  color: rgb(255 255 255 / .78); }
#intro .rover { display: block; width: auto; height: clamp(70px, 22 * var(--vh), 240px); margin: 0 auto calc(2.5 * var(--vh)); }
/* The second slide's parts arrive one after another once it is on screen. */
.slide:last-child .copy > * { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s ease; }
#intro.how .slide:last-child .copy > * { opacity: 1; transform: none; }
#intro.how .slide:last-child .copy > :nth-child(1) { transition-delay: .45s; }
#intro.how .slide:last-child .copy > :nth-child(2) { transition-delay: .6s; }
#intro.how .slide:last-child .copy > :nth-child(3) { transition-delay: .72s; }
#intro.how .slide:last-child .copy > :nth-child(4) { transition-delay: .9s; }
#intro .status { position: absolute; left: max(clamp(22px, 7vw, 110px), env(safe-area-inset-left)); right: max(clamp(22px, 7vw, 110px), env(safe-area-inset-right));
  bottom: calc(22px + env(safe-area-inset-bottom)); text-align: center; }
.bar { height: 1px; background: var(--line); border-radius: 2px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--teal); transition: width .35s ease-out; }
#status-text { margin: 9px 0 0; font-size: 12px; letter-spacing: .04em; color: var(--muted); min-height: 1.4em; }
/* A phone on its side: the rover beside its text, less room given to the header and the bar. */
@media (orientation: landscape) and (max-height: 520px) {
  .slide { padding-top: calc(50px + env(safe-area-inset-top)); padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
  .slide:last-child .copy { display: grid; grid-template-columns: auto 1fr; column-gap: 30px; align-items: center; text-align: left; }
  #intro .rover { grid-row: 1 / span 3; height: clamp(90px, 52 * var(--vh), 220px); margin: 0; }
  #intro .body { margin-left: 0; }
  #intro .status { bottom: calc(12px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .reel, .slide .copy > * { transition-duration: .01s !important; transition-delay: 0s !important; } }

/* ── contact panel ────────────────────────────────────────────────────
   --kb is the on-screen keyboard's height and --vvh the height left above it (app.js). */
#scrim { position: fixed; z-index: 11; inset: 0; background: rgb(0 0 0 / .62); opacity: 0; pointer-events: none; transition: opacity .4s ease; }
body.lead-open #scrim { opacity: 1; pointer-events: auto; }
#lead { position: fixed; z-index: 12; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom) + var(--kb, 0px)); width: min(calc(100% - 24px), 400px);
  max-height: calc(var(--vvh, 100 * var(--vh)) - 24px - env(safe-area-inset-top)); overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 18px 18px 14px; border-radius: 18px; background: #0d0d0d; border: 1px solid rgb(255 255 255 / .16);
  -webkit-user-select: auto; user-select: auto; opacity: 0; transform: translate(-50%, 24px);
  transition: opacity .4s ease, transform .4s ease, bottom .2s ease; }
#lead.on { opacity: 1; transform: translate(-50%, 0); }
#lead h2 { margin: 0 36px 4px 0; font-size: 20px; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
#lead p { margin: 0 0 12px; font-size: 14px; line-height: 1.4; color: var(--muted); }
#lead p b { color: var(--teal); font-weight: 600; }
#lead input, #lead button { -webkit-appearance: none; appearance: none; margin: 0; font: inherit; }
#lead input { display: block; width: 100%; margin: 0 0 8px; padding: 11px 13px; font-size: 16px; line-height: 1.25; color: #fff;
  background: #1c1c1c; border: 1px solid rgb(255 255 255 / .16); border-radius: 10px; outline: none;
  -webkit-user-select: text; user-select: text; }
#lead input::placeholder { color: rgb(255 255 255 / .45); }
#lead input:focus { border-color: var(--teal); }
#lead button[type=submit] { display: block; width: 100%; margin-top: 2px; padding: 12px; font-size: 16px; font-weight: 600;
  color: #000; background: var(--teal); border: 0; border-radius: 10px; }
#lead button[disabled] { opacity: .6; }
#lead .close { position: absolute; right: 6px; top: 4px; width: 44px; height: 44px; padding: 0; font-size: 26px; line-height: 1; color: var(--muted);
  background: none; border: 0; }
#lead .msg { margin: 8px 0 0; min-height: 1.3em; text-align: center; color: #fff; }
#lead .msg:empty { display: none; }
#lead.sent > :not(.msg) { display: none; }
#lead.sent .msg { margin: 6px 0; font-size: 17px; font-weight: 600; }
body.lead-open #legend { opacity: 0; }
@media (orientation: landscape) and (max-height: 520px) {
  #lead { width: min(calc(100% - 24px), 660px); padding: 14px 16px 12px; }
  #lead p { margin-bottom: 10px; }
  #lead .fields { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 8px; }
}

/* ── plain pages (about, marker) ────────────────────────────────────── */
.page { overflow: auto; height: auto; min-height: 100%; -webkit-user-select: auto; user-select: auto; }
.page main { max-width: 720px; margin: 0 auto; padding: 24px 18px 60px; }
.page a { color: var(--teal); }
