/* ============================================================
   Soundbites (HTML5) — Kiwrious brand
   Palette from cdn.kiwrious.info/css/theme.css
   ============================================================ */

@font-face { font-family: 'Aglet Sans'; src: url('../assets/fonts/AgletSans-Regular.otf') format('opentype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Aglet Sans'; src: url('../assets/fonts/AgletSans-Bold.otf') format('opentype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Aglet Sans'; src: url('../assets/fonts/AgletSans-Black.otf') format('opentype'); font-weight: 900; font-display: swap; }
@font-face { font-family: 'Ballinger'; src: url('../assets/fonts/Ballinger_Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }

:root {
  --kw-orange: #f85708;
  --kw-orange-hover: #ff671c;
  --kw-orange-active: #e54b00;
  --kw-yellow: #f6aa0a;          /* Soundbites mark */
  --kw-pink: #ff006e;            /* end stop of the Kiwrious logo gradient */
  --kw-teal: #005766;
  --kw-teal-deep: #12333d;
  --kw-ink: #0b2228;
  --kw-mint: #4fd7cf;
  --kw-aqua: #00aba1;

  --text: #eef4f5;
  --text-muted: #9fb6bb;
  --line: rgba(255, 255, 255, 0.09);
  --card: rgba(255, 255, 255, 0.045);
  --card-strong: rgba(255, 255, 255, 0.07);

  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 24px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  --brand-gradient: linear-gradient(120deg, var(--kw-yellow), var(--kw-orange) 55%, var(--kw-pink));

  --font: 'Aglet Sans', 'aglet-sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Ballinger', 'Aglet Sans', system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
}

* { box-sizing: border-box; }

/* No rubber-band overscroll, top or bottom. The page scrolls inside <body>
   rather than the window: browsers honour overscroll-behavior on an element
   scroller at both ends, while the root scroller still bounces in places.
   The dark html background covers any edge a browser reveals anyway. */
html {
  -webkit-text-size-adjust: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--kw-ink);
  overscroll-behavior: none;
}
body {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: none;
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 85% -10%, rgba(0, 171, 161, 0.22), transparent 60%),
    radial-gradient(900px 600px at -10% 30%, rgba(248, 87, 8, 0.12), transparent 60%),
    linear-gradient(180deg, var(--kw-teal-deep) 0%, var(--kw-ink) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--kw-mint); }
a:hover { color: #7ce6e0; }
:focus-visible { outline: 3px solid var(--kw-mint); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

h1, h2, h3 { font-weight: 900; line-height: 1.08; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: clamp(28px, 3.4vw, 40px); margin-bottom: 20px; }
h3 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }

.eyebrow {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--kw-mint);
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px var(--gutter);
  background: rgba(11, 34, 40, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.topbar__spacer { flex: 1; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand__icon { display: block; filter: drop-shadow(0 2px 6px rgba(248, 87, 8, 0.35)); }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name { font-weight: 900; font-size: 21px; color: #fff; }
.brand__note { color: var(--kw-yellow); margin-left: 2px; }
.brand__by { font-size: 12px; color: var(--text-muted); letter-spacing: 0.04em; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font: 700 14px var(--font);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.status:hover { background: var(--card-strong); border-color: rgba(255, 255, 255, 0.2); }
/* Idle = the Connect call to action, in theme orange */
.status[data-state='idle'],
.status[data-state='connecting'] {
  background: var(--kw-orange);
  border-color: var(--kw-orange);
  color: #fff;
  box-shadow: 0 6px 18px rgba(248, 87, 8, 0.35);
}
.status[data-state='idle']:hover { background: var(--kw-orange-hover); border-color: var(--kw-orange-hover); box-shadow: 0 8px 24px rgba(248, 87, 8, 0.5); }
.status[data-state='idle']:active { background: var(--kw-orange-active); }
.status[data-state='idle'] .status__dot { background: #fff; }
.status:disabled,
.status[data-state='idle']:disabled { background: #5c6b6f; border-color: #5c6b6f; box-shadow: none; opacity: 0.7; cursor: not-allowed; }
.status { white-space: nowrap; flex: none; }
.status__dot { width: 9px; height: 9px; border-radius: 50%; background: #6c8085; }
.status[data-state='connecting'] .status__dot { background: var(--kw-yellow); animation: pulse 1s infinite; }
.status[data-state='live'] { border-color: rgba(79, 215, 207, 0.5); }
.status[data-state='live'] .status__dot { background: var(--kw-mint); box-shadow: 0 0 0 4px rgba(79, 215, 207, 0.2); }
.status[data-state='demo'] .status__dot { background: var(--kw-orange); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 999px;
  border: 0;
  font: 700 17px var(--font);
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, color 0.2s, border-color 0.2s;
}
.btn svg { width: 20px; height: 20px; fill: currentColor; }
.btn--primary {
  color: #fff;
  background: var(--kw-orange);
  box-shadow: 0 8px 24px rgba(248, 87, 8, 0.35);
}
.btn--primary:hover { background: var(--kw-orange-hover); box-shadow: 0 10px 32px rgba(248, 87, 8, 0.5); }
.btn--primary:active { background: var(--kw-orange-active); }
.btn--primary:disabled { background: #5c6b6f; box-shadow: none; cursor: not-allowed; }
.btn--ghost {
  color: var(--text);
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
}
.btn--ghost:hover { border-color: var(--kw-mint); color: var(--kw-mint); background: rgba(79, 215, 207, 0.06); }

/* ---------- Home ---------- */
.home, .player { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }

.hero {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  padding: clamp(24px, 4vh, 48px) 0;
}
.hero h1 { font-size: clamp(46px, 7vw, 86px); margin-bottom: 22px; }
.hero h1 em {
  font-style: normal;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lead { font-size: clamp(17px, 1.5vw, 19px); color: #cfe0e2; max-width: 34em; margin: 0 0 28px; }
.notice {
  margin: 18px 0 0;
  padding: 12px 16px;
  border-radius: var(--radius-s);
  background: rgba(246, 170, 10, 0.1);
  border: 1px solid rgba(246, 170, 10, 0.35);
  color: #ffe2a6;
  font-size: 15px;
}
.hero__art { margin: 0; }
.scene { display: block; width: 100%; height: auto; overflow: visible; }

/* Illustration styling */
.scene .cable { fill: none; stroke: #59666d; stroke-width: 6; stroke-linecap: round; }
.scene .usb-tag rect { fill: rgba(255, 255, 255, 0.08); stroke: rgba(255, 255, 255, 0.18); }
.scene .usb-tag text { fill: var(--text-muted); font: 700 13px var(--font); text-anchor: middle; }
.wire { fill: none; stroke-width: 4; stroke-linecap: round; }
.wire--a { stroke: var(--kw-orange); }
.wire--b { stroke: var(--kw-mint); }
.scene .clip--a rect { fill: var(--kw-orange); }
.scene .clip--b rect { fill: var(--kw-mint); }
.scene .bowl-shine { fill: none; stroke: rgba(255, 255, 255, 0.35); stroke-width: 6; stroke-linecap: round; }
.current {
  fill: none;
  stroke: #fff6c8;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 2 10;
  animation: flow 0.9s linear infinite;
  filter: drop-shadow(0 0 4px rgba(255, 246, 200, 0.9));
}
.scene .sensor { filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.45)); }
.scene .sensor__led { fill: var(--kw-mint); animation: blink 1.4s infinite; }
.scene .chip rect { fill: rgba(11, 34, 40, 0.88); stroke: rgba(79, 215, 207, 0.55); }
.scene .chip text { fill: var(--text); font: 700 13px var(--font); text-anchor: middle; }
.scene .chip__us { fill: var(--kw-mint); }
.scene .chip__hz { fill: var(--kw-yellow); }
.scene .waves path { fill: none; stroke: var(--kw-yellow); stroke-width: 4; stroke-linecap: round; opacity: 0; animation: wave 2.4s ease-out infinite; }
.scene .waves path:nth-child(2) { animation-delay: 0.3s; }
.scene .waves path:nth-child(3) { animation-delay: 0.6s; }
.scene .note { fill: var(--kw-yellow); font: 900 34px var(--font); animation: float 3.6s ease-in-out infinite; }
.scene .n2 { fill: #fff; animation-delay: 0.9s; font-size: 30px; }
.scene .n3 { fill: var(--kw-mint); animation-delay: 1.8s; }
.scene .n4 { fill: var(--kw-orange); animation-delay: 2.6s; font-size: 28px; }

/* ---------- Sections ---------- */
.section { padding: clamp(24px, 4vh, 48px) 0; }

/* Home groups. app.js packs consecutive groups into screens that fit the
   viewport, gives each group a min-height that spreads the leftover space
   evenly, and marks the first group of each screen with .screen (the ↑/↓
   stops). Content is centred inside the height it gets. */
.group { scroll-margin-top: var(--bar-h, 66px); }
.hero.group { align-content: center; }
.section.group { display: flex; flex-direction: column; justify-content: center; }
.group > .footer { padding-top: clamp(12px, 2vh, 24px); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step {
  position: relative;
  padding: 26px 24px 24px;
  border-radius: var(--radius-l);
  background: var(--card);
  border: 1px solid var(--line);
  transition: border-color 0.2s, background 0.2s;
}
.step:hover { border-color: rgba(79, 215, 207, 0.35); background: var(--card-strong); }
.step p { margin: 0; color: var(--text-muted); font-size: 16px; }
.step__num {
  position: absolute;
  top: 20px;
  right: 22px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: #fff;
  font-weight: 900;
}
.step__art { width: 140px; height: 105px; display: block; margin-bottom: 14px; }
.step__art .arrow { fill: none; stroke: var(--text-muted); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.step__art .wave-line { fill: none; stroke: var(--kw-yellow); stroke-width: 3.5; stroke-linecap: round; }
.step__mono { fill: var(--kw-mint); font: 900 24px var(--font); }
.step__note { fill: var(--kw-yellow); font: 900 22px var(--font); }

/* Mapping */
.mapping__intro {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 12px clamp(24px, 4vw, 56px);
  align-items: start;
  margin-bottom: clamp(14px, 2.4vh, 28px);
}
.mapping__intro h2 { margin: 0; }
.mapping__intro p { color: #cfe0e2; margin: 0; }
.mapping__intro strong { color: #fff; }

/* Pipeline spans the full width; pills share the row evenly. */
.pipeline { display: flex; flex-wrap: nowrap; align-items: stretch; gap: 10px; margin: 0 0 clamp(12px, 2vh, 20px); }
.pipe {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12px 16px;
  border-radius: var(--radius-m);
  background: rgba(79, 215, 207, 0.08);
  border: 1px solid rgba(79, 215, 207, 0.28);
}
.pipe--out { background: rgba(246, 170, 10, 0.08); border-color: rgba(246, 170, 10, 0.35); }
.pipe__k { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.pipe__v { font-weight: 700; font-size: 18px; color: #fff; white-space: nowrap; }
.pipe__arrow { align-self: center; color: var(--text-muted); font-weight: 700; }

/* Chart and examples side by side, stretched to the same height. */
.mapping__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}
.examples-card {
  display: flex;
  flex-direction: column;
  padding: 18px 22px;
  border-radius: var(--radius-l);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.examples-card .examples { flex: 1; }
.formula {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  margin: 0 0 14px;
  font-size: 15px;
  padding: 12px 16px;
  border-radius: var(--radius-s);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
  color: var(--kw-yellow);
  overflow-x: auto;
}
.examples { width: 100%; border-collapse: collapse; font-size: 15px; }
.examples th { text-align: left; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); font-weight: 700; padding: 0 0 8px; }
.examples td { padding: 8px 0; font-variant-numeric: tabular-nums; }
.examples td:nth-child(2) { color: var(--kw-yellow); font-weight: 700; }
.examples td:nth-child(3) { color: var(--kw-mint); }

.chart-card {
  margin: 0;
  padding: 18px 18px 14px;
  border-radius: var(--radius-l);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.chart-card figcaption { margin-top: 8px; font-size: 14px; color: var(--text-muted); text-align: center; }
.map-chart { display: block; width: 100%; height: auto; }
.mc-grid line { stroke: rgba(255, 255, 255, 0.07); }
.mc-tick { fill: var(--text-muted); font: 400 12px var(--font); }
.mc-tick--x { text-anchor: middle; }
.mc-tick--y { text-anchor: end; }
.mc-axis { fill: #cfe0e2; font: 700 13px var(--font); text-anchor: middle; }
.mc-area { fill: rgba(248, 87, 8, 0.12); }
.mc-line { fill: none; stroke: var(--kw-orange); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.mc-guide { stroke: var(--kw-mint); stroke-width: 1.5; stroke-dasharray: 4 4; }
.mc-dot { fill: var(--kw-mint); stroke: #fff; stroke-width: 3; }
.mc-label { fill: #fff; font: 700 14px var(--font); paint-order: stroke; stroke: var(--kw-ink); stroke-width: 4px; }

/* Tips + footer */
.tip-list { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.tip {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 4px 18px;
  align-items: start;
  padding: 22px 24px;
  border-radius: var(--radius-l);
  background: var(--card);
  border: 1px solid var(--line);
  transition: border-color 0.2s, background 0.2s;
}
.tip:hover { border-color: rgba(79, 215, 207, 0.35); background: var(--card-strong); }
.tip__icon {
  grid-row: 1 / span 2;
  width: 44px;
  height: 44px;
  padding: 10px;
  box-sizing: content-box;
  border-radius: var(--radius-m);
  background: rgba(79, 215, 207, 0.1);
  fill: none;
  stroke: var(--kw-mint);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tip:nth-child(2) .tip__icon, .tip:nth-child(4) .tip__icon { background: rgba(246, 170, 10, 0.1); stroke: var(--kw-yellow); }
.tip h3 { margin: 0; }
.tip p { margin: 0; color: var(--text-muted); font-size: 16px; }
.tip em { color: #fff; }

/* Last screen: tips centred in the space, credit line pinned to the bottom. */
.tips.group > h2 { margin-top: auto; }
.tips.group > .footer { margin-top: auto; }
.footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 28px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* ---------- Player ---------- */
.player { padding-top: clamp(24px, 4vw, 48px); padding-bottom: 48px; display: grid; gap: 20px; }
.readout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 24px;
  align-items: center;
  padding: clamp(20px, 3vw, 32px);
  border-radius: var(--radius-l);
  background: linear-gradient(140deg, rgba(0, 87, 102, 0.55), rgba(11, 34, 40, 0.6));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.hz {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(64px, 10vw, 128px);
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hz__unit { font-size: 0.32em; margin-left: 10px; -webkit-text-fill-color: var(--text-muted); color: var(--text-muted); }
.readout__meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; }
.meta-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.meta-pill__k { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.meta-pill--state { color: var(--text-muted); }
.meta-pill--state[data-open='true'] { color: var(--kw-ink); background: var(--kw-mint); border-color: var(--kw-mint); }
.scope { width: 100%; height: 200px; display: block; border-radius: var(--radius-m); background: rgba(0, 0, 0, 0.28); }

.controls {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  gap: 18px 28px;
  align-items: center;
  padding: 20px 24px;
  border-radius: var(--radius-l);
  background: var(--card);
  border: 1px solid var(--line);
}
.control { display: flex; flex-direction: column; gap: 8px; }
.control__label { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.control--range input { width: 100%; accent-color: var(--kw-orange); }
#demo-control { grid-column: 1 / -1; }
.demo-hint { color: var(--text-muted); }

.segmented { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); flex-wrap: wrap; }
.segmented button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font: 700 14px var(--font);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.segmented button svg { width: 26px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.segmented button:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.segmented button[aria-checked='true'] { background: var(--kw-orange); color: #fff; }

.control--toggle { flex-direction: row; align-items: center; gap: 12px; cursor: pointer; font-weight: 700; }
.control--toggle small { color: var(--text-muted); font-weight: 400; }
.control--toggle input { position: absolute; opacity: 0; pointer-events: none; }
.switch { position: relative; flex: none; width: 44px; height: 26px; border-radius: 999px; background: rgba(255, 255, 255, 0.15); transition: background 0.2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left 0.2s; }
.control--toggle input:checked + .switch { background: var(--kw-mint); }
.control--toggle input:checked + .switch::after { left: 21px; }
.control--toggle input:focus-visible + .switch { outline: 3px solid var(--kw-mint); outline-offset: 3px; }

.chart-card--live { padding: 18px; }
.chart-card--live .map-chart { max-width: 760px; margin: 0 auto; }
.player__back { margin: 0; text-align: center; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 20;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: var(--radius-m);
  background: #fff;
  color: var(--kw-ink);
  font-weight: 700;
  box-shadow: var(--shadow);
}

/* ---------- Motion ---------- */
@keyframes pulse { 50% { opacity: 0.35; } }
@keyframes blink { 50% { opacity: 0.25; } }
@keyframes flow { to { stroke-dashoffset: -24; } }
@keyframes float {
  0% { transform: translateY(0); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translateY(-70px); opacity: 0; }
}
@keyframes wave { 0% { opacity: 0; } 30% { opacity: 0.9; } 100% { opacity: 0; } }
.scene .note { transform-box: fill-box; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .scene .note, .scene .waves path { opacity: 1; }
}

/* ---------- Responsive ---------- */
/* Set-up groups tighten with viewport height so "How it works" and
   "Before you plug in" can share one screen on short laptop displays. */
@media (min-width: 901px) {
  .section { padding: clamp(14px, 3vh, 48px) 0; }
  .section h2 { font-size: clamp(26px, 4.4vh, 40px); margin-bottom: clamp(10px, 2.2vh, 20px); }
  /* Cards take a set share of the screen height (not all of it), so each
     group keeps clear space above and below; content centred inside. */
  .group > .steps { flex: none; min-height: min(60vh, 620px); }
  .group > .tip-list { flex: none; min-height: min(54vh, 560px); }
  .step { display: flex; flex-direction: column; justify-content: center; }
  .tip { align-content: center; }
  .tip-list { grid-auto-rows: 1fr; }
  /* Cards scale with screen height: compact on short laptops, roomy on tall screens. */
  .steps { gap: clamp(14px, 2vh, 28px); }
  .step { padding: clamp(14px, 3.4vh, 44px) clamp(20px, 2vw, 32px); }
  .step__num { width: clamp(30px, 4vh, 42px); height: clamp(30px, 4vh, 42px); top: clamp(14px, 2.6vh, 28px); right: clamp(16px, 2.6vh, 28px); }
  .step__art { height: clamp(64px, 22vh, 240px); width: auto; margin-bottom: clamp(8px, 2vh, 22px); }
  .step h3 { font-size: clamp(18px, 3vh, 30px); margin-bottom: clamp(4px, 1vh, 10px); }
  .step p { font-size: clamp(15px, 2.3vh, 21px); line-height: 1.5; }
  .tip-list { gap: clamp(12px, 2vh, 24px); }
  .tip { padding: clamp(16px, 3.4vh, 40px) clamp(18px, 2vw, 32px); gap: clamp(4px, 0.8vh, 10px) clamp(14px, 1.6vw, 24px); }
  .tip__icon { width: clamp(30px, 6vh, 64px); height: clamp(30px, 6vh, 64px); padding: clamp(8px, 1.3vh, 14px); }
  .tip h3 { font-size: clamp(18px, 3vh, 30px); }
  .tip p { font-size: clamp(15px, 2.3vh, 21px); line-height: 1.5; }
}

/* Desktop: the mapping screen is exactly one screen tall, and the chart and
   example table take whatever height is left after the intro and strip, so
   the whole block fits without scrolling on short laptop screens too. */
@media (min-width: 901px) and (min-height: 540px) {
  .mapping.group { height: calc(100dvh - var(--bar-h, 66px)); min-height: 0 !important; }
  .mapping__intro p { font-size: clamp(14px, 2.1vh, 17px); }
  .mapping__intro h2 { font-size: clamp(26px, 4.4vh, 40px); }
  .pipe { padding: clamp(6px, 1.2vh, 12px) 16px; }
  .pipe__v { font-size: clamp(15px, 2.2vh, 18px); }
  .mapping__grid { flex: 1 1 0; min-height: 0; }
  .mapping .chart-card { display: flex; flex-direction: column; min-height: 0; padding: clamp(10px, 1.8vh, 18px); }
  .mapping .chart-card .map-chart { flex: 1 1 0; min-height: 0; height: 100%; }
  .mapping .chart-card figcaption { margin-top: 4px; }
  .examples-card { min-height: 0; overflow: hidden; padding: clamp(10px, 1.8vh, 18px) 22px; }
  .examples-card .formula { margin-bottom: clamp(6px, 1.2vh, 14px); padding: clamp(6px, 1.2vh, 12px) 16px; }
  .examples { font-size: clamp(13px, 1.9vh, 15px); }
  .examples td { padding: clamp(2px, 0.9vh, 8px) 0; }
}

@media (max-width: 900px) {
  .hero, .mapping__intro, .mapping__grid { grid-template-columns: 1fr; }
  /* Narrow screens: keep the strip on one line and let it scroll sideways. */
  .pipeline { overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .pipe { flex: 0 0 auto; }
  .hero__art { order: -1; max-width: 560px; margin: 0 auto; width: 100%; }
  .steps { grid-template-columns: 1fr; }
  .readout { grid-template-columns: 1fr; }
  .controls { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .tip-list { grid-template-columns: 1fr; }
  .brand__by { display: none; }
  .status { padding: 8px 12px; font-size: 13px; }
  .scope { height: 150px; }
}
