/* ==========================================================================
   lite.css — the new pages on v2.cygm.me. The shared header and footer are in
   shell.css. Loaded after tokens.css: site colours, radii, spacing and type all
   come from the semantic tokens there. The case colours are the printed plastic
   and are set on the swatches from lite.php.

   Layout: one centred column, sections stacked with generous padding. One bold
   thing per page; everything else quiet.
   ========================================================================== */

@font-face { font-family: 'DM Sans'; src: url('/fonts/dm-sans-var.woff2') format('woff2'); font-weight: 100 1000; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/fonts/jetbrains-mono-var.woff2') format('woff2'); font-weight: 100 800; font-display: swap; }

:root { color-scheme: dark; }
[hidden] { display: none !important; }
/* Tab panels other than the first stay visible without script; with it they
   are hidden from the first paint, before lite.js takes over. */
.js [role="tabpanel"][data-alt] { display: none; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5.5rem; }
body {
  margin: 0;
  background: var(--color-page);
  color: var(--color-text);
  font: 400 var(--size-base)/var(--leading-body) var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
img { height: auto; display: block; }
a { color: var(--color-accent-2); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); border-radius: 6px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.08; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
button { font: inherit; color: inherit; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 0.5rem; left: 0.5rem; z-index: 100; background: var(--color-surface); padding: 0.5rem 1rem; border-radius: var(--radius-sm); }
.mono { font-family: var(--font-mono); }

.wrap {
  width: 100%; max-width: calc(1240px + 2 * max(24px, env(safe-area-inset-left, 0px)));
  margin-inline: auto;
  padding-left: max(24px, env(safe-area-inset-left, 0px));
  padding-right: max(24px, env(safe-area-inset-right, 0px));
}
@media (max-width: 30rem) {
  .wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
}

/* ---------- Small parts ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 48px; padding: 0.75rem 1.5rem;
  border-radius: var(--radius-button); border: 1px solid transparent;
  font: 600 var(--size-sm)/1 var(--font-body); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), box-shadow var(--dur) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--color-accent); color: var(--color-page); }
.btn-primary:hover { box-shadow: 0 0 32px 2px var(--color-glow-strong); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--color-text); border-color: color-mix(in srgb, var(--color-text) 20%, transparent); }
.btn-ghost:hover { border-color: var(--color-accent); text-decoration: none; }
.btn-sm { min-height: 38px; padding: 0.55rem 1.05rem; font-size: var(--size-xs); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.arrow-link { font-weight: 600; text-decoration: none; display: inline-flex; gap: 0.4rem; align-items: center; }
.arrow-link::after { content: "→"; transition: transform var(--dur-fast) var(--ease); }
.arrow-link:hover::after { transform: translateX(3px); }
.arrow-link:hover { text-decoration: underline; }

.tag {
  display: inline-flex; align-items: center; padding: 0.2em 0.6em; border-radius: var(--radius-pill);
  background: var(--color-wash-strong); color: var(--color-accent);
  font: 600 0.66rem/1.3 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; vertical-align: 0.15em; white-space: nowrap;
}
.tag-quiet { background: color-mix(in srgb, var(--color-text) 8%, transparent); color: var(--color-text-muted); }
.label { font: 500 var(--size-2xs)/1.4 var(--font-mono); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--color-accent); }
.lede { font-size: var(--size-lg); color: var(--color-text-muted); line-height: 1.55; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(4rem, 9vw, 7rem); }
.section-alt { background: var(--color-surface-alt); border-block: 1px solid var(--color-border); }
.head { display: grid; gap: 0.9rem; max-width: 46rem; margin-bottom: clamp(2.25rem, 4.5vw, 3.5rem); }
.head h2 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.1rem); }
.head-center { margin-inline: auto; text-align: center; justify-items: center; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { position: relative; padding-block: clamp(2.75rem, 6vw, 5rem) clamp(3.5rem, 7vw, 6rem); overflow: hidden; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(42% 52% at 74% 46%, var(--color-glow) 0%, transparent 72%),
    linear-gradient(var(--color-grid) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, var(--color-grid) 1px, transparent 1px) 0 0 / 44px 44px;
  -webkit-mask-image: linear-gradient(to bottom, black 55%, transparent);
  mask-image: linear-gradient(to bottom, black 55%, transparent);
}
.hero-in { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: clamp(2.5rem, 5vw, 4.5rem); align-items: center; }
.hero-copy { display: grid; gap: 1.5rem; justify-items: start; }
.hero h1 { font-size: clamp(2.6rem, 1.5rem + 3.4vw, 4.1rem); letter-spacing: -0.03em; line-height: 1.02; }
.hero h1 em { font-style: normal; color: var(--color-accent); }
.hero .lede { max-width: 33rem; }
.news {
  display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0.9rem 0.4rem 0.45rem;
  border-radius: var(--radius-pill); border: 1px solid var(--color-border-strong); background: var(--color-wash);
  color: var(--color-text); text-decoration: none; font-size: var(--size-sm);
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.news:hover { border-color: var(--color-accent); background: var(--color-wash-strong); }
.news .tag { background: var(--color-accent); color: var(--color-page); }
.news b { font-weight: 600; }
.checks { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; color: var(--color-text-muted); font-size: var(--size-sm); }
.checks li { display: inline-flex; align-items: center; gap: 0.5rem; }
.checks li::before { content: ""; width: 18px; height: 18px; flex: none; background: var(--glucose-ok); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Ccircle cx='9' cy='9' r='9' fill='black' fill-opacity='0.2'/%3E%3Cpath d='M5.2 9.2l2.6 2.6 5-5.6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Ccircle cx='9' cy='9' r='9' fill='black' fill-opacity='0.2'/%3E%3Cpath d='M5.2 9.2l2.6 2.6 5-5.6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
@media (max-width: 60rem) {
  .hero-in { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
  .hero .lede { max-width: none; }
  /* The model belongs on the first screen of a phone, straight after the headline. */
  .hero-copy { display: contents; }
  .hero-in > .demo { order: 2; }
  .hero-copy > .news { order: 0; justify-self: start; }
  .hero-copy > h1 { order: 1; }
  .hero-copy > .lede { order: 3; }
  .hero-copy > .btn-row { order: 4; }
  .hero-copy > .checks { order: 5; }
}

/* ==========================================================================
   The device and its live screen
   ========================================================================== */
.demo-ctl { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.5rem; min-height: 40px; padding: 0.5rem 0.95rem;
  border-radius: var(--radius-pill); border: 1px solid var(--color-border); background: var(--color-surface);
  color: var(--color-text-muted); font-size: var(--size-sm); font-weight: 600; cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.chip:hover { color: var(--color-text); border-color: var(--color-border-strong); }
.chip[aria-pressed="true"] { color: var(--color-text); border-color: var(--color-accent); background: var(--color-surface-high); }
.chip-dot { width: 9px; height: 9px; border-radius: 50%; }
.chip-ok { background: var(--glucose-ok); } .chip-hi { background: var(--glucose-high); } .chip-lo { background: var(--glucose-low); }
.units { display: inline-flex; padding: 3px; border-radius: var(--radius-pill); border: 1px solid var(--color-border); background: var(--color-surface); }
.units button { border: 0; background: transparent; color: var(--color-text-faint); padding: 0.45rem 0.8rem; min-height: 34px; border-radius: var(--radius-pill); font: 600 var(--size-xs)/1 var(--font-mono); cursor: pointer; }
.units button[aria-pressed="true"] { background: var(--color-surface-high); color: var(--color-text); }
.demo-note { color: var(--color-text-faint); font-size: var(--size-sm); min-height: 3em; }
.demo-note b { color: var(--color-text); font-weight: 600; }

/* ==========================================================================
   How it works: the path a reading takes
   ========================================================================== */
.flow-wrap { position: relative; }
.flow { list-style: none; position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem; }
.flow::before {
  content: ""; position: absolute; top: 35px; left: 12.5%; right: 12.5%; height: 2px;
  background: linear-gradient(90deg, var(--color-border-strong), color-mix(in srgb, var(--color-accent) 60%, transparent), var(--color-border-strong));
}
.flow-pulse {
  position: absolute; z-index: 2; top: 31px; left: 12.5%; width: 10px; height: 10px; border-radius: 50%;
  background: var(--color-accent); box-shadow: 0 0 14px 4px var(--color-glow-strong);
  animation: travel 4.8s cubic-bezier(.45,.05,.55,.95) infinite;
}
@keyframes travel {
  0%   { left: 12.5%; opacity: 0; }
  8%   { opacity: 1; }
  88%  { opacity: 1; }
  100% { left: calc(87.5% - 10px); opacity: 0; }
}
.flow li { position: relative; display: grid; justify-items: center; text-align: center; gap: 0.55rem; align-content: start; }
.flow-icon {
  position: relative; z-index: 1; width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center;
  background: var(--color-surface); border: 1px solid var(--color-border-strong); color: var(--color-accent);
}
.flow-icon svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.flow li:last-child .flow-icon { background: var(--color-accent); color: var(--color-page); box-shadow: 0 0 34px var(--color-glow-strong); border-color: transparent; }
.flow h3 { font-size: var(--size-lg); margin-top: 0.4rem; }
.flow p { color: var(--color-text-muted); font-size: var(--size-sm); max-width: 22ch; }
@media (max-width: 47.99rem) {
  .flow { grid-template-columns: minmax(0, 1fr); gap: 1.6rem; }
  .flow::before { top: 36px; bottom: 36px; left: 35px; right: auto; width: 2px; height: auto; background: linear-gradient(180deg, var(--color-border-strong), color-mix(in srgb, var(--color-accent) 60%, transparent), var(--color-border-strong)); }
  .flow-pulse { left: 31px; top: 36px; animation-name: travel-v; }
  @keyframes travel-v { 0% { top: 36px; opacity: 0; } 8% { opacity: 1; } 88% { opacity: 1; } 100% { top: calc(100% - 46px); opacity: 0; } }
  .flow li { grid-template-columns: 72px minmax(0, 1fr); justify-items: start; text-align: left; column-gap: 1.1rem; row-gap: 0.2rem; }
  .flow-icon { grid-row: span 2; }
  .flow h3 { margin-top: 0.7rem; }
  .flow p { max-width: none; }
}

/* The CGM picker under the flow */
.picker { margin-top: clamp(3rem, 6vw, 4.5rem); display: grid; gap: 1rem; }
.picker-q { font: 600 var(--size-lg)/1.3 var(--font-display); }
.cgm { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.85rem; }
.cgm-card {
  appearance: none; text-align: left; cursor: pointer;
  display: grid; gap: 0.3rem; padding: 1.15rem 1.25rem;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-card);
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.cgm-card:hover { border-color: var(--color-border-strong); }
.cgm-card[aria-selected="true"] { border-color: var(--color-accent); background: var(--color-surface-high); box-shadow: 0 0 0 3px var(--color-wash); }
.cgm-card strong { font: 600 var(--size-lg)/1.2 var(--font-display); }
.cgm-card span { color: var(--color-text-muted); font-size: var(--size-sm); }
.cgm-detail {
  padding: clamp(1.25rem, 3vw, 1.75rem); border-radius: var(--radius-card); background: var(--color-page); border: 1px solid var(--color-border);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem; align-items: center;
}
.cgm-detail ol { list-style: none; counter-reset: s; display: grid; gap: 0.7rem; }
.cgm-detail li { counter-increment: s; display: grid; grid-template-columns: 2rem minmax(0, 1fr); color: var(--color-text-muted); }
.cgm-detail li::before { content: counter(s); width: 1.5rem; height: 1.5rem; border-radius: 50%; display: grid; place-items: center; background: var(--color-wash-strong); color: var(--color-accent); font: 600 0.72rem/1 var(--font-mono); margin-top: 0.1rem; }
.cgm-detail li b { color: var(--color-text); font-weight: 600; }
@media (max-width: 47.99rem) { .cgm { grid-template-columns: minmax(0, 1fr); } .cgm-detail { grid-template-columns: minmax(0, 1fr); } }

/* ==========================================================================
   Who it's for
   ========================================================================== */
.tabs { display: flex; gap: 0.4rem; padding: 5px; width: fit-content; max-width: 100%; overflow-x: auto; border-radius: var(--radius-pill); background: var(--color-surface); border: 1px solid var(--color-border); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: none; border: 0; background: transparent; color: var(--color-text-muted); cursor: pointer;
  padding: 0.7rem 1.2rem; min-height: 44px; border-radius: var(--radius-pill); font-weight: 600; font-size: var(--size-sm);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.tabs button:hover { color: var(--color-text); }
.tabs button[aria-selected="true"] { background: var(--color-accent); color: var(--color-page); }
@media (max-width: 40rem) {
  .tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; border-radius: 22px; }
  .tabs button { width: 100%; }
}
.who { margin-top: 1.75rem; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.75rem, 4vw, 3.5rem); align-items: center; }
.who-photo { border-radius: 20px; overflow: hidden; aspect-ratio: 4 / 3; border: 1px solid var(--color-border); background: var(--color-surface); }
.who-photo img { width: 100%; height: 100%; object-fit: cover; }
.who-copy { display: grid; gap: 1rem; align-content: start; }
.who-copy h3 { font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.2rem); }
.who-copy > p { color: var(--color-text-muted); font-size: var(--size-lg); line-height: 1.55; }
.ticks { list-style: none; display: grid; gap: 0.65rem; margin-block: 0.25rem 0.5rem; }
.ticks li { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); color: var(--color-text); }
.ticks li::before { content: ""; width: 18px; height: 18px; margin-top: 0.2em; background: var(--color-accent); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Ccircle cx='9' cy='9' r='9' fill='black' fill-opacity='0.2'/%3E%3Cpath d='M5.2 9.2l2.6 2.6 5-5.6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Ccircle cx='9' cy='9' r='9' fill='black' fill-opacity='0.2'/%3E%3Cpath d='M5.2 9.2l2.6 2.6 5-5.6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
@media (max-width: 52rem) { .who { grid-template-columns: minmax(0, 1fr); } }

/* ==========================================================================
   Models
   ========================================================================== */
.models { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1rem, 2.5vw, 1.5rem); align-items: stretch; }
.model {
  position: relative; display: grid; grid-template-rows: auto 1fr; border-radius: 24px; overflow: hidden;
  background: var(--color-surface); border: 1px solid var(--color-border);
}
.model-plus { border-color: color-mix(in srgb, var(--color-accent) 45%, transparent); box-shadow: 0 30px 80px -40px var(--color-glow-strong); }
.model-media {
  position: relative; display: grid; align-content: end; justify-items: center; gap: 1rem;
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1.25rem, 4vw, 2.5rem) 1.25rem;
  background: radial-gradient(70% 80% at 50% 100%, var(--color-wash) 0%, transparent 70%), var(--color-surface-alt);
  border-bottom: 1px solid var(--color-border);
  min-height: 100%;
}
.model-shot { all: unset; cursor: zoom-in; display: block; width: 100%; }
.model-shot:focus-visible { outline: var(--focus-ring); outline-offset: 4px; border-radius: 18px; }
.model-plus .model-shot { max-width: 420px; }
.model-classic .model-shot { max-width: calc(420px * 0.77); }
.frame { display: block; border-radius: 16px; padding: 9px; background: linear-gradient(160deg, color-mix(in srgb, var(--color-text) 12%, var(--color-surface-high)), var(--color-page)); border: 1px solid color-mix(in srgb, var(--color-text) 10%, transparent); box-shadow: 0 24px 40px -24px var(--color-page); }
.frame img { width: 100%; border-radius: 5px; background: var(--color-page); }
.thumbs { display: flex; gap: 0.45rem; justify-content: center; flex-wrap: wrap; }
.thumbs button {
  border: 1px solid var(--color-border); background: var(--color-page); color: var(--color-text-muted);
  border-radius: var(--radius-pill); padding: 0.35rem 0.75rem; min-height: 32px; font-size: var(--size-xs); font-weight: 600; cursor: pointer;
}
.thumbs button:hover { color: var(--color-text); }
.thumbs button[aria-pressed="true"] { border-color: var(--color-accent); color: var(--color-text); }
.model-body { display: grid; gap: 1.1rem; padding: clamp(1.5rem, 3.5vw, 2.25rem); align-content: start; }
.model-name { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.model-name h3 { font-size: clamp(1.8rem, 1.4rem + 1.4vw, 2.4rem); }
.model-body > p { color: var(--color-text-muted); }
.price { display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; }
.price b { font: 700 var(--size-xl)/1 var(--font-display); }
.price span { color: var(--color-text-faint); font-size: var(--size-sm); }
.specs { display: grid; gap: 0; border-top: 1px solid var(--color-border); }
.specs div { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--color-border); font-size: var(--size-sm); }
.specs dt { color: var(--color-text-faint); }
.specs dd { margin: 0; color: var(--color-text); }
.model .btn-row { margin-top: 0.25rem; }
.size-note { margin-top: 1rem; text-align: center; color: var(--color-text-faint); font-size: var(--size-xs); }
@media (max-width: 52rem) { .models { grid-template-columns: minmax(0, 1fr); } }

.compare { margin-top: 1.75rem; border-radius: var(--radius-card); border: 1px solid var(--color-border); background: var(--color-surface); }
.compare summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.25rem; font-weight: 600;
}
.compare summary::-webkit-details-marker { display: none; }
.compare summary::after { content: "+"; color: var(--color-accent); font: 500 1.35rem/1 var(--font-mono); transition: transform var(--dur-fast) var(--ease); }
.compare[open] summary::after { transform: rotate(45deg); }
.table-scroll { overflow-x: auto; border-top: 1px solid var(--color-border); }
table { width: 100%; border-collapse: collapse; font-size: var(--size-sm); min-width: 34rem; }
th, td { text-align: left; padding: 0.85rem 1.25rem; border-bottom: 1px solid var(--color-border); vertical-align: top; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
thead th { font: 600 var(--size-base)/1.2 var(--font-display); color: var(--color-text); }
thead th:nth-child(2) { color: var(--color-accent); }
tbody th { font-weight: 500; color: var(--color-text-faint); width: 26%; }
tbody td:nth-child(2) { background: var(--color-wash); }

/* ==========================================================================
   Steps
   ========================================================================== */
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 2.5vw, 1.5rem); counter-reset: step; }
.steps > li {
  counter-increment: step; display: grid; gap: 0.75rem; align-content: start;
  padding: clamp(1.4rem, 3vw, 1.9rem); border-radius: 20px; background: var(--color-surface); border: 1px solid var(--color-border);
}
.steps > li::before {
  content: counter(step); width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--color-wash-strong); color: var(--color-accent); font: 700 1.15rem/1 var(--font-display); margin-bottom: 0.25rem;
}
.steps h3 { font-size: var(--size-xl); }
.steps p { color: var(--color-text-muted); }
.step-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; margin-top: 0.25rem; }
.soon {
  margin-top: 1.5rem; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
  padding: 1rem 1.25rem; border-radius: var(--radius-card); border: 1px dashed var(--color-border-strong); background: var(--color-wash);
}
.soon p { flex: 1 1 22rem; color: var(--color-text-muted); }
.soon b { color: var(--color-text); }
@media (max-width: 52rem) { .steps { grid-template-columns: minmax(0, 1fr); } }

/* ==========================================================================
   Trust: privacy and the story
   ========================================================================== */
.trust { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); }
.trust h2 { font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.4rem); }
.trust-col { display: grid; gap: 1.25rem; align-content: start; }
.points { list-style: none; display: grid; gap: 1.1rem; }
.points li { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); gap: 0.25rem; color: var(--color-text-muted); }
.points svg { width: 26px; height: 26px; fill: none; stroke: var(--color-accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.points b { color: var(--color-text); font-weight: 600; display: block; }
.quote { margin: 0; font: 500 clamp(1.25rem, 1.05rem + 0.8vw, 1.6rem)/1.45 var(--font-display); color: var(--color-text); letter-spacing: -0.01em; }
.quote::before { content: "“"; display: block; font-size: 3.5rem; line-height: 0.6; color: var(--color-accent); margin-bottom: 0.5rem; }
.quote-by { display: flex; align-items: center; gap: 0.9rem; color: var(--color-text-muted); font-size: var(--size-sm); }
.quote-by img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 2px solid var(--color-border-strong); }
.quote-by b { color: var(--color-text); font-weight: 600; display: block; }
@media (max-width: 52rem) { .trust { grid-template-columns: minmax(0, 1fr); } }

/* ==========================================================================
   CYGM+ page
   ========================================================================== */
.crumb { font: 500 var(--size-xs)/1 var(--font-mono); color: var(--color-text-faint); display: flex; gap: 0.5rem; }
.crumb a { color: var(--color-text-muted); text-decoration: none; }
.crumb a:hover { color: var(--color-text); }
.parts { list-style: none; display: grid; gap: 0.75rem; }
.part {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.5rem 1.5rem; align-items: center;
  padding: 1.15rem 1.35rem; border-radius: var(--radius-card); background: var(--color-surface); border: 1px solid var(--color-border);
}
.part-main { display: grid; gap: 0.3rem; }
.part-name { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; font: 600 var(--size-lg)/1.25 var(--font-display); }
.part-main p { color: var(--color-text-muted); font-size: var(--size-sm); }
.part-buy { display: flex; align-items: center; gap: 1rem; }
.part-buy b { font: 700 var(--size-lg)/1 var(--font-display); white-space: nowrap; }
.part-total { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.35rem; color: var(--color-text-muted); font-size: var(--size-sm); }
.part-total b { color: var(--color-text); font: 700 var(--size-lg)/1 var(--font-display); }
@media (max-width: 40rem) { .part { grid-template-columns: minmax(0, 1fr); } .part-buy { justify-content: space-between; } }
.warn { display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: 0.5rem; padding: 1rem 1.25rem; border-radius: var(--radius-card); background: color-mix(in srgb, var(--glucose-high) 9%, transparent); border: 1px solid color-mix(in srgb, var(--glucose-high) 30%, transparent); font-size: var(--size-sm); color: var(--color-text-muted); }
.warn svg { width: 22px; height: 22px; fill: none; stroke: var(--glucose-high); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-top: 0.1rem; }
.warn b { color: var(--color-text); }

.case { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(1.75rem, 4vw, 3.5rem); align-items: center; }
.case-tools { display: flex; flex-wrap: wrap; gap: 0.9rem 1.25rem; align-items: center; }
.case-copy { display: grid; gap: 1.25rem; align-content: start; }
.case-copy h2 { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.8rem); }
.print-specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--color-border); border: 1px solid var(--color-border); border-radius: 14px; overflow: hidden; }
.print-specs div { background: var(--color-surface); padding: 0.8rem 1rem; display: grid; gap: 0.2rem; }
.print-specs dt { font: 500 var(--size-2xs)/1.3 var(--font-mono); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--color-text-faint); }
.print-specs dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 52rem) { .case { grid-template-columns: minmax(0, 1fr); } }

.install { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 22px; padding: clamp(1.4rem, 3.5vw, 2.1rem); display: grid; gap: 1.15rem; }
.card-accent { border-color: color-mix(in srgb, var(--color-accent) 40%, transparent); box-shadow: 0 30px 70px -45px var(--color-glow-strong); }
.need { list-style: none; display: grid; gap: 0.8rem; }
.need li { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); color: var(--color-text-muted); }
.need svg { width: 22px; height: 22px; fill: none; stroke: var(--color-accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; margin-top: 0.1rem; }
.need b { color: var(--color-text); font-weight: 600; }
.check { display: grid; grid-template-columns: 1.75rem minmax(0, 1fr); gap: 0.6rem; align-items: start; cursor: pointer; padding: 0.9rem 1rem; border-radius: 14px; background: var(--color-page); border: 1px solid var(--color-border); }
.check input { width: 20px; height: 20px; margin: 0.15rem 0 0; accent-color: var(--color-accent); cursor: pointer; }
.hint { color: var(--color-text-faint); font-size: var(--size-sm); }
.notice { padding: 1rem 1.15rem; border-radius: 14px; background: color-mix(in srgb, var(--glucose-high) 9%, transparent); border: 1px solid color-mix(in srgb, var(--glucose-high) 30%, transparent); font-size: var(--size-sm); }
.after { list-style: none; counter-reset: a; display: grid; gap: 0.9rem; }
.after li { counter-increment: a; display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); color: var(--color-text-muted); }
.after li::before { content: counter(a); width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; background: var(--color-wash-strong); color: var(--color-accent); font: 600 0.75rem/1 var(--font-mono); }
.after b { color: var(--color-text); font-weight: 600; }
@media (max-width: 52rem) { .install { grid-template-columns: minmax(0, 1fr); } }

.faq { display: grid; max-width: 52rem; }
.faq details { border-top: 1px solid var(--color-border); }
.faq details:last-child { border-bottom: 1px solid var(--color-border); }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.15rem 0; font: 600 var(--size-lg)/1.3 var(--font-display); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--color-accent); font: 500 1.4rem/1 var(--font-mono); transition: transform var(--dur-fast) var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq-body { padding-bottom: 1.25rem; display: grid; gap: 0.85rem; color: var(--color-text-muted); }
.faq-body ul { padding-left: 1.2rem; display: grid; gap: 0.5rem; }
pre { margin: 0; background: var(--color-page); border: 1px solid var(--color-border); border-radius: 12px; padding: 1rem; overflow-x: auto; font: 400 var(--size-xs)/1.7 var(--font-mono); color: var(--color-text); }
.files { list-style: none; display: grid; gap: 0.3rem; font: 400 var(--size-xs)/1.6 var(--font-mono); }
.files span { color: var(--color-text-faint); }
.ver-line { color: var(--color-text-faint); font: 400 var(--size-xs)/1.6 var(--font-mono); }

/* ---------- Safety + footer ---------- */
.safety { padding-block: clamp(2.5rem, 5vw, 3.5rem); }
.safety p {
  max-width: 62rem; padding: 1.15rem 1.35rem; border-radius: 14px;
  background: color-mix(in srgb, var(--glucose-high) 7%, var(--color-surface-alt));
  border: 1px solid color-mix(in srgb, var(--glucose-high) 26%, transparent);
  font-size: var(--size-sm); color: var(--color-text-muted);
}
.safety strong { color: var(--color-text); }
/* ---------- Lightbox ---------- */
.lightbox { border: 1px solid var(--color-border-strong); border-radius: 20px; background: var(--color-surface); color: var(--color-text); padding: 1rem; width: min(92vw, 860px); max-width: none; }
.lightbox::backdrop { background: color-mix(in srgb, var(--color-page) 86%, transparent); backdrop-filter: blur(5px); }
.lightbox img { width: 100%; border-radius: 10px; }
.lightbox-cap { margin-top: 0.8rem; color: var(--color-text-muted); font-size: var(--size-sm); }
.lightbox form { display: flex; justify-content: flex-end; margin-bottom: 0.6rem; }
.lightbox-close { background: none; border: 1px solid var(--color-border); width: 38px; height: 38px; border-radius: 50%; font-size: 1.35rem; line-height: 1; cursor: pointer; }

/* ---------- Gentle entrance. Content is visible at rest; this only adds
              movement once script has run, and never for reduced motion. ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .rise { animation: rise 0.9s var(--ease) both; }
  .js .rise-2 { animation-delay: 0.08s; }
  .js .rise-3 { animation-delay: 0.16s; }
  .js .rise-4 { animation-delay: 0.24s; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .flow-pulse { display: none; }
}

/* ==========================================================================
   The stage: the CYGM+ as a 3D object, standing on the page's grid. The flat
   frame underneath is what shows before the mesh lands and where WebGL is
   missing; once the mesh is up the two cross-fade.
   ========================================================================== */
.demo { display: grid; gap: 1rem; width: 100%; min-width: 0; }
.stage {
  position: relative; width: 100%; aspect-ratio: 5 / 4; display: grid; place-items: center;
  touch-action: pan-y; cursor: grab; border-radius: 24px; outline-offset: 6px;
  isolation: isolate;
}
.stage::before {
  content: ""; position: absolute; inset: 4% 2% 0; z-index: -1; pointer-events: none;
  background: radial-gradient(50% 50% at 50% 48%, var(--color-glow-strong) 0%, transparent 72%);
}
.stage:active { cursor: grabbing; }
.stage-gl {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 0.7s var(--ease);
  /* The light on the surface must never show the canvas's rectangle. */
  -webkit-mask-image: linear-gradient(to right, transparent, black 7%, black 93%, transparent), linear-gradient(to bottom, transparent, black 5%, black 95%, transparent);
  mask-image: linear-gradient(to right, transparent, black 7%, black 93%, transparent), linear-gradient(to bottom, transparent, black 5%, black 95%, transparent);
  -webkit-mask-composite: source-in; mask-composite: intersect;
}
.stage.ready .stage-gl { opacity: 1; }
.stage.ready .device { opacity: 0; pointer-events: none; }
.stage-wrap { position: relative; }
.stage-wrap .swatches { position: absolute; right: 0.25rem; bottom: 0.25rem; }
@media (max-width: 40rem) { .stage-wrap .swatches { position: static; justify-content: center; margin-top: 0.5rem; } }
.demo .stage-hint { left: 0.25rem; transform: none; }
.stage-hint {
  position: absolute; left: 50%; bottom: 0.25rem; transform: translateX(-50%); padding: 0.3rem 0; white-space: nowrap;
  font: 500 var(--size-2xs)/1.3 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-faint);
  opacity: 0; transition: opacity var(--dur) var(--ease); pointer-events: none;
}
.stage.ready .stage-hint { opacity: 1; }
.stage.touched .stage-hint { opacity: 0; }

.device {
  position: relative; width: 84%; border-radius: clamp(14px, 2.4vw, 22px); padding: clamp(8px, 1.5vw, 14px);
  background: linear-gradient(160deg, color-mix(in srgb, var(--color-text) 14%, var(--color-surface-high)) 0%, var(--color-surface) 45%, var(--color-page) 100%);
  border: 1px solid color-mix(in srgb, var(--color-text) 12%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--color-text) 16%, transparent), 0 34px 60px -28px var(--color-page);
  transition: opacity 0.7s var(--ease);
}
.device-glass { border-radius: clamp(5px, 1vw, 9px); overflow: hidden; background: var(--color-page); line-height: 0; }
.device-glass img, .device-glass canvas { width: 100%; height: auto; aspect-ratio: 3 / 2; display: block; }

.swatches { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.swatches button { width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 2px solid var(--color-page); box-shadow: 0 0 0 1px var(--color-border-strong); background: var(--sw); cursor: pointer; transition: box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
.swatches button:hover { transform: scale(1.08); }
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--color-accent); }
.seg { display: inline-flex; padding: 3px; border-radius: var(--radius-pill); border: 1px solid var(--color-border); background: var(--color-surface); }
.seg button { border: 0; background: transparent; color: var(--color-text-muted); padding: 0.45rem 0.9rem; min-height: 36px; border-radius: var(--radius-pill); font: 600 var(--size-xs)/1 var(--font-body); cursor: pointer; }
.seg button:hover { color: var(--color-text); background: var(--color-hover-veil); }

/* The CYGM+ page's hero: the model first, centred, at the largest size that still
   leaves the headline and controls on one screen. */
.plus-hero { position: relative; padding-block: clamp(2rem, 4vw, 3.5rem) clamp(3rem, 6vw, 5rem); overflow: hidden; isolation: isolate; text-align: center; }
.plus-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(var(--color-grid) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, var(--color-grid) 1px, transparent 1px) 0 0 / 44px 44px;
  -webkit-mask-image: linear-gradient(to bottom, black 55%, transparent);
  mask-image: linear-gradient(to bottom, black 55%, transparent);
}
.plus-hero h1 { font-size: clamp(2.6rem, 1.5rem + 3.4vw, 4.1rem); letter-spacing: -0.03em; line-height: 1.02; }
.plus-hero h1 em { font-style: normal; color: var(--color-accent); }
.plus-hero .lede { max-width: 42rem; margin: 1rem auto 0; }
.plus-hero .crumb { justify-content: center; margin-bottom: 1rem; }
.plus-hero .stage { aspect-ratio: 16 / 9; max-width: 980px; max-height: 52vh; margin: 0.5rem auto 0; }
.plus-hero .btn-row, .plus-hero .checks { justify-content: center; }
.plus-hero .btn-row { margin-top: 1.5rem; }
.plus-hero .checks { margin-top: 1.25rem; }
.stage-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.75rem 1.25rem; margin-top: 0.25rem; }
@media (max-width: 40rem) { .plus-hero .stage { aspect-ratio: 5 / 4; } }

/* The socket warning stays large: plugging a battery into the speaker socket destroys
   the amplifier, and this is the one thing on the page that can break the hardware. */
.warn-big {
  display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); gap: 0.75rem; margin-top: 1.25rem; padding: 1.25rem 1.5rem;
  border-radius: var(--radius-card); border: 2px solid var(--glucose-high); background: var(--color-surface);
  font-size: var(--size-lg); line-height: 1.45; font-weight: 700; color: var(--color-text);
}
.warn-big b { display: block; font-size: var(--size-xl); color: var(--glucose-high); margin-bottom: 0.25rem; }
.warn-big svg { width: 34px; height: 34px; fill: none; stroke: var(--glucose-high); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ==========================================================================
   The device map. A dark world map at page scale; the homepage holds it as a band
   and /map/ gives it the whole screen with the list of cities beside it.
   ========================================================================== */
.map-canvas { width: 100%; height: 100%; min-height: 20rem; background: var(--color-surface-alt); }
.map-band { position: relative; border-radius: 24px; overflow: hidden; border: 1px solid var(--color-border); height: clamp(22rem, 52vw, 34rem); }
.map-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem 2rem; margin-bottom: clamp(1.5rem, 3vw, 2.25rem); }
.map-head h2 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.1rem); }
.map-head .lede { margin-top: 0.75rem; max-width: 40rem; }
.map-figure { font-variant-numeric: tabular-nums; color: var(--color-accent); }
.map-note { margin-top: 1rem; color: var(--color-text-faint); font-size: var(--size-sm); max-width: 62ch; }

.map-page { display: grid; grid-template-columns: minmax(19rem, 23rem) minmax(0, 1fr); height: calc(100dvh - 67px); min-height: 34rem; }
.map-side { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; min-height: 0; background: var(--color-surface-alt); border-right: 1px solid var(--color-border); }
.map-side-head { padding: clamp(1.25rem, 2.5vw, 1.75rem); border-bottom: 1px solid var(--color-border); display: grid; gap: 0.5rem; }
.map-side-head h1 { font-size: clamp(1.75rem, 1.4rem + 1vw, 2.25rem); }
.map-side-head p { color: var(--color-text-muted); font-size: var(--size-sm); }
.map-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--color-border); border-bottom: 1px solid var(--color-border); }
.map-stats div { background: var(--color-surface-alt); padding: 0.9rem 1.25rem; }
.map-stats b { display: block; font: 700 var(--size-xl)/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.map-stats span { color: var(--color-text-faint); font-size: var(--size-xs); }
.map-list { list-style: none; flex: 1; min-height: 0; overflow-y: auto; padding: 0.4rem; scrollbar-width: thin; scrollbar-color: var(--color-border-strong) transparent; }
.map-list button {
  width: 100%; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.6rem 0.85rem; min-height: 40px;
  background: none; border: 0; border-radius: var(--radius-sm); color: var(--color-text-muted); text-align: left; cursor: pointer; font-size: var(--size-sm);
}
.map-list button:hover, .map-list button[aria-pressed="true"] { background: var(--color-hover-veil); color: var(--color-text); }
.map-list b { font: 600 var(--size-xs)/1 var(--font-mono); color: var(--color-accent); font-variant-numeric: tabular-nums; }
.map-side-foot { padding: 1rem 1.25rem; border-top: 1px solid var(--color-border); color: var(--color-text-faint); font-size: var(--size-xs); line-height: 1.5; }
.map-main { grid-column: 2; grid-row: 1; position: relative; min-width: 0; }
.map-main .map-canvas { position: absolute; inset: 0; }
.map-reset { position: absolute; top: 0.75rem; right: 0.75rem; z-index: 500; background: var(--color-surface); }
@media (max-width: 56rem) {
  .map-page { grid-template-columns: minmax(0, 1fr); height: auto; }
  .map-side, .map-main { grid-column: 1; grid-row: auto; }
  .map-main { height: 58dvh; min-height: 22rem; }
  .map-side { border-right: 0; }
  .map-list { overflow: visible; }
}

.print { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(1.75rem, 4vw, 3.5rem); align-items: start; }
@media (max-width: 52rem) { .print { grid-template-columns: minmax(0, 1fr); } }

/* A build page's own hero, smaller than a product page's. */
.page-hero { position: relative; padding-block: clamp(2rem, 4vw, 3.5rem) clamp(2.5rem, 5vw, 4rem); overflow: hidden; isolation: isolate; }
.page-hero h1 { font-size: clamp(2.6rem, 1.5rem + 3.4vw, 4.1rem); letter-spacing: -0.03em; line-height: 1.02; margin-top: 1rem; }
.page-hero h1 em { font-style: normal; color: var(--color-accent); }
.page-hero .lede { max-width: 44rem; margin-top: 1rem; }
.page-hero .btn-row { margin-top: 1.5rem; }
.case .stage { aspect-ratio: 4 / 3; }
.case .stage-tools { justify-content: flex-start; margin-top: 0.75rem; }
.model-wide { grid-template-rows: none; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.model-wide .model-shot { max-width: 520px; }
.model-wide .model-media { border-bottom: 0; border-right: 1px solid var(--color-border); align-content: center; }
@media (max-width: 52rem) {
  .model-wide { grid-template-columns: minmax(0, 1fr); }
  .model-wide .model-media { border-right: 0; border-bottom: 1px solid var(--color-border); }
}
/* The way to the original: deliberately quieter than the CYGM+ link beside it. */
.legacy-link { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--color-text-muted); font-weight: 500; text-decoration: none; }
.legacy-link:hover { color: var(--color-text); text-decoration: underline; }
.model-classic .btn-ghost { color: var(--color-text-muted); }

/* Small pieces added to the homepage. */
.tool-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin-top: 1.5rem; align-items: baseline; }
.tool-links span { color: var(--color-text-faint); font-size: var(--size-sm); }
