/* ============================================================================
   Scaffold design system — single source of truth.
   Tokens come from brand-spec.md, extracted from Scaffold-Brand-Kit.dc.html.
   No raw colour may appear outside the :root block below.
   ========================================================================= */

:root {
  /* ── six core tokens ───────────────────────────────────────────────── */
  --bg: oklch(94.6% 0.006 223.5); /* #E9EEF0 kit body background */
  --surface: oklch(100% 0 0); /* #FFFFFF kit panels          */
  --fg: oklch(23.8% 0.002 197.1); /* rgba(0,0,0,.87) body ink    */
  --muted: oklch(48.4% 0.003 228.8); /* rgba(0,0,0,.6)  captions    */
  --border: oklch(88.2% 0.015 231.2); /* hairline                    */
  --accent: oklch(51.4% 0.104 233.5); /* #0B7099 kit link colour     */

  /* ── kit brand extensions ──────────────────────────────────────────── */
  --deep: oklch(34.2% 0.065 231); /* #063E54 display + primary   */
  --nib: oklch(72.1% 0.143 232.4); /* #1AB3EF Nib body            */
  --spark: oklch(85% 0.146 90.5); /* #F2C94C the one flourish    */
  --tint: oklch(97.4% 0.003 219.5); /* #F4F7F8 inset wells         */
  --sky: oklch(89.6% 0.059 223.9); /* #B3E6FA type on --deep      */

  /* ── derived, never hand-authored ──────────────────────────────────── */
  --accent-soft: color-mix(in oklch, var(--accent) 12%, transparent);
  --deep-soft: color-mix(in oklch, var(--deep) 10%, transparent);
  --spark-soft: color-mix(in oklch, var(--spark) 26%, transparent);
  --nib-soft: color-mix(in oklch, var(--nib) 18%, transparent);
  --fg-soft: color-mix(in oklch, var(--fg) 5%, transparent);
  --on-deep-dim: color-mix(in oklch, var(--sky) 78%, var(--deep));

  /* ── app redesign palette (--sc-*) ─────────────────────────────────────
     Names follow design_handoff_app_redesign/README.md. Where a kit token
     above already holds the colour, the --sc- name aliases it so the two
     can never drift. ─────────────────────────────────────────────────── */
  --sc-navy: var(--deep); /* #063E54 app bar, primary buttons, headings   */
  --sc-navy-hover: var(--accent); /* #0B7099 hover on navy, links, eyebrows       */
  --sc-blue: var(--nib); /* #1AB3EF Nib body, done ticks, progress       */
  --sc-blue-light: var(--sky); /* #B3E6FA secondary text on navy               */
  --sc-blue-tint: oklch(95.6% 0.023 224.9); /* #E1F4FC info panels, spoken-word highlight   */
  --sc-yellow: var(--spark); /* #F2C94C spark, "now" ring, points coin       */
  --sc-yellow-tint: oklch(95.2% 0.057 93.2); /* #FCEFC4 points chips, warning panels         */
  --sc-bg: var(--tint); /* #F4F7F8 app page background, inset panels    */
  --sc-surface: var(--surface); /* #FFFFFF cards                                */
  --sc-line: var(--bg); /* #E9EEF0 dividers, neutral chips              */
  --sc-line-strong: oklch(86.8% 0.016 222.7); /* #C9D6DB input and outline-button borders     */
  --sc-footer-line: oklch(92.7% 0.009 225.1); /* #E1E8EB footer top border                    */
  --sc-ink: var(--fg); /* rgba(0,0,0,.87) body text                    */
  --sc-ink-muted: var(--muted); /* rgba(0,0,0,.6) captions, meta text           */

  /* ── type ──────────────────────────────────────────────────────────── */
  --sc-font: 'Montserrat', sans-serif;
  --font-display: var(--sc-font);
  --font-brand: var(--sc-font);
  --font-body: var(--sc-font);
  /* Montserrat throughout; real monospace stays only where look-alike characters matter */
  --font-mono: var(--sc-font);
  --font-code: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, monospace;

  --fs-h1: clamp(30px, 3.4vw, 42px);
  --fs-h2: clamp(22px, 2.2vw, 28px);
  --fs-h3: 17px;
  --fs-lead: 17px;
  --fs-body: 16px;
  --fs-meta: 13px;

  /* ── space / shape ─────────────────────────────────────────────────── */
  --gap-xs: 6px;
  --gap-sm: 12px;
  --gap-md: 20px;
  --gap-lg: 32px;
  --gap-xl: 56px;
  --gap-2xl: 88px;
  --container: 1160px;
  --wrap: 820px;
  --gutter: 28px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --bar-h: 60px;
  --shadow-sm: 0 1px 2px color-mix(in oklch, var(--deep) 10%, transparent);
  --shadow-md: 0 4px 16px color-mix(in oklch, var(--deep) 12%, transparent);
  --shadow-lg: 0 18px 48px color-mix(in oklch, var(--deep) 22%, transparent);

  /* ── app redesign radius and shadow ────────────────────────────────── */
  --sc-radius-pill: 999px;
  --sc-radius-xl: 24px; /* large card */
  --sc-radius-card: 20px;
  --sc-radius-inset: 16px; /* inset panel */
  --sc-radius-sm: 14px; /* small panel, 12–14px */
  --sc-radius-check: 8px; /* checkbox */
  --sc-ring-now: 0 0 0 3px var(--sc-yellow); /* "now" emphasis, no border */
  --sc-shadow-float: 0 4px 16px color-mix(in oklch, var(--deep) 12%, transparent);
  --sc-shadow-dialog: 0 18px 48px color-mix(in oklch, var(--deep) 30%, transparent);
  --sc-shadow-sheet: -18px 0 48px color-mix(in oklch, var(--deep) 22%, transparent);
}

/* ── reset & base ──────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--sc-bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img,
svg {
  display: block;
  max-width: 100%;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
p {
  margin: 0;
  text-wrap: pretty;
}
h1,
h2,
h3,
h4 {
  margin: 0;
  text-wrap: balance;
}
ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--sc-navy-hover);
  outline-offset: 2px;
  border-radius: 4px;
}
.on-deep :focus-visible,
.appbar :focus-visible {
  outline-color: var(--spark);
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -60px;
  z-index: 90;
  background: var(--deep);
  color: var(--surface);
  padding: 10px 16px;
  border-radius: 0 0 var(--radius) var(--radius);
  font-size: 14px;
  font-weight: 600;
}
.skip-link:focus {
  top: 0;
  text-decoration: none;
}
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ── layout ────────────────────────────────────────────────────────── */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section {
  padding-block: clamp(44px, 6vw, var(--gap-2xl));
}
.page {
  padding-block: var(--gap-lg) var(--gap-xl);
}
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--gap-md);
}
.stack-sm {
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
}
.stack-lg {
  display: flex;
  flex-direction: column;
  gap: var(--gap-lg);
}
.row {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  flex-wrap: wrap;
}
.row-tight {
  display: flex;
  align-items: center;
  gap: var(--gap-xs);
  flex-wrap: wrap;
}
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-md);
  flex-wrap: wrap;
}
.row-top {
  display: flex;
  align-items: flex-start;
  gap: var(--gap-md);
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap-md);
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap-md);
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap-md);
}
.grid-main {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(280px, 1fr);
  gap: var(--gap-lg);
  align-items: start;
}
.grid-aside {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr);
  gap: var(--gap-lg);
  align-items: start;
}
.spacer {
  flex: 1 1 auto;
}

@media (max-width: 960px) {
  .grid-3,
  .grid-4,
  .grid-main,
  .grid-aside {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  :root {
    --gutter: 18px;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ── type ──────────────────────────────────────────────────────────── */
h1,
.h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h1);
  line-height: 1.12;
  letter-spacing: -0.014em;
  color: var(--deep);
}
h2,
.h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h2);
  line-height: 1.2;
  letter-spacing: -0.011em;
  color: var(--deep);
}
h3,
.h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-h3);
  line-height: 1.32;
  letter-spacing: -0.004em;
  color: var(--deep);
}
.h4 {
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.005em;
  color: var(--deep);
}
.display {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--deep);
  line-height: 1.04;
}
.lead {
  font-size: var(--fs-lead);
  color: var(--muted);
  max-width: 62ch;
}
.body-muted {
  color: var(--muted);
}
.small {
  font-size: 14px;
}
.eyebrow {
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.meta {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  color: var(--muted);
}
.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.on-deep {
  color: var(--surface);
}
.on-deep h1,
.on-deep h2,
.on-deep h3,
.on-deep .h1,
.on-deep .h2,
.on-deep .h3,
.on-deep .display {
  color: var(--surface);
}
.on-deep .lead,
.on-deep .body-muted {
  color: var(--sky);
}
.on-deep .meta {
  color: var(--on-deep-dim);
}
.on-deep .eyebrow {
  color: var(--sky);
}
.on-deep a {
  color: var(--sky);
}
.on-deep a:hover {
  color: var(--surface);
}

/* ── logo (kit direction 1a — stacked bars, widest at the base) ─────── */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.logo-mark {
  flex: 0 0 auto;
}
.logo-word {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.6px;
  color: var(--deep);
  line-height: 1;
}
.appbar .logo-mark {
  width: 26px;
  height: 26px;
}
.logo-word.on-dark,
.appbar .logo-word {
  color: var(--surface);
}
.logo:hover {
  text-decoration: none;
}
.logo:hover .logo-word {
  color: color-mix(in oklch, var(--deep) 82%, black);
}
/* on the deep band the wordmark is already white — signal with the rule, not a lighter fill */
.appbar .logo:hover .logo-word,
.on-deep .logo:hover .logo-word {
  color: var(--surface);
  text-decoration: underline;
  text-decoration-color: var(--spark);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
/* fills live in CSS: SVG presentation attributes do not accept var() */
.logo-mark .bar-base {
  fill: var(--deep);
}
.logo-mark .bar-mid {
  fill: var(--nib);
}
.logo-mark .bar-top {
  fill: var(--spark);
}
.appbar .logo-mark .bar-base,
.on-deep .logo-mark .bar-base,
.logo-mark.on-dark .bar-base {
  fill: var(--surface);
}

/* ── monoline icon cell ────────────────────────────────────────────── */
.feature-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-content: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--deep);
  background: var(--surface);
}
.feature-mark svg {
  width: 19px;
  height: 19px;
}
.on-deep .feature-mark {
  background: transparent;
  border-color: color-mix(in oklch, var(--sky) 40%, transparent);
  color: var(--sky);
}

/* ── pull quote ────────────────────────────────────────────────────── */
.quote {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(21px, 2.1vw, 29px);
  line-height: 1.38;
  letter-spacing: -0.011em;
  margin: 0;
  max-width: 34ch;
}
.quote-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 96px;
  line-height: 0.62;
  color: var(--spark);
  user-select: none;
}
.quote-author {
  font-size: 14.5px;
  margin-top: 16px;
}

/* ── day card (backward-scheduled plan) ────────────────────────────── */
.day-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.day-card .day-no {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
}
.day-card .day-task {
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: 14.5px;
  color: var(--deep);
  margin-top: 6px;
}

/* ── browser-chrome frame for the product mock ─────────────────────── */
.mock {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.mock-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--tint);
  border-bottom: 1px solid var(--border);
}
.mock-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border);
  flex: 0 0 auto;
}
.mock-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.mock-tab {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}
.mock-tab.is-active {
  background: var(--deep);
  color: var(--surface);
}

/* ── app bar (kit deep-band inversion) ─────────────────────────────── */
.appbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--deep);
  box-shadow: var(--shadow-sm);
}
.appbar-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: none;
  padding-block: 0;
  padding-inline: 32px;
}
.appbar nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.appbar nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--sc-blue-light);
  transition:
    background 0.15s ease,
    color 0.15s ease;
}
.appbar nav a:hover {
  background: color-mix(in oklch, var(--surface) 12%, transparent);
  color: var(--surface);
  text-decoration: none;
}
.appbar nav a[aria-current='page'] {
  color: var(--sc-navy);
  background: var(--surface);
}
.appbar nav a[aria-current='page']:hover {
  background: var(--surface);
  color: var(--sc-navy);
}
/* the redesigned bar separates the points pill from the nav with space, not a rule */
.appbar-sep {
  display: none;
}

.points-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  background: color-mix(in oklch, var(--surface) 12%, transparent);
  color: var(--surface);
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.points-pill .coin {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--sc-yellow);
  flex: 0 0 auto;
}

/* Narrow screens: logo and points share the first row, the nav takes its own. */
@media (max-width: 720px) {
  .appbar-inner {
    flex-wrap: wrap;
    min-height: 0;
    padding-block: 12px;
    gap: 10px 12px;
  }
  .appbar nav {
    order: 3;
    flex: 1 1 100%;
    gap: 0;
  }
  .appbar nav a {
    padding: 0 10px;
    font-size: 13.5px;
  }
}
@media (max-width: 640px) {
  .appbar-inner {
    padding-inline: var(--gutter);
  }
}

/* ── marketing topnav (light) ──────────────────────────────────────── */
.topnav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in oklch, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topnav-inner {
  min-height: var(--bar-h);
  display: flex;
  align-items: center;
  gap: var(--gap-lg);
}
.topnav nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.topnav nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  font-size: 14.5px;
  color: var(--muted);
}
.topnav nav a:hover {
  background: var(--deep-soft);
  color: var(--deep);
  text-decoration: none;
}

/* ── buttons (44px targets) ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--sc-navy);
  color: var(--surface);
  min-height: 44px;
  padding: 0 24px;
  border: 1.5px solid var(--sc-navy);
  border-radius: var(--sc-radius-pill);
  font-family: var(--font-brand);
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  flex-shrink: 0;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}
.btn:hover {
  background: var(--sc-navy-hover);
  border-color: var(--sc-navy-hover);
  color: var(--surface);
  text-decoration: none;
}
.btn-lg {
  min-height: 52px;
  padding: 0 32px;
  font-size: 16px;
}
.btn-sm {
  min-height: 40px;
  padding: 0 18px;
  font-size: 14px;
}
.btn-block {
  width: 100%;
}
/* Pills stay on one line, except on phones where a long label must wrap, not overflow. */
@media (max-width: 480px) {
  .btn {
    max-width: 100%;
    padding-block: 10px;
    white-space: normal;
  }
}

/* primary: navy fill, white text */
.btn-primary {
  background: var(--sc-navy);
  color: var(--surface);
  border-color: var(--sc-navy);
}
.btn-primary:hover {
  background: var(--sc-navy-hover);
  border-color: var(--sc-navy-hover);
  color: var(--surface);
}
/* primary on a navy surface: the yellow main action */
.on-deep .btn-primary {
  background: var(--sc-yellow);
  border-color: var(--sc-yellow);
  color: var(--sc-navy);
}
.on-deep .btn-primary:hover {
  background: var(--surface);
  border-color: var(--surface);
  color: var(--sc-navy);
}
/* secondary: navy outline */
.btn-secondary {
  background: transparent;
  color: var(--sc-navy);
  border-color: var(--sc-navy);
}
.btn-secondary:hover {
  background: var(--sc-bg);
  border-color: var(--sc-navy);
  color: var(--sc-navy);
}
/* tertiary: pale outline, for the quieter of two actions */
.btn-tertiary {
  background: transparent;
  color: var(--sc-navy);
  border-color: var(--sc-line-strong);
  font-weight: 600;
}
.btn-tertiary:hover {
  background: var(--sc-bg);
  border-color: var(--sc-line-strong);
  color: var(--sc-navy);
}
/* quiet: soft fill, no outline */
.btn-quiet {
  background: var(--sc-bg);
  color: var(--sc-navy);
  border-color: transparent;
}
.btn-quiet:hover {
  background: var(--sc-line);
  color: var(--sc-navy);
}
.btn-outline-deep {
  background: transparent;
  color: var(--sc-navy);
  border-color: var(--sc-navy);
}
.btn-outline-deep:hover {
  background: var(--sc-navy);
  color: var(--surface);
}
/* neutral slate for destructive — the kit ships no alarm colour */
.btn-grave {
  background: transparent;
  color: var(--muted);
  border-color: var(--muted);
}
.btn-grave:hover {
  background: var(--muted);
  color: var(--surface);
  border-color: var(--muted);
}
.on-deep .btn-secondary {
  background: transparent;
  color: var(--surface);
  border-color: color-mix(in oklch, var(--sky) 55%, transparent);
}
.on-deep .btn-secondary:hover {
  background: var(--surface);
  color: var(--sc-navy);
  border-color: var(--surface);
}
.btn[disabled],
.btn[aria-disabled='true'] {
  background: var(--sc-line);
  color: var(--muted);
  border-color: var(--sc-line);
  cursor: not-allowed;
}
.btn-arrow::after {
  content: '→';
  font-family: var(--font-body);
}

/* ── surfaces ──────────────────────────────────────────────────────── */
/* white on the --sc-bg page: no border, no shadow */
.card {
  background: var(--sc-surface);
  border: 0;
  border-radius: var(--sc-radius-card);
  padding: 24px;
}
.card-pad-lg {
  padding: 32px;
  border-radius: var(--sc-radius-xl);
}
.card-tint {
  background: var(--sc-bg);
}
.card-flat {
  background: transparent;
  border: 0;
  padding: 0;
  border-radius: 0;
}
/* the one obvious next action: the yellow "now" ring */
.card-focus {
  border: 0;
  border-radius: var(--sc-radius-xl);
  box-shadow: var(--sc-ring-now);
}
.card-deep {
  background: var(--sc-navy);
  color: var(--surface);
}
.card-link {
  display: block;
  color: inherit;
}
.card-link:hover {
  box-shadow: var(--sc-shadow-float);
  text-decoration: none;
}
.card-link:hover .h3,
.card-link:hover h3 {
  color: var(--deep);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-sm);
  flex-wrap: wrap;
}
.rule {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 0;
}
.rule-deep {
  border: 0;
  border-top: 1px solid var(--deep);
  margin: 0;
}

/* ── pills, tags, badges ───────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: var(--accent);
}
.pill-course {
  background: var(--deep-soft);
  color: var(--deep);
}
.pill-next {
  background: var(--spark);
  color: var(--deep);
  font-weight: 600;
}
.pill-done {
  background: var(--nib-soft);
  color: var(--deep);
}
.pill-later {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--muted);
}
.pill-on-deep {
  background: color-mix(in oklch, var(--surface) 18%, transparent);
  color: var(--surface);
}
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  color: var(--muted);
  background: var(--surface);
}

/* ── stacked-bar meter (logo 1a logic: base → spark ascent) ─────────── */
.meter {
  display: block;
}
.meter-track {
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--deep-soft);
  overflow: hidden;
}
.meter-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--deep), var(--nib));
  min-width: 10px;
}
.meter-fill.is-complete {
  background: linear-gradient(90deg, var(--deep), var(--nib) 62%, var(--spark));
}
.meter-label {
  display: flex;
  justify-content: space-between;
  gap: var(--gap-sm);
  margin-bottom: 7px;
}
.meter-sm .meter-track {
  height: 7px;
}

/* stepped bars used on cards — three rungs, widest at base */
.rungs {
  display: flex;
  flex-direction: column-reverse;
  gap: 3px;
  width: 26px;
}
.rungs i {
  display: block;
  height: 5px;
  border-radius: var(--radius-pill);
  background: var(--deep-soft);
}
.rungs i:nth-child(1) {
  width: 100%;
}
.rungs i:nth-child(2) {
  width: 68%;
}
.rungs i:nth-child(3) {
  width: 38%;
}
.rungs[data-filled='1'] i:nth-child(1) {
  background: var(--deep);
}
.rungs[data-filled='2'] i:nth-child(1) {
  background: var(--deep);
}
.rungs[data-filled='2'] i:nth-child(2) {
  background: var(--nib);
}
.rungs[data-filled='3'] i:nth-child(1) {
  background: var(--deep);
}
.rungs[data-filled='3'] i:nth-child(2) {
  background: var(--nib);
}
.rungs[data-filled='3'] i:nth-child(3) {
  background: var(--spark);
}

/* ── forms ─────────────────────────────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field > label,
.field-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--deep);
}
.hint {
  font-size: 13.5px;
  color: var(--muted);
}
.input,
.textarea,
.select {
  width: 100%;
  min-height: 46px;
  padding: 11px 16px;
  border: 1.5px solid var(--sc-line-strong);
  border-radius: var(--sc-radius-sm);
  background: var(--surface);
  color: var(--fg);
  font-size: 16px;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}
.input::placeholder,
.textarea::placeholder {
  color: var(--muted);
}
.input:hover,
.textarea:hover,
.select:hover {
  border-color: var(--sc-navy);
}
/* the global focus ring (2px, offset 2px) stays; the border just follows it */
.input:focus-visible,
.textarea:focus-visible,
.select:focus-visible {
  border-color: var(--sc-navy-hover);
}
.textarea {
  min-height: 104px;
  resize: vertical;
  line-height: 1.6;
}
.select {
  appearance: none;
  padding-right: 40px;
  background-image: none;
}
.select-wrap {
  position: relative;
}
.select-wrap::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--deep);
  border-bottom: 2px solid var(--deep);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.input-code {
  font-family: var(--font-code);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  text-align: center;
  min-height: 60px;
}
.input-pin {
  font-family: var(--font-code);
  font-size: 26px;
  letter-spacing: 0.5em;
  text-align: center;
  min-height: 60px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}
.check input {
  appearance: none;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border: 2px solid var(--sc-line-strong);
  border-radius: var(--sc-radius-check);
  background: var(--surface);
  display: grid;
  place-content: center;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}
.check input:hover {
  border-color: var(--sc-navy);
}
.check input:checked {
  background: var(--sc-navy);
  border-color: var(--sc-navy);
}
.check input:checked::after {
  content: '';
  width: 11px;
  height: 6px;
  border-left: 2.5px solid var(--surface);
  border-bottom: 2.5px solid var(--surface);
  transform: translateY(-2px) rotate(-45deg);
}
.check span {
  font-size: 15px;
  line-height: 1.55;
}

/* duration / choice chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  min-height: 44px;
  padding: 0 18px;
  border: 1.5px solid var(--sc-line-strong);
  border-radius: var(--sc-radius-pill);
  background: var(--surface);
  color: var(--sc-navy);
  font-family: var(--font-brand);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}
.chip:hover {
  background: var(--sc-bg);
  border-color: var(--sc-navy);
  color: var(--sc-navy);
}
.chip[aria-pressed='true'] {
  background: var(--sc-navy);
  border-color: var(--sc-navy);
  color: var(--surface);
}
.chip[aria-pressed='true']:hover {
  background: var(--sc-navy-hover);
  border-color: var(--sc-navy-hover);
  color: var(--surface);
}

/* segmented control */
.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--deep-soft);
  border-radius: var(--radius-pill);
}
.segmented button {
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--deep);
  font-family: var(--font-brand);
  font-size: 14px;
  font-weight: 600;
}
.segmented button:hover {
  background: color-mix(in oklch, var(--surface) 70%, transparent);
}
.segmented button[aria-selected='true'] {
  background: var(--surface);
  color: var(--deep);
  box-shadow: var(--shadow-sm);
}
.on-deep .segmented {
  background: color-mix(in oklch, var(--surface) 14%, transparent);
}
.on-deep .segmented button {
  color: var(--sky);
}
.on-deep .segmented button:hover {
  background: color-mix(in oklch, var(--surface) 20%, transparent);
  color: var(--surface);
}
.on-deep .segmented button[aria-selected='true'] {
  background: var(--sky);
  color: var(--deep);
}

/* toggle switch */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-md);
  padding: 14px 0;
}
.switch {
  position: relative;
  flex: 0 0 auto;
  width: 52px;
  height: 30px;
  border: 0;
  padding: 0;
  border-radius: var(--radius-pill);
  background: var(--sc-line-strong);
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface);
  transition: transform 0.18s ease;
}
.switch[aria-checked='true'] {
  background: var(--deep);
}
.switch[aria-checked='true']::after {
  transform: translateX(22px);
}
.switch:hover {
  background: color-mix(in oklch, var(--sc-line-strong) 80%, var(--sc-navy));
}
.switch[aria-checked='true']:hover {
  background: var(--sc-navy-hover);
}

/* ── banners ───────────────────────────────────────────────────────── */
.banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px 20px;
  border-radius: var(--sc-radius-inset);
  border: 0;
  background: var(--surface);
  font-size: 15px;
  line-height: 1.5;
}
/* warning and note: yellow tint */
.banner-note {
  background: var(--sc-yellow-tint);
}
/* info and success: blue tint */
.banner-ok {
  background: var(--sc-blue-tint);
}
.banner-grave {
  background: var(--surface);
  border: 2px solid var(--muted);
}
.banner-offline {
  background: var(--sc-yellow-tint);
  border: 0;
  border-radius: 0;
  justify-content: center;
  text-align: center;
}
.banner strong {
  color: var(--deep);
}
.banner-mark {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-content: center;
  background: var(--deep);
  color: var(--surface);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
}
.banner-grave .banner-mark {
  background: var(--muted);
}

/* ── lists / steps ─────────────────────────────────────────────────── */
.steplist {
  display: flex;
  flex-direction: column;
}
.step-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: var(--gap-sm) var(--gap-md);
  align-items: start;
  padding: 18px 0;
  border-top: 1px solid var(--border);
}
.step-row:first-child {
  border-top: 0;
}
.step-seq {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-content: center;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.step-row[data-state='done'] .step-seq {
  background: var(--nib);
  border-color: var(--nib);
  color: var(--deep);
}
.step-row[data-state='next'] .step-seq {
  background: var(--deep);
  border-color: var(--deep);
  color: var(--surface);
}
.step-row[data-state='done'] .step-text {
  color: var(--muted);
}
.step-text {
  font-weight: 500;
  color: var(--deep);
  font-family: var(--font-brand);
  font-size: 15.5px;
}
.step-row[data-state='later'] .step-text {
  color: var(--muted);
}

.data-row {
  display: flex;
  justify-content: space-between;
  gap: var(--gap-md);
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.data-row:first-child {
  border-top: 0;
}
.data-row dt {
  color: var(--muted);
  font-size: 14px;
}
.data-row dd {
  margin: 0;
  font-weight: 600;
  color: var(--deep);
  text-align: right;
}

/* ── table ─────────────────────────────────────────────────────────── */
.ds-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}
.ds-table th,
.ds-table td {
  padding: 13px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.ds-table th {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}
.ds-table tbody tr:hover {
  background: var(--tint);
}
.ds-table .num-col {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* ── metric tile ───────────────────────────────────────────────────── */
.tile {
  background: var(--tint);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.tile-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 34px;
  line-height: 1.08;
  letter-spacing: -0.016em;
  color: var(--deep);
  font-variant-numeric: tabular-nums;
}
.tile-num .unit {
  font-size: 0.5em;
  font-weight: 700;
  margin-left: 1px;
}
.tile-label {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 6px;
}
.tile-title {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── stat billboard (marketing) ────────────────────────────────────── */
.stat-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(44px, 5.4vw, 72px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--deep);
}
.stat-label {
  color: var(--muted);
  font-size: 15px;
  margin-top: 10px;
  max-width: 26ch;
}

/* ── empty state ───────────────────────────────────────────────────── */
.empty {
  text-align: center;
  padding: clamp(36px, 6vw, 64px) var(--gutter);
}
.empty .empty-art {
  margin: 0 auto var(--gap-md);
}
.empty h2 {
  margin-bottom: 8px;
  /* app.css makes every h2 a flex row, which would pin the heading to the left */
  justify-content: center;
}
.empty .lead {
  margin-inline: auto;
}

/* ── Nib (the one flourish) ────────────────────────────────────────── */
/* Brand kit: a soft blue blob with a yellow spark. Still while idle; it
   morphs only while it works (.is-thinking), the spark orbiting the top edge.
   Geometry is derived from --nib-size (S): blob inset 0.1S, spark 0.3S,
   ring max(2px, 0.05S). data-ring picks the ring colour; none = no ring. */
.nib {
  --nib-s: var(--nib-size, 32px);
  --nib-ring: max(2px, calc(var(--nib-s) * 0.05));
  display: inline-block;
  vertical-align: middle;
  position: relative;
  flex: 0 0 auto;
  width: var(--nib-s);
  height: var(--nib-s);
}
.nib::before {
  content: '';
  position: absolute;
  inset: 10%;
  background: var(--sc-blue);
  border-radius: 50%;
}
.nib::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 30%;
  height: 30%;
  border-radius: 50%;
  background: var(--spark);
  box-sizing: border-box;
}
.nib[data-ring='deep']::after {
  border: var(--nib-ring) solid var(--deep);
}
.nib[data-ring='bg']::after {
  border: var(--nib-ring) solid var(--bg);
}
.nib[data-ring='surface']::after {
  border: var(--nib-ring) solid var(--surface);
}
.nib[data-ring='tint']::after {
  border: var(--nib-ring) solid var(--tint);
}
.nib[data-ring='nib']::after {
  border: var(--nib-ring) solid var(--nib);
}
.nib.is-thinking::before {
  animation: nibMorph 1.8s ease-in-out infinite;
}
/* Thinking: spark sits top-centre and orbits the blob's centre. The spark
   is a circle, so rotating it about the container centre is identical to
   rotating a full-size wrapper around it. */
.nib.is-thinking::after {
  top: -4%;
  right: auto;
  left: 35%;
  transform-origin: 50% calc(var(--nib-s) * 0.54);
  animation: nibOrbit 1.2s linear infinite;
}
@keyframes nibMorph {
  0%,
  100% {
    border-radius: 50%;
    transform: rotate(0) scale(0.96);
  }
  25% {
    border-radius: 58% 42% 50% 50%;
  }
  50% {
    border-radius: 44% 56% 46% 54%;
    transform: rotate(180deg) scale(1);
  }
  75% {
    border-radius: 52% 48% 60% 40%;
  }
}
@keyframes nibOrbit {
  from {
    transform: rotate(0);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ── chat ──────────────────────────────────────────────────────────── */
.chat {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.msg {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  max-width: 86%;
}
.msg-you {
  align-self: flex-end;
}
.msg-nib {
  align-self: flex-start;
}
.bubble {
  padding: 12px 16px;
  font-size: 15.5px;
  line-height: 1.5;
  border-radius: var(--radius-lg);
}
.msg-you .bubble {
  background: var(--deep);
  color: var(--surface);
  border-bottom-right-radius: 4px;
}
.msg-nib .bubble {
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.msg-nib .bubble strong {
  color: var(--deep);
}
.speaker {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
}
.word-karaoke {
  border-radius: 4px;
  padding: 0 2px;
}
.word-karaoke.is-active {
  background: var(--spark-soft);
  color: var(--deep);
  font-weight: 600;
}

/* ── whiteboard ────────────────────────────────────────────────────── */
.board {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 1px 1px, var(--border) 1px, transparent 0) 0 0/22px 22px,
    var(--surface);
  overflow: hidden;
}
.wb-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 14px;
}
.wb-card.is-active {
  border: 2px solid var(--accent);
  box-shadow: var(--shadow-md);
}
.wb-card.is-upcoming {
  opacity: 0.55;
  border-style: dashed;
  box-shadow: none;
}
.wb-kind {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.wb-card.is-upcoming .wb-kind {
  color: var(--muted);
}
.anchor-point {
  fill: var(--accent);
}
/* anchor bullets for whiteboard lists — marker stays put, text wraps beside it */
.wb-anchor-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.wb-anchor-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.wb-anchor-list li > span:last-child {
  min-width: 0;
}
.wb-anchor {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.graph-curve {
  fill: none;
  stroke: var(--nib);
  stroke-width: 2.5;
}
.graph-curve-2 {
  fill: none;
  stroke: var(--deep);
  stroke-width: 2.5;
}
.graph-grid {
  stroke: var(--border);
  stroke-width: 1;
}
.graph-axis {
  stroke: var(--muted);
  stroke-width: 1.5;
}
.graph-band {
  fill: var(--nib-soft);
}

/* ── focus timer ───────────────────────────────────────────────────── */
.timer {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 6px 0 16px;
  border-radius: var(--radius-pill);
  background: color-mix(in oklch, var(--surface) 15%, transparent);
  border: 1px solid color-mix(in oklch, var(--sky) 40%, transparent);
}
.timer-read {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  color: var(--surface);
  font-variant-numeric: tabular-nums;
}
.timer-btn {
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--sky);
  color: var(--deep);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-brand);
}
.timer-btn:hover {
  background: var(--surface);
  color: var(--deep);
}

/* ── dialog ────────────────────────────────────────────────────────── */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: color-mix(in oklch, var(--sc-navy) 45%, transparent);
  display: grid;
  place-items: center;
  padding: var(--gutter);
  overflow-y: auto;
}
.sheet-backdrop[hidden] {
  display: none;
}
.sheet {
  background: var(--sc-surface);
  border-radius: var(--sc-radius-xl);
  box-shadow: var(--sc-shadow-dialog);
  width: min(540px, 100%);
  padding: 32px;
  max-height: calc(100vh - 2 * var(--gutter));
  overflow-y: auto;
}
.sheet-wide {
  width: min(720px, 100%);
}

/* ── reward card ───────────────────────────────────────────────────── */
.reward {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.reward-cost {
  /* a chip, not a full-width bar, whether the parent is a block or a flex column */
  width: fit-content;
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--deep);
  background: var(--spark-soft);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

/* ── vault ─────────────────────────────────────────────────────────── */
.vault-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 44px;
  letter-spacing: -0.018em;
  line-height: 1.05;
  color: var(--surface);
  font-variant-numeric: tabular-nums;
}
.coin-lg {
  display: inline-grid;
  vertical-align: middle;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--spark);
  border: 3px solid var(--deep);
  place-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 17px;
  color: var(--deep);
}

/* ── legal footer ──────────────────────────────────────────────────── */
.legal {
  border-top: 1px solid var(--sc-footer-line);
  padding: 20px 64px;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  color: var(--sc-ink-muted);
}
.legal .container {
  max-width: none;
  padding-inline: 0;
  text-wrap: balance;
}
.legal strong {
  color: var(--sc-navy);
}
@media (max-width: 640px) {
  .legal {
    padding-inline: var(--gutter);
  }
}
.pagefoot {
  border-top: 1px solid var(--border);
  padding-block: var(--gap-lg);
  font-size: 14px;
  color: var(--muted);
}

/* ── launcher (index) ──────────────────────────────────────────────── */
.launch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: var(--gap-md);
}
.launch-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
}
.launch-card:hover {
  border-color: var(--deep);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  transform: translateY(-2px);
}
.launch-card:hover .h3 {
  color: var(--deep);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.launch-thumb {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--tint);
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.swatch {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  height: 72px;
}

/* ── motion respect (product requirement, not a nicety) ────────────── */
@media (prefers-reduced-motion: reduce) {
  .nib::before,
  .nib::after {
    animation: none !important;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
body[data-calm-motion='true'] .nib::before,
body[data-calm-motion='true'] .nib::after,
body.no-motion .nib::before,
body.no-motion .nib::after {
  animation: none !important;
}
