/* ══════════════════════════════════════════════════════════════
   Shanghai Sightlines
   Palette: Pudong at night — ink base, neon magenta/cyan, warm gold.
   ══════════════════════════════════════════════════════════════ */

:root {
  --bg: #06080f;
  --ink: #eef2ff;
  --muted: rgba(238, 242, 255, 0.62);
  --faint: rgba(238, 242, 255, 0.38);
  --glass: rgba(13, 17, 30, 0.62);
  --glass-hi: rgba(30, 37, 58, 0.72);
  /* Opaque enough to stand in for a blurred backdrop — see .marker. */
  --marker-bg: rgba(11, 15, 26, 0.84);
  --stroke: rgba(255, 255, 255, 0.13);
  --stroke-hi: rgba(255, 255, 255, 0.26);
  --neon-a: #ff5fa2;
  --neon-b: #49d8ff;
  --gold: #ffc46b;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --blur: saturate(150%) blur(18px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}

button, input, a { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }
h1, h2, h3, p, dl, dd { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
svg { display: block; }
[hidden] { display: none !important; }

/* ── camera stage ──────────────────────────────────────────── */

.stage { position: fixed; inset: 0; background: #000; }

.stage__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: translateZ(0);
}

.stage__vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 50%, transparent 42%, rgba(0, 0, 0, 0.42) 100%),
    linear-gradient(to bottom, rgba(3, 5, 12, 0.72) 0%, transparent 22%, transparent 62%, rgba(3, 5, 12, 0.82) 100%);
}

.horizon {
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(to right, transparent, rgba(73, 216, 255, 0.45), transparent);
  transition: opacity 0.4s;
}
.horizon.is-on { opacity: 1; }

/* centre reticle */
.reticle {
  position: absolute;
  left: 50%; top: 50%;
  width: 46px; height: 46px;
  margin: -23px 0 0 -23px;
  pointer-events: none;
  opacity: 0.5;
}
.reticle span {
  position: absolute;
  width: 11px; height: 11px;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
}
.reticle span:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.reticle span:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.reticle span:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.reticle span:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; }

/* ── AR markers ────────────────────────────────────────────── */

.marker-layer { position: absolute; inset: 0; pointer-events: none; }

.marker {
  position: absolute;
  left: 0; top: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  border-radius: 999px;
  /* Deliberately NOT backdrop-filter. One blurred backdrop per marker means a
     separate readback of the video behind each one, every frame — it is by far
     the most expensive thing this screen can do. A more opaque fill reads
     almost identically over a camera feed. Only the focused marker, of which
     there is at most one, gets the real glass treatment. */
  background: var(--marker-bg);
  border: 1px solid var(--stroke);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  pointer-events: auto;
  transform-origin: 0 50%;
  will-change: transform;
  contain: layout style paint;      /* keep invalidation inside the marker */
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.marker::before {
  /* tether down toward the ground */
  content: "";
  position: absolute;
  top: 100%;
  left: 21px;
  width: 1px;
  height: var(--tether, 0px);
  background: linear-gradient(to bottom, var(--accent, #fff), transparent);
  opacity: 0.5;
}

.marker__pin {
  flex: none;
  width: 30px; height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 15px;
  line-height: 1;
  background: color-mix(in srgb, var(--accent) 26%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  /* Glow only on the focused pin — 30 blurred shadows cost real fill rate. */
}

.marker__label { display: flex; flex-direction: column; min-width: 0; }
.marker__name {
  font-size: 13.5px;
  font-weight: 620;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.marker__meta {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.marker.is-focused {
  background: var(--glass-hi);
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent),
              0 10px 34px rgba(0, 0, 0, 0.55),
              0 0 26px color-mix(in srgb, var(--accent) 25%, transparent);
  backdrop-filter: var(--blur);     /* affordable: at most one at a time */
  -webkit-backdrop-filter: var(--blur);
  z-index: 5;
}
.marker.is-focused .marker__name { font-size: 14.5px; }
.marker.is-focused .marker__pin {
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 45%, transparent);
}

.marker.is-far { opacity: 0.72; }

/* ── HUD frame ─────────────────────────────────────────────── */

.hud {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  padding: calc(var(--safe-t) + 10px) 12px calc(var(--safe-b) + 12px);
}
.hud > * { pointer-events: auto; }

.hud__top { display: flex; gap: 10px; align-items: flex-start; }
.hud__topRight { display: flex; gap: 8px; flex: none; }

.icon-btn {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 13px;
  background: var(--glass);
  border: 1px solid var(--stroke);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  transition: transform 0.15s var(--ease), background 0.2s;
}
.icon-btn:active { transform: scale(0.92); background: var(--glass-hi); }
.icon-btn svg {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}

/* compass ribbon */
.compass {
  position: relative;
  flex: 1;
  height: 42px;
  border-radius: 13px;
  overflow: hidden;
  background: var(--glass);
  border: 1px solid var(--stroke);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent);
}
.compass__strip { position: absolute; inset: 0; contain: layout style paint; }
/* Positioned by transform rather than `left`: writing `left` on 32 elements
   every frame forces a layout pass; transforms stay on the compositor. */
.compass__tick {
  position: absolute;
  top: 6px; left: 0;
  width: 1px; height: 6px;
  background: rgba(255, 255, 255, 0.3);
  transform: translate3d(-50%, 0, 0);
  will-change: transform;
}
.compass__tick--major { height: 9px; background: rgba(255, 255, 255, 0.55); }
.compass__cardinal {
  position: absolute;
  top: 16px; left: 0;
  transform: translate3d(-50%, 0, 0);
  will-change: transform;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  color: var(--muted);
}
.compass__cardinal[data-n="N"] { color: var(--neon-a); }
.compass__needle {
  position: absolute;
  left: 50%; top: 0; bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: linear-gradient(to bottom, var(--neon-b), transparent);
}
.compass__readout {
  position: absolute;
  right: 9px; top: 50%;
  transform: translateY(-50%);
  display: flex; align-items: baseline; gap: 4px;
  font-variant-numeric: tabular-nums;
}
.compass__readout b { font-size: 15px; font-weight: 700; }
.compass__readout span { font-size: 10.5px; color: var(--muted); letter-spacing: 0.06em; }

/* status pills */
.hud__status { display: flex; gap: 6px; margin-top: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  font-size: 11px; font-weight: 560;
  letter-spacing: 0.01em;
  color: var(--muted);
  background: rgba(6, 9, 18, 0.5);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.pill .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--faint);
  box-shadow: 0 0 8px currentColor;
}
.pill.is-good { color: #7ff2c3; }
.pill.is-good .dot { background: #4fe0a6; }
.pill.is-warn { color: var(--gold); }
.pill.is-warn .dot { background: var(--gold); animation: blink 1.6s infinite; }
.pill.is-bad { color: #ff8fa3; }
.pill.is-bad .dot { background: #ff5f7a; }

@keyframes blink { 50% { opacity: 0.28; } }

/* focus card */
.focus {
  margin-top: auto;
  margin-bottom: 10px;
  border-radius: var(--r-md);
  background: var(--glass);
  border: 1px solid var(--stroke);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  animation: rise 0.35s var(--ease);
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.focus__bar { height: 2px; background: var(--accent, var(--neon-b)); }
.focus__main { display: flex; align-items: center; gap: 11px; padding: 11px 12px 9px; }
.focus__icon {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  font-size: 19px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent, #fff) 20%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent, #fff) 45%, transparent);
}
.focus__text { min-width: 0; flex: 1; }
.focus__text b { display: block; font-size: 15.5px; font-weight: 650; letter-spacing: -0.012em; }
.focus__zh { display: block; font-size: 11.5px; color: var(--muted); }
.focus__dist { text-align: right; flex: none; font-variant-numeric: tabular-nums; }
.focus__dist b { display: block; font-size: 16px; font-weight: 700; }
.focus__dist span { font-size: 10.5px; color: var(--muted); letter-spacing: 0.05em; }
.focus__more {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 3px;
  padding: 9px;
  font-size: 12.5px; font-weight: 600;
  color: var(--neon-b);
  border-top: 1px solid var(--stroke);
}
.focus__more svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.focus__more:active { background: rgba(255, 255, 255, 0.06); }

/* bottom bar */
.hud__bottom { display: flex; align-items: flex-end; gap: 10px; }
.radar {
  width: 96px; height: 96px;
  flex: none;
  border-radius: 50%;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 2px 4px;
  scrollbar-width: none;
  mask-image: linear-gradient(to right, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(to right, #000 88%, transparent);
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px; font-weight: 580;
  white-space: nowrap;
  color: var(--muted);
  background: rgba(6, 9, 18, 0.55);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.14s var(--ease), color 0.2s, border-color 0.2s;
}
.chip:active { transform: scale(0.94); }
.chip.is-on {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--accent, #fff) 60%, transparent);
  background: color-mix(in srgb, var(--accent, #fff) 18%, rgba(6, 9, 18, 0.6));
}

/* ── intro ─────────────────────────────────────────────────── */

.intro {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 22px calc(var(--safe-b) + 26px);
  background:
    radial-gradient(90% 60% at 50% 8%, #17224a 0%, transparent 62%),
    linear-gradient(#080b18, #06080f 55%);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.intro.is-leaving { opacity: 0; transform: scale(1.04); pointer-events: none; }

.intro__glow {
  position: absolute;
  left: 50%; top: 6%;
  width: 460px; height: 460px;
  margin-left: -230px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 95, 162, 0.16), transparent 62%);
  filter: blur(20px);
  animation: drift 12s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate(24px, -18px) scale(1.12); } }

/* In the flex flow, not absolutely positioned: it claims whatever vertical
   space the copy below does not want, and shrinks on short screens instead of
   sliding underneath the headline. `xMidYMax meet` keeps it bottom-aligned as
   it scales. */
.skyline {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;                   /* must be able to shrink, or it overflows */
  align-self: stretch;
  width: calc(100% + 44px);
  margin: 6vh -22px 2px;           /* negative margins restore the full bleed */
  max-height: 42vh;
  opacity: 0.95;
  filter: drop-shadow(0 0 18px rgba(73, 216, 255, 0.28));
  /* Soften the ground line so it doesn't read as a rule across the page. */
  mask-image: linear-gradient(to bottom, #000 72%, transparent 99%);
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 99%);
}
.skyline__g path, .skyline__g circle {
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: draw 2.4s var(--ease) forwards;
}
.skyline__g > *:nth-child(2) { animation-delay: 0.1s; }
.skyline__g > *:nth-child(3) { animation-delay: 0.16s; }
.skyline__g > *:nth-child(4) { animation-delay: 0.22s; }
.skyline__g > *:nth-child(5) { animation-delay: 0.28s; }
.skyline__g > *:nth-child(6) { animation-delay: 0.34s; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.intro__body {
  position: relative;
  z-index: 1;                      /* lift the whole block above the skyline */
  animation: rise 0.7s 0.3s var(--ease) backwards;
}

/* Belt and braces: the flow layout already keeps the skyline clear of the copy,
   but the drop-shadow glow bleeds a little past the artwork. Fixed px stops, so
   the ramp is the same regardless of how tall the text block ends up. */
.intro__body::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -22px; right: -22px;       /* bleed through the intro's side padding */
  top: -96px;
  bottom: -60px;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(6, 8, 15, 0) 0px,
    rgba(6, 8, 15, 0.82) 72px,
    rgba(6, 8, 15, 0.96) 96px,
    #06080f 130px
  );
}

.eyebrow {
  font-size: 11.5px;
  font-weight: 640;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--neon-b);
  margin-bottom: 6px;
}
.intro__title {
  font-size: clamp(38px, 12vw, 54px);
  font-weight: 760;
  letter-spacing: -0.035em;
  line-height: 1;
  background: linear-gradient(100deg, #fff 10%, var(--neon-b) 55%, var(--neon-a) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.intro__lede {
  margin: 12px 0 20px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 34ch;
}

.perms { display: grid; gap: 7px; margin-bottom: 18px; }
.perm {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 13px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--stroke);
  transition: border-color 0.3s, background 0.3s;
}
.perm__icon { font-size: 17px; width: 22px; text-align: center; }
.perm__text { flex: 1; display: flex; flex-direction: column; }
.perm__text b { font-size: 13.5px; font-weight: 600; }
.perm__text small { font-size: 11.5px; color: var(--faint); }
.perm__state {
  width: 18px; height: 18px;
  flex: none;
  border-radius: 50%;
  border: 1.5px solid var(--stroke-hi);
  position: relative;
}
.perm__state[data-state="ok"] { border-color: #4fe0a6; background: #4fe0a6; }
.perm__state[data-state="ok"]::after {
  content: "";
  position: absolute;
  left: 5px; top: 2px;
  width: 4px; height: 8px;
  border: solid #06210f;
  border-width: 0 2px 2px 0;
  transform: rotate(43deg);
}
.perm__state[data-state="wait"] {
  border-color: var(--neon-b);
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
.perm__state[data-state="fail"] { border-color: #ff5f7a; background: rgba(255, 95, 122, 0.2); }
.perm__state[data-state="fail"]::after {
  content: "!";
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 800; color: #ff8fa3;
}
@keyframes spin { to { transform: rotate(360deg); } }
.perm.is-ok { border-color: rgba(79, 224, 166, 0.32); background: rgba(79, 224, 166, 0.07); }
.perm.is-fail { border-color: rgba(255, 95, 122, 0.32); background: rgba(255, 95, 122, 0.07); }

.intro__note {
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--gold);
  min-height: 1em;
}

/* ── buttons ───────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 12px 18px;
  border-radius: 14px;
  font-size: 14.5px; font-weight: 640;
  letter-spacing: -0.005em;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.15s var(--ease), filter 0.2s, opacity 0.2s;
}
.btn:active { transform: scale(0.975); }
.btn--lg { width: 100%; padding: 15px; font-size: 15.5px; border-radius: 16px; }
.btn--primary {
  color: #07101c;
  background: linear-gradient(100deg, var(--neon-b), #9ae8ff 40%, var(--neon-a));
  box-shadow: 0 8px 28px rgba(73, 216, 255, 0.24);
  border: 0px;
}
.btn--primary:active { filter: brightness(1.08); }
.btn--ghost {
  width: 100%;
  margin-top: 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--stroke);
}
.btn[disabled] { opacity: 0.45; pointer-events: none; }

/* ── sheets ────────────────────────────────────────────────── */

.sheet {
  position: fixed;
  z-index: 30;
  left: 0; right: 0; bottom: 0;
  background: rgba(9, 12, 22, 0.9);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-top: 1px solid var(--stroke);
  display: flex;
  flex-direction: column;
}
/* The entry animation is a class, never a bare rule on .sheet — otherwise any
   later clearing of an inline `animation` would silently replay it. */
.sheet.is-entering { animation: sheetIn 0.34s var(--ease); }
@keyframes sheetIn { from { transform: translateY(100%); } }
.sheet.is-leaving { animation: sheetOut 0.26s var(--ease) forwards; }
@keyframes sheetOut { to { transform: translateY(100%); } }

.sheet--full { top: 0; border-radius: 0; }
.sheet--card { max-height: 82vh; border-radius: var(--r-lg) var(--r-lg) 0 0; }

/* Drag surfaces: the browser must not claim these gestures for scrolling. */
.sheet__grab,
.sheet__head { touch-action: none; }

.sheet__grab {
  display: block;
  width: 100%;
  padding: 12px 0 6px;
  flex: none;
  cursor: grab;
}
.sheet__grab:active { cursor: grabbing; }
.sheet__grab::before {
  content: "";
  display: block;
  width: 40px; height: 4px;
  margin: 0 auto;
  border-radius: 2px;
  background: var(--stroke-hi);
  transition: width 0.2s var(--ease), background 0.2s;
}
.sheet__grab:active::before { width: 52px; background: var(--ink); }

/* Floats over the scroll area, so it stays put as the content moves. */
.sheet__close {
  position: absolute;
  top: 8px;
  right: 12px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  touch-action: auto;
}
.sheet__close svg { width: 16px; height: 16px; stroke-width: 2; }

.sheet__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: calc(var(--safe-t) + 16px) 18px 12px;
  border-bottom: 1px solid var(--stroke);
  flex: none;
  cursor: grab;
}
.sheet__head:active { cursor: grabbing; }
/* …but the close button inside it is still a button. */
.sheet__head .icon-btn { cursor: pointer; touch-action: auto; }
.sheet__head h2 { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; }
.sheet__sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.sheet__title { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; padding: 0 18px 4px; }

.sheet__scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 18px calc(var(--safe-b) + 22px);
  overscroll-behavior: contain;
}

/* list */
.sight-list { display: grid; gap: 7px; }
.sight {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke);
  text-align: left;
  transition: transform 0.14s var(--ease), background 0.2s;
}
.sight:active { transform: scale(0.985); background: rgba(255, 255, 255, 0.08); }
.sight__icon {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  font-size: 18px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}
.sight__text { flex: 1; min-width: 0; }
.sight__text b { display: block; font-size: 14.5px; font-weight: 620; letter-spacing: -0.01em; }
.sight__text span { font-size: 11.5px; color: var(--muted); }
.sight__right { text-align: right; flex: none; font-variant-numeric: tabular-nums; }
.sight__right b { display: block; font-size: 14px; font-weight: 680; }
.sight__right span { font-size: 10.5px; color: var(--faint); letter-spacing: 0.05em; }

/* detail */
/* Right padding keeps the title clear of the floating close button. */
.detail__head { display: flex; align-items: center; gap: 13px; padding: 0 40px 14px 0; }
.detail__icon {
  width: 52px; height: 52px; flex: none;
  display: grid; place-items: center;
  font-size: 26px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 48%, transparent);
  box-shadow: 0 0 26px color-mix(in srgb, var(--accent) 26%, transparent);
}
.detail__head h2 { font-size: 21px; font-weight: 720; letter-spacing: -0.025em; line-height: 1.15; }
.detail__zh { font-size: 13px; color: var(--muted); margin-top: 2px; }

.detail__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--stroke);
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 14px;
}
.detail__stats > div {
  background: rgba(255, 255, 255, 0.035);
  padding: 11px 8px;
  text-align: center;
}
.detail__stats b { display: block; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.detail__stats small { font-size: 10.5px; color: var(--faint); letter-spacing: 0.05em; }

.detail__blurb { font-size: 14.5px; line-height: 1.62; color: rgba(238, 242, 255, 0.86); }
.detail__tip {
  display: flex; flex-direction: column; gap: 3px;
  margin: 14px 0 18px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: rgba(255, 196, 107, 0.08);
  border: 1px solid rgba(255, 196, 107, 0.24);
  font-size: 13.5px;
  line-height: 1.5;
}
.detail__tip b {
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold);
}
.detail__h3 {
  margin: 20px 0 9px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

.detail__highlights { display: grid; gap: 8px; }
.detail__highlights li {
  position: relative;
  padding-left: 20px;
  font-size: 13.5px;
  line-height: 1.5;
  color: rgba(238, 242, 255, 0.82);
}
.detail__highlights li::before {
  content: "";
  position: absolute;
  left: 4px; top: 8px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent, var(--neon-b));
  box-shadow: 0 0 8px var(--accent, var(--neon-b));
}

.detail__facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1px;
  background: var(--stroke);
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  overflow: hidden;
  font-size: 13px;
}
.detail__facts dt,
.detail__facts dd {
  background: rgba(255, 255, 255, 0.035);
  padding: 9px 12px;
}
.detail__facts dt {
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.detail__facts dd { text-align: right; line-height: 1.4; }

.detail__note {
  margin: 0 0 18px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--faint);
}

.detail__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.detail__actions .btn { width: 100%; margin: 0; }

/* live-rotating heading arrow inside "Point me at it" */
.btn__arrow {
  width: 17px; height: 17px;
  flex: none;
  fill: currentColor;
  transform-origin: 50% 55%;
  transition: transform 0.12s linear;
}

/* settings fields */
.field { display: block; margin-bottom: 20px; padding: 0 18px; }
.field__label {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 13px; font-weight: 600;
  margin-bottom: 9px;
}
.field__label b { font-variant-numeric: tabular-nums; color: var(--neon-b); font-size: 13.5px; }
.field small { display: block; margin-top: 7px; font-size: 11.5px; line-height: 1.45; color: var(--faint); }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 26px;
  background: none;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--neon-b), var(--neon-a));
  opacity: 0.75;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  margin-top: -9px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #0b1020;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--neon-b); }
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid #0b1020; }

.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--stroke);
}
.seg button {
  padding: 9px;
  border-radius: 9px;
  font-size: 13px; font-weight: 580;
  color: var(--muted);
  transition: background 0.2s, color 0.2s;
}
.seg button.is-on { background: rgba(255, 255, 255, 0.12); color: var(--ink); }

.diag {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 14px;
  font-size: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--stroke);
}
.diag dt { color: var(--faint); }
.diag dd { text-align: right; font-variant-numeric: tabular-nums; word-break: break-word; }

/* ── off-screen guide arrow ────────────────────────────────── */

.guide {
  position: fixed;
  z-index: 20;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 46vw;
  padding: 9px 12px 9px 9px;
  border-radius: 999px;
  background: var(--glass-hi);
  border: 1px solid var(--stroke-hi);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  animation: rise 0.3s var(--ease);
}
.guide--left { right: auto; left: 10px; flex-direction: row-reverse; padding: 9px 9px 9px 12px; }
.guide--left .guide__arrow { transform: scaleX(-1); }
.guide__arrow {
  width: 22px; height: 22px;
  flex: none;
  fill: none;
  stroke: var(--neon-b);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: nudge 1.1s ease-in-out infinite;
}
@keyframes nudge { 50% { opacity: 0.4; } }
.guide__body { display: flex; flex-direction: column; min-width: 0; }
.guide__deg { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.guide__name {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* toast */
.toast {
  position: fixed;
  left: 50%; bottom: calc(var(--safe-b) + 118px);
  transform: translateX(-50%);
  z-index: 50;
  max-width: min(92vw, 380px);
  padding: 11px 16px;
  border-radius: 999px;
  font-size: 13px;
  text-align: center;
  background: rgba(9, 12, 22, 0.92);
  border: 1px solid var(--stroke);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.55);
  animation: rise 0.3s var(--ease);
}

/* Short screens: tighten the copy so the skyline keeps a usable amount of room
   rather than being squeezed down to a strip. */
@media (max-height: 730px) {
  .skyline { margin-top: 3vh; }
  .intro__title { font-size: clamp(32px, 10.5vw, 46px); }
  .intro__lede { margin: 9px 0 14px; font-size: 13.5px; }
  .perms { gap: 5px; margin-bottom: 14px; }
  .perm { padding: 8px 12px; }
  .perm__text small { font-size: 11px; }
  .btn--lg { padding: 13px; }
  .btn--ghost { padding: 10px 18px; }
}

/* Very short screens: the lede is the most expendable block on the page. */
@media (max-height: 620px) {
  .intro__lede { display: none; }
  .skyline { margin-top: 2vh; }
  .perm__text small { display: none; }
  .perm { padding: 7px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .skyline__g path, .skyline__g circle { stroke-dashoffset: 0; }
}
