/* Omniocular — a field-kit landing page.
 * Loads after /shared/base.css. Flat specificity: one class per selector where possible.
 * Palette: bone, ink, slate, case orange, BLE blue (link graphic only). Light scheme.
 * Motion contract: default CSS is the final state. page.js adds html.js, then classes that
 * hide-then-reveal; without JS or under reduced motion, everything is simply there. */

:root {
  color-scheme: light;
  --bone: #EFEDE6;
  --paper: #F6F4EE;   /* raised bone */
  --ink: #15171A;
  --slate: #2B2F33;
  --slate-2: #20242a;
  --orange: #FF6A00;
  --ble: #0082FC;
  --edge: #D8D4C8;    /* hairline on bone */
  --dim: #5A5E62;     /* muted ink */
  --dim-dark: #9AA0A6;
  --focus-ring: #15171A;
  --selection-bg: #FF6A00;
  --selection-fg: #15171A;
  --max-w: 1120px;
  --phone-w: 272px; /* replica + its stage column; narrower and the AP rows wrap */
  --r-panel: 12px;  /* outer panels and grids */
  --r-inner: 8px;   /* rows and inner panels */
  --r-ctl: 6px;     /* buttons and chips */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --disp: "Barlow Condensed", system-ui, sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* tint the shared shell + footer for this page */
  --shell-bg: var(--slate);
  --shell-fg: var(--bone);
  --footer-bg: var(--slate);
  --footer-fg: var(--bone);
}

body { background: var(--bone); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.6; }

/* Focus: the ink ring is invisible on the dark surfaces (strip, dark bands, footer),
   so switch the ring to orange there for a visible WCAG-compliant focus indicator. */
.band--dark, .band--ethics, .band--access, .aer-strip, .aer-footer { --focus-ring: var(--orange); }

/* ---------- page nav ---------- */
.pagenav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bone) 92%, transparent); backdrop-filter: saturate(1.1) blur(6px); border-bottom: 1px solid var(--edge); }
.pagenav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.pagenav__brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; font-family: var(--disp); font-weight: 700; font-size: 1.4rem; letter-spacing: 0.01em; }
.pagenav__mark { display: inline-flex; }
.pagenav__menu { display: flex; align-items: center; gap: 4px; }
.pagenav__menu a { text-decoration: none; font-weight: 500; font-size: 1rem; padding: 10px 12px; border-radius: 4px; background: linear-gradient(var(--orange), var(--orange)) 12px calc(100% - 7px) / 0 2px no-repeat; transition: background-size 220ms var(--ease); }
.pagenav__menu a:hover { background-size: calc(100% - 24px) 2px; }
.pagenav__actions { display: flex; align-items: center; gap: 10px; }
.pagenav__cta { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border-radius: var(--r-ctl); background: var(--orange); color: var(--ink); font-family: var(--disp); font-weight: 700; font-size: 1.02rem; letter-spacing: 0.01em; text-decoration: none; white-space: nowrap; box-shadow: inset 0 0 0 2px var(--ink); transition: box-shadow 140ms var(--ease), transform 140ms var(--ease); }
.pagenav__cta:hover { transform: translateY(-1px); box-shadow: inset 0 0 0 2px var(--ink), 3px 3px 0 var(--ink); }
.pagenav__cta:active { transform: translateY(1px); box-shadow: inset 0 0 0 2px var(--ink); }
.pagenav__toggle { display: none; width: 44px; height: 44px; border: 2px solid var(--ink); border-radius: var(--r-ctl); background: var(--paper); flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.pagenav__toggle span { width: 20px; height: 2px; background: var(--ink); transition: transform 180ms var(--ease); }
.pagenav__toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.pagenav__toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
/* reading progress: a thin orange rule under the nav that fills as you scroll (scroll-linked, no script) */
@supports (animation-timeline: scroll()) {
  .pagenav::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 100%; height: 2px; background: var(--orange); transform-origin: left; transform: scaleX(0); animation: progress linear both; animation-timeline: scroll(root); pointer-events: none; }
  @keyframes progress { to { transform: scaleX(1); } }
}

@media (max-width: 820px) {
  .pagenav__toggle { display: flex; }
  .pagenav__menu { position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 0; background: var(--bone); border-bottom: 2px solid var(--ink); padding: 6px var(--gutter) 14px; }
  .pagenav__menu[hidden] { display: none; }
  .pagenav__menu a { padding: 14px 8px; min-height: 48px; border-bottom: 1px solid var(--edge); border-radius: 0; font-size: 1.05rem; background: none; }
}
@media (min-width: 821px) { .pagenav__menu[hidden] { display: flex; } }
/* keep the primary CTA beside the toggle on small phones: trim both so the row
   fits at 360px even before Barlow Condensed loads (wider fallback metrics). */
@media (max-width: 480px) {
  .pagenav .wrap { gap: 6px; }
  .pagenav__brand { font-size: 1.1rem; gap: 6px; }
  .pagenav__mark svg { width: 22px; height: 22px; }
  .pagenav__actions { gap: 7px; }
  .pagenav__cta { min-height: 44px; padding: 6px 10px; font-size: 0.85rem; }
}

/* ---------- shared heading + button idioms ---------- */
.band[id] { scroll-margin-top: 61px; }
.h2 { font-family: var(--disp); font-weight: 700; font-size: clamp(1.7rem, 3.4vw, 2.5rem); line-height: 1.04; letter-spacing: 0.005em; text-wrap: balance; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 22px; font-family: var(--disp); font-weight: 700; font-size: 1.15rem; letter-spacing: 0.02em; text-decoration: none; border-radius: var(--r-ctl); transition: transform 140ms var(--ease), box-shadow 140ms var(--ease), background 140ms var(--ease); }
.btn--primary { background: var(--orange); color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn--primary:hover, .btn--ghost:hover { transform: translateY(-1px); box-shadow: inset 0 0 0 2px var(--ink), 4px 4px 0 var(--ink); }
.btn--ghost:hover { background: var(--paper); }
.btn:active { transform: translateY(1px); box-shadow: inset 0 0 0 2px var(--ink); }
.band--dark .btn--ghost, .band--access .btn--ghost, .band--ethics .btn--ghost { color: var(--bone); box-shadow: inset 0 0 0 2px var(--bone); }
.band--dark .btn--ghost:hover, .band--access .btn--ghost:hover { background: transparent; box-shadow: inset 0 0 0 2px var(--bone), 4px 4px 0 var(--orange); }

code { font-family: var(--mono); font-size: 0.86em; background: color-mix(in srgb, var(--ink) 7%, transparent); padding: 1px 5px; border-radius: 4px; }

/* ---------- hero ---------- */
.hero { padding: clamp(28px, 5vw, 60px) 0 clamp(36px, 6vw, 72px); }
.hero__grid { display: grid; gap: clamp(28px, 5vw, 56px); grid-template-columns: 1fr; align-items: center; }
@media (min-width: 1100px) {
  .hero { padding-top: clamp(24px, 3vw, 40px); }
  .hero__grid { grid-template-columns: minmax(0, 0.84fr) minmax(0, 1.16fr); align-items: start; }
  .hero__copy { padding-top: 8px; }
}
.hero__title { font-family: var(--disp); font-weight: 700; font-size: clamp(2.4rem, 6vw, 4.4rem); line-height: 0.98; letter-spacing: 0.004em; max-width: 17ch; text-wrap: balance; }
.hero__lede { margin-top: 18px; font-size: clamp(1.05rem, 1.6vw, 1.3rem); line-height: 1.5; color: var(--ink); max-width: 44ch; text-wrap: pretty; }
/* hero copy arrives in sequence on load. CSS-only (fill-mode both), so there is no flash
   before page.js runs and the end state is plain visible text even without JS. */
@media (prefers-reduced-motion: no-preference) {
  .hero__copy > * { animation: rise 0.6s var(--ease) both; }
  .hero__copy > :nth-child(2) { animation-delay: 80ms; }
  .hero__copy > :nth-child(3) { animation-delay: 160ms; }
  .hero__copy > :nth-child(4) { animation-delay: 240ms; }
  .hero__copy > :nth-child(5) { animation-delay: 300ms; }
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* gate — the one memorable thing */
.gate { margin-top: 22px; max-width: 460px; }
.gate__switch { display: flex; align-items: center; gap: 16px; width: 100%; min-height: 64px; padding: 14px 16px; text-align: left; background: var(--paper); border: 2px solid var(--ink); border-radius: 10px; transition: box-shadow 160ms var(--ease), border-color 200ms var(--ease), background 200ms var(--ease), transform 140ms var(--ease); }
.gate__switch:hover { box-shadow: 4px 4px 0 var(--ink); }
.gate__switch:active { transform: translateY(1px); box-shadow: none; }
.gate__track { position: relative; flex: 0 0 auto; width: 68px; height: 38px; border-radius: 999px; background: var(--slate); box-shadow: inset 0 0 0 2px color-mix(in srgb, #000 22%, transparent); transition: background 220ms var(--ease); }
.gate__thumb { position: absolute; top: 4px; left: 4px; width: 30px; height: 30px; border-radius: 50%; background: var(--bone); box-shadow: 0 1px 2px rgba(0,0,0,0.5); transition: transform 320ms cubic-bezier(.34, 1.4, .64, 1), background 200ms var(--ease); }
.gate__switch:active .gate__thumb { transform: scaleX(1.18); transform-origin: left; }
.gate__switch[aria-checked="true"] { border-color: var(--orange); background: color-mix(in srgb, var(--orange) 12%, var(--paper)); }
.gate__switch[aria-checked="true"] .gate__track { background: var(--orange); }
.gate__switch[aria-checked="true"] .gate__thumb { transform: translateX(30px); background: var(--ink); }
.gate__switch[aria-checked="true"]:active .gate__thumb { transform: translateX(26px) scaleX(1.18); transform-origin: right; }
.gate__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gate__name { font-family: var(--disp); font-weight: 700; font-size: 1.25rem; line-height: 1; }
.gate__sub { font-size: 0.92rem; color: var(--dim); text-wrap: pretty; }
.gate__state { margin-top: 10px; font-size: 0.95rem; color: var(--dim); line-height: 1.45; min-height: 2.6em; text-wrap: pretty; }
.gate__state[data-armed="true"] { color: var(--ink); }
.gate__state[data-armed="true"] strong { color: color-mix(in srgb, var(--orange) 60%, var(--ink)); }

.hero__cta { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 14px; }
@media (max-width: 480px) { .hero__cta .btn { flex: 1 1 100%; } }
.hero__access { margin-top: 14px; font-size: 0.95rem; color: var(--dim); }

/* hero stage: device + arc + phone */
.hero__stage { display: grid; grid-template-columns: minmax(0, 1fr) var(--phone-w); align-items: center; gap: clamp(6px, 1.4vw, 14px); }
@media (min-width: 721px) and (max-width: 1099px) { .hero__stage { grid-template-columns: minmax(0, 404px) var(--phone-w); } }
.stage__device { display: grid; grid-template-columns: minmax(0, 1fr) 60px; align-items: center; gap: 4px; }
.board { width: 100%; max-width: 340px; height: auto; justify-self: end; }
.link-arc { width: 60px; height: auto; align-self: center; }
.link-arc--v { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .board__antenna { stroke-dasharray: 60; stroke-dashoffset: 60; animation: trace 1.1s ease forwards 0.2s; }
  .link-arc path { opacity: 0; animation: arcin 0.5s ease forwards; }
  .link-arc path:nth-child(2) { animation-delay: 0.8s; }
  .link-arc g path:nth-child(1) { animation-delay: 1.0s; }
  .link-arc g path:nth-child(3) { animation-delay: 1.0s; }
  /* the link breathes once the demo is connected: a slow, subtle pulse on the outer arcs only */
  .hero__stage.is-done .link-arc g path:nth-child(1), .hero__stage.is-done .link-arc g path:nth-child(3) { animation: arcin 0.5s ease forwards, breathe 3.2s ease-in-out 1.4s infinite; }
}
@keyframes trace { to { stroke-dashoffset: 0; } }
.link-arc g path:nth-child(1), .link-arc g path:nth-child(3) { --o: 0.3; }
.link-arc g path:nth-child(2), .link-arc > path { --o: 0.85; }
@keyframes arcin { from { opacity: 0; } to { opacity: var(--o, 0.8); } }
@keyframes breathe { 0%, 100% { opacity: 0.3; } 50% { opacity: 0.6; } }

/* ---------- phone replica ----------
   Sizes inside the replica are in em so the whole screen scales with .phone's font-size:
   17px beside the board on desktop, 19px when it stands alone on a phone (readable at 390). */
.phone { position: relative; width: var(--phone-w); max-width: 100%; aspect-ratio: 9 / 19.5; justify-self: center; font-size: 17px; background: var(--ink); border-radius: 34px; padding: 10px; box-shadow: 0 10px 30px rgba(21,23,26,0.28); }
.phone__notch { position: absolute; top: 15px; left: 50%; transform: translateX(-50%); width: 64px; height: 6px; border-radius: 999px; background: var(--slate-2); z-index: 2; }
/* The frame determines the height; app content cannot stretch it. */
.phone__screen { position: absolute; inset: 10px; background: var(--bone); border-radius: 24px; overflow: hidden; display: flex; flex-direction: column; }
.appbar { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 0.5em; padding: 1.1em 0.85em 0.6em; background: var(--slate); color: var(--bone); }
.appbar__title { font-family: var(--disp); font-weight: 700; font-size: 1.15em; }
.appbar__link { display: inline-flex; align-items: center; gap: 0.4em; font-size: 0.78em; color: var(--dim-dark); white-space: nowrap; }
.appbar__link .dot { position: relative; width: 0.6em; height: 0.6em; border-radius: 50%; background: var(--ble); box-shadow: 0 0 0 2px color-mix(in srgb, var(--ble) 30%, transparent); transition: background 200ms var(--ease), box-shadow 200ms var(--ease); }
.appscroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: thin; scrollbar-color: var(--dim) transparent; -webkit-overflow-scrolling: touch; padding: 0.7em; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.7em; align-content: start; }
.appscroll:focus-visible { outline: 2px solid var(--ble); outline-offset: -2px; }

.ppanel { min-width: 0; background: var(--paper); border: 1px solid var(--edge); border-radius: var(--r-inner); padding: 0.7em; }
.ppanel__head { font-family: var(--disp); font-weight: 700; font-size: 1em; margin-bottom: 0.55em; display: flex; align-items: center; justify-content: space-between; gap: 0.5em; }
.ppanel__count { font-family: var(--body); font-weight: 500; font-size: 0.72em; color: var(--dim); letter-spacing: 0.02em; }
.ack { display: flex; gap: 0.5em; align-items: flex-start; font-size: 0.76em; line-height: 1.3; color: var(--ink); }
.ack__box { flex: 0 0 auto; width: 1.1em; height: 1.1em; border: 2px solid var(--slate); border-radius: 4px; margin-top: 0.05em; display: grid; place-items: center; transition: background 160ms var(--ease), border-color 160ms var(--ease); }
.ack__box::after { content: ""; width: 0.5em; height: 0.26em; border-left: 2px solid var(--bone); border-bottom: 2px solid var(--bone); transform: rotate(-45deg) scale(0); transform-origin: center; transition: transform 200ms cubic-bezier(.34, 1.4, .64, 1); margin-top: -0.12em; }
.phone.is-armed .ack__box { background: var(--orange); border-color: var(--orange); }
.phone.is-armed .ack__box::after { transform: rotate(-45deg) scale(1); }

.pbtns { display: flex; gap: 0.45em; margin-top: 0.6em; }
.pbtn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4em; flex: 1; min-width: 0; min-height: 2.6em; padding: 0.45em 0.4em; border-radius: var(--r-ctl); font-size: 0.78em; font-weight: 600; text-align: center; border: 1.5px solid var(--slate); color: var(--slate); background: transparent; transition: background 200ms var(--ease), color 200ms var(--ease), border-color 200ms var(--ease); }
.pbtn--go { background: var(--slate); color: var(--bone); border-color: var(--slate); }

.plab { margin-top: 0.7em; font-size: 0.72em; color: var(--dim); letter-spacing: 0.02em; min-height: 1.3em; }

/* The survey list mirrors Flutter's ListTile: flat rows with dividers, a signal glyph leading. */
.aplist { display: grid; gap: 0; margin-top: 0.3em; padding: 0; list-style: none; } /* no role=list, so base.css leaves the 40px indent */
.ap { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "sig ssid rssi" "sig bssid ch"; gap: 0 0.55em; align-items: center; padding: 0.5em 0.15em; border-bottom: 1px solid var(--edge); }
.ap:last-child { border-bottom: 0; }
.ap__sig { grid-area: sig; display: inline-flex; align-items: flex-end; gap: 2px; height: 1em; width: 1.1em; }
.ap__sig i { display: block; flex: 1; background: var(--edge); border-radius: 1px; transform-origin: bottom; }
.ap__sig i:nth-child(1) { height: 30%; } .ap__sig i:nth-child(2) { height: 52%; } .ap__sig i:nth-child(3) { height: 76%; } .ap__sig i:nth-child(4) { height: 100%; }
.ap__sig[data-bars="4"] i, .ap__sig[data-bars="3"] i:nth-child(-n+3), .ap__sig[data-bars="2"] i:nth-child(-n+2), .ap__sig[data-bars="1"] i:first-child { background: var(--ink); }
.ap__ssid { grid-area: ssid; font-weight: 600; font-size: 0.82em; line-height: 1.25; }
.ap__bssid { grid-area: bssid; font-family: var(--mono); font-size: 0.68em; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap__rssi { grid-area: rssi; font-family: var(--mono); font-size: 0.76em; font-weight: 600; text-align: right; white-space: nowrap; line-height: 1.25; }
.ap__rssi::after { content: " dBm"; font-size: 0.78em; font-weight: 500; color: var(--dim); }
.ap__ch { grid-area: ch; font-size: 0.68em; color: var(--dim); text-align: right; }
.ap__ch::before { content: "ch "; }

/* expert panel — locked until the gate arms it: a deliberate, legible locked state,
   not a faded one. The pill carries a padlock, the controls read as outlined-and-waiting. */
.ppanel--expert { background: color-mix(in srgb, var(--slate) 7%, var(--paper)); transition: background 240ms var(--ease), border-color 240ms var(--ease), box-shadow 240ms var(--ease); }
.phone.is-armed .ppanel--expert { background: var(--paper); border-color: var(--orange); box-shadow: 0 0 0 1px var(--orange); }
.lockpill { display: inline-flex; align-items: center; gap: 0.35em; font-family: var(--body); font-weight: 600; font-size: 0.62em; letter-spacing: 0.04em; text-transform: uppercase; padding: 0.3em 0.7em; border-radius: 999px; background: var(--slate); color: var(--bone); transition: background 200ms var(--ease), color 200ms var(--ease); }
.lockpill__i { display: inline-flex; }
.lockpill svg { width: 0.9em; height: 0.9em; }
.phone.is-armed .lockpill { background: var(--orange); color: var(--ink); }
.phone.is-armed .lockpill__i { display: none; }
.field { display: grid; gap: 0.1em; padding: 0.4em 0; border-bottom: 1px dashed var(--edge); }
.field__label { font-size: 0.7em; color: var(--dim); }
.field__val { font-family: var(--mono); font-size: 0.76em; font-weight: 600; }
/* locked = a solid, tinted, padlocked control at full contrast: deliberate, never faded */
.pbtn--window, .pbtn--hold { font-size: 0.72em; text-wrap: balance; }
.pbtn--window { width: 100%; margin-top: 0.6em; border-color: transparent; background: color-mix(in srgb, var(--slate) 12%, var(--paper)); color: var(--slate); }
.pbtn--hold { position: relative; width: 100%; margin-top: 0.45em; overflow: hidden; border-color: transparent; background: color-mix(in srgb, var(--slate) 12%, var(--paper)); color: var(--slate); user-select: none; -webkit-user-select: none; touch-action: none; }
.pbtn__lock { width: 0.95em; height: 0.95em; flex: none; }
.pbtn__fill { position: absolute; inset: 0; background: var(--orange); transform: scaleX(0); transform-origin: left; }
.pbtn__text { position: relative; z-index: 1; }
.phone.is-armed .pbtn--window { border-color: var(--slate); background: transparent; color: var(--slate); }
.phone.is-armed .pbtn--hold { border-style: solid; border-color: var(--orange); background: color-mix(in srgb, var(--orange) 16%, transparent); color: var(--ink); }
.phone.is-armed .pbtn__lock { display: none; }
.phone.is-armed .pbtn--hold:active { transform: scale(0.985); }
/* the two controls unlock with a small nudge, one after the other */
.phone.is-armed .pbtn--window { animation: unlock 0.45s var(--ease) both; }
.phone.is-armed .pbtn--hold { animation: unlock 0.45s var(--ease) 90ms both; }
@keyframes unlock { from { transform: translateX(-4px); } to { transform: none; } }

/* phone bottom nav */
.tabbar { flex: 0 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; padding: 0.5em 0.25em 0.65em; background: var(--slate); }
.tab { display: flex; flex-direction: column; align-items: center; gap: 0.2em; font-size: 0.66em; color: var(--dim-dark); }
.tab__i { width: 1.4em; height: 1.4em; display: block; }
.tab--on { color: var(--orange); }

/* the survey demo: JS hides the rows and the status, then plays them in (see page.js) */
html.js .phone.is-playing .ap { opacity: 0; transform: translateY(6px); }
html.js .phone .ap { transition: opacity 0.45s var(--ease), transform 0.45s var(--ease); }
html.js .phone.is-playing .ap__sig i { transform: scaleY(0); }
html.js .phone .ap__sig i { transition: transform 0.3s var(--ease); }
html.js .phone .ap.is-in { opacity: 1; transform: none; }
html.js .phone .ap.is-in .ap__sig i { transform: none; }
.phone .ap.is-in .ap__sig i:nth-child(2) { transition-delay: 60ms; }
.phone .ap.is-in .ap__sig i:nth-child(3) { transition-delay: 120ms; }
.phone .ap.is-in .ap__sig i:nth-child(4) { transition-delay: 180ms; }
.phone.is-connecting .appbar__link .dot { background: var(--dim-dark); box-shadow: 0 0 0 2px color-mix(in srgb, var(--dim-dark) 30%, transparent); }
.phone.is-connected .appbar__link .dot::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--ble); animation: ring 0.9s var(--ease) forwards; }
@keyframes ring { from { opacity: 0.9; transform: scale(1); } to { opacity: 0; transform: scale(3); } }
.phone.is-playing .plab { color: var(--ink); }
.phone .plab__ch { font-family: var(--mono); font-weight: 600; }

/* ---------- content bands ---------- */
.band { padding: clamp(44px, 6vw, 80px) 0; border-top: 1px solid var(--edge); }
.band__lede { margin-top: 12px; max-width: 60ch; font-size: 1.1rem; color: var(--dim); text-wrap: pretty; }
.band__lede--dark { color: var(--dim-dark); }
.band--dark { background: var(--slate); color: var(--bone); border-top: 0; }
.band--dark .h2 { color: var(--bone); }
.band--dark code { background: color-mix(in srgb, var(--bone) 14%, transparent); color: var(--bone); }

/* ---------- staggered reveals: a container with data-reveal gets .is-in from shell.js once
   it scrolls into view; its children then rise one after another. JS-only, final state by default. */
html.js [data-reveal] > * { opacity: 0; transform: translateY(14px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
html.js [data-reveal].is-in > * { opacity: 1; transform: none; }
[data-reveal] > :nth-child(2) { transition-delay: 60ms; }
[data-reveal] > :nth-child(3) { transition-delay: 120ms; }
[data-reveal] > :nth-child(4) { transition-delay: 180ms; }
[data-reveal] > :nth-child(5) { transition-delay: 240ms; }
[data-reveal] > :nth-child(6) { transition-delay: 300ms; }
[data-reveal] > :nth-child(n+7) { transition-delay: 360ms; }

/* feature grid — borders (not shadows) encode hierarchy */
.feat { display: grid; gap: 1px; margin-top: 32px; grid-template-columns: 1fr; background: var(--edge); border: 1px solid var(--edge); border-radius: var(--r-panel); overflow: hidden; }
@media (min-width: 620px) { .feat { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .feat { grid-template-columns: repeat(4, 1fr); } }
.card { background: var(--bone); padding: 22px 20px; transition: background 200ms var(--ease); }
.card:hover { background: var(--paper); }
.card__h { font-family: var(--disp); font-weight: 700; font-size: 1.3rem; line-height: 1.05; margin-bottom: 8px; text-wrap: balance; }
.card p { font-size: 0.98rem; color: var(--ink); text-wrap: pretty; }
.card__h + p { color: var(--dim); }

.feat--dark { background: color-mix(in srgb, var(--bone) 16%, var(--slate)); border-color: transparent; grid-template-columns: 1fr; }
@media (min-width: 820px) { .feat--dark { grid-template-columns: repeat(3, 1fr); } }
.card--dark { background: var(--slate-2); }
.card--dark:hover { background: #23282f; }
.card--dark .card__h { color: var(--bone); }
.card--dark p { color: var(--dim-dark); }

/* architecture diagram + the folded transmit-discipline note beside it */
.archwrap { display: grid; gap: 22px; margin-top: 30px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1200px) { .archwrap { grid-template-columns: 1.5fr 1fr; } }
.archfig { min-width: 0; position: relative; }
.arch { background: var(--slate-2); border: 1px solid #3a4048; border-radius: var(--r-panel); padding: 18px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #3a4048 transparent; }
.arch.is-over:not(.is-end) { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent); }
.archsvg { width: 100%; max-width: 760px; min-width: 560px; height: auto; margin-inline: auto; }
/* the control path draws itself as the section enters (JS + motion only) */
html.js .archwrap .archsvg line[marker-end] { stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset 0.7s var(--ease); }
html.js .archwrap .archsvg line[marker-end]:nth-of-type(2) { transition-delay: 0.25s; }
html.js .archwrap .archsvg line[marker-end]:nth-of-type(3) { transition-delay: 0.5s; }
html.js .archwrap.is-in .archsvg line[marker-end] { stroke-dashoffset: 0; }
.arch__hint { display: none; margin-top: 8px; font-size: 0.86rem; color: var(--dim-dark); }
.arch__hint::before { content: ""; display: inline-block; width: 14px; height: 2px; margin: 0 8px 4px 0; background: var(--dim-dark); vertical-align: middle; }
.arch.is-over ~ .arch__hint { display: block; }
.archnote__h { font-family: var(--disp); font-weight: 700; font-size: 1.4rem; color: var(--bone); margin-bottom: 8px; text-wrap: balance; }
.archnote p { font-size: 1rem; line-height: 1.55; color: var(--dim-dark); max-width: 62ch; text-wrap: pretty; }
.spec { margin-top: 20px; font-size: 0.9rem; color: var(--dim-dark); }
.spec code { font-size: 0.85rem; }

/* survey replica — reuses .aplist at a readable size, with a channel-hop row */
.surveydemo { display: grid; gap: 24px; margin-top: 30px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 820px) { .surveydemo { grid-template-columns: 360px 1fr; } }
.surveydemo__panel { background: var(--paper); border: 1px solid var(--edge); border-radius: var(--r-panel); padding: 16px; font-size: 19px; }
.surveydemo__head { display: flex; align-items: center; justify-content: space-between; font-family: var(--disp); font-weight: 700; font-size: 1.15rem; margin-bottom: 8px; }
.surveydemo__tag { font-family: var(--body); font-weight: 600; font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); border: 1px solid var(--edge); border-radius: 999px; padding: 3px 9px; }
.surveydemo .aplist { margin-top: 0; border-top: 1px solid var(--edge); }
.surveydemo .ap { padding: 0.6em 0.1em; }
.surveydemo .ap:last-child { border-bottom: 1px solid var(--edge); }
.hop { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 10px; margin-top: 12px; }
.hop__label { font-size: 0.88rem; color: var(--dim); }
.hop__val { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 0.86rem; font-weight: 600; white-space: nowrap; }
.hop__ch { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 4px; background: var(--ink); color: var(--orange); }
.hop__dwell { margin-left: 4px; font-weight: 500; color: var(--dim); }
.surveydemo__note p { font-size: 1.05rem; line-height: 1.6; color: var(--dim); max-width: 48ch; text-wrap: pretty; }
.specs { display: grid; gap: 0; margin: 18px 0 0; max-width: 48ch; border-top: 1px solid var(--edge); }
.specs > div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--edge); }
.specs dt { font-family: var(--disp); font-weight: 700; font-size: 1.05rem; line-height: 1.3; }
.specs dd { margin: 0; font-size: 0.95rem; line-height: 1.5; color: var(--dim); text-wrap: pretty; }
@media (max-width: 400px) { .specs > div { grid-template-columns: 1fr; gap: 2px; } }

/* steps */
.band--steps { background: var(--paper); }
.steps { display: grid; gap: 1px; margin-top: 32px; grid-template-columns: 1fr; background: var(--edge); border: 1px solid var(--edge); border-radius: var(--r-panel); overflow: hidden; }
@media (min-width: 620px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.step { background: var(--bone); padding: 24px 20px; transition: background 200ms var(--ease); }
.step:hover { background: var(--paper); }
.step__n { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-inner); background: var(--ink); color: var(--orange); font-family: var(--disp); font-weight: 700; font-size: 1.4rem; margin-bottom: 14px; }
.step__h { font-family: var(--disp); font-weight: 700; font-size: 1.2rem; line-height: 1.08; margin-bottom: 7px; text-wrap: balance; }
.step p { font-size: 0.95rem; color: var(--dim); text-wrap: pretty; }
/* phones: the number sits beside the text instead of on its own line */
@media (max-width: 619px) {
  .step { display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 14px; padding: 18px 16px; }
  .step__n { grid-row: 1 / span 2; margin: 0; }
  .step__h { margin-top: 8px; }
}

/* ethics */
.band--ethics { background: var(--ink); color: var(--bone); border-top: 0; }
.band--ethics .h2 { color: var(--bone); }
.ethics { display: grid; gap: 32px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .ethics { grid-template-columns: 1.4fr 1fr; align-items: start; } }
.ethics__main p { margin-top: 14px; max-width: 54ch; color: #D7D4CC; text-wrap: pretty; }
.ethics .muted { color: var(--dim-dark); font-size: 0.96rem; }
.doclist__label { font-size: 0.95rem; color: var(--dim-dark); margin-bottom: 6px; }
.doclist { display: grid; gap: 0; border-top: 1px solid #3a4048; }
.doclist li { display: grid; grid-template-columns: 14px minmax(0, 1fr); column-gap: 12px; row-gap: 2px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid #3a4048; }
.doclist li::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--orange); align-self: center; }
.doclist__h { font-family: var(--disp); font-weight: 700; font-size: 1.15rem; }
.doclist li span:last-child { grid-column: 2; font-size: 0.9rem; color: var(--dim-dark); }

/* status */
.band--status { background: var(--bone); }
.statusgrid { display: grid; gap: 1px; margin-top: 30px; background: var(--edge); border: 1px solid var(--edge); border-radius: var(--r-panel); overflow: hidden; }
.statrow { display: grid; grid-template-columns: 104px 1fr; gap: 16px; align-items: start; padding: 16px 18px; background: var(--paper); }
@media (max-width: 480px) { .statrow { grid-template-columns: 1fr; gap: 8px; padding: 14px 16px; } }
.statrow__state { display: inline-flex; align-items: center; justify-self: start; gap: 6px; min-height: 28px; padding: 2px 10px; border-radius: 999px; font-family: var(--disp); font-weight: 700; font-size: 0.98rem; letter-spacing: 0.02em; }
.statrow__state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.statrow--done .statrow__state { background: var(--slate); color: var(--bone); }
.statrow--pending .statrow__state { background: var(--orange); color: var(--ink); }
.statrow__txt { color: var(--ink); font-size: 1rem; text-wrap: pretty; padding-top: 2px; }

/* access — the page's last word, set apart from the footer by colour and a hairline */
.band--access { background: var(--ink); color: var(--bone); border-top: 0; padding-bottom: clamp(44px, 6vw, 72px); }
.band--access .h2 { color: var(--bone); }
.access .band__lede { color: var(--dim-dark); }
.access__cta { margin-top: 26px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; }
.access__meta { flex: 1 1 100%; margin-top: -4px; font-size: 0.92rem; color: var(--dim-dark); }
@media (min-width: 600px) { .access__meta { flex: 0 1 auto; margin-left: 6px; } }
@media (max-width: 480px) { .access__cta .btn { flex: 1 1 100%; } .band--access { padding-bottom: 32px; } .access__cta { margin-top: 22px; } }
.aer-footer { border-top: 1px solid color-mix(in srgb, var(--bone) 18%, transparent); }

/* ---------- small-screen hero stacking: device over a downward arc over phone ---------- */
@media (max-width: 720px) {
  :root { --phone-w: min(100%, 340px); }
  .hero__stage { grid-template-columns: 1fr; justify-items: center; gap: 10px; }
  .stage__device { grid-template-columns: 1fr; justify-items: center; max-width: 300px; }
  .board { max-width: 236px; justify-self: center; }
  .link-arc--h { display: none; }
  .link-arc--v { display: block; width: 112px; margin: 0; }
  .phone { font-size: 18px; }
}

/* ---------- reduced motion: every final state, immediately ---------- */
@media (prefers-reduced-motion: reduce) {
  html.js [data-reveal] > *, html.js .phone .ap, html.js .phone .ap__sig i { opacity: 1; transform: none; transition: none; }
  html.js .archwrap .archsvg line[marker-end] { stroke-dashoffset: 0; transition: none; }
  .phone.is-armed .pbtn--window, .phone.is-armed .pbtn--hold { animation: none; }
  .phone.is-connected .appbar__link .dot::after { display: none; }
  .link-arc g path { animation: none !important; }
  .pagenav::after { display: none; }
}

/* Restoring motion must not repeat the completed connection acknowledgement. */
.phone[data-motion-settled] .appbar__link .dot::after { display: none; }
