/* Kakureneko website. Shared styles for every page (design language: "design language/DESIGN.md").
   Plain CSS, no build step, no scripts. Light and dark follow the system (prefers-color-scheme).
   Rules carried over from DESIGN.md:
   - warm neutrals, one amber accent used as a FILL (buttons, focus ring), never as text on paper;
     accent text uses amber-ink;
   - flat: no soft shadows; depth comes from overlap. The halftone panels are print grain (dots), not gradients;
   - Soot is never cropped or recoloured; on dark surfaces use the -sticker files.
   Layout: wide (up to 1680 px of content, fluid gutters), full-bleed bands, fluid type (clamp) from phone to
   large desktop. */

:root {
  color-scheme: light dark;

  /* Colour tokens (DESIGN.md §2), light */
  --ink: #121212;
  --paper: #F4F2EC;
  --card: #FFFFFF;
  --line: #E2DFD6;
  --ink-2: #6E6B63;
  --ink-3: #9A978F;
  --amber: #FFB300;
  --amber-ink: #7A5200;
  --pink: #FF4D8D;

  /* Dark bands stay dark in both themes (DESIGN.md §10) */
  --band: #121212;
  --band-ink: #F4F2EC;
  --band-ink-2: #A6A299;
  --band-card: #24231E;
  --band-line: #35332C;

  /* State colours (DESIGN.md §2.1): fill + text */
  --working: #FFB300;   --working-text: #7A5200;
  --waiting: #FF4D8D;   --waiting-text: #B3134F;
  --drowsy: #7B6CF6;    --drowsy-text: #4A3FD0;
  --asleep: #4A44B5;    --asleep-text: #3A35A0;
  --attention: #F26B1D; --attention-text: #9A3E00;
  --critical: #E5484D;  --critical-text: #B3261E;
  --finished: #34B36B;  --finished-text: #1B7A43;
  --idle: #8E8B84;      --idle-text: #6E6B63;

  /* Halftone panels: how much of the state colour tints the panel, and how strong its dots are */
  --panel-tint: 26%;
  --panel-dot: 55%;

  /* Type: system fonts (SF Pro on Apple devices, like the apps) */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  /* Shape and space (DESIGN.md §4): 4 px base */
  --r-chip: 6px;
  --r-card: 18px;
  --r-panel: 32px;
  --r-sheet: 28px;
  --gutter: clamp(16px, 4.5vw, 72px);
  --maxw: 1680px;
  --section: clamp(72px, 10vw, 160px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #F4F2EC;
    --paper: #1A1915;
    --card: #24231E;
    --line: #35332C;
    --ink-2: #A6A299;
    --ink-3: #6E6B63;
    --amber-ink: #FFC63D;

    --working-text: #FFC63D;
    --waiting-text: #FF7AAA;
    --drowsy-text: #B1A8FF;
    --asleep-text: #A09AFF;
    --attention-text: #FF9F66;
    --critical-text: #FF7B7B;
    --finished-text: #6FDC9A;
    --idle-text: #A6A299;

    --panel-tint: 12%;
    --panel-dot: 32%;
  }
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: clamp(16px, 0.35vw + 15px, 18px);
  line-height: 1.5;
  overflow-wrap: break-word;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

img, svg, picture { max-width: 100%; height: auto; }
img { display: block; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.025em;
  text-wrap: balance;
  margin: 0 0 16px;
}
h1 { font-size: clamp(44px, 6.2vw + 8px, 136px); line-height: 0.98; letter-spacing: -0.035em; }
h2 { font-size: clamp(34px, 3.4vw + 12px, 84px); letter-spacing: -0.03em; }
h3 { font-size: clamp(19px, 0.5vw + 16px, 24px); line-height: 1.25; letter-spacing: -0.01em; }

p { margin: 0 0 16px; text-wrap: pretty; }
ul, ol { margin: 0 0 16px; padding-left: 24px; }
li + li { margin-top: 8px; }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
  border-radius: 4px;
}

code, kbd, .path {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-chip);
  padding: 0.05em 0.35em;
  overflow-wrap: anywhere;
}

pre {
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.5;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 0 0 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
pre code { background: none; border: 0; padding: 0; font-size: inherit; }

hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }

strong { font-weight: 650; }

.num { font-variant-numeric: tabular-nums; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 30;
  background: var(--amber);
  color: #121212;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: calc(var(--maxw) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.wrap--narrow { max-width: calc(820px + 2 * var(--gutter)); }

.muted { color: var(--ink-2); }
.small { font-size: 15px; }
.caption { font-size: 13px; color: var(--ink-2); }

/* Section label (+0.6 pt tracking, DESIGN.md §3) */
.label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--amber-ink);
  margin: 0 0 12px;
}

/* ---------- Header: a floating pill that stays on top ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 12px 0;
  background: var(--paper);
}
@supports (backdrop-filter: blur(1px)) {
  /* Paper shows through just enough to read as a layer; the pill itself stays solid */
  .site-header { background: color-mix(in srgb, var(--paper) 82%, transparent); backdrop-filter: blur(12px); }
}
.site-header > .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
}
.site-header .bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 8px 8px 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  padding: 6px 0;
  margin-right: auto;
}
.brand img { height: 22px; width: auto; }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav li + li { margin-top: 0; }
.site-nav a {
  display: inline-block;
  padding: 8px 0;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}
.site-nav a:hover { text-decoration: underline; }
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--amber);
}
.btn.header-cta { min-height: 42px; padding: 0 22px; font-size: 15px; }

/* Phones: brand + download on the first row, the links on a second row that scrolls sideways if it must */
@media (max-width: 759px) {
  .site-header .bar { border-radius: 24px; padding: 8px 8px 4px 18px; gap: 0 12px; }
  .site-nav { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav ul { flex-wrap: nowrap; gap: 18px; white-space: nowrap; padding-bottom: 2px; }
  .site-nav a { font-size: 14px; }
  .btn.header-cta { min-height: 36px; padding: 0 16px; font-size: 14px; }
  .brand img { height: 19px; }
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: var(--section);
  padding: 48px 0 56px;
  font-size: 15px;
  color: var(--ink-2);
}
.site-footer .wrap { display: grid; gap: 16px; }
.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-footer li + li { margin-top: 0; }
.site-footer a { color: var(--ink); }
.site-footer p { margin: 0; }
.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  padding-bottom: 16px;
}
.footer-top img { height: 24px; width: auto; }
/* A footer directly after a full-bleed band needs no extra gap */
.band-cta + .site-footer, main:has(> .band-cta:last-child) + .site-footer { margin-top: 0; border-top: 0; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn:hover { text-decoration: none; }
.btn svg { width: 20px; height: 20px; flex: none; }

/* Primary: amber fill with ink text, in both themes */
.btn-primary {
  background: var(--amber);
  color: #121212;
}
.btn-primary:hover { background: #FFC226; }
.btn-primary:active { background: #E6A200; }

.btn-secondary {
  background: var(--card);
  color: var(--ink);
  border-color: var(--line);
}
.btn-secondary:hover { border-color: var(--ink-2); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 32px 0 16px;
}

/* ---------- Sections ---------- */

.section { padding: var(--section) 0 0; }
.section-intro { max-width: 860px; margin-bottom: clamp(32px, 4vw, 56px); }
.section-intro p { color: var(--ink-2); font-size: clamp(17px, 0.5vw + 15px, 21px); max-width: 40em; }

.lead {
  font-size: clamp(18px, 0.6vw + 15px, 22px);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 34em;
}

/* Chip: a tag with a state dot ("The logbook…" style) */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 600;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 24px 0 0; }
.chips li { margin: 0; }
.chip--tint { background: color-mix(in srgb, var(--amber) 16%, var(--card)); border-color: transparent; color: var(--amber-ink); }

/* ---------- Hero ---------- */

.hero { padding: clamp(32px, 5vw, 72px) 0 0; }
.hero .wrap {
  display: grid;
  gap: 40px;
  align-items: center;
}
.hero h1 { margin-top: 20px; }
.hero-meta { font-size: 15px; color: var(--ink-2); margin: 0; }
.hero-art { max-width: 520px; width: 100%; justify-self: center; }
.hero-art img { width: 100%; height: auto; }

@media (min-width: 960px) {
  .hero .wrap { grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: clamp(40px, 5vw, 96px); }
  .hero--full .wrap { min-height: min(calc(100svh - 140px), 860px); }
}

/* The hero's visual: the Mac menu behind, the iPhone in front, on a halftone panel */
.hero-stage {
  position: relative;
  aspect-ratio: 1 / 1.02;
  width: 100%;
  display: grid;
  place-items: center;
}
.hero-stage .stage-menu {
  position: absolute;
  left: 5%;
  top: 8%;
  width: 52%;
  border-radius: 14px;
}
.hero-stage .phone {
  position: absolute;
  right: 4%;
  bottom: 5%;
  width: 40%;
}
.hero-stage .stage-soot {
  position: absolute;
  left: 4%;
  bottom: -3%;
  width: 34%;
}
@media (max-width: 959px) {
  .hero-stage { max-width: 640px; justify-self: center; }
}
/* Phones: the menu would be too small to read here (it has its own row below), so the iPhone gets the stage */
@media (max-width: 599px) {
  .hero-stage { aspect-ratio: auto; padding: 40px 0; }
  .hero-stage .stage-menu { display: none; }
  .hero-stage .phone { position: relative; right: auto; bottom: auto; width: 68%; }
}

/* Page title block for inner pages */
.page-head { padding: clamp(40px, 6vw, 88px) 0 8px; }
.page-head .lead { margin-bottom: 0; }

/* ---------- Halftone panels ---------- */

.panel {
  --tone: var(--working);
  position: relative;
  border-radius: var(--r-panel);
  background-color: color-mix(in srgb, var(--tone) var(--panel-tint), var(--paper));
  background-image: radial-gradient(circle at center, color-mix(in srgb, var(--tone) var(--panel-dot), transparent) 1.3px, transparent 1.8px);
  background-size: 8px 8px;
  overflow: hidden;
}
.panel--plain { background-image: none; }
.panel--working { --tone: var(--working); }
.panel--waiting { --tone: var(--waiting); }
.panel--drowsy { --tone: var(--drowsy); }
.panel--finished { --tone: var(--finished); }
.panel--idle { --tone: var(--idle); }

/* A phone frame around a real screenshot: flat ink bezel, no shadow */
.phone {
  display: block;
  position: relative;
  width: clamp(220px, 24vw, 360px);
  padding: 2.6%;
  border-radius: 15% / 7%;
  background: #121212;
  box-shadow: 0 0 0 1px color-mix(in srgb, #F4F2EC 14%, transparent);
}
.phone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12.5% / 5.8%;
}
.phone picture { display: block; }

/* ---------- Feature rows (alternating: text and a big panel) ---------- */

.features { display: grid; gap: var(--section); padding-top: var(--section); }
.feature {
  display: grid;
  gap: clamp(28px, 4vw, 48px);
  align-items: center;
}
.feature-text { max-width: 640px; }
.feature-text h2 { font-size: clamp(32px, 2.8vw + 14px, 68px); }
.feature-text > p { color: var(--ink-2); font-size: clamp(17px, 0.5vw + 15px, 21px); }
.feature-panel {
  display: grid;
  place-items: center;
  padding: clamp(36px, 6vw, 88px) clamp(20px, 4vw, 56px);
  min-height: clamp(420px, 46vw, 720px);
}
.feature-panel .phone { width: clamp(230px, 24vw, 400px); }
.feature-panel .mac-menu { width: min(100%, 520px); border-radius: 14px; }
@media (min-width: 960px) {
  .feature { grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); }
  .feature--flip { grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); }
  .feature--flip .feature-panel { order: -1; }
  .feature-text { padding: 0 clamp(0px, 2vw, 32px); }
}

/* An iPhone alert drawn over a panel (texts from the app's real templates) */
.float-alert {
  position: absolute;
  left: 50%;
  top: calc(clamp(36px, 6vw, 88px) + clamp(40px, 4vw, 64px));
  z-index: 1;
  transform: translateX(-50%);
  width: min(90%, 460px);
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 60px;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: var(--card);
  color: var(--ink);
  border: 2px solid #121212;
  border-radius: 24px;
  font-size: 15px;
  line-height: 1.3;
  text-align: left;
}
.float-alert .icon { width: 44px; height: 44px; border-radius: 11px; }
.float-alert .thumb { width: 60px; height: 60px; border-radius: 10px; }
.float-alert b { display: block; font-weight: 650; }
.float-alert span { display: block; }
.float-alert .body { color: var(--ink-2); }

@media (max-width: 479px) {
  .float-alert { grid-template-columns: 40px minmax(0, 1fr); width: 92%; padding: 12px 14px; font-size: 14px; }
  .float-alert .icon { width: 40px; height: 40px; }
  .float-alert .thumb { display: none; }
}

/* ---------- Statement (one big paragraph) ---------- */

.statement {
  font-family: var(--font-display);
  font-size: clamp(28px, 2.9vw + 12px, 60px);
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 650;
  max-width: 24em;
  margin: 0;
  text-wrap: balance;
}
.statement .dim { color: var(--ink-3); }

/* ---------- Steps ---------- */

.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
}
.steps > li {
  counter-increment: step;
  margin: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: clamp(20px, 2vw, 28px);
}
.steps > li::before {
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-bottom: 20px;
  border-radius: 999px;
  background: var(--amber);
  color: #121212;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.steps h3 { margin-bottom: 8px; }
.steps p { margin: 0; color: var(--ink-2); }

@media (min-width: 640px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1040px) {
  .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* A wide screenshot (the Mac setup window) on its own panel */
.wide-shot {
  margin-top: 16px;
  padding: clamp(24px, 5vw, 80px) clamp(16px, 5vw, 80px) 0;
  display: grid;
  place-items: end center;
}
.wide-shot img { width: min(100%, 1040px); border-radius: 14px 14px 0 0; }

/* ---------- Cards and grids ---------- */

.grid {
  display: grid;
  gap: 16px;
}
@media (min-width: 720px) {
  .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 720px) and (max-width: 1039px) {
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: clamp(20px, 2vw, 32px);
}
.card > :last-child { margin-bottom: 0; }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--ink-2); }
.card ul { color: var(--ink-2); }
.card-icon {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 20px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--amber) 18%, var(--card));
  color: var(--amber-ink);
}
.card-icon svg { width: 26px; height: 26px; }

/* ---------- Screenshot frames (older layout, kept for other pages) ---------- */

.shot { margin: 0; }
.shot figcaption { margin-top: 8px; font-size: 13px; color: var(--ink-2); }

/* App Store screenshot strip (iPhone page): scrolls sideways inside its own box, never the page */
.gallery {
  list-style: none;
  margin: 0;
  padding: 0 0 12px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(170px, 1fr);
  gap: clamp(12px, 1.4vw, 20px);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
}
.gallery > li { margin: 0; scroll-snap-align: start; }
.gallery img {
  width: 100%;
  height: auto;
  border-radius: var(--r-card);
  border: 1px solid var(--line);
}
@media (max-width: 639px) {
  .gallery { grid-auto-columns: 70%; }
}

/* ---------- Dark band ("While you're away", the wordmark band) ---------- */

.band {
  background: var(--band);
  color: var(--band-ink);
  margin-top: var(--section);
  padding: var(--section) 0;
}
.band .section-intro p { color: var(--band-ink-2); }
.band .label { color: #FFC63D; }
.band a { color: var(--band-ink); }
.band-card {
  background: var(--band-card);
  border-radius: var(--r-card);
  padding: clamp(20px, 2vw, 32px);
}
.band-card p { color: var(--band-ink-2); margin: 0; }
.band-card h3 { margin: 20px 0 8px; display: flex; align-items: center; gap: 10px; }
.band-card .pose { width: clamp(120px, 12vw, 168px); height: auto; }

/* The wordmark band: the name as big as the screen, with Soot's poses */
.band-word { text-align: center; overflow: hidden; }
.band-word .word { width: 100%; height: auto; margin: 0 auto; }
.band-word .poses {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
  gap: clamp(8px, 2vw, 32px);
  margin: clamp(32px, 5vw, 72px) auto 0;
  max-width: 1100px;
}
.band-word .poses img { width: 100%; height: auto; }
.band-word .meaning { margin: clamp(24px, 3vw, 40px) 0 0; color: var(--band-ink-2); font-size: clamp(16px, 0.6vw + 14px, 20px); }
@media (max-width: 639px) {
  .band-word .poses { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 24px; }
}

/* ---------- Numbers strip ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--card);
  margin: 0;
  overflow: hidden;
}
.stats > div { padding: clamp(20px, 2.4vw, 36px); border-color: var(--line); border-style: solid; border-width: 0; }
.stats > div:nth-child(odd) { border-right-width: 1px; }
.stats > div:nth-child(-n+2) { border-bottom-width: 1px; }
.stats dt {
  font-family: var(--font-display);
  font-size: clamp(36px, 3.4vw + 12px, 72px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  margin-bottom: 10px;
}
.stats dd { margin: 0; color: var(--ink-2); font-size: 15px; }
@media (min-width: 900px) {
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stats > div { border-width: 0 !important; }
  .stats > div + div { border-left-width: 1px !important; }
}

/* ---------- State pills and dots ---------- */

.dot {
  display: inline-block;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--idle);
}
.dot--working { background: var(--working); }
.dot--waiting { background: var(--waiting); }
.dot--drowsy { background: var(--drowsy); }
.dot--finished { background: var(--finished); }
.dot--critical { background: var(--critical); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: color-mix(in srgb, var(--idle) 15%, var(--card));
  color: var(--idle-text);
}
.pill--working { background: color-mix(in srgb, var(--working) 18%, var(--card)); color: var(--working-text); }
.pill--waiting { background: color-mix(in srgb, var(--waiting) 15%, var(--card)); color: var(--waiting-text); }
.pill--drowsy { background: color-mix(in srgb, var(--drowsy) 15%, var(--card)); color: var(--drowsy-text); }
.pill--finished { background: color-mix(in srgb, var(--finished) 15%, var(--card)); color: var(--finished-text); }

/* ---------- Example alerts (text from the app's real templates) ---------- */

.alerts {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}
.alerts > li { margin: 0; }
.alert {
  background: var(--card);
  border-radius: var(--r-card);
  padding: 14px 16px;
}
.alert-app {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 4px;
}
.alert-title { font-weight: 650; margin: 0; }
.alert-body { margin: 2px 0 0; color: var(--ink-2); font-size: 15px; }

/* ---------- Two-column block ---------- */

.split {
  display: grid;
  gap: 24px;
  align-items: start;
}
@media (min-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(48px, 6vw, 112px); }
}
.split > div > p { color: var(--ink-2); font-size: clamp(17px, 0.5vw + 15px, 21px); }
.pose-figure { margin: 0; max-width: 220px; }
.pose-figure img { width: 100%; height: auto; }

/* Feature list with a leading mark */
.checks {
  list-style: none;
  padding: 0;
}
.checks > li {
  position: relative;
  padding-left: 28px;
}
.checks > li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.5em;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--amber);
}

/* ---------- Definition lists (requirements) ---------- */

.reqs {
  display: grid;
  gap: 16px;
  margin: 0;
}
@media (min-width: 720px) {
  .reqs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.reqs > div {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: clamp(20px, 2vw, 32px);
}
.reqs dt { font-weight: 700; font-size: clamp(18px, 0.4vw + 16px, 22px); margin-bottom: 8px; }
.reqs dd { margin: 0; color: var(--ink-2); }

/* ---------- Long-form pages (support, privacy) ---------- */

.prose { max-width: 760px; }
.prose h2 { font-size: clamp(28px, 1.6vw + 18px, 40px); margin-top: 64px; scroll-margin-top: 96px; }
.prose h3 { margin-top: 32px; scroll-margin-top: 96px; }
.prose h2:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li::marker { color: var(--ink-2); }

.toc {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 16px 20px;
  margin: 32px 0 0;
}
.toc h2 {
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 0 0 8px;
}
.toc ol { margin: 0; padding-left: 20px; }
.toc li + li { margin-top: 4px; }

.note {
  background: var(--card);
  border-left: 4px solid var(--amber);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 0 0 16px;
}
.note > :last-child { margin-bottom: 0; }
.prose .note h2 { font-size: 20px; letter-spacing: -0.01em; margin: 0 0 8px; }

/* Tables: scroll inside their own box, never the page */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
th, td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
tr:last-child td { border-bottom: 0; }
th { font-weight: 650; background: color-mix(in srgb, var(--paper) 50%, var(--card)); }
caption {
  text-align: left;
  font-size: 13px;
  color: var(--ink-2);
  padding: 10px 12px 0;
}

/* On narrow screens, record tables become stacked cards */
@media (max-width: 640px) {
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td, .table-stack caption { display: block; width: 100%; }
  .table-stack caption { padding-bottom: 4px; }
  .table-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table-stack tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .table-stack tr:last-child { border-bottom: 0; }
  .table-stack td { border: 0; padding: 4px 12px; }
  .table-stack td::before {
    content: attr(data-label);
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-2);
  }
}

/* Doc pages (support, privacy): contents in a sticky sidebar on wide screens, above the text on narrow ones */
.doc-body { display: grid; gap: 32px; align-items: start; padding-top: 24px; }
.doc-side .toc { margin: 0; }
@media (min-width: 1100px) {
  .doc-body { grid-template-columns: 280px minmax(0, 820px); gap: clamp(48px, 6vw, 120px); }
  .doc-side { position: sticky; top: 104px; }
  .doc .page-head.prose { max-width: none; padding-left: calc(280px + clamp(48px, 6vw, 120px)); }
  .doc .page-head.prose > * { max-width: 820px; }
}
.doc .prose { max-width: 820px; }

/* FAQ (details/summary, no script) */
.faq { display: grid; gap: 8px; margin: 0 0 16px; }
.faq details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 0 20px;
}
.faq summary {
  cursor: pointer;
  font-weight: 650;
  padding: 16px 0;
  list-style-position: outside;
}
.faq summary::-webkit-details-marker { color: var(--ink-2); }
.faq details[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.faq details > :last-child { margin-bottom: 16px; }

/* CTA block at the bottom of inner pages */
.cta {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-sheet);
  padding: clamp(28px, 4vw, 56px);
  margin-top: var(--section);
  display: grid;
  gap: 24px;
  align-items: center;
}
.cta h2 { margin-bottom: 8px; }
.cta p { margin: 0; color: var(--ink-2); }
.cta .btn-row { margin: 0; }
.cta .pose { width: 140px; height: auto; }
@media (min-width: 720px) {
  .cta { grid-template-columns: auto 1fr auto; }
}

/* The closing band of the home page: halftone, full width, one card in the middle */
.band-cta {
  margin-top: var(--section);
  padding: var(--section) var(--gutter);
  border-radius: 0;
  display: grid;
  place-items: center;
}
.band-cta .cta-card {
  width: min(100%, 720px);
  background: var(--card);
  border: 2px solid #121212;
  border-radius: var(--r-sheet);
  padding: clamp(28px, 5vw, 64px);
  text-align: center;
}
.band-cta .cta-card .pose { width: clamp(120px, 14vw, 180px); margin: 0 auto 16px; }
.band-cta .cta-card p { color: var(--ink-2); font-size: clamp(17px, 0.5vw + 15px, 21px); max-width: 30em; margin-inline: auto; }
.band-cta .btn-row { justify-content: center; margin-bottom: 8px; }

.note--spaced { margin-top: 48px; }
.after-steps { margin-top: 16px; }

/* ---------- Motion: rows rise in as they scroll into view (CSS only, where supported) ---------- */

@media (prefers-reduced-motion: no-preference) {
  .btn, .site-nav a { transition: background-color 180ms ease-out, border-color 180ms ease-out; }
  @supports (animation-timeline: view()) {
    .rise {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 40%;
    }
    @keyframes rise {
      from { opacity: 0; transform: translateY(40px); }
      to { opacity: 1; transform: none; }
    }
  }
}
