/* Kilat site. Values follow SGMapLens 04-build/tokens.md (light and dark). */
:root {
  color-scheme: light dark;
  --bg: #FFFFFF;
  --ink: #2A2A2A;
  --label: #000000;
  --secondary: rgba(0, 0, 0, 0.5);
  --tertiary: rgba(0, 0, 0, 0.4);
  --divider: rgba(0, 0, 0, 0.1);
  --track: rgba(0, 0, 0, 0.1);
  --ruler-bg: rgba(0, 0, 0, 0.95);
  --ruler-ink: #FFFFFF;
  --ruler-border: rgba(255, 255, 255, 0.3);
  --ruler-divider: rgba(255, 255, 255, 0.2);
  --ruler-sub: rgba(255, 255, 255, 0.41);
  --dock-bg: #000000;
  --dock-pill: rgba(255, 255, 255, 0.1);
  --chip-on: #FFFFFF;
  --chip-on-ink: #000000;
  --chip-off-ink: rgba(255, 255, 255, 0.85);
  --when-bg: #FFFFFF;
  --when-ink: #000000;
  --rail-idle: rgba(0, 0, 0, 0.2);
  --rail-on: #000000;
  --rail-on-ink: #FFFFFF;
  --accent-now: #FFD60A;
  --link: #0A66C2;
  --skeleton: rgba(0, 0, 0, 0.08);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --margin: max(20px, calc((100vw - 1120px) / 2));
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --ink: #FFFFFF;
    --label: #FFFFFF;
    --secondary: rgba(255, 255, 255, 0.5);
    --tertiary: rgba(255, 255, 255, 0.4);
    --divider: rgba(255, 255, 255, 0.1);
    --track: rgba(255, 255, 255, 0.3);
    --ruler-bg: rgba(255, 255, 255, 0.95);
    --ruler-ink: #000000;
    --ruler-border: rgba(0, 0, 0, 0.3);
    --ruler-divider: rgba(0, 0, 0, 0.2);
    --ruler-sub: rgba(0, 0, 0, 0.41);
    --dock-bg: #FFFFFF;
    --dock-pill: rgba(0, 0, 0, 0.1);
    --chip-on: #000000;
    --chip-on-ink: #FFFFFF;
    --chip-off-ink: rgba(0, 0, 0, 0.85);
    --when-bg: #000000;
    --when-ink: #FFFFFF;
    --rail-idle: rgba(0, 0, 0, 0.2);
    --rail-on: #FFFFFF;
    --rail-on-ink: #000000;
    --link: #5AB0FF;
    --skeleton: rgba(255, 255, 255, 0.12);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--link); }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Stage: the live map, laid out like the app's rest screen ---------- */
.stage { position: relative; height: 100vh; height: 100svh; min-height: 640px; max-height: 1100px; overflow: hidden; background: var(--bg); }
.stage .map { position: absolute; inset: 0 0 138px 0; }
.sheet { position: absolute; left: 0; right: 0; bottom: 138px; height: 46%; pointer-events: none;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 0%, transparent), color-mix(in srgb, var(--bg) 70%, transparent)); }

.topbar { position: absolute; top: 0; left: 0; right: 0; height: 52px; padding: 0 var(--margin); display: flex; align-items: center; justify-content: space-between; z-index: 3; }
.brand { display: flex; align-items: center; gap: 6px; color: var(--label); text-decoration: none; font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.brand svg { width: 20px; height: 20px; fill: currentColor; stroke: none; }
.store-pill { font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 999px; background: var(--label); color: var(--bg); text-decoration: none; }
.store-pill.soon { background: var(--bg); color: var(--secondary); border: 1px solid var(--divider); font-weight: 500; }

.titles { position: absolute; top: 58px; left: var(--margin); z-index: 2; pointer-events: none; }
.lens-title { margin: 0; font-size: 48px; font-weight: 400; line-height: 1; letter-spacing: -0.042em; color: var(--ink); }
.where { margin: 4px 0 0; font-size: 22px; font-weight: 500; line-height: 1.1; letter-spacing: -0.01em; color: var(--ink); }
.when-chip { display: inline-block; margin: 10px 0 0; padding: 5px 12px; border-radius: 999px; background: var(--when-bg); color: var(--when-ink); font-size: 14px; font-weight: 500; line-height: 1.2; font-variant-numeric: tabular-nums; box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12); }

.rail { position: absolute; top: 140px; right: var(--margin); display: flex; flex-direction: column; gap: 10px; z-index: 2; }
.rail-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; padding: 0; display: grid; place-items: center; cursor: pointer;
  background: var(--rail-idle); color: #FFFFFF; backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); transition: transform 0.2s cubic-bezier(0.3, 1.6, 0.5, 1); }
.rail-btn:active { transform: scale(0.9); }
.rail-btn.active { background: var(--rail-on); color: var(--rail-on-ink); }
.rail-btn svg { width: 20px; height: 20px; }
.rail-btn span { font: 700 10px/1 var(--sans); }
.rail-btn[hidden] { display: none; }

.hero { position: absolute; left: var(--margin); right: var(--margin); bottom: 178px; z-index: 2; pointer-events: none; }
.hero-row { display: flex; align-items: flex-end; gap: 10px; }
.hero-value { font-size: 84px; font-weight: 400; line-height: 0.86; letter-spacing: -0.036em; font-variant-numeric: tabular-nums; color: var(--ink); }
.hero-value:empty { display: none; }
.hero-icon svg { width: 84px; height: 84px; stroke-width: 1.4; color: var(--ink); display: block; }
.hero-suffix { display: flex; flex-direction: column; padding-bottom: 6px; }
.suffix-label { font-size: 22px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.1; color: var(--ink); }
.suffix-unit { font: 500 12px/1.2 var(--mono); color: var(--secondary); }
.hero-word { margin: 8px 0 0; font-size: 36px; font-weight: 400; line-height: 1.1; letter-spacing: -0.028em; color: var(--ink); }
.hero-word:empty { display: none; }
.hero [hidden] { display: none; }

.gauge { position: relative; display: flex; gap: 4px; margin-top: 22px; max-width: 520px; }
.gauge .seg { height: 6px; border-radius: 3px; flex: 1 1 30px; background: var(--track); position: relative; transition: flex-grow 0.35s ease; }
.gauge .seg.on { flex: 8 1 160px; height: 16px; border-radius: 8px; margin-top: -5px; }
.gauge .seg.on span { position: absolute; inset: 0; display: grid; place-items: center; font: 700 12px/1 var(--mono); letter-spacing: 0.02em; text-transform: uppercase; color: rgba(0, 0, 0, 0.75); }
.gauge .marker { position: absolute; top: -18px; width: 0; height: 0; border-left: 7.5px solid transparent; border-right: 7.5px solid transparent; border-top: 7px solid var(--ink); transform: translateX(-7.5px); transition: left 0.35s ease; }

.skeleton { display: flex; flex-direction: column; gap: 12px; }
.skeleton span { display: block; height: 64px; width: 180px; border-radius: 12px; background: var(--skeleton); animation: pulse 1.4s ease-in-out infinite; }
.skeleton span + span { height: 32px; width: 260px; }
.skeleton[hidden] { display: none; }
@keyframes pulse { 50% { opacity: 0.45; } }

/* Ruler: fixed centre needle, track scrolls beneath it */
.ruler { position: absolute; left: 0; right: 0; bottom: 84px; height: 54px; background: var(--ruler-bg); border-top: 1px solid var(--ruler-border);
  box-shadow: 0 -10px 50px rgba(0, 0, 0, 0.25); overflow: hidden; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; z-index: 3; outline: none; }
.ruler:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-now); }
.ruler.dragging { cursor: grabbing; }
.ruler-track { position: absolute; top: 0; bottom: 0; left: 50%; will-change: transform; }
.ruler-track.settle { transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
.tick { position: absolute; top: 0; width: 1px; background: var(--ruler-ink); height: 5px; transform: translateX(-0.5px); }
.tick.major { height: 12px; }
.tlabel { position: absolute; top: 24px; transform: translateX(-50%); font: 700 10px/1 var(--mono); color: var(--ruler-ink); opacity: 0.55; white-space: nowrap; letter-spacing: 0.02em; }
.tlabel.now { opacity: 1; }
.group { position: absolute; top: 0; bottom: 0; width: 90px; border-left: 0.5px solid var(--ruler-divider); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.group b { font: 700 10px/12px var(--mono); color: var(--ruler-ink); letter-spacing: 0.02em; text-transform: uppercase; white-space: nowrap; }
.group small { font: 500 8px/12px var(--mono); color: var(--ruler-sub); letter-spacing: 0.04em; text-transform: uppercase; }
.needle { position: absolute; top: 0; left: 50%; width: 2px; height: 53px; margin-left: -1px; background: var(--accent-now); pointer-events: none; }
.needle::before { content: ""; position: absolute; top: 0; left: -3.5px; border-left: 4.5px solid transparent; border-right: 4.5px solid transparent; border-top: 5px solid var(--accent-now); }
.ruler.empty .needle { display: none; }
.ruler .loading-bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 30%; background: var(--ruler-sub); animation: grow 1.6s ease-in-out infinite; }
@keyframes grow { from { transform: translateX(-100%); } to { transform: translateX(340%); } }

.dock { position: absolute; left: 0; right: 0; bottom: 0; height: 84px; background: var(--dock-bg); display: flex; align-items: center; justify-content: center; z-index: 3; }
.dock-pill { display: flex; gap: 10px; padding: 5px 10px; border-radius: 22px; background: var(--dock-pill); }
.chip { width: 40px; height: 34px; border-radius: 17px; border: 0; padding: 0; display: grid; place-items: center; background: none; color: var(--chip-off-ink); cursor: pointer; }
.chip svg { width: 22px; height: 22px; }
.chip .fill { fill: currentColor; stroke: none; }
.chip[aria-pressed="true"] { background: var(--chip-on); color: var(--chip-on-ink); }

/* Map pins (AQ): 50 circle, value 18 bold white */
.pin { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; color: #FFFFFF; font: 700 18px/1 var(--sans); letter-spacing: -0.01em; font-variant-numeric: tabular-nums;
  border: 1px solid rgba(255, 255, 255, 0.2); box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25); transition: background-color 0.3s ease; }
.mapboxgl-ctrl-top-right, .maplibregl-ctrl-top-right { top: 52px !important; }
.mapboxgl-ctrl-attrib, .maplibregl-ctrl-attrib { font-size: 11px; }

/* ---------- Content below: app type roles ---------- */
.content { padding: 56px var(--margin) 0; }
.intro { max-width: 640px; }
.icon { width: 76px; height: 76px; border-radius: 17px; border: 1px solid var(--divider); display: block; margin-bottom: 20px; }
.big-title { margin: 0; font-size: 48px; font-weight: 400; line-height: 1; letter-spacing: -0.042em; }
.subtitle { margin: 6px 0 16px; font-size: 22px; font-weight: 500; letter-spacing: -0.01em; color: var(--secondary); }
.lead { margin: 0; color: var(--ink); }
.shots { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 40px var(--margin) 24px; margin: 0 calc(-1 * var(--margin)); -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.shots::-webkit-scrollbar { display: none; }
.shots img { flex: 0 0 auto; width: 220px; height: auto; aspect-ratio: 552 / 1200; border-radius: 28px; border: 1px solid var(--divider); scroll-snap-align: start; }
.modules { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px 40px; padding: 24px 0 8px; }
.module p { margin: 10px 0 0; color: var(--secondary); font-size: 16px; }
.label { display: flex; align-items: center; gap: 8px; margin: 0; padding-bottom: 10px; border-bottom: 1px solid var(--divider); font: 700 12px/1 var(--mono); letter-spacing: 0.02em; text-transform: uppercase; color: var(--label); }
.label svg { width: 16px; height: 16px; flex: 0 0 auto; }
.sources { border-top: 1px solid var(--divider); margin: 48px 0 0; padding-top: 24px; color: var(--tertiary); font-size: 14px; max-width: 760px; }
footer { padding: 24px 0 56px; font: 700 12px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.02em; color: var(--tertiary); }
footer a { color: var(--label); text-decoration: none; margin-right: 20px; }

@media (min-width: 900px) {
  .lens-title { font-size: 64px; }
  .where { font-size: 26px; }
  .hero-value { font-size: 112px; }
  .hero-icon svg { width: 112px; height: 112px; }
  .hero-word { font-size: 44px; }
  .big-title { font-size: 64px; }
}
@media (max-width: 380px) {
  .store-pill { font-size: 12px; padding: 6px 10px; }
  .shots img { width: 180px; }
}
@media (prefers-reduced-motion: reduce) {
  .ruler-track.settle, .gauge .seg, .gauge .marker, .pin { transition: none; }
  .skeleton span, .ruler .loading-bar { animation: none; }
}
