/* ============================================================
   DeviceDeck — immersive build
   One WebGL world. DOM floats over it.

   Palette: deep indigo base (never pure black) with four live
   hues that the scene cycles through as you scroll.
   ============================================================ */

:root {
  /* base — indigo, not black */
  --ink-900: #070a18;
  --ink-800: #0b1024;
  --ink-700: #121834;
  --ink-600: #1c2450;

  /* live hues, one per act */
  --h-blue:    #4d8dff;
  --h-cyan:    #22e0d6;
  --h-magenta: #ff4d9d;
  --h-amber:   #ffb44d;
  --h-violet:  #9b6bff;

  /* the accent is blue everywhere; the other hues are scene/act colour */
  --acc: var(--h-blue);

  --paper: #f4f6ff;
  --dim:   #9aa8cc;
  --dimmer:#6a789e;

  --line:   rgba(150, 180, 255, .14);
  --line-2: rgba(150, 180, 255, .08);
  --fill:   rgba(120, 160, 255, .06);

  --sans: "Space Grotesk", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  --wrap: 1280px;
  --pad: 32px;
  --r: 16px;

  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }

body {
  margin: 0;
  background: var(--ink-900);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Lenis */
html.lenis { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.04em; line-height: 1; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

::selection { background: var(--h-magenta); color: #fff; }

::-webkit-scrollbar { width: 0; height: 0; }

/* ============================================================
   The world canvas + fixed overlays
   ============================================================ */

#world {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

/* Ambient nebula plate, the deepest layer of the scene.
   It sits behind the WebGL canvas, so it must stay dark: the headline
   is white and sits over the left of it. Opacity is driven per act. */
#sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--sky, .55);
  transition: opacity 1.2s var(--ease);
}
#sky video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* keep the left column, where the copy lives, quiet */
#sky::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 10, 24, .92) 0%, rgba(7, 10, 24, .5) 42%, transparent 70%),
    linear-gradient(180deg, rgba(7, 10, 24, .8) 0%, transparent 30%, transparent 72%, rgba(7, 10, 24, .9) 100%);
}

/* colour wash that shifts hue per act, sits under the canvas */
#wash {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(120% 80% at 70% 10%, var(--wash-a, #1b2a6b) 0%, transparent 60%),
    radial-gradient(100% 70% at 10% 90%, var(--wash-b, #3a1a5c) 0%, transparent 62%),
    var(--ink-900);
  transition: background 1.2s var(--ease);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: .16;
  mix-blend-mode: overlay;
  background-image: url("../assets/tex/grain.png");
  background-size: 380px;
}

/* Content layer.
   This box covers the whole viewport above the canvas, so with default
   pointer-events it swallows every click before the globe can see one.
   It stays transparent to the pointer and interactive things opt back in. */
.page { position: relative; z-index: 10; pointer-events: none; }
.page a,
.page button,
.page input,
.page select,
.page label,
.page .hud,
.page .pan__track,
.page .use,
.page .plat__media,
.page .cap,
.page .plan { pointer-events: auto; }

/* every act is a full-viewport stage the world plays behind */
.act {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding: 0 var(--pad);
}
.act__in {
  max-width: var(--wrap);
  margin: 0 auto;
  width: 100%;
  position: relative;
}

/* Readable ground under the copy.
   The world is bright and moving, so text needs its own floor or the
   contrast depends on wherever the globe happens to be. */
.act__in::before {
  content: "";
  position: absolute;
  inset: -14% -10%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(52% 64% at 26% 50%, rgba(7, 10, 24, .93) 0%, rgba(7, 10, 24, .72) 46%, transparent 74%);
}
/* centred acts get a centred floor */
.close::before,
.faqs::before {
  background: radial-gradient(62% 60% at 50% 50%, rgba(7, 10, 24, .92) 0%, rgba(7, 10, 24, .68) 50%, transparent 76%);
}

/* the world needs the pointer, prose does not */
.act { pointer-events: none; }

/* ============================================================
   Type
   ============================================================ */

.display {
  font-size: clamp(2.8rem, 8vw, 7.5rem);
  line-height: .92;
  letter-spacing: -.055em;
}
.h2 {
  font-size: clamp(2rem, 4.6vw, 3.8rem);
  line-height: .98;
  letter-spacing: -.045em;
}
.lede {
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  line-height: 1.55;
  color: var(--dim);
  max-width: 46ch;
}
.mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
}

/* gradient word inside a headline */
.grad {
  background: linear-gradient(96deg, var(--h-cyan), var(--h-blue) 38%, var(--h-violet) 66%, var(--h-magenta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* per-character reveal */
.split { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .08em; }
.split > span { display: inline-block; will-change: transform; }

/* ============================================================
   Preloader
   ============================================================ */

/* ============================================================
   Header
   ============================================================ */

.hdr {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 22px var(--pad);
  mix-blend-mode: difference;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  margin-right: auto;
  font-weight: 700; letter-spacing: -.03em; font-size: 17px;
  pointer-events: auto;
}
.brand i {
  width: 10px; height: 10px;
  background: #fff;
  transform: rotate(45deg);
  display: block;
}
.hdr nav { display: flex; gap: 26px; pointer-events: auto; }
.hdr nav a {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  opacity: .75;
  transition: opacity .3s var(--ease);
}
.hdr nav a:hover { opacity: 1; }

/* act progress rail */
.rail {
  position: fixed;
  right: var(--pad);
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 14px;
  pointer-events: auto;
}
.rail button {
  width: 26px; height: 2px;
  border: 0; padding: 0;
  background: rgba(255, 255, 255, .22);
  cursor: pointer;
  transition: all .4s var(--ease);
}
.rail button.is-on { width: 44px; background: var(--h-cyan); }

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 26px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  border: 0;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  white-space: nowrap;
  transition: color .3s var(--ease);
}
.btn--fill {
  background: linear-gradient(96deg, var(--h-cyan), var(--h-blue) 55%, var(--h-violet));
  color: #050a1c;
  font-weight: 600;
}
.btn--fill:hover { color: #050a1c; }
.btn--line {
  border: 1px solid var(--line);
  color: var(--paper);
  background: rgba(255, 255, 255, .02);
  backdrop-filter: blur(8px);
}
.btn--line::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(96deg, var(--h-magenta), var(--h-violet));
  transform: translateY(101%);
  transition: transform .45s var(--ease);
}
.btn--line:hover { color: #fff; border-color: transparent; }
.btn--line:hover::before { transform: translateY(0); }

.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 40px; }

/* ============================================================
   ACT 1 — hero
   ============================================================ */

.hero__in { max-width: 1000px; }
.hero .mono { color: var(--h-cyan); margin-bottom: 26px; display: block; }
.hero .lede { margin-top: 28px; }

.hero__stats {
  display: flex;
  gap: 44px;
  margin-top: 64px;
  flex-wrap: wrap;
}
.stat__v {
  font-family: var(--mono);
  font-size: clamp(1.4rem, 2.4vw, 2.1rem);
  font-weight: 600;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(96deg, var(--h-cyan), var(--h-blue));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat__k {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--dimmer);
  margin-top: 6px;
}

/* ============================================================
   ACT 2 — live coordinate console over the globe
   ============================================================ */

/* Controls live in a single left column and the globe gets the whole right
   side, the way the app itself lays out: panel left, map right. The earlier
   two-column split parked the deck directly on top of the globe. */
.console {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 26px;
  width: 100%;
  max-width: 430px;
}
.console > * { width: 100%; }

.hud {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(9, 14, 36, .86);
  backdrop-filter: blur(20px);
  padding: 20px;
  pointer-events: auto;
}
.hud__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-2);
}
.hud__row:last-of-type { border-bottom: 0; }
.hud__k {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--dimmer);
}
.hud__v {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--h-cyan);
}

.cities { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.city {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 10px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
  transition: all .3s var(--ease);
}
.city:hover { color: var(--paper); border-color: rgba(150, 180, 255, .4); }
.city.is-on {
  background: linear-gradient(96deg, var(--h-cyan), var(--h-blue));
  border-color: transparent;
  color: #050a1c;
  font-weight: 600;
}

/* ============================================================
   ACT 3 — capability pan (horizontal)
   ============================================================ */

.pan { position: relative; overflow: hidden; min-height: 100dvh; display: flex; align-items: center; }
.pan__track { display: flex; gap: 28px; padding: 0 max(var(--pad), 8vw); will-change: transform; }

.cap {
  flex: none;
  width: min(380px, 78vw);
  border-radius: 20px;
  padding: 32px;
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(12, 18, 44, .92), rgba(9, 13, 32, .86));
  backdrop-filter: blur(16px);
  min-height: 380px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
/* each card carries its own hue */
.cap::after {
  content: "";
  position: absolute;
  inset: auto -40% -60% -40%;
  height: 70%;
  background: radial-gradient(closest-side, var(--hue), transparent);
  opacity: .5;
  pointer-events: none;
}
.cap__n {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--hue);
}
.cap__t { font-size: 26px; letter-spacing: -.03em; margin: 16px 0 12px; line-height: 1.05; }
.cap__b { font-size: 14.5px; line-height: 1.6; color: var(--dim); }
.cap__foot {
  margin-top: auto;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--dimmer);
}

/* ============================================================
   ACT 4 — platforms
   ============================================================ */

.plat { display: grid; grid-template-columns: 1fr 1fr; gap: 70px; align-items: center; width: 100%; }
.plat__media {
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  position: relative;
}
.plat__media img { width: 100%; aspect-ratio: 16 / 11; object-fit: cover; }
.os {
  display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px;
}
.os span {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 16px;
  color: var(--dim);
}
.os span.new { border-color: var(--h-cyan); color: var(--h-cyan); }

/* ============================================================
   ACT 5 — use cases, each with its own hue
   ============================================================ */

.uses { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; width: 100%; }
.use {
  grid-column: span 2;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(9, 14, 36, .72);
  position: relative;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 26px;
  isolation: isolate;
}
/* rhythm across exactly 6 cells: two wide, three medium, one full */
.use:nth-child(1), .use:nth-child(2) { grid-column: span 3; min-height: 360px; }
.use:nth-child(6) {
  grid-column: span 6;
  min-height: 300px;
  align-items: flex-start;
  justify-content: flex-end;
}
.use:nth-child(6) .use__b { max-width: 52ch; }

/* the wide card's art is bright across the middle, so its copy needs a
   left-weighted scrim rather than the usual bottom-only one */
.use:nth-child(6) .use__bg::after {
  background:
    linear-gradient(90deg, rgba(7, 10, 24, .95) 0%, rgba(7, 10, 24, .74) 42%, rgba(7, 10, 24, .2) 100%),
    linear-gradient(180deg, transparent 35%, rgba(7, 10, 24, .9) 100%);
}

.use__bg {
  position: absolute; inset: 0; z-index: -2;
}
.use__bg img {
  width: 100%; height: 100%; object-fit: cover;
  /* art is natively in palette now, so only a light lift */
  filter: saturate(1.12);
  opacity: .95;
  transition: transform 1s var(--ease);
}
.use:hover .use__bg img { transform: scale(1.05); }
.use__bg::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, transparent 30%, rgba(7, 10, 24, .94) 100%),
    linear-gradient(120deg, var(--hue), transparent 68%);
  opacity: .9;
  mix-blend-mode: normal;
}
.use__k {
  font-family: var(--mono); font-size: 10px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--hue);
}
.use__t { font-size: 22px; letter-spacing: -.03em; margin: 12px 0 8px; line-height: 1.1; }
.use__b { font-size: 14px; line-height: 1.55; color: var(--dim); max-width: 40ch; }

/* small print needs its own ground, it lands over the world */
.fineprint {
  margin-top: 28px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--dimmer);
  max-width: 72ch;
  background: rgba(9, 14, 36, .82);
  backdrop-filter: blur(10px);
  border-left: 2px solid var(--line);
  padding: 14px 18px;
  border-radius: 0 10px 10px 0;
}

/* ============================================================
   ACT 6 — pricing / close
   ============================================================ */

.close { text-align: center; width: 100%; }
.plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 900px;
  margin: 56px auto 0;
  text-align: left;
}
.plan {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  background: rgba(10, 16, 40, .5);
  backdrop-filter: blur(12px);
  position: relative;
  transition: transform .4s var(--ease), border-color .4s var(--ease);
}
.plan:hover { transform: translateY(-6px); border-color: rgba(150, 180, 255, .45); }
.plan.best {
  border-color: transparent;
  background:
    linear-gradient(rgba(10, 16, 40, .8), rgba(10, 16, 40, .8)) padding-box,
    linear-gradient(150deg, var(--h-cyan), var(--h-violet), var(--h-magenta)) border-box;
  border: 1px solid transparent;
}
.plan__term { font-family: var(--mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--dimmer); }
.plan__p { font-size: 38px; font-weight: 700; letter-spacing: -.05em; margin: 14px 0 6px; }
.plan__n { font-size: 13.5px; color: var(--dim); }

/* coming-soon store treatment */
.soon-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--h-cyan);
  padding: 7px 14px; margin-bottom: 22px;
  border: 1px solid rgba(34, 224, 214, .35); border-radius: 999px;
  background: rgba(34, 224, 214, .06);
}
.soon-badge::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--h-cyan); box-shadow: 0 0 10px 1px var(--h-cyan);
  animation: soonPulse 2s var(--ease) infinite;
}
@keyframes soonPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.btn.is-soon { opacity: .55; cursor: not-allowed; }
.btn.is-soon:hover { color: #050a1c; }

.notify { max-width: 460px; margin: 40px auto 4px; text-align: center; }
.notify__lbl {
  display: block; font-family: var(--mono); font-size: 11px;
  letter-spacing: .18em; text-transform: uppercase; color: var(--dimmer);
  margin-bottom: 12px;
}
.notify__row { display: flex; gap: 10px; }
.notify__row input {
  flex: 1; min-width: 0;
  background: rgba(10, 16, 40, .5); backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-radius: 12px;
  color: var(--paper); font-family: var(--sans); font-size: 15px;
  padding: 0 16px; height: 48px;
  transition: border-color .3s var(--ease);
}
.notify__row input:focus { outline: none; border-color: rgba(34, 224, 214, .55); }
.notify__row input::placeholder { color: var(--dimmer); }
.notify__row .btn { flex: 0 0 auto; white-space: nowrap; }
.notify__msg { min-height: 18px; margin: 12px 0 0; font-size: 13.5px; color: var(--h-cyan); }
.notify__msg.is-err { color: var(--h-magenta); }

.pay-note { margin-top: 28px; font-size: 13px; color: var(--dimmer); }
.pay-note b { color: var(--dim); font-weight: 600; }

@media (max-width: 520px) {
  .notify__row { flex-direction: column; }
  .notify__row .btn { width: 100%; }
}

.faqs { max-width: 820px; margin: 0 auto; width: 100%; }
.faq { border-bottom: 1px solid var(--line-2); }
.faq button {
  width: 100%; display: flex; align-items: center; gap: 20px;
  background: transparent; border: 0; color: var(--paper);
  padding: 26px 0; text-align: left; cursor: pointer;
  font-size: clamp(1rem, 1.5vw, 1.25rem); font-weight: 500; letter-spacing: -.02em;
}
.faq button i {
  margin-left: auto; width: 22px; height: 22px; flex: none;
  border-radius: 50%; border: 1px solid var(--line);
  position: relative; transition: all .4s var(--ease);
}
.faq button i::before, .faq button i::after {
  content: ""; position: absolute; left: 50%; top: 50%; background: var(--h-cyan);
  transform: translate(-50%, -50%); transition: transform .4s var(--ease);
}
.faq button i::before { width: 9px; height: 1px; }
.faq button i::after { width: 1px; height: 9px; }
.faq.open button i { border-color: var(--h-cyan); }
.faq.open button i::after { transform: translate(-50%, -50%) rotate(90deg); }
.faq__a { max-height: 0; overflow: hidden; transition: max-height .5s var(--ease); }
.faq__a p { padding-bottom: 26px; color: var(--dim); font-size: 15px; line-height: 1.65; max-width: 62ch; }

.foot {
  position: relative; z-index: 10;
  display: flex; gap: 20px; flex-wrap: wrap; align-items: center;
  padding: 40px var(--pad);
  border-top: 1px solid var(--line-2);
  font-family: var(--mono); font-size: 10px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--dimmer);
}

/* ============================================================
   Reveal (IntersectionObserver drives this, never ScrollTrigger)
   ============================================================ */

.rv { opacity: 0; transform: translateY(28px); }
.rv.in {
  opacity: 1; transform: none;
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1024px) {
  .console { max-width: 100%; gap: 24px; }
  .plat { grid-template-columns: 1fr; gap: 34px; }
  .uses { grid-template-columns: repeat(2, 1fr); }
  .use, .use:nth-child(1), .use:nth-child(2) { grid-column: span 1; }
}

/* the pan cannot be scroll-jacked on touch, so it becomes a
   snap carousel and the TRACK does the scrolling, not the page */
@media (max-width: 820px) {
  .pan { overflow: hidden; min-height: auto; padding: 90px 0; }
  .pan__track {
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
    padding: 0 20px 18px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    transform: none !important;
  }
  .pan__track::-webkit-scrollbar { height: 0; }
  .cap { scroll-snap-align: center; min-height: 320px; }
}

@media (max-width: 720px) {
  :root { --pad: 20px; }
  .hdr nav { display: none; }
  .rail { display: none; }
  .act { min-height: auto; padding-top: 96px; padding-bottom: 96px; }
  .uses { grid-template-columns: 1fr; }
  .plans { grid-template-columns: 1fr; }
  .hero__stats { gap: 26px; }
  .cities { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   Reduced motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
  .rv { opacity: 1; transform: none; }
  #loader { display: none; }
}

/* ============================================================
   Location control deck
   Mirrors the app's Location panel: mode, coordinates,
   Set location, Keep this location, Flat / Globe.
   ============================================================ */

.deck__modes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .05);
  margin-bottom: 18px;
}
.mode {
  border: 0;
  background: transparent;
  color: var(--dim);
  border-radius: 999px;
  padding: 9px 4px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .3s var(--ease);
}
.mode:hover { color: var(--paper); }
.mode.is-on {
  background: linear-gradient(96deg, var(--h-cyan), var(--h-blue));
  color: #050a1c;
  font-weight: 600;
}

.pane { margin-top: 18px; }
.pane[hidden] { display: none; }

.hint {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dimmer);
  margin: 12px 0;
}

/* status line changes meaning once you set a location */
#statusLine[data-state="real"] { color: var(--dim); }
#statusLine[data-state="sim"] { color: var(--h-amber); }

/* coordinate entry */
.coord { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.coord input {
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 12px;
  min-width: 0;
}
.coord input:focus {
  outline: none;
  border-color: var(--h-cyan);
  background: rgba(34, 224, 214, .07);
}
.coord input::placeholder { color: var(--dimmer); }

.mini {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
  color: var(--paper);
  border-radius: 10px;
  padding: 11px 16px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .25s var(--ease);
  white-space: nowrap;
}
.mini:hover { border-color: var(--h-cyan); color: var(--h-cyan); }
.mini--go {
  background: linear-gradient(96deg, var(--h-cyan), var(--h-blue));
  border-color: transparent;
  color: #050a1c;
  font-weight: 600;
  flex: 1;
}
.mini--go:hover { filter: brightness(1.1); color: #050a1c; }

/* joystick */
.joy {
  position: relative;
  width: 148px; height: 148px;
  margin: 6px auto 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: radial-gradient(circle at 50% 42%, rgba(34, 224, 214, .1), transparent 62%);
  touch-action: none;
  cursor: grab;
}
.joy:active { cursor: grabbing; }
.joy:focus-visible { outline: 2px solid var(--h-cyan); outline-offset: 3px; }
.joy__ring {
  position: absolute; inset: 22%;
  border-radius: 50%;
  border: 1px dashed rgba(150, 180, 255, .18);
}
.joy__n {
  position: absolute; left: 50%; top: 7px;
  transform: translateX(-50%);
  font-family: var(--mono); font-size: 9px; color: var(--dimmer);
}
.joy__knob {
  position: absolute; left: 50%; top: 50%;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--h-cyan), var(--h-blue));
  transform: translate(-50%, -50%);
  box-shadow: 0 10px 26px -8px rgba(34, 224, 214, .9);
  pointer-events: none;
}

/* speed pills */
.speeds { display: flex; align-items: center; gap: 6px; margin-top: 14px; }
.spd {
  flex: 1;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--dim);
  border-radius: 8px;
  padding: 9px 0;
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
  transition: all .25s var(--ease);
}
.spd:hover { color: var(--paper); border-color: rgba(150, 180, 255, .4); }
.spd.is-on {
  background: var(--h-cyan);
  border-color: transparent;
  color: #050a1c;
  font-weight: 600;
}
.spd__u {
  font-family: var(--mono); font-size: 9px;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--dimmer);
}

/* route A to B */
.ab { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 8px; align-items: center; }
.ab__d {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--paper);
}
.ab__d--a { background: var(--h-amber); }
.ab select {
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 8px;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
  min-width: 0;
}
.ab select:focus { outline: none; border-color: var(--h-cyan); }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.stats b {
  display: block;
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 600;
  color: var(--h-cyan);
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}

.deck__run { display: flex; gap: 8px; margin-top: 16px; }

#scrub {
  width: 100%;
  accent-color: var(--h-cyan);
  margin: 4px 0 0;
}

/* footer toggles */
.deck__foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line-2);
}
.toggle {
  display: flex; align-items: center; gap: 10px;
  background: transparent; border: 0; cursor: pointer;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 0;
  margin-right: auto;
}
.toggle__sw {
  width: 34px; height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  position: relative;
  transition: background .3s var(--ease);
  flex: none;
}
.toggle__sw::after {
  content: "";
  position: absolute; top: 3px; left: 3px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--dim);
  transition: all .3s var(--ease);
}
.toggle[aria-pressed="true"] { color: var(--h-cyan); }
.toggle[aria-pressed="true"] .toggle__sw { background: rgba(34, 224, 214, .3); }
.toggle[aria-pressed="true"] .toggle__sw::after { left: 19px; background: var(--h-cyan); }

.proj {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  padding: 3px;
  cursor: pointer;
  gap: 2px;
}
.proj span {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dimmer);
  padding: 6px 12px;
  border-radius: 999px;
  transition: all .3s var(--ease);
}
.proj span.is-on {
  background: var(--paper);
  color: #050a1c;
  font-weight: 600;
}

@media (max-width: 720px) {
  .joy { width: 130px; height: 130px; }
  .deck__modes { grid-template-columns: repeat(2, 1fr); border-radius: 14px; }
  .mode { border-radius: 10px; }
  .deck__foot { flex-wrap: wrap; }
}

/* The location deck is the tallest content on the page. On a short laptop
   viewport it would overflow a strict 100dvh act, so let that one act grow
   and scroll normally rather than clipping the controls. */
@media (max-height: 920px) {
  #place { min-height: auto; padding-top: 112px; padding-bottom: 88px; }
  #place .hud { padding: 16px; }
  #place .hud__row { padding: 7px 0; }
  #place .joy { width: 118px; height: 118px; }
  #place .joy__knob { width: 44px; height: 44px; }
  #place .deck__modes { margin-bottom: 14px; }
  #place .pane { margin-top: 14px; }
}

/* ============================================================
   Act backdrops
   Ambient video behind a section. Sits under the content but over
   the world canvas, and carries its own scrim so copy stays legible
   wherever the footage happens to be bright.
   ============================================================ */

.actbg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  opacity: var(--bg-op, .5);
}
.actbg video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.actbg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 10, 24, .95) 0%, rgba(7, 10, 24, .62) 40%, rgba(7, 10, 24, .25) 78%),
    linear-gradient(180deg, var(--ink-900) 0%, transparent 22%, transparent 74%, var(--ink-900) 100%);
}
/* mirrored for sections whose copy sits on the right */
.actbg--right::after {
  background:
    linear-gradient(270deg, rgba(7, 10, 24, .9) 0%, rgba(7, 10, 24, .6) 42%, rgba(7, 10, 24, .3) 80%),
    linear-gradient(180deg, var(--ink-900) 0%, transparent 22%, transparent 74%, var(--ink-900) 100%);
}

.pan { position: relative; }

@media (prefers-reduced-motion: reduce) {
  .actbg video { display: none; }
}

/* ============================================================
   Sound toggle
   ============================================================ */

.snd {
  display: flex;
  align-items: center;
  gap: 9px;
  background: transparent;
  border: 0;
  padding: 6px 0 6px 22px;
  cursor: pointer;
  color: var(--paper);
  pointer-events: auto;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  opacity: .75;
  transition: opacity .3s var(--ease);
}
.snd:hover { opacity: 1; }

.snd__bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}
.snd__bars i {
  width: 2px;
  height: 3px;
  background: currentColor;
  display: block;
  transition: height .25s var(--ease);
}
/* muted reads as a flat line, not an ambiguous icon */
.snd[aria-pressed="true"] .snd__bars i {
  animation: eq .9s ease-in-out infinite alternate;
}
.snd[aria-pressed="true"] .snd__bars i:nth-child(2) { animation-delay: .12s; }
.snd[aria-pressed="true"] .snd__bars i:nth-child(3) { animation-delay: .26s; }
.snd[aria-pressed="true"] .snd__bars i:nth-child(4) { animation-delay: .38s; }

@keyframes eq {
  from { height: 3px; }
  to   { height: 12px; }
}

@media (max-width: 720px) {
  .snd__t { display: none; }
  .snd { padding-left: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .snd[aria-pressed="true"] .snd__bars i { animation: none; height: 8px; }
}

/* ============================================================
   Loading experience

   Not a spinner. A short scene: an arc fills, a scrambled feed
   reports what is actually happening, then the whole thing leaves
   as six columns wiping upward to reveal the hero behind it.
   ============================================================ */

#loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--ink-900);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#loader.is-done { pointer-events: none; }

/* the curtain */
.ld__cols {
  position: absolute;
  inset: 0;
  display: flex;
  z-index: 2;
}
.ld__cols i {
  flex: 1;
  background: var(--ink-900);
  display: block;
  will-change: transform;
}

.ld__in {
  position: relative;
  z-index: 3;
  display: grid;
  place-items: center;
  width: min(340px, 74vw);
  aspect-ratio: 1;
}

/* progress arc */
.ld__ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ld__ring circle { fill: none; stroke-width: 1.2; }
.ld__trk { stroke: rgba(150, 180, 255, .14); }
.ld__arc {
  stroke: url(#g);
  stroke: var(--h-cyan);
  stroke-linecap: round;
  stroke-dasharray: 339.3;      /* 2 * pi * 54 */
  stroke-dashoffset: 339.3;
  filter: drop-shadow(0 0 6px rgba(34, 224, 214, .7));
}

.ld__mid { text-align: center; }
.ld__n {
  font-family: var(--mono);
  font-size: clamp(3.4rem, 11vw, 5.6rem);
  line-height: .9;
  font-weight: 600;
  letter-spacing: -.05em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(96deg, var(--h-cyan), var(--h-blue) 55%, var(--h-violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ld__feed {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--dim);
  margin-top: 14px;
  min-height: 1.2em;
  white-space: nowrap;
}

.ld__meta {
  position: absolute;
  inset: auto 0 -14px;
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--dimmer);
}

.ld__bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: rgba(150, 180, 255, .1);
  z-index: 3;
}
.ld__bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--h-cyan), var(--h-blue), var(--h-violet), var(--h-magenta));
  box-shadow: 0 0 14px rgba(34, 224, 214, .6);
}

@media (prefers-reduced-motion: reduce) {
  #loader { display: none; }
}

/* ============================================================
   Image motion

   Every image gets three layers of movement: a masked reveal on
   entry, a scrub-linked parallax while it passes, and a depth
   tilt under the cursor. Transform and opacity only.
   ============================================================ */

/* the frame clips, the picture moves inside it */
.use__bg,
.plat__media {
  overflow: hidden;
  clip-path: inset(0 0 0 0);
}

/* entry wipe: the frame opens from the bottom */
.img-rv { clip-path: inset(0 0 100% 0); }
.img-rv.in {
  clip-path: inset(0 0 0% 0);
  transition: clip-path 1.15s cubic-bezier(.16, 1, .3, 1);
}

/* the picture itself is oversized so parallax never exposes an edge */
.use__bg img,
.plat__media img {
  width: 100%;
  height: 112%;
  object-fit: cover;
  will-change: transform;
}

/* Depth tilt.
   perspective applies to an element's CHILDREN, so it goes on the
   container. On the card itself it does nothing for the card. */
.uses,
.plat { perspective: 1100px; }
.use,
.plat__media { transform-style: preserve-3d; }
.use__bg,
.plat__media img {
  transition: transform .5s cubic-bezier(.16, 1, .3, 1);
}

/* a slow continuous drift so a static frame is never fully still */
@keyframes driftimg {
  0%   { transform: scale(1.06) translate3d(0, 0, 0); }
  50%  { transform: scale(1.10) translate3d(-1.2%, -0.8%, 0); }
  100% { transform: scale(1.06) translate3d(0, 0, 0); }
}
.use__bg img { animation: driftimg 18s ease-in-out infinite; }
.use:nth-child(2n) .use__bg img { animation-duration: 23s; animation-direction: reverse; }
.use:nth-child(3n) .use__bg img { animation-duration: 27s; }

/* a sheen that sweeps across on hover */
.use__bg::before,
.plat__media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .13) 50%, transparent 62%);
  transform: translateX(-120%);
  transition: transform .9s cubic-bezier(.16, 1, .3, 1);
}
.use:hover .use__bg::before,
.plat__media:hover::before { transform: translateX(120%); }

.plat__media { position: relative; }

@media (prefers-reduced-motion: reduce) {
  .use__bg img { animation: none; }
  .img-rv { clip-path: none; }
}

/* ============================================================
   Mobile ergonomics (kept last so it overrides the component
   rules above): comfortable touch targets, no iOS zoom-on-focus,
   HUD values that never crowd a narrow screen.
   ============================================================ */
@media (max-width: 720px), (pointer: coarse) {
  /* iOS zooms the whole page when a focused field is under 16px. */
  input, select, textarea { font-size: 16px; }
  .coord input { font-size: 16px; padding: 12px; }
  .notify__row input { font-size: 16px; }
  .ab select, #routeA, #routeB { font-size: 15px; min-height: 44px; }

  /* ~44px tap targets */
  .mode { min-height: 44px; }
  .city { min-height: 46px; font-size: 13px; }
  .mini { min-height: 44px; padding: 0 16px; }
  .spd { min-width: 44px; min-height: 40px; }
  .proj { min-height: 40px; }
  .btn { padding: 15px 26px; }

  /* the Keep-location toggle was an 18px hit target */
  .deck__foot { gap: 14px; }
  .toggle { min-height: 44px; padding: 6px 4px; }

  /* larger, easier sound control in the header */
  .snd { padding: 10px 14px; }

  /* wide mono HUD values: keep them clear of the edge, let long
     status text wrap rather than clip */
  .hud__v { font-size: 15px; text-align: right; overflow-wrap: anywhere; }
  .hud__row { gap: 12px; align-items: baseline; }
}

/* Very narrow phones: stack the hero actions full-width */
@media (max-width: 380px) {
  .hero .actions { flex-direction: column; align-items: stretch; }
  .hero .actions .btn { width: 100%; text-align: center; }
  .hud__v { font-size: 14px; }
}
