/* FloodMesh website.
   Layout: a flood-gauge spine. A staff-gauge scale runs down the hero's edge,
   sections stack like water levels, and the store is a catalogue beside an
   order sheet. Life-jacket orange is kept for SOS and the main action only. */

:root {
  --paper: #edf2f3;
  --surface: #fbfdfd;
  --ink: #102530;
  --muted: #4a5d67;
  --line: #c7d5da;
  --field-line: #6f8590;
  --water: #1d6a85;
  --water-soft: #d4e7ed;
  --sos: #c2410c;
  --sos-ink: #ffffff;
  --oled: #0a0e11;
  --oled-text: #c4e8ff;
  --ok: #2b7a4b;
  --err: #b42318;

  --display: "Anek Latin", "Anek Tamil", "Anek Devanagari", "Arial Narrow", system-ui, sans-serif;
  --body: "Hind", "Hind Madurai", "Noto Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --screen: "VT323", "VT323 Fallback", ui-monospace, "Courier New", monospace;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: clamp(1.9rem, 2.2vw + 1.2rem, 2.6rem);
  --step-4: clamp(2.4rem, 4.6vw + 1rem, 4.4rem);

  --gutter: clamp(16px, 4vw, 56px);
  --wrap: 1440px;
  --radius: 6px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0c161b;
    --surface: #122028;
    --ink: #e3ecef;
    --muted: #9fb2bb;
    --line: #253841;
    --field-line: #5d7a87;
    --water: #63b4d0;
    --water-soft: #15313b;
    --sos: #ff8a3d;
    --sos-ink: #1c0d03;
    --oled: #05080a;
    --oled-text: #c4e8ff;
    --ok: #5cc68a;
    --err: #ff7b6b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0c161b;
  --surface: #122028;
  --ink: #e3ecef;
  --muted: #9fb2bb;
  --line: #253841;
  --field-line: #5d7a87;
  --water: #63b4d0;
  --water-soft: #15313b;
  --sos: #ff8a3d;
  --sos-ink: #1c0d03;
  --oled: #05080a;
  --oled-text: #c4e8ff;
  --ok: #5cc68a;
  --err: #ff7b6b;
  color-scheme: dark;
}

/* Monospace fallback sized to VT323's narrow letters, so the unit's screen
   text fits even before (or without) the web font. */
@font-face {
  font-family: "VT323 Fallback";
  src: local("Courier New"), local("CourierNewPSMT"), local("Menlo"), local("DejaVu Sans Mono"), local("Roboto Mono"), local("Droid Sans Mono"), local("Noto Sans Mono");
  size-adjust: 66.7%;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* --head-h is measured by site.js; anchors land below the sticky header */
  scroll-padding-top: calc(env(safe-area-inset-top, 0px) + var(--head-h, 76px) + 12px);
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
figure { margin: 0; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
a { color: var(--water); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--water); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 {
  font-family: var(--display);
  font-stretch: 82%;
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0;
}
:lang(ta) h1, :lang(ta) h2, :lang(ta) h3,
:lang(hi) h1, :lang(hi) h2, :lang(hi) h3 { line-height: 1.3; letter-spacing: 0; }
p { margin: 0; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.measure { max-width: 62ch; }
.eyebrow {
  font-family: var(--display);
  font-stretch: 100%;
  font-weight: 600;
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
:lang(ta) .eyebrow, :lang(hi) .eyebrow { letter-spacing: 0.02em; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 50; background: var(--surface); padding: 8px 12px; }

/* ---------------------------------------------------------------- header */
.site-head {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap {
  max-width: none;   /* the header runs edge to edge; the content below keeps --wrap */
  display: flex;
  align-items: center;
  gap: 12px 24px;
  min-height: 64px;
  flex-wrap: wrap;
  padding-block: 8px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-stretch: 90%;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
}
.brand-mark { flex: none; width: 30px; height: 30px; color: var(--ink); }   /* four units, all linked: a mesh */
.brand-mark .l { fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.brand-mark .n { fill: var(--water); }
.brand-mark .s { fill: var(--sos); }
.brand small {
  font-family: var(--body);
  font-weight: 400;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0;
}
.nav { display: flex; gap: 4px 20px; flex-wrap: wrap; margin-left: auto; }
.nav a { color: var(--ink); text-decoration: none; font-size: 0.98rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--water); }
.head-tools { display: flex; align-items: center; gap: 10px; }
.lang {
  display: inline-flex;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.lang button {
  font: inherit;
  font-size: 0.9rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 4px 10px;
  cursor: pointer;
}
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.lang button:focus-visible { outline-offset: -4px; }
.lang button[aria-pressed="true"]:focus-visible { outline-color: var(--paper); }
.cart-link { position: relative; }
.count {
  display: inline-grid;
  place-items: center;
  min-width: 1.5em;
  height: 1.5em;
  padding: 0 0.35em;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--sos-ink);
  color: var(--sos);
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.menu-btn { display: none; }
/* Tablets: logo, language and pre-order on the first row, the links on a second row.
   One row needs about 940px in English and Hindi and 1250px in Tamil. */
@media (max-width: 959px) {
  .nav { order: 3; width: 100%; margin-left: 0; gap: 4px 20px; }
  .head-tools { margin-left: auto; }
}
@media (max-width: 1259px) {
  html:lang(ta) .nav { order: 3; width: 100%; margin-left: 0; gap: 4px 20px; }
  html:lang(ta) .head-tools { margin-left: auto; }
}
/* Phones: one row (logo, language, menu button); the links and the pre-order button
   open under it. Without JavaScript (no .js on <html>) the links simply show. */
@media (max-width: 760px) {
  .cart-link { white-space: nowrap; }
  .js .site-head .wrap { gap: 8px; min-height: 56px; }
  .js .head-tools { display: contents; }
  .js .lang { order: 1; margin-left: auto; }
  .js .menu-btn {
    order: 2;
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: transparent;
    color: var(--ink);
    cursor: pointer;
  }
  .js .menu-btn svg { width: 20px; height: 20px; }
  .js .menu-btn .x { display: none; }
  .js .menu-open .menu-btn .bars { display: none; }
  .js .menu-open .menu-btn .x { display: block; }
  .js .nav, .js .cart-link { display: none; }
  .js .menu-open .nav {
    display: grid;
    order: 3;
    width: 100%;
    margin: 0;
    gap: 0;
    border-top: 1px solid var(--line);
    padding-top: 4px;
  }
  .js .menu-open .nav a { padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
  .js .menu-open .cart-link { display: inline-flex; order: 4; width: 100%; justify-content: center; margin-bottom: 8px; }
  html:not(.js) .nav { order: 3; width: 100%; margin-left: 0; gap: 4px 16px; }
  html:not(.js) .site-head { position: static; }
  html:not(.js) .head-tools { margin-left: auto; }
}
@media (max-width: 400px) {
  .head-tools { gap: 6px; }
  .brand { font-size: 1.25rem; gap: 7px; }
  .brand-mark { width: 26px; height: 26px; }
  .lang button { padding: 4px 8px; }
  .cart-link.btn-small { padding-inline: 10px; }
}

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  padding: 12px 20px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  text-decoration: none;
  cursor: pointer;
}
.btn-sos { background: var(--sos); color: var(--sos-ink); }
.btn-sos:hover { filter: brightness(1.06); }
.btn-line { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-line:hover { background: var(--ink); color: var(--paper); }
.btn-small { padding: 8px 14px; font-size: 0.92rem; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ---------------------------------------------------------------- hero */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(to bottom, transparent 70%, var(--water-soft) 70%),
    var(--paper);
}
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 40px;
  align-items: center;
  padding-block: clamp(40px, 7vw, 88px) clamp(48px, 7vw, 96px);
  padding-left: calc(var(--gutter) + 56px);
}
.gauge {
  position: absolute;
  top: 0;
  bottom: 0;
  left: max(var(--gutter), calc((100% - var(--wrap)) / 2 + var(--gutter)));
  width: 34px;
  border-right: 2px solid var(--ink);
  background: repeating-linear-gradient(to bottom, transparent 0 23px, var(--ink) 23px 25px);
  background-size: 12px 100%;
  background-repeat: repeat-y;
  background-position: right top;
  border-right-color: color-mix(in srgb, var(--ink) 85%, transparent);
}
.gauge span {
  position: absolute;
  right: 16px;
  font-family: var(--display);
  font-stretch: 75%;
  font-size: 0.78rem;
  font-weight: 600;
  color: color-mix(in srgb, var(--ink) 85%, transparent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transform: translateY(-50%);
}
.gauge .danger {
  right: -2px;
  left: auto;
  width: 22px;
  height: 3px;
  background: var(--sos);
  transform: none;
}
.gauge .danger-label {
  /* runs up the gap between the gauge and the text, centred on the red mark */
  right: auto;
  left: 38px;
  color: var(--sos);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
  line-height: 1;
  writing-mode: vertical-rl;
  transform: translateY(-50%) rotate(180deg);
}
.hero h1 { font-size: var(--step-4); font-weight: 700; }
/* Tamil and Devanagari words run long; keep the hero headline inside the column. */
:lang(ta) .hero h1, :lang(hi) .hero h1 { font-size: clamp(2rem, 3.4vw + 1rem, 3.5rem); }
.hero .lede { margin-top: 20px; font-size: var(--step-1); color: var(--muted); max-width: 46ch; }
.hero .ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero .note { margin-top: 18px; font-size: var(--step--1); color: var(--muted); }
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); padding-left: calc(var(--gutter) + 44px); }
  .gauge { width: 26px; }
  .gauge span { font-size: 0.7rem; right: 12px; }
  .gauge .danger-label { left: 30px; }
}

/* AI scene photos, assets/img/*.jpg */
.hero.has-photo { background: var(--paper); }
.hero-photo, .band-photo { position: absolute; inset: 0; margin: 0; z-index: 0; }
.hero-photo img, .band-photo img { width: 100%; height: 100%; object-fit: cover; }
.hero-photo img { object-position: 70% 50%; }
.hero-photo::after {
  /* fade the photo into the page behind the headline so text stays readable */
  content: "";
  position: absolute;
  inset: 0;
  --x0: max(var(--gutter), calc((100% - var(--wrap)) / 2 + var(--gutter)));   /* where the gauge and text start */
  background:
    linear-gradient(90deg,
      color-mix(in srgb, var(--paper) 55%, transparent) 0,
      color-mix(in srgb, var(--paper) 86%, transparent) var(--x0),
      color-mix(in srgb, var(--paper) 86%, transparent) calc(var(--x0) + 620px),
      color-mix(in srgb, var(--paper) 40%, transparent) calc(var(--x0) + 840px),
      transparent calc(var(--x0) + 1080px));
}
.hero.has-photo .wrap, .hero.has-photo .gauge { position: relative; z-index: 1; }
.hero.has-photo .gauge { position: absolute; }
@media (max-width: 860px) {
  .hero-photo::after {
    background: linear-gradient(to bottom, color-mix(in srgb, var(--paper) 80%, transparent) 0%, color-mix(in srgb, var(--paper) 94%, transparent) 40%, var(--paper) 70%);
  }
}
.cta-band.has-photo { position: relative; overflow: hidden; }
.band-photo::after { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--ink) 82%, transparent); }
.cta-band.has-photo .wrap { position: relative; z-index: 1; }
.who-head, .how-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); gap: clamp(24px, 4vw, 48px); align-items: center; margin-bottom: clamp(28px, 4vw, 48px); }
.who-head .section-head, .how-head .section-head { margin-bottom: 0; }
.media-slot.how-photo { aspect-ratio: 1672 / 941; }   /* whole picture: the message bubbles sit near its edges */
.who-head:not(:has(figure)) { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 860px) { .who-head, .how-head { grid-template-columns: minmax(0, 1fr); } }

/* ---------------------------------------------------------------- the unit (illustration) */
.unit-figure { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 10px; }
.unit-figure figcaption { font-size: 0.78rem; color: var(--muted); }
.hero.has-photo .unit-figure figcaption { position: relative; z-index: 1; padding: 4px 10px; border-radius: 4px; background: color-mix(in srgb, var(--surface) 88%, transparent); max-width: 34ch; text-align: center; }
.unit {
  position: relative;
  min-width: 0;
  container-type: inline-size;
  width: min(270px, 100%);
  padding: 22px 20px 24px;
  margin-top: 70px;
  border-radius: 26px 26px 30px 30px;
  /* the unit's orange case, as in the product render; the same in light and dark */
  background: linear-gradient(160deg, #f47a45, #e2531e 38%, #cc4512);
  box-shadow: 0 1px 0 #ff9a6a inset, 0 -3px 0 #a9370b inset, 0 24px 40px -24px rgba(5, 20, 28, 0.6);
}
.unit::before {
  /* the antenna */
  content: "";
  position: absolute;
  right: 34px;
  bottom: 100%;
  width: 12px;
  height: 92px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(90deg, #1a1f22, #3b4449 50%, #1a1f22);
}
.screen {
  background: var(--oled);
  border-radius: 6px;
  padding: 10px 12px;
  min-height: 112px;
  border: 3px solid #000;
  font-family: var(--screen);
  font-size: min(1.32rem, 9.2cqi);
  line-height: 1.05;
  color: var(--oled-text);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  overflow: hidden;
}
.screen .line { display: block; white-space: nowrap; overflow: hidden; text-overflow: clip; }
.screen .inv { background: var(--oled-text); color: var(--oled); padding: 0 4px; }
.screen .big { font-size: min(1.9rem, 13.5cqi); line-height: 1.1; margin-top: 6px; }
.keys {
  /* phone keypad, as on the unit: 1-9, then * 0 #; letters as in the firmware's
     multi-tap (1 is punctuation, 0 is space) */
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
}
.keys span {
  display: grid;
  place-items: center;
  align-content: center;
  line-height: 1;
  aspect-ratio: 1.55;
  max-width: 100%;
  border-radius: 7px;
  background: #23282b;   /* black keys on the orange case */
  color: #f1f4f5;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
  box-shadow: 0 2px 0 #7a2a0b;
}
/* * and # (hold both for SOS): light keys, so they stand out on the orange case */
.keys small { margin-top: 3px; font-family: var(--body); font-size: 0.56rem; font-weight: 600; letter-spacing: 0.06em; opacity: 0.8; }
.keys .hot { background: #fff4ec; color: #8a2c08; box-shadow: 0 2px 0 #7a2a0b; }
@media (prefers-reduced-motion: no-preference) {
  .keys .hot.pulse { animation: press 2.4s ease-in-out infinite; }
}
@keyframes press {
  0%, 60%, 100% { transform: translateY(0); box-shadow: 0 2px 0 #7a2a0b; }
  70%, 90% { transform: translateY(2px); box-shadow: 0 0 0 #7a2a0b; }
}

/* ---------------------------------------------------------------- sections */
.section { padding-block: clamp(56px, 8vw, 104px); border-bottom: 1px solid var(--line); }
.section-head { display: grid; gap: 14px; align-content: start; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head h2 { font-size: var(--step-3); font-weight: 700; }
.section-head p { color: var(--muted); max-width: 60ch; }

/* story */
.story .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.dates { display: grid; gap: 18px; margin-top: 28px; }
.date {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 16px;
  padding-top: 14px;
  border-top: 2px solid var(--ink);
}
.date strong {
  font-family: var(--display);
  font-stretch: 80%;
  font-size: var(--step-2);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.story p + p { margin-top: 16px; }
@media (max-width: 860px) { .story .wrap { grid-template-columns: minmax(0, 1fr); } }

/* media slots: where real photos go */
.media-slot {
  position: relative;
  display: grid;
  place-items: end start;
  aspect-ratio: 4 / 3;
  max-width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background:
    repeating-linear-gradient(-12deg, transparent 0 14px, color-mix(in srgb, var(--water) 10%, transparent) 14px 15px),
    linear-gradient(to bottom, var(--water-soft), color-mix(in srgb, var(--water) 30%, var(--water-soft)));
  border: 1px solid var(--line);
}
.media-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media-slot img.product-photo { object-fit: contain; background: #fdfdfd; }   /* whole unit, on the render's own white */
/* pack cards: one small unit per unit in the pack, centred rows (store.js drawTiles sets --c and --r) */
.media-slot.has-tiles { background: #fdfdfd; }
.unit-tiles { position: absolute; inset: 0; padding: 5% 6%; display: flex; flex-wrap: wrap; justify-content: center; align-content: center; }
.media-slot .unit-tiles img { position: static; box-sizing: border-box; width: calc(100% / var(--c)); height: calc(100% / var(--r)); padding: 1px; object-fit: contain; }
.media-slot .tag {
  position: relative;
  margin: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.8rem;
}

/* steps: a real sequence, so numbered */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 36px); counter-reset: step; list-style: none; margin: 0; padding: 0; }
.steps li { display: grid; gap: 10px; align-content: start; }
.steps li::before {
  counter-increment: step;
  content: counter(step);
  font-family: var(--display);
  font-stretch: 75%;
  font-weight: 700;
  font-size: 3rem;
  line-height: 1;
  color: var(--water);
}
.steps h3 { font-size: var(--step-2); }
.steps p { color: var(--muted); }
@media (max-width: 860px) { .steps { grid-template-columns: minmax(0, 1fr); } }

/* the street map: units passing messages (drawn by mesh.js) */
.mesh {
  display: grid;
  gap: 12px;
  padding: clamp(12px, 2vw, 20px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.mesh-controls { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.mesh-tabs { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.mesh-tabs button, .mesh-pause {
  font: inherit;
  font-size: 0.92rem;
  padding: 6px 14px;
  border: 1px solid var(--field-line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.mesh-tabs button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.mesh-map { display: block; width: 100%; max-width: 100%; height: auto; }
.mesh-water { fill: var(--water-soft); }
.mesh-road { fill: none; stroke: color-mix(in srgb, var(--line) 75%, var(--surface)); stroke-width: 22; stroke-linecap: round; }
.mesh-road.thin { stroke-width: 12; }
.mesh-node .house { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }
.mesh-node .roof-shape { fill: var(--ink); }
.mesh-node .antenna { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.mesh-node .hull { fill: var(--water); }
.mesh-node .dot { fill: var(--water); transition: fill 0.3s, opacity 0.3s; }
.mesh-node.asleep .dot { fill: var(--line); }
.mesh-node.quiet .dot { fill: var(--sos); opacity: 0.55; }
.mesh-node.sos .dot, .mesh-node.alert .dot { fill: var(--sos); }
.mesh-node.done .dot { fill: var(--ok); }
.mesh-node .bubble { opacity: 0; transition: opacity 0.3s; }
.mesh-node.shown .bubble, .mesh-node.sos .bubble, .mesh-node.alert .bubble { opacity: 1; }
.mesh-node .bubble rect, .mesh-node .bubble path { fill: var(--water); }
.mesh-node.sos .bubble rect, .mesh-node.sos .bubble path,
.mesh-node.alert .bubble rect, .mesh-node.alert .bubble path { fill: var(--sos); }
.mesh-node.done .bubble rect, .mesh-node.done .bubble path { fill: var(--ok); }
.mesh-node .bubble text { fill: var(--paper); font: 700 10px var(--body); }
.ring { stroke-width: 3; }
.ring.msg { stroke: var(--water); fill: color-mix(in srgb, var(--water) 10%, transparent); }
.ring.sos { stroke: var(--sos); fill: color-mix(in srgb, var(--sos) 10%, transparent); }
.ring.ack { stroke: var(--ok); fill: color-mix(in srgb, var(--ok) 10%, transparent); }
.hop { stroke-width: 3.5; stroke-linecap: round; fill: none; }
.hop.msg { stroke: var(--water); opacity: 0.55; }
.hop.sos { stroke: var(--sos); stroke-width: 4.5; }
.hop.ack { stroke: var(--ok); stroke-width: 3; transform: translate(0, 5px); }
.mesh-label { fill: var(--muted); font: 600 15px var(--body); }
.mesh-label.screen { fill: var(--ok); font: 400 24px var(--screen); }
@media (max-width: 560px) {
  .mesh-label:not(.screen) { display: none; }
  .mesh-label.screen { font-size: 44px; }
  .ring { stroke-width: 5; }
  .hop { stroke-width: 6; }
  .hop.sos { stroke-width: 7; }
}
.mesh-caption { min-height: 3.2em; font-weight: 600; }
.mesh-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; font-size: 0.85rem; color: var(--muted); }
.mesh-legend li { display: inline-flex; align-items: center; gap: 6px; }
.key { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.key.asleep { background: var(--line); }
.key.awake { background: var(--water); }
.key.shown { background: var(--water); border-radius: 3px; width: 16px; }
.key.sos { background: var(--sos); opacity: 0.55; }

/* how it works: messages and SOS side by side */
.tracks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 4vw, 56px); margin-top: clamp(36px, 5vw, 56px); }
.track { display: grid; gap: 18px; align-content: start; }
.track > h3 { font-size: var(--step-2); }
.tracks .steps { grid-template-columns: minmax(0, 1fr); gap: 18px; }
.tracks .steps li::before { font-size: 2.2rem; }
.steps h4 { margin: 0; font-family: var(--display); font-stretch: 90%; font-size: var(--step-1); line-height: 1.2; }
@media (max-width: 860px) { .tracks { grid-template-columns: minmax(0, 1fr); } }
.facts-title { margin-top: clamp(40px, 6vw, 64px); font-size: var(--step-2); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(24px, 4vw, 48px); margin: 14px 0 0; border-top: 2px solid var(--ink); }
.facts > div { padding-block: 16px; border-bottom: 1px solid var(--line); }
.facts dt { font-family: var(--display); font-weight: 700; font-stretch: 90%; font-size: var(--step-1); }
.facts dd { margin: 6px 0 0; color: var(--muted); }
@media (max-width: 700px) { .facts { grid-template-columns: minmax(0, 1fr); } }

/* features */
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.feature { padding: 24px 24px 28px 0; border-bottom: 1px solid var(--line); display: grid; gap: 8px; align-content: start; }
.feature:not(:nth-child(3n + 1)) { padding-left: 24px; border-left: 1px solid var(--line); }
.feature h3 { font-size: var(--step-1); font-stretch: 90%; }
.feature p { color: var(--muted); font-size: 1rem; }
@media (max-width: 860px) {
  .features { grid-template-columns: minmax(0, 1fr); }
  .feature, .feature:not(:nth-child(3n + 1)) { padding-left: 0; border-left: 0; }
}

/* field tests */
.tests .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); }
.readings { display: grid; gap: 0; border-top: 2px solid var(--ink); }
.reading { display: grid; grid-template-columns: minmax(7rem, auto) minmax(0, 1fr); gap: 20px; padding-block: 18px; border-bottom: 1px solid var(--line); align-items: baseline; }
.reading strong {
  font-family: var(--display);
  font-stretch: 75%;
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--water);
}
.reading span { color: var(--muted); }
@media (max-width: 860px) { .tests .wrap { grid-template-columns: minmax(0, 1fr); } }

/* audiences */
.audiences { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.aud {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.aud h3 { font-size: var(--step-1); }
.aud p { color: var(--muted); font-size: 0.98rem; }
.aud a { font-weight: 600; margin-top: auto; align-self: flex-start; }
@media (max-width: 1000px) { .audiences { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .audiences { grid-template-columns: minmax(0, 1fr); } }

/* faq */
.faq { display: grid; border-top: 1px solid var(--line); max-width: 820px; }
.faq details { border-bottom: 1px solid var(--line); padding-block: 4px; }
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 32px 16px 0;
  position: relative;
  font-weight: 600;
  font-size: var(--step-1);
  font-family: var(--display);
  font-stretch: 92%;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 12px;
  font-size: 1.5rem;
  color: var(--water);
}
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding-bottom: 18px; color: var(--muted); max-width: 64ch; }

/* call to action band */
.cta-band { background: var(--ink); color: var(--paper); }
.cta-band .wrap { display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: center; justify-content: space-between; padding-block: clamp(40px, 6vw, 72px); }
.cta-band h2 { font-size: var(--step-3); max-width: 22ch; }
.cta-band p { color: color-mix(in srgb, var(--paper) 75%, var(--ink)); margin-top: 10px; max-width: 52ch; }
.cta-band a:not(.btn) { color: var(--paper); }
.cta-band :focus-visible { outline-color: var(--paper); }

/* footer */
.site-foot { padding-block: 40px 56px; font-size: 0.95rem; color: var(--muted); }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 16px 40px; justify-content: space-between; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-foot a { color: var(--muted); }

/* ---------------------------------------------------------------- store */
.store-head { padding-block: clamp(36px, 6vw, 64px) 24px; }
.store-head h1 { font-size: var(--step-4); }
.store-head p { margin-top: 14px; color: var(--muted); max-width: 60ch; }
.store-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
  padding-bottom: 80px;
}
@media (max-width: 960px) { .store-layout { grid-template-columns: minmax(0, 1fr); } }
.catalogue { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 640px) { .catalogue { grid-template-columns: minmax(0, 1fr); } }
.product {
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.product .media-slot { border: 0; border-radius: 0; border-bottom: 1px solid var(--line); aspect-ratio: 16 / 10; }
.product-body { display: grid; gap: 10px; padding: 18px 18px 8px; align-content: start; }
.product h3 { font-size: var(--step-2); }
.group-title {
  grid-column: 1 / -1;
  font-size: var(--step-1);
  font-stretch: 90%;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--ink);
}
.group-title:not(:first-child) { margin-top: 28px; }
.hint-line { font-size: 0.9rem; color: var(--water); font-weight: 600; }
.product .tagline { color: var(--muted); }
.product ul { margin: 4px 0 0; padding-left: 1.1em; font-size: 0.97rem; display: grid; gap: 4px; }
.badge {
  justify-self: start;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--water-soft);
  color: var(--ink);
}
.product-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 18px;
}
.price {
  font-family: var(--display);
  font-weight: 700;
  font-stretch: 85%;
  font-size: var(--step-2);
  font-variant-numeric: tabular-nums;
}
.price small { display: block; font-family: var(--body); font-weight: 400; font-size: 0.75rem; color: var(--muted); }
.price span { display: inline-block; transform-origin: left center; }
.price .was { margin-right: 8px; font-size: 0.62em; font-weight: 500; color: var(--muted); text-decoration-thickness: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .price.bump span { animation: price-bump 0.4s ease-out; }
}
@keyframes price-bump {
  from { color: var(--water); transform: scale(1.06); }
  to { color: inherit; transform: none; }
}
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--field-line); border-radius: var(--radius); }
.stepper button {
  font: inherit;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 1.15rem;
}
.stepper input {
  width: 3.2em;
  height: 36px;
  border: 0;
  border-inline: 1px solid var(--line);
  text-align: center;
  font: inherit;
  font-variant-numeric: tabular-nums;
  background: transparent;
  color: var(--ink);
  -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.add-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.order {
  position: sticky;
  top: calc(env(safe-area-inset-top, 0px) + var(--head-h, 65px) + 16px);
  max-height: calc(100vh - env(safe-area-inset-top, 0px) - var(--head-h, 65px) - 32px);
  max-height: calc(100dvh - env(safe-area-inset-top, 0px) - var(--head-h, 65px) - 32px);
  overflow-y: auto;
  display: grid;
  gap: 18px;
  padding: 22px;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
}
@media (max-width: 960px) { .order { position: static; max-height: none; overflow: visible; } }
.order h2 { font-size: var(--step-2); }
.lines { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.lines li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.lines .name { font-weight: 600; }
.lines .sub { font-size: 0.85rem; color: var(--muted); grid-column: 1; }
.lines .amt { font-variant-numeric: tabular-nums; grid-row: 1 / span 2; grid-column: 2; text-align: right; }
.lines .remove { font: inherit; font-size: 0.82rem; border: 0; background: none; color: var(--err); padding: 0; cursor: pointer; justify-self: start; }
.empty { color: var(--muted); font-size: 0.97rem; }
.total { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; }
.total strong { font-family: var(--display); font-size: var(--step-2); font-variant-numeric: tabular-nums; }
.paynote { font-size: 0.88rem; color: var(--muted); padding: 10px 12px; background: var(--water-soft); border-radius: 4px; }

.form { display: grid; gap: 14px; }
.field { display: grid; gap: 4px; }
.field label { font-size: 0.9rem; font-weight: 600; }
.field .hint { font-size: 0.8rem; color: var(--muted); }
.field input, .field textarea, .field select {
  font: inherit;
  font-size: 1rem;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--field-line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: 1; }
.field textarea { min-height: 80px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--water); outline-offset: 0; border-color: var(--water); }
.field [aria-invalid="true"] { border-color: var(--err); }
.field .error { font-size: 0.82rem; color: var(--err); }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
@media (max-width: 420px) { .row2 { grid-template-columns: minmax(0, 1fr); } }
.check { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; font-size: 0.9rem; }
.check input { margin-top: 5px; width: 18px; height: 18px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.status { font-size: 0.95rem; border-radius: 4px; padding: 12px 14px; }
.status.ok { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); border: 1px solid var(--ok); }
.status.bad { background: color-mix(in srgb, var(--err) 10%, var(--surface)); border: 1px solid var(--err); }
.status code { font-family: var(--screen); font-size: 1.2rem; }
[data-result]:focus { outline: none; }
[data-result]:focus-visible { outline: 2px solid var(--water); outline-offset: 2px; }
.cap-note { font-size: 0.85rem; color: var(--muted); flex-basis: 100%; }
.cap-note:empty { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.store-fallback { grid-column: 1 / -1; color: var(--muted); }
.summary-copy {
  width: 100%;
  min-height: 120px;
  font-family: ui-monospace, monospace;
  font-size: 0.82rem;
  padding: 8px;
  border: 1px solid var(--field-line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
}

/* ---------------------------------------------------------------- legal page */
.prose { padding-block: clamp(36px, 6vw, 72px); }
.prose h1 { font-size: var(--step-3); margin-bottom: 18px; }
.prose h2 { font-size: var(--step-1); margin-top: 32px; margin-bottom: 8px; font-stretch: 95%; }
.prose p, .prose li { color: var(--ink); max-width: 66ch; }
.prose ul { padding-left: 1.2em; display: grid; gap: 6px; }
.prose .muted { color: var(--muted); }
