/* =============================================================
   MapLab Tech — Design System
   Tokens & component styles shared across index.html + maplab-survey.html
   ============================================================= */

/* ---------- Tokens ---------- */
:root {
  /* Brand */
  --brand:       #0A5FFF;
  --brand-600:   #0950DB;
  --brand-700:   #0742B5;
  --brand-200:   #B8CDFF;
  --brand-100:   #DCE6FF;
  --brand-tint:  rgba(10, 95, 255, 0.08);

  /* Ink (dark) */
  --ink:         #0A0F1C;
  --ink-800:     #111728;
  --ink-700:     #1A2236;
  --ink-600:     #232C44;
  --ink-500:     #3A4561;
  --ink-400:     #5A6685;
  --ink-300:     #8693B1;
  --ink-200:     #B6BFD3;
  --ink-100:     #D9DEEA;

  /* Mist (light) */
  --mist:        #F4F6FB;
  --mist-100:    #ECEFF6;
  --mist-200:    #DDE2ED;
  --paper:       #FFFFFF;

  /* Accent */
  --cyan:        #22D3EE;
  --cyan-600:    #06B6D4;
  --cyan-tint:   rgba(34, 211, 238, 0.12);
  --amber:       #F5B544;
  --signal:      #22C55E;

  /* Type */
  --font-display: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body:    "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:    "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Type scale (desktop baseline) */
  --t-display-xl: clamp(48px, 7vw, 104px);
  --t-display-l:  clamp(40px, 5vw, 72px);
  --t-display-m:  clamp(32px, 3.6vw, 56px);
  --t-display-s:  clamp(28px, 2.6vw, 40px);
  --t-h1:         clamp(24px, 2vw, 32px);
  --t-h2:         clamp(20px, 1.5vw, 24px);
  --t-h3:         18px;
  --t-body-l:     18px;
  --t-body:       16px;
  --t-body-s:     14px;
  --t-caption:    12px;

  /* Spacing scale (multiples of 4) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --s-9: 96px; --s-10: 128px; --s-11: 160px; --s-12: 192px;

  /* Radii */
  --r-1: 4px; --r-2: 8px; --r-3: 12px; --r-4: 16px; --r-5: 24px; --r-full: 999px;

  /* Shadows (light context) */
  --sh-1: 0 1px 2px rgba(10,15,28,0.06), 0 1px 1px rgba(10,15,28,0.04);
  --sh-2: 0 4px 12px rgba(10,15,28,0.08), 0 1px 2px rgba(10,15,28,0.05);
  --sh-3: 0 16px 48px rgba(10,15,28,0.12), 0 4px 12px rgba(10,15,28,0.06);
  --sh-glow-brand: 0 0 0 1px rgba(10,95,255,0.18), 0 12px 40px rgba(10,95,255,0.18);

  /* Layout */
  --container: 1280px;
  --container-wide: 1440px;
  --nav-h: 64px;
  --easing: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
h1, h2, h3, h4, h5, h6, p { margin: 0; }
ul { list-style: none; padding: 0; margin: 0; }

/* ---------- Theme: dark page ---------- */
body.theme-dark {
  background: var(--ink);
  color: var(--ink-100);
}
body.theme-dark::before {
  /* subtle grain */
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(10,95,255,0.18), transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(34,211,238,0.06), transparent 60%);
  mix-blend-mode: screen;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--s-5);
  position: relative;
}
.container--wide { max-width: var(--container-wide); }
@media (min-width: 768px) { .container { padding: 0 var(--s-6); } }

.section { padding: var(--s-9) 0; position: relative; }
@media (min-width: 768px) { .section { padding: var(--s-10) 0; } }
.section--tight { padding: var(--s-8) 0; }

/* ---------- Type ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-400);
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}
body.theme-dark .eyebrow { color: var(--ink-300); }
.eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: var(--r-full);
  background: var(--brand);
  box-shadow: 0 0 12px var(--brand);
}

.display-xl {
  font-family: var(--font-display);
  font-size: var(--t-display-xl);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.display-l {
  font-family: var(--font-display);
  font-size: var(--t-display-l);
  font-weight: 500;
  line-height: 1.0;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.display-m {
  font-family: var(--font-display);
  font-size: var(--t-display-m);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.display-s {
  font-family: var(--font-display);
  font-size: var(--t-display-s);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.h1 { font-family: var(--font-display); font-size: var(--t-h1); font-weight: 500; line-height: 1.2; letter-spacing: -0.015em; }
.h2 { font-family: var(--font-display); font-size: var(--t-h2); font-weight: 500; line-height: 1.25; letter-spacing: -0.01em; }
.h3 { font-family: var(--font-display); font-size: var(--t-h3); font-weight: 500; line-height: 1.3; }
.body-l { font-size: var(--t-body-l); line-height: 1.55; color: var(--ink-400); }
body.theme-dark .body-l { color: var(--ink-200); }
.body { font-size: var(--t-body); line-height: 1.6; color: var(--ink-400); }
body.theme-dark .body { color: var(--ink-200); }
.body-s { font-size: var(--t-body-s); line-height: 1.55; color: var(--ink-400); }
.mono { font-family: var(--font-mono); font-feature-settings: "ss01"; letter-spacing: -0.01em; }

.text-balance { text-wrap: balance; }
.text-gradient {
  background: linear-gradient(180deg, var(--paper) 0%, rgba(255,255,255,0.65) 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  height: 48px;
  padding: 0 var(--s-5);
  border-radius: var(--r-full);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: transform 0.2s var(--easing), background 0.2s var(--easing), color 0.2s var(--easing), box-shadow 0.2s var(--easing);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-arrow {
  width: 14px; height: 14px;
  transition: transform 0.25s var(--easing);
}
.btn:hover .btn-arrow { transform: translateX(3px); }

.btn--primary {
  background: var(--brand);
  color: white;
  box-shadow: 0 1px 2px rgba(7,66,181,0.4), inset 0 1px 0 rgba(255,255,255,0.18);
}
.btn--primary:hover {
  background: var(--brand-600);
  box-shadow: var(--sh-glow-brand);
}
.btn--secondary {
  background: rgba(255,255,255,0.04);
  color: var(--ink-100);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(6px);
}
.btn--secondary:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.22);
}
body:not(.theme-dark) .btn--secondary {
  background: white;
  color: var(--ink);
  border: 1px solid var(--mist-200);
  box-shadow: var(--sh-1);
}
body:not(.theme-dark) .btn--secondary:hover {
  border-color: var(--ink-300);
}
.btn--ghost {
  height: 40px;
  padding: 0 var(--s-3);
  color: var(--ink-300);
}
.btn--ghost:hover { color: var(--ink-100); }
body:not(.theme-dark) .btn--ghost { color: var(--ink-400); }
body:not(.theme-dark) .btn--ghost:hover { color: var(--ink); }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  height: var(--nav-h);
  z-index: 50;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: rgba(10,15,28,0.55);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
body:not(.theme-dark) .nav {
  background: rgba(255,255,255,0.78);
  border-bottom: 1px solid var(--mist-200);
}
.nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
}
.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.nav__brand-mark {
  width: 22px; height: 22px;
  display: grid; place-items: center;
}
.nav__menu {
  display: none;
  gap: var(--s-2);
  align-items: center;
}
@media (min-width: 760px) { .nav__menu { display: flex; } }
.nav__link {
  padding: 8px 12px;
  font-size: 14px;
  color: var(--ink-300);
  border-radius: var(--r-2);
  transition: color 0.2s var(--easing), background 0.2s var(--easing);
}
.nav__link:hover { color: var(--ink-100); background: rgba(255,255,255,0.04); }
body:not(.theme-dark) .nav__link { color: var(--ink-400); }
body:not(.theme-dark) .nav__link:hover { color: var(--ink); background: var(--mist); }
.nav__link[aria-current="page"] { color: var(--paper); }
body:not(.theme-dark) .nav__link[aria-current="page"] { color: var(--ink); }
.nav__cta { display: inline-flex; }

/* ---------- Cards (apps grid) ---------- */
.app-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
}
@media (min-width: 640px) { .app-grid { grid-template-columns: repeat(2, 1fr); gap: var(--s-4); } }
@media (min-width: 1024px) { .app-grid { grid-template-columns: repeat(4, 1fr); gap: var(--s-4); } }

.app-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 340px;
  padding: var(--s-5);
  border-radius: var(--r-4);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015));
  border: 1px solid rgba(255,255,255,0.08);
  transition: transform 0.4s var(--easing), border-color 0.3s var(--easing), background 0.3s var(--easing);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  will-change: transform;
}
.app-card:hover {
  border-color: rgba(255,255,255,0.16);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
}
.app-card__status {
  position: absolute;
  top: var(--s-4); right: var(--s-4);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-300);
  z-index: 2;
}
.app-card__status .dot {
  width: 6px; height: 6px;
  border-radius: var(--r-full);
  background: var(--ink-500);
}
.app-card--live .app-card__status { color: var(--signal); }
.app-card--live .app-card__status .dot {
  background: var(--signal);
  box-shadow: 0 0 0 4px rgba(34,197,94,0.18);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0px rgba(34,197,94,0.4);} 50% { box-shadow: 0 0 0 6px rgba(34,197,94,0);} }

.app-card__art {
  flex: 1;
  margin: calc(-1 * var(--s-5)) calc(-1 * var(--s-5)) var(--s-4);
  padding: var(--s-6) var(--s-5) var(--s-4);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: grid;
  place-items: center;
  min-height: 180px;
  position: relative;
  overflow: hidden;
}
.app-card__title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin-bottom: var(--s-2);
}
.app-card__desc {
  font-size: 13px;
  color: var(--ink-300);
  line-height: 1.5;
}
.app-card__cta {
  margin-top: var(--s-5);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-200);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.app-card--live .app-card__cta { color: var(--paper); }
.app-card--soon { opacity: 0.7; pointer-events: none; }

/* ---------- Vision section ---------- */
.vision-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
}
@media (min-width: 720px) { .vision-grid { grid-template-columns: repeat(3, 1fr); } }

.vision-card {
  padding: var(--s-6);
  border-radius: var(--r-4);
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.08);
  position: relative;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.vision-card__num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-400);
  letter-spacing: 0.1em;
}
.vision-card__title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin-top: var(--s-5);
}
.vision-card__body {
  font-size: 14px;
  color: var(--ink-300);
  line-height: 1.6;
  margin-top: auto;
}
.vision-card__icon {
  width: 32px; height: 32px;
  color: var(--cyan);
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-6);
  align-items: start;
}
@media (min-width: 880px) {
  .about-grid { grid-template-columns: 3fr 9fr; gap: var(--s-7); }
}
.about-meta {
  position: sticky; top: calc(var(--nav-h) + var(--s-5));
  display: flex; flex-direction: column; gap: var(--s-4);
}
.about-meta dl { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4) var(--s-3); margin: 0; }
.about-meta dt { font-family: var(--font-mono); font-size: 11px; color: var(--ink-400); text-transform: uppercase; letter-spacing: 0.1em; }
.about-meta dd { margin: 0; font-size: 13px; color: var(--ink-100); }

/* ---------- Contact ---------- */
.contact-cta {
  text-align: center;
  padding: var(--s-10) var(--s-5);
  border-radius: var(--r-5);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(10,95,255,0.18), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.0));
  border: 1px solid rgba(255,255,255,0.08);
  position: relative;
  overflow: hidden;
}
.contact-cta__inner { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: var(--s-5); }

/* ---------- Footer ---------- */
.footer { padding: var(--s-8) 0 var(--s-6); border-top: 1px solid rgba(255,255,255,0.06); }
body:not(.theme-dark) .footer { border-top: 1px solid var(--mist-200); }
.footer__row { display: flex; flex-wrap: wrap; gap: var(--s-5); justify-content: space-between; align-items: flex-start; }
.footer__col { display: flex; flex-direction: column; gap: var(--s-3); min-width: 160px; }
.footer__col h4 { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-400); }
.footer__col a { font-size: 14px; color: var(--ink-200); }
body:not(.theme-dark) .footer__col a { color: var(--ink-500); }
.footer__col a:hover { color: var(--ink-100); }
body:not(.theme-dark) .footer__col a:hover { color: var(--ink); }
.footer__bottom { margin-top: var(--s-7); display: flex; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; font-family: var(--font-mono); font-size: 11px; color: var(--ink-400); text-transform: uppercase; letter-spacing: 0.1em; }

/* ---------- Hero (home, dark) ---------- */
.hero { position: relative; padding: calc(var(--nav-h) + 32px) 0 var(--s-10); overflow: hidden; }
.hero__inner { position: relative; z-index: 3; padding-top: var(--s-9); padding-bottom: var(--s-6); }
.hero__title { margin-top: var(--s-5); }
.hero__sub { margin-top: var(--s-5); max-width: 620px; }
.hero__ctas { margin-top: var(--s-6); display: flex; gap: var(--s-3); flex-wrap: wrap; }
.hero__coord {
  position: absolute;
  bottom: var(--s-5); right: var(--s-5);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-400);
  display: flex; align-items: center; gap: var(--s-2);
  z-index: 3;
}
.hero__coord .pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}
.hero__coord .pill::before {
  content: ""; width: 6px; height: 6px; border-radius: 999px;
  background: var(--cyan); box-shadow: 0 0 8px var(--cyan);
}
.hero__bg {
  position: absolute; inset: 0;
  z-index: 1;
  pointer-events: none;
}
.hero__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 30%, transparent 80%);
}
.hero__crosshairs {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(34,211,238,0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34,211,238,0.18) 1px, transparent 1px);
  background-size: 256px 256px;
  background-position: 50% 50%;
  mask-image: radial-gradient(ellipse 30% 30% at 50% 40%, black 40%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 30% 30% at 50% 40%, black 40%, transparent 80%);
  opacity: 0.5;
}
.hero__contours { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__contours path {
  fill: none;
  stroke: rgba(10,95,255,0.32);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.hero__contours .c-cyan { stroke: rgba(34,211,238,0.28); }
.hero__contours .c-faint { stroke: rgba(255,255,255,0.06); }
.hero__contour-anim {
  animation: drift 24s linear infinite;
  transform-origin: 50% 50%;
}
.hero__contour-anim--slow { animation-duration: 40s; }
.hero__contour-anim--reverse { animation-direction: reverse; }
@keyframes drift {
  0%   { transform: translate3d(-2%, -1%, 0); }
  50%  { transform: translate3d( 2%,  1%, 0); }
  100% { transform: translate3d(-2%, -1%, 0); }
}
.hero__vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 50% at 50% 40%, transparent 30%, rgba(10,15,28,0.85) 80%);
}

/* Stat strip under hero */
.hero__strip {
  margin-top: var(--s-8);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: relative;
  z-index: 3;
}
.hero__strip > div {
  padding: var(--s-5) var(--s-4);
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex; flex-direction: column; gap: 6px;
}
.hero__strip > div:last-child { border-right: none; }
.hero__strip dt { font-family: var(--font-mono); font-size: 11px; color: var(--ink-400); text-transform: uppercase; letter-spacing: 0.1em; }
.hero__strip dd { margin: 0; font-family: var(--font-display); font-size: 22px; font-weight: 500; letter-spacing: -0.015em; }
@media (max-width: 720px) {
  .hero__strip { grid-template-columns: repeat(2, 1fr); }
  .hero__strip > div:nth-child(2n) { border-right: none; }
}

/* ---------- Tweaks panel (custom) ---------- */
.tweaks {
  position: fixed;
  bottom: var(--s-5); right: var(--s-5);
  z-index: 100;
  width: 280px;
  background: rgba(17, 23, 40, 0.86);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--r-4);
  padding: var(--s-4);
  color: var(--ink-100);
  font-family: var(--font-body);
  font-size: 13px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5), 0 4px 12px rgba(0,0,0,0.3);
  display: none;
}
.tweaks.is-open { display: block; }
.tweaks__header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--s-4);
}
.tweaks__title { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-300); }
.tweaks__close { color: var(--ink-300); width: 24px; height: 24px; display: grid; place-items: center; border-radius: var(--r-2); }
.tweaks__close:hover { color: var(--ink-100); background: rgba(255,255,255,0.06); }
.tweaks__row { display: flex; flex-direction: column; gap: 8px; margin-bottom: var(--s-4); }
.tweaks__row:last-child { margin-bottom: 0; }
.tweaks__label { font-size: 12px; color: var(--ink-300); }
.tweaks__segments { display: inline-flex; padding: 3px; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.08); border-radius: 999px; }
.tweaks__segments button {
  padding: 6px 14px;
  font-size: 12px;
  color: var(--ink-300);
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
}
.tweaks__segments button[aria-pressed="true"] { background: var(--brand); color: white; }
.tweaks__swatches { display: flex; gap: 8px; }
.tweaks__swatch {
  width: 28px; height: 28px;
  border-radius: 999px;
  border: 2px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
}
.tweaks__swatch[aria-pressed="true"] { border-color: white; transform: scale(1.1); }

/* Floating toggle button when collapsed */
.tweaks-toggle {
  position: fixed;
  bottom: var(--s-5); right: var(--s-5);
  z-index: 99;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(17, 23, 40, 0.86);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--ink-100);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}
.tweaks-toggle:hover { border-color: rgba(255,255,255,0.2); }
.tweaks-toggle::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.tweaks.is-open ~ .tweaks-toggle { display: none; }

/* ---------- Product page (light) styles ---------- */
.product-hero {
  position: relative;
  padding: calc(var(--nav-h) + 48px) 0 var(--s-8);
  overflow: hidden;
  background: linear-gradient(180deg, var(--mist) 0%, var(--paper) 70%);
}
.product-hero__inner { text-align: center; max-width: 820px; margin: 0 auto; position: relative; z-index: 2; }
.product-hero__title { margin-top: var(--s-4); }
.product-hero__sub { margin-top: var(--s-5); margin-left: auto; margin-right: auto; max-width: 540px; }
.product-hero__cta-row { margin-top: var(--s-6); display: flex; gap: var(--s-3); justify-content: center; flex-wrap: wrap; }
.product-hero__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(10,15,28,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10,15,28,0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 50% at 50% 30%, black 40%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 50% at 50% 30%, black 40%, transparent 80%);
  z-index: 1;
}

/* Store badges (custom-built, not Apple/Google copyrighted artwork) */
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 22px 0 18px;
  border-radius: 14px;
  background: var(--ink);
  color: white;
  font-family: var(--font-display);
  border: 1px solid var(--ink-700);
  transition: transform 0.2s var(--easing), background 0.2s var(--easing);
}
.store-badge:hover { background: var(--ink-800); transform: translateY(-1px); }
.store-badge__icon { width: 26px; height: 26px; flex-shrink: 0; }
.store-badge__text { display: flex; flex-direction: column; line-height: 1.1; }
.store-badge__small { font-size: 10px; opacity: 0.7; letter-spacing: 0.04em; text-transform: uppercase; font-family: var(--font-mono); }
.store-badge__big { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; }

/* Phone mockup stage */
.phone-stage {
  margin-top: var(--s-8);
  position: relative;
  display: grid; place-items: center;
}
.phone-stage::before {
  content: ""; position: absolute;
  width: 80%; height: 60%; bottom: 0; left: 10%;
  background: radial-gradient(ellipse at 50% 100%, rgba(10,95,255,0.18), transparent 70%);
  z-index: 0;
}
.phone {
  position: relative;
  width: 320px;
  height: 660px;
  border-radius: 56px;
  background: linear-gradient(180deg, #0F1626, #060912);
  padding: 14px;
  box-shadow:
    0 60px 120px rgba(10,15,28,0.18),
    0 24px 48px rgba(10,15,28,0.12),
    inset 0 0 0 1px rgba(255,255,255,0.04);
  z-index: 1;
}
.phone--lg { width: 340px; height: 720px; }
.phone__screen {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 44px;
  overflow: hidden;
  background: #0A0F1C;
}
.phone__notch {
  position: absolute;
  top: 12px; left: 50%; transform: translateX(-50%);
  width: 110px; height: 30px;
  border-radius: 999px;
  background: #000;
  z-index: 10;
}
.phone__statusbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50px;
  z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px 0;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: white;
}

/* Phone stack (3-up) */
.phone-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-6);
  justify-items: center;
}
@media (min-width: 720px) {
  .phone-stack { grid-template-columns: repeat(3, 1fr); gap: var(--s-5); align-items: end; }
  .phone-stack .phone { transform: scale(0.86); }
  .phone-stack .phone:nth-child(2) { transform: scale(0.95) translateY(-12px); }
}

/* Features grid */
.features {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-5);
}
@media (min-width: 640px) { .features { grid-template-columns: repeat(2, 1fr); gap: var(--s-5) var(--s-6); } }
@media (min-width: 1080px) { .features { grid-template-columns: repeat(4, 1fr); gap: var(--s-5) var(--s-6); } }
.feature {
  display: flex; flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-5) 0;
  border-top: 1px solid var(--mist-200);
}
.feature__icon {
  width: 32px; height: 32px;
  color: var(--brand);
  margin-bottom: var(--s-2);
}
.feature__title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.feature__desc { font-size: 14px; color: var(--ink-400); line-height: 1.55; }
.feature__tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-400);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--s-2);
}

/* Chips (who it's for) */
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-5); }
.chip {
  padding: 10px 16px;
  border-radius: var(--r-full);
  font-size: 14px;
  background: var(--mist);
  color: var(--ink);
  border: 1px solid var(--mist-200);
  transition: background 0.2s var(--easing), border-color 0.2s var(--easing), color 0.2s var(--easing);
}
.chip:hover { background: var(--brand); color: white; border-color: var(--brand); }

/* Pro section (dark) */
.pro-section {
  background: var(--ink);
  color: var(--ink-100);
  border-radius: var(--r-5);
  padding: var(--s-9) var(--s-6);
  overflow: hidden;
  position: relative;
}
@media (min-width: 720px) { .pro-section { padding: var(--s-10) var(--s-9); } }
.pro-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 20% 0%, rgba(10,95,255,0.2), transparent 60%),
    radial-gradient(ellipse 40% 30% at 100% 100%, rgba(34,211,238,0.1), transparent 60%);
}
.pro-section__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-7);
  position: relative;
  z-index: 1;
}
@media (min-width: 720px) { .pro-section__grid { grid-template-columns: 1fr 1fr; gap: var(--s-8); align-items: center; } }
.pro-section .eyebrow { color: var(--cyan); }
.pro-section .eyebrow::before { background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }

.pro-checks { display: flex; flex-direction: column; gap: var(--s-3); }
.pro-check {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: var(--s-3);
  padding: var(--s-3) 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 15px;
}
.pro-check:last-child { border-bottom: none; }
.pro-check__icon { color: var(--cyan); margin-top: 1px; }

/* FAQ */
.faq { max-width: 780px; margin: 0 auto; }
.faq__item {
  border-bottom: 1px solid var(--mist-200);
}
.faq__btn {
  width: 100%;
  display: flex; justify-content: space-between; align-items: center; gap: var(--s-4);
  padding: var(--s-5) 0;
  text-align: left;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  transition: color 0.2s var(--easing);
}
.faq__btn:hover { color: var(--brand); }
.faq__plus {
  width: 22px; height: 22px;
  position: relative;
  flex-shrink: 0;
  transition: transform 0.3s var(--easing);
}
.faq__plus::before, .faq__plus::after {
  content: "";
  position: absolute;
  background: currentColor;
}
.faq__plus::before { top: 50%; left: 0; right: 0; height: 1.5px; transform: translateY(-50%); }
.faq__plus::after { left: 50%; top: 0; bottom: 0; width: 1.5px; transform: translateX(-50%); transition: transform 0.3s var(--easing); }
.faq__item[open] .faq__plus::after { transform: translateX(-50%) scaleY(0); }
.faq__answer { padding: 0 0 var(--s-5); color: var(--ink-400); font-size: 16px; line-height: 1.6; max-width: 640px; }

/* Section headers */
.section-head { display: flex; flex-direction: column; gap: var(--s-3); margin-bottom: var(--s-7); }
.section-head__inner { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s-5); flex-wrap: wrap; }
.section-head__title { max-width: 720px; }
.section-head__sub { max-width: 420px; }

/* Decorative coordinate marker */
.coord-pin {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-400);
}

/* Logo mark */
.logo-mark { width: 22px; height: 22px; }
.logo-mark .ring { stroke: currentColor; }
.logo-mark .dot { fill: var(--brand); }

/* Utility */
.text-center { text-align: center; }
.mt-2 { margin-top: var(--s-2); }
.mt-3 { margin-top: var(--s-3); }
.mt-4 { margin-top: var(--s-4); }
.mt-5 { margin-top: var(--s-5); }
.mt-6 { margin-top: var(--s-6); }
.mt-7 { margin-top: var(--s-7); }
.mt-8 { margin-top: var(--s-8); }
.flex { display: flex; }
.gap-3 { gap: var(--s-3); }
.gap-4 { gap: var(--s-4); }
.wrap { flex-wrap: wrap; }

/* In-view reveal — transform-only so content stays visible if animation never runs
   (e.g. document.hidden / background tab / automated capture) */
@keyframes reveal {
  from { transform: translateY(16px); }
  to   { transform: translateY(0); }
}
.reveal { animation: reveal 0.8s var(--easing) both; }
.reveal-2 { animation-delay: 0.1s; }
.reveal-3 { animation-delay: 0.2s; }
.reveal-4 { animation-delay: 0.3s; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* =============================================================
   Real-app phone chrome (matches MapLab Survey UI)
   ============================================================= */

/* Recording-style green status pill (top-left in real app) */
.status-record {
  background: #2BB152;
  color: white;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.status-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: black;
}
.status-right .lte {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.status-bat {
  background: #2BB152;
  color: white;
  padding: 3px 6px 3px 5px;
  border-radius: 4px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* Top search bar (matches real app) */
.phone-search {
  position: absolute;
  top: 64px;
  left: 14px; right: 14px;
  height: 48px;
  background: white;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(10,15,28,0.10);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 10px;
  z-index: 5;
}
.phone-search__ham {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  color: var(--ink);
  flex-shrink: 0;
}
.phone-search__icon {
  width: 16px; height: 16px;
  color: var(--ink-300);
  flex-shrink: 0;
}
.phone-search__text {
  flex: 1;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-300);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.phone-search__map {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(10,95,255,0.08);
  display: grid; place-items: center;
  color: var(--brand);
  flex-shrink: 0;
}

/* Layer pill (just below search bar) */
.phone-layer {
  position: absolute;
  top: 122px;
  left: 14px;
  height: 32px;
  padding: 0 12px 0 6px;
  background: white;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(10,15,28,0.08);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  z-index: 5;
}
.phone-layer__icon {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  color: var(--ink-400);
}
.phone-layer__dot {
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--brand);
}
.phone-layer__chev {
  width: 12px; height: 12px;
  color: var(--ink-300);
}

/* Right-side controls stack */
.phone-rs {
  position: absolute;
  right: 12px;
  top: 130px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 5;
}
.phone-rs__zoom {
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(10,15,28,0.08);
  overflow: hidden;
}
.phone-rs__zoom button {
  width: 38px;
  height: 38px;
  display: grid; place-items: center;
  color: var(--ink);
}
.phone-rs__zoom button + button {
  border-top: 1px solid var(--mist-100);
}
.phone-rs__round {
  width: 38px; height: 38px;
  border-radius: 999px;
  background: white;
  box-shadow: 0 4px 14px rgba(10,15,28,0.08);
  display: grid; place-items: center;
  color: var(--ink);
}
.phone-rs__round.is-active { color: var(--brand); }

/* Polygon overlay on map */
.map-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
}
.map-overlay svg { width: 100%; height: 100%; }
.poly-stroke { stroke: #FF3B5C; stroke-width: 2; fill: rgba(255,59,92,0.18); stroke-linejoin: round; }
.poly-vertex { fill: #FF3B5C; }
.poly-vertex-ring { fill: white; stroke: #FF3B5C; stroke-width: 2; }
.poly-edge-label {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 9px;
  fill: #1a1a1a;
}
.poly-edge-label-bg {
  fill: white;
  stroke: rgba(10,15,28,0.08);
  stroke-width: 0.5;
}

/* Center area pill */
.poly-area-pill {
  fill: #FF3B5C;
}
.poly-area-pill-text {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  fill: white;
}

/* Action pill at bottom (Add / Ruler / Layers / Stake-out) */
.phone-action {
  position: absolute;
  left: 14px; right: 14px;
  bottom: 64px;
  height: 60px;
  background: white;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(10,15,28,0.10);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
  z-index: 6;
}
.phone-action__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  border-radius: 12px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 500;
  min-width: 56px;
}
.phone-action__btn svg { width: 20px; height: 20px; color: var(--ink-500); }
.phone-action__btn.is-active { background: rgba(10,95,255,0.08); }
.phone-action__btn.is-active svg { color: var(--brand); }
.phone-action__btn.is-active span { color: var(--brand); }

/* Bottom tab bar (Map / Records / Data / Calculation / Account) */
.phone-tabs {
  position: absolute;
  left: 0; right: 0;
  bottom: 0;
  height: 56px;
  background: white;
  border-top: 1px solid var(--mist-100);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 4px 0 14px;
  z-index: 7;
}
.phone-tabs__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--ink-300);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 500;
}
.phone-tabs__btn svg { width: 18px; height: 18px; }
.phone-tabs__btn.is-active { color: var(--brand); }

/* Attribution pill (bottom-left, like real app) */
.phone-attrib {
  position: absolute;
  left: 8px;
  bottom: 130px;
  display: flex;
  gap: 4px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 9px;
  color: rgba(10,15,28,0.6);
  z-index: 4;
}

/* Stake-out compass mock */
.stakeout-screen {
  position: absolute;
  inset: 0;
  background: var(--mist);
  padding: 60px 18px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 4;
}
.stakeout-screen__back {
  align-self: flex-start;
  margin-bottom: 8px;
  color: var(--ink);
}
.stakeout-screen__title {
  align-self: flex-start;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.stakeout-screen__sub {
  align-self: flex-start;
  font-size: 11px;
  color: var(--ink-400);
  margin-top: 2px;
}
.stakeout-screen__gps {
  align-self: flex-start;
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255,59,92,0.10);
  color: #D62F4D;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.stakeout-screen__buttons {
  align-self: stretch;
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.stakeout-screen__buttons button {
  flex: 1;
  height: 36px;
  border-radius: 10px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
}
.stakeout-screen__buttons .nav-btn {
  background: var(--brand);
  color: white;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.stakeout-screen__buttons .map-btn {
  background: white;
  color: var(--ink);
  border: 1px solid var(--mist-200);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.stakeout-screen__compass {
  width: 180px;
  height: 180px;
  margin: 18px auto 12px;
  position: relative;
}
.stakeout-screen__distance {
  align-self: stretch;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,59,92,0.25);
  background: rgba(255,59,92,0.04);
  text-align: center;
  margin-top: 8px;
}
.stakeout-screen__distance .label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--ink-400);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.stakeout-screen__distance .val {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: #FF3B5C;
  margin-top: 2px;
}

/* Map satellite-style background (for shots) */
.map-satellite {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 40%, #5C8D5A 0%, transparent 40%),
    radial-gradient(ellipse at 70% 60%, #4A7B4A 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, #6D9A66 0%, transparent 50%),
    linear-gradient(150deg, #6D9A66 0%, #4A7B4A 50%, #5C8D5A 100%);
}
.map-satellite::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(45deg, rgba(0,0,0,0.06) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,0.04) 0 1px, transparent 1px 12px);
}
