/* Soapbox product site. Dark by default (the display's own green), light when the system asks for it.
   Colour pairs are checked for WCAG AA in test/site.test.ts, which reads the tokens below. */
:root {
  color-scheme: dark;
  --bg: #07130b;
  --surface: #0d1f12;
  --surface-2: #142a1a;
  --line: #24402d;
  --text: #eef3ee;
  --muted: #a8baac;
  --accent: #ffb020;
  --accent-hover: #ffc04d;
  --accent-ink: #1c1300;
  --accent-text: #ffb020;
  --focus: #ffd27a;
  --soon: #2a3d30;
  --soon-ink: #d9e4db;
  --radius: 20px;
  --gutter: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f6f8f3;
    --surface: #ffffff;
    --surface-2: #edf2ec;
    --line: #d3ddd4;
    --text: #0c1a10;
    --muted: #4a5c4f;
    --accent: #ffb020;
    --accent-hover: #f5a300;
    --accent-ink: #1c1300;
    --accent-text: #8a5200;
    --focus: #8a5200;
    --soon: #dfe7e0;
    --soon-ink: #24382a;
  }
}
@media (min-width: 640px) { :root { --gutter: 32px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
p { margin: 0; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; margin: 0; text-wrap: balance; letter-spacing: -.01em; }
h2 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.5rem); font-weight: 700; }
h3 { font-size: 1.1875rem; font-weight: 650; line-height: 1.3; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; left: var(--gutter); top: -100px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: 10px; font-weight: 650;
  text-decoration: none;
}
.skip:focus { top: 12px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.wrap { width: 100%; max-width: 1140px; margin-inline: auto; padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right)); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 1.1875rem/1 var(--font-display); text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.site-nav a:not(.btn) { padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--muted); font-size: .9375rem; }
.site-nav a:not(.btn):hover { color: var(--text); }
.site-nav .btn { margin-left: 8px; }
@media (max-width: 720px) { .site-nav .nav-link { display: none; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border-radius: 12px; border: 1px solid transparent;
  font: 650 1rem/1.2 var(--font); text-decoration: none; text-align: center; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { text-decoration: none; }
.btn-large { min-height: 52px; padding: 14px 24px; font-size: 1.0625rem; }
.btn-small { min-height: 40px; padding: 8px 14px; font-size: .9375rem; border-radius: 10px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary.is-soon { background: var(--soon); color: var(--soon-ink); border-color: var(--line); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--line); }
.btn-secondary:hover { background: var(--surface-2); }

/* Sections */
main section { padding-block: clamp(56px, 8vw, 96px); }
.eyebrow { font-size: .8125rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 12px; }
.section-head { max-width: 640px; margin-bottom: 32px; display: grid; gap: 12px; }
.section-head p { color: var(--muted); }
.muted { color: var(--muted); }

/* Hero */
.hero { padding-block: clamp(40px, 7vw, 88px) clamp(48px, 7vw, 88px); }
.hero .wrap { display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) { .hero .wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 56px; } }
.hero-icon { width: 72px; height: 72px; border-radius: 17px; margin-bottom: 20px; box-shadow: 0 0 0 1px var(--line); }
.hero h1 { font-size: clamp(2.5rem, 1.6rem + 4.2vw, 4.25rem); font-weight: 800; letter-spacing: -.02em; }
.hero .lede { margin-top: 20px; font-size: clamp(1.125rem, 1rem + .5vw, 1.3125rem); color: var(--muted); max-width: 34rem; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.cta-note { margin-top: 14px; font-size: .9375rem; color: var(--muted); }
@media (max-width: 479px) { .cta .btn { width: 100%; } }

/* Demo */
.demo { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 16px; display: grid; gap: 14px; }
.demo-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-inline: 4px; }
.demo-head h2 { font-size: 1.1875rem; }
.badge { font-size: .75rem; font-weight: 700; letter-spacing: .04em; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.demo-note { font-size: .875rem; color: var(--muted); padding-inline: 4px; }

/* The miniature speaker display. Colours come from faceLook in the display's core.js (set by demo.js). */
.screen {
  --bg: #0d1f12; --ink: #ffffff; --ink-opacity: 1; --clock-size: 64px; --title-size: 14px; --status-size: 10px;
  position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden;
  background: var(--bg); color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  border: 6px solid #030604; box-shadow: 0 0 0 1px var(--line), 0 12px 32px -12px rgba(0,0,0,.6);
  transition: background-color .4s;
}
.screen[data-instant] { transition: none; }
.screen-main {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2%; padding: 4%; opacity: var(--ink-opacity);
}
.screen[data-face="ring"] .screen-main { padding: calc(var(--ring) + 3%); }
.screen-title { font-size: var(--title-size); font-weight: 600; line-height: 1.1; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.screen-clock { font-size: var(--clock-size); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.screen-clock[data-dim] { opacity: .6; }
.screen-clock[data-underline] { text-decoration: underline; text-decoration-thickness: .07em; text-underline-offset: .12em; padding-bottom: .1em; }
.screen-status { font-size: var(--status-size); font-weight: 700; letter-spacing: .3em; margin-right: -.3em; opacity: .6; min-height: 1em; line-height: 1; }
.screen[data-corner] .screen-main { inset: auto 0 0 auto; width: 45%; align-items: flex-end; justify-content: flex-end; padding: 0 3% 3% 0; gap: 1%; }
.screen[data-corner] .screen-title { text-align: right; }
.screen-ring { position: absolute; inset: 0; width: 100%; height: 100%; display: none; pointer-events: none; }
.screen[data-face="ring"] .screen-ring { display: block; }
.screen-ring path { fill: none; }
.screen-ring .track { stroke: #fff; stroke-opacity: .12; }
.screen-pulse { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.screen-overlay {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center; padding: 5%;
  color: #fff; font-weight: 800; line-height: 1.05; text-align: center; background: rgb(20, 90, 230);
}
.screen-overlay[data-blink="off"] { background: rgb(16, 72, 190); }
.screen-overlay.show { display: flex; }

.demo-controls { display: grid; gap: 12px; border: 0; margin: 0; padding: 0; min-width: 0; }
.demo-controls:disabled { opacity: .55; }
.faces { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 0; margin: 0; min-width: 0; }
.faces legend { padding: 0; }
.faces label { position: relative; display: grid; place-items: center; min-height: 40px; padding: 6px 4px; border-radius: 9px; font-size: .875rem; font-weight: 600; text-align: center; line-height: 1.15; cursor: pointer; color: var(--muted); }
.faces input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.faces label:has(input:checked) { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.25), 0 0 0 1px var(--line); }
.faces label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 1px; }
.actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.actions .message { grid-column: 1 / -1; }
@media (max-width: 420px) { .actions { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.actions button {
  min-height: 44px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); font: 600 .9375rem/1.2 var(--font); cursor: pointer; font-variant-numeric: tabular-nums;
}
.actions button:hover { border-color: var(--muted); }
.actions .primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.actions .primary:hover { background: var(--accent-hover); }
.actions .message { background: rgb(20, 90, 230); color: #fff; border-color: transparent; }
.actions .message:hover { background: rgb(16, 72, 190); }

/* Feature points */
.points { display: grid; gap: 16px; }
@media (min-width: 760px) { .points { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; } }
.point { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: grid; gap: 8px; align-content: start; }
.point p { color: var(--muted); }
.point-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent-text); margin-bottom: 8px; }
.point-icon svg { width: 22px; height: 22px; }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; counter-reset: step; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; } }
.steps li { counter-increment: step; display: grid; gap: 8px; align-content: start; padding: 24px; border-radius: var(--radius); border: 1px solid var(--line); }
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font: 800 1rem/1 var(--font-display); margin-bottom: 8px;
}
.steps p { color: var(--muted); }
.steps code { font: 500 .92em/1 ui-monospace, "SF Mono", Menlo, monospace; overflow-wrap: anywhere; color: var(--text); }

/* Local mode */
.band { background: var(--surface); border-block: 1px solid var(--line); }
.split { display: grid; gap: 24px; align-items: start; }
@media (min-width: 860px) { .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; } }
.split p { color: var(--muted); }
.split p + p { margin-top: 12px; }

/* Faces gallery */
.gallery { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.gallery li { display: grid; gap: 10px; align-content: start; }
.gallery p { color: var(--muted); font-size: .9375rem; }
.mini {
  position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; display: grid; place-items: center;
  font: 700 clamp(2rem, 9vw, 3.25rem)/1 ui-rounded, "SF Pro Rounded", system-ui, sans-serif; font-variant-numeric: tabular-nums;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.mini-classic { background: #735200; color: #fff; }
.mini-mono { background: #000; color: #fff; }
.mini-mono span { text-decoration: underline; text-decoration-thickness: .07em; text-underline-offset: .12em; }
.mini-subtle { background: #0a0a0a; color: #ff1a1a; place-items: end; padding: 4% 5%; font-size: clamp(1rem, 3.6vw, 1.375rem); }
.mini-ring { background: #000; color: #fff; font-size: clamp(1.5rem, 6vw, 2.25rem); }
.mini-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Everything on the phone */
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px 32px; }
@media (min-width: 760px) { .checklist { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.checklist li { position: relative; padding-left: 30px; }
.checklist li::before {
  content: ""; position: absolute; left: 2px; top: .45em; width: 14px; height: 8px;
  border-left: 2.5px solid var(--accent-text); border-bottom: 2.5px solid var(--accent-text); transform: rotate(-45deg);
}

/* FAQ */
.faq { display: grid; gap: 12px; max-width: 760px; }
.faq details { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.faq summary {
  list-style: none; cursor: pointer; padding: 18px 52px 18px 20px; position: relative; font-weight: 650; border-radius: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 22px; top: 50%; width: 9px; height: 9px; margin-top: -6px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details > div { padding: 0 20px 20px; color: var(--muted); display: grid; gap: 10px; }

/* Closing call */
.closing { text-align: center; }
.closing .wrap { display: grid; justify-items: center; gap: 16px; }
.closing .cta { justify-content: center; margin-top: 8px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: 32px 40px; font-size: .9375rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.site-footer nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; padding: 0; }
.site-footer a { color: var(--text); }

/* Plain text pages (privacy, 404) */
.prose { max-width: 720px; padding-block: clamp(40px, 6vw, 72px) 72px; }
.prose h1 { font-size: clamp(2.25rem, 1.6rem + 3vw, 3.25rem); font-weight: 800; margin-bottom: 12px; }
.prose h2 { font-size: 1.5rem; margin-top: 40px; margin-bottom: 12px; }
.prose p, .prose ul { margin: 0 0 14px; }
.prose ul { padding-left: 1.25em; }
.prose li + li { margin-top: 6px; }
.prose .muted { margin-bottom: 28px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Narrow phones (320–400 px): keep labels on one line. */
.site-nav .btn { white-space: nowrap; }
@media (max-width: 400px) {
  .faces { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .btn-large { font-size: 1rem; padding-inline: 16px; }
  .site-header .wrap { gap: 8px; }
  .site-nav .btn { margin-left: 0; padding-inline: 12px; }
}
