/* =========================================================================
   Just One — landing page
   A calm, one-task-at-a-time to-do app. The page recreates the app's screens
   in HTML/CSS/SVG (no web fonts, no frameworks, no CDNs) so every surface
   animates and re-themes live at near-zero payload. Motion borrows the app's
   real spring vocabulary — smooth, well-damped, never bouncy ("liquid glass").
   ========================================================================= */

:root {
  color-scheme: light;

  /* Warm stone neutrals — mirror the app's tokens (src/theme/colors.ts). */
  --bg: #fafaf9;
  --bg-warm: #f7f6f3;
  --surface: #ffffff;
  --surface-alt: #f5f5f4;
  --ink: #1c1917;
  --secondary: #44403c;
  --muted: #78716c;
  --subtle: #736e68; /* AA: >=4.6:1 on every surface used for real text */
  --border: #e7e5e4;

  /* Clay — destructive / overdue. */
  --clay: #e9cdc8;
  --clay-text: #703229;

  /* Accent — user-selectable. `--accent` is the pale pastel fill, `--accent-ink`
     the constant dark text that sits on it, `--accent-deep` the AA-safe dark
     pair used for accent-colored TEXT and the icon "1", and `--accent-rgb` the
     channels for alpha tints (blooms). Defaults = Sea Mist (the app's launch
     accent). app.js + the inline head script override these live. */
  --accent: #c7ddd5;
  --accent-deep: #55796d; /* AA-safe Sea Mist dark pair for text + icon "1" */
  --accent-ink: #292524;
  --accent-rgb: 199 221 213;

  /* Liquid-glass easing — a well-damped, overshoot-free curve approximating the
     app's exit spring (damping 22 / stiffness 150). */
  --ease-glass: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --shadow-card: 0 18px 50px rgba(28, 25, 23, 0.1), 0 2px 8px rgba(28, 25, 23, 0.04);
  --shadow-soft: 0 12px 36px rgba(28, 25, 23, 0.07);

  --r-lg: 26px;
  --r-md: 18px;
  --r-pill: 999px;

  --font:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    "Apple Color Emoji", sans-serif;

  --maxw: 1080px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Offset in-page anchor jumps so they clear the fixed nav (+ any notch). */
  scroll-padding-top: calc(58px + env(safe-area-inset-top, 0px) + 12px);
  /* No gray tap-flash on iOS — the :active press states below are the feedback. */
  -webkit-tap-highlight-color: transparent;
}

/* Suppress iOS pull-to-refresh + the rubber-band glow at the page edges: pure OS
   bounce, which fights the "never bouncy / liquid glass" feel. */
html,
body {
  overscroll-behavior-y: none;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* clip (not hidden) keeps overflow-y computed as visible, so it never becomes a
     scroll container that would break the Collapse's position: sticky. */
  overflow-x: clip;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: -0.025em;
  line-height: 1.04;
  font-weight: 800;
}

p {
  margin: 0;
}

a {
  color: var(--accent-deep);
  text-decoration: none;
  transition: color 0.4s ease, opacity 0.18s ease;
}
/* Hover is gated to devices that truly hover (mouse/trackpad); on touch it would
   "stick" after a tap until you tap elsewhere. :active below is the touch feedback. */
@media (hover: hover) and (pointer: fine) {
  a:hover {
    opacity: 0.78;
  }
}
a:active {
  opacity: 0.6;
}

button {
  font-family: inherit;
  cursor: pointer;
}

.accent-ink {
  color: var(--accent-deep);
  transition: color 0.4s ease;
}

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

.skip-link:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  width: auto;
  height: auto;
  clip: auto;
  margin: 0;
  padding: 10px 16px;
  z-index: 100;
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-soft);
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 6px;
}
:focus:not(:focus-visible) {
  outline: none;
}

/* ── Buttons & chips ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 26px;
  border: 0;
  border-radius: var(--r-pill);
  font-size: 1.02rem;
  font-weight: 700;
  text-decoration: none;
  transition:
    transform 0.32s var(--ease-glass),
    background-color 0.4s ease,
    color 0.4s ease,
    box-shadow 0.3s ease,
    opacity 0.2s ease;
}
.btn:active {
  transform: scale(0.97);
}

/* Touch: drop double-tap-zoom on rapidly-tapped controls (Surprise me, modes,
   dots) and the legacy tap delay. No-op / harmless on mouse. */
.btn,
.swatch,
.seg,
.nav-cta,
.linklike,
.calm-dots button {
  touch-action: manipulation;
}

.btn-accent {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 10px 24px rgb(var(--accent-rgb) / 0.4);
}
@media (hover: hover) and (pointer: fine) {
  .btn-accent:hover {
    box-shadow: 0 14px 30px rgb(var(--accent-rgb) / 0.55);
    transform: translateY(-1px);
  }
}
/* On touch the Done press settles its shadow inward (combines with .btn:active
   scale) instead of the hover lift, which never fires on a finger. */
.btn-accent:active {
  box-shadow: 0 4px 14px rgb(var(--accent-rgb) / 0.5);
}

.btn-ghost {
  background: var(--surface-alt);
  color: var(--secondary);
}
@media (hover: hover) and (pointer: fine) {
  .btn-ghost:hover {
    background: var(--border);
  }
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  background: var(--surface-alt);
  color: var(--secondary);
  font-size: 0.92rem;
  font-weight: 600;
  transition: background-color 0.4s ease, color 0.4s ease;
}
.chip--active {
  background: var(--accent);
  color: var(--accent-ink);
}
.chip--ring {
  min-width: 38px;
  background: transparent;
  border: 2px solid var(--accent);
  transition: border-color 0.4s ease;
}

.linklike {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent-deep);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.4s ease, opacity 0.18s ease;
}
.linklike:active {
  opacity: 0.6;
}

.section-kicker {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--subtle);
}

/* ── Sticky mini-bar ──────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Grow the bar under the status bar / Dynamic Island so its 58px content box
     stays clear of the notch; sides clear the notch in landscape. */
  height: calc(58px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) max(clamp(16px, 4vw, 34px), env(safe-area-inset-right))
    0 max(clamp(16px, 4vw, 34px), env(safe-area-inset-left));
  background: rgba(250, 250, 249, 0);
  border-bottom: 1px solid transparent;
  transition: background-color 0.32s ease, border-color 0.32s ease, box-shadow 0.32s ease;
}
.nav.scrolled {
  background: rgba(250, 250, 249, 0.72);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom-color: var(--border);
  box-shadow: 0 1px 20px rgba(28, 25, 23, 0.04);
}
.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.nav-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(28, 25, 23, 0.12);
}
.nav-cta {
  padding: 9px 18px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--secondary);
  font-weight: 650;
  font-size: 0.92rem;
  transition: transform 0.32s var(--ease-glass), border-color 0.3s ease, opacity 0.18s ease;
}
@media (hover: hover) and (pointer: fine) {
  .nav-cta:hover {
    border-color: var(--subtle);
    opacity: 1;
  }
}
.nav-cta:active {
  transform: scale(0.97);
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh; /* tracks the live viewport as the URL bar retracts */
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 96px max(clamp(16px, 4vw, 34px), env(safe-area-inset-right)) 60px
    max(clamp(16px, 4vw, 34px), env(safe-area-inset-left));
  /* Clip the Focus card as it flies off-screen. hidden is the pre-Safari-16
     fallback for clip; neither breaks the Collapse's sticky (it's a sibling). */
  overflow-x: hidden;
  overflow-x: clip;
}
.hero-inner {
  width: min(var(--maxw), 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  gap: clamp(28px, 6vw, 72px);
  align-items: center;
}
.hero-icon {
  width: 78px;
  height: 78px;
  border-radius: 20px;
  box-shadow: 0 14px 30px rgb(var(--accent-rgb) / 0.4);
  margin-bottom: 22px;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-deep);
  margin-bottom: 14px;
  transition: color 0.4s ease;
}
.hero-title {
  font-size: clamp(3rem, 8vw, 5.6rem);
  margin-bottom: 22px;
}
.hero-sub {
  max-width: 30em;
  font-size: clamp(1.06rem, 1.5vw, 1.26rem);
  color: var(--muted);
  margin-bottom: 22px;
}
.hero-hint {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  color: var(--subtle);
  transition: opacity 0.5s ease;
}
.hero-hint.is-hidden {
  opacity: 0;
}
.hero-hint-glyph {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--subtle);
  position: relative;
  flex: none;
}
.hero-hint-glyph::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--subtle);
  animation: hintpulse 2.4s var(--ease-out) infinite;
}
@keyframes hintpulse {
  0%, 100% { transform: scale(0.6); opacity: 0.5; }
  50% { transform: scale(1); opacity: 1; }
}

/* Hero stage + Focus card */
.hero-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}
.focus-wrap {
  position: relative;
  width: min(360px, 86vw);
}
.focus-deck {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.deck-card {
  position: absolute;
  inset: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transform-origin: center top;
}
.deck-card--1 {
  transform: translateY(16px) scale(0.955);
  opacity: 0.72;
  box-shadow: var(--shadow-soft);
}
.deck-card--2 {
  transform: translateY(32px) scale(0.91);
  opacity: 0.42;
}

.focus-card {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 340px;
  padding: 26px 26px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
}
.focus-card.is-dragging {
  transition: none !important;
  will-change: transform;
}
.focus-card.is-grabbable {
  cursor: grab;
}
.focus-card.is-grabbing {
  cursor: grabbing;
}
/* Touch has no grab cursor, so give the card a faint press-in (a calm 0.8% dip,
   smaller than the buttons) the moment a finger lands — confirming it's a thing
   you can grab. Skipped once a real drag starts (inline transform takes over). */
@media (hover: none) and (pointer: coarse) {
  .focus-card:active:not(.is-dragging) {
    transform: scale(0.992);
    transition: transform 0.18s var(--ease-glass);
  }
}
.focus-pos {
  align-self: flex-end;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  background: var(--surface-alt);
  color: var(--subtle);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}
.focus-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px 2px 22px;
}
.focus-due {
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--muted);
  margin-bottom: 10px;
  min-height: 1.2em;
}
.focus-due.is-overdue {
  color: var(--clay-text);
}
.focus-task-title {
  font-size: clamp(1.7rem, 4.5vw, 2.15rem);
  letter-spacing: -0.03em;
}
.focus-task-desc {
  margin-top: 10px;
  color: var(--muted);
  font-size: 1rem;
}
.focus-task-desc:empty {
  display: none;
}
.focus-actions {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 12px;
}
.focus-actions .btn {
  min-height: 52px;
  width: 100%;
}

/* Done overlays */
.focus-bloom {
  position: absolute;
  top: 42%;
  left: 50%;
  width: 120px;
  height: 120px;
  margin: -60px 0 0 -60px;
  border-radius: 50%;
  background: rgb(var(--accent-rgb) / 1);
  opacity: 0;
  transform: scale(0.6);
  pointer-events: none;
}
.focus-bloom.is-blooming {
  animation: bloom 540ms var(--ease-out) forwards;
}
@keyframes bloom {
  0% { opacity: 0; transform: scale(0.6); }
  14% { opacity: 0.34; }
  100% { opacity: 0; transform: scale(2.6); }
}

/* Accent ripple — a full-viewport wash that blooms FROM the tapped swatch when
   the accent changes, so re-theming reads as a single calm pulse across the page.
   JS injects the element, sets its --bx/--by origin, and removes it on animationend. */
.accent-bloom {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  background: radial-gradient(
    circle at var(--bx, 50%) var(--by, 50%),
    rgb(var(--accent-rgb) / 0.22),
    transparent 60%
  );
  opacity: 0;
  animation: accent-bloom 560ms var(--ease-out) forwards;
}
@keyframes accent-bloom {
  0% { opacity: 0; }
  18% { opacity: 1; }
  100% { opacity: 0; }
}
.focus-check {
  position: absolute;
  top: 42%;
  left: 50%;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  fill: none;
  stroke: var(--accent-deep);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
}
.focus-check.is-checking {
  animation: checkpop 420ms var(--ease-out) forwards;
}
@keyframes checkpop {
  0% { opacity: 0; transform: scale(0.7); }
  35% { opacity: 1; transform: scale(1.05); }
  70% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1); }
}

/* Celebration (queue emptied) */
.focus-celebrate {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 30px;
  text-align: center;
  background: var(--surface);
  border-radius: var(--r-lg);
}
.focus-celebrate[hidden] {
  display: none;
}
.focus-celebrate h2 {
  font-size: clamp(1.8rem, 5vw, 2.3rem);
}
.focus-celebrate p {
  color: var(--muted);
  max-width: 22em;
}
.focus-celebrate .btn {
  margin-top: 8px;
}

/* Inline accent rail (hero) */
.accent-rail {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  /* Narrow enough to wrap the 13 swatches into balanced 7 + 6 rows, rather than
     an 11 + 2 split against the full card width. */
  max-width: min(228px, 86vw);
}
.accent-rail .swatch {
  width: 22px;
  height: 22px;
}
/* Grow the touch target past the 22px dot without overlapping neighbours (9px
   gap), and without touching the box-shadow ring/checkmark anchored to the dot. */
.accent-rail .swatch::before {
  content: "";
  position: absolute;
  inset: -4px;
}

/* Scroll hint */
.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: max(24px, calc(env(safe-area-inset-bottom, 0px) + 12px));
  transform: translateX(-50%);
  width: 1px;
  height: 46px;
  overflow: hidden;
}
.scroll-hint span {
  position: absolute;
  inset: 0;
  background: var(--subtle);
  animation: scrolldraw 2.4s var(--ease-out) infinite;
}
@keyframes scrolldraw {
  0% { transform: translateY(-100%); }
  45%, 100% { transform: translateY(100%); }
}

/* ── The Collapse ─────────────────────────────────────────────────────────── */
.collapse {
  position: relative;
  height: 190vh;
}
.collapse-sticky {
  position: sticky;
  top: 0;
  /* dvh tracks the live viewport, so the centred head/stack never push under the
     notch while the URL bar is showing — and it keeps the scrub calibrated
     (paneHeight === innerHeight at every URL-bar state). vh is the pre-dvh fallback. */
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 80px max(20px, env(safe-area-inset-right)) 40px max(20px, env(safe-area-inset-left));
  overflow: hidden;
}
.collapse-bloom {
  position: absolute;
  top: 52%;
  left: 50%;
  width: min(640px, 90vw);
  height: min(640px, 90vw);
  transform: translate(-50%, -50%) scale(0.3);
  border-radius: 50%;
  background: radial-gradient(circle, rgb(var(--accent-rgb) / 0.5), transparent 62%);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}
.collapse-head {
  position: relative;
  z-index: 2;
  text-align: center;
  font-size: clamp(2rem, 6.5vw, 4rem);
  display: grid;
}
.collapse-head span {
  grid-area: 1 / 1;
}
.collapse-head-b {
  color: var(--ink);
}
.collapse-stage {
  position: relative;
  z-index: 1;
  width: min(420px, 84vw);
  height: min(52vh, 460px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.collapse-stack {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  justify-content: center;
  -webkit-mask-image: linear-gradient(transparent, #000 16%, #000 84%, transparent);
  mask-image: linear-gradient(transparent, #000 16%, #000 84%, transparent);
}
.mini-card {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 13px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--secondary);
  font-weight: 600;
  font-size: 0.96rem;
  box-shadow: 0 6px 18px rgba(28, 25, 23, 0.04);
}
.mini-card em {
  margin-left: auto;
  font-style: normal;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--clay-text);
  background: var(--clay);
  padding: 2px 9px;
  border-radius: var(--r-pill);
}
.mini-card--final {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 24px 24px 22px;
  transform: translate(-50%, -50%) scale(0.9);
  opacity: 0;
  box-shadow: var(--shadow-card);
  border-color: var(--border);
}
.mini-final-due {
  font-size: 0.86rem;
  font-weight: 650;
  color: var(--muted);
}
.mini-card--final strong {
  font-size: clamp(1.4rem, 4vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.mini-final-pos {
  margin-top: 4px;
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--subtle);
}
.collapse-sub {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 30em;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.18rem);
}

/* A quiet "keep scrolling" cue for the pinned Collapse — on a phone the 190vh
   pin can read as stuck. Decorative; hidden until JS drives it, and under
   reduced motion (where the section isn't a scrub). */
.collapse-progress {
  position: absolute;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: 64px;
  height: 2px;
  border-radius: var(--r-pill);
  background: var(--border);
  overflow: hidden;
  opacity: 0;
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.collapse-progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--accent-deep);
  transform: scaleX(0);
  transform-origin: left center;
}

/* Collapse end-state (no-JS / reduced motion fallback) */
.collapse.is-collapsed .mini-card:not(.mini-card--final) {
  opacity: 0;
}
.collapse.is-collapsed .mini-card--final {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.collapse.is-collapsed .collapse-head-a {
  opacity: 0;
}
.collapse.is-collapsed .collapse-bloom {
  opacity: 0.85;
  transform: translate(-50%, -50%) scale(1);
}
/* Pre-JS / mid-scroll default (expanded) — only applies once JS removes
   is-collapsed and drives the scrub. */
.collapse:not(.is-collapsed) .collapse-head-b {
  opacity: 0;
}
.collapse:not(.is-collapsed) .collapse-sub {
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* ── How it works ─────────────────────────────────────────────────────────── */
.how {
  width: min(var(--maxw), 100%);
  margin: 0 auto;
  padding: clamp(70px, 12vw, 140px) clamp(16px, 4vw, 34px);
  padding-right: max(clamp(16px, 4vw, 34px), env(safe-area-inset-right));
  padding-left: max(clamp(16px, 4vw, 34px), env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: clamp(56px, 9vw, 110px);
}
.how > .section-kicker {
  text-align: center;
  margin-bottom: -20px;
}
.how-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 6vw, 72px);
  align-items: center;
}
.how-row--rev .how-copy {
  order: 2;
}
.how-copy h3 {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  margin-bottom: 12px;
}
.how-copy p {
  color: var(--muted);
  font-size: clamp(1.02rem, 1.4vw, 1.18rem);
  max-width: 26em;
}

.how-art {
  position: relative;
  height: 220px;
  border-radius: var(--r-lg);
  background: var(--bg-warm);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
/* See one */
.ha-stack {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ha-stack span {
  width: 150px;
  height: 26px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  opacity: 0.55;
}
.how-art--see .ha-one {
  position: relative;
  width: 200px;
  height: 86px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border);
  transform: translateY(18px) scale(0.96);
  opacity: 0;
  transition: transform 0.7s var(--ease-glass), opacity 0.7s var(--ease-glass);
}
.reveal.in .how-art--see .ha-one,
.how-art--see.in .ha-one {
  transform: none;
  opacity: 1;
}
/* Swipe */
.how-art--swipe .ha-card {
  width: 180px;
  height: 96px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border);
  z-index: 2;
  transition: transform 0.9s var(--ease-glass);
}
.reveal.in .how-art--swipe .ha-card {
  animation: swipenudge 2.6s var(--ease-glass) 0.3s infinite;
}
@keyframes swipenudge {
  0%, 100% { transform: translateX(0); }
  42% { transform: translateX(54px); }
  46% { transform: translateX(54px); }
  88% { transform: translateX(0); }
}
.ha-hint {
  position: absolute;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 6px 14px;
  border-radius: var(--r-pill);
}
.ha-hint--skip {
  left: 20px;
  color: var(--clay-text);
  background: var(--clay);
}
.ha-hint--done {
  right: 20px;
  color: var(--accent-ink);
  background: var(--accent);
  transition: background-color 0.4s ease;
}
/* Drawer */
.how-art--drawer .ha-focus {
  width: 150px;
  height: 110px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border);
  z-index: 2;
}
.how-art--drawer .ha-drawer {
  position: absolute;
  right: -120px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--surface-alt);
  opacity: 0.5;
  transition: transform 0.8s var(--ease-glass), opacity 0.8s var(--ease-glass);
}
.ha-drawer span {
  width: 96px;
  height: 16px;
  border-radius: 6px;
  background: var(--surface);
}
.reveal.in .how-art--drawer .ha-drawer {
  transform: translateX(-90px);
  opacity: 0.85;
}

/* ── Make it yours ────────────────────────────────────────────────────────── */
.theme {
  text-align: center;
  padding: clamp(60px, 10vw, 120px) clamp(16px, 4vw, 34px);
  padding-right: max(clamp(16px, 4vw, 34px), env(safe-area-inset-right));
  padding-left: max(clamp(16px, 4vw, 34px), env(safe-area-inset-left));
}
.theme-inner {
  width: min(640px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.theme-icon {
  width: 110px;
  height: 110px;
  border-radius: 26px;
  box-shadow: 0 20px 44px rgb(var(--accent-rgb) / 0.5);
  margin-bottom: 26px;
}
.theme h2 {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  max-width: 14em;
}
.theme-sub {
  margin-top: 14px;
  color: var(--muted);
  max-width: 30em;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
}
.swatches {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 30px 0 8px;
  max-width: 460px;
}
.swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: var(--sw);
  box-shadow: inset 0 0 0 1px rgba(28, 25, 23, 0.08);
  position: relative;
  transition: transform 0.3s var(--ease-glass), box-shadow 0.3s ease;
}
/* Transparent overlay lifts the 36px dot to a 44px (HIG) touch target without
   moving the painted disc, its hairline, or the box-shadow selection ring. */
.swatch::before {
  content: "";
  position: absolute;
  inset: -4px;
}
@media (hover: hover) and (pointer: fine) {
  .swatch:hover {
    transform: scale(1.12);
  }
}
.swatch:active {
  transform: scale(0.92);
}
.swatch[aria-pressed="true"] {
  box-shadow: inset 0 0 0 1px rgba(28, 25, 23, 0.08), 0 0 0 2px var(--bg), 0 0 0 4px var(--ink);
}
.swatch[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 12px;
  height: 7px;
  border-left: 2.5px solid rgba(41, 37, 36, 0.85);
  border-bottom: 2.5px solid rgba(41, 37, 36, 0.85);
  transform: translateY(-1px) rotate(-45deg);
}
.theme-demo {
  display: flex;
  gap: 10px;
  margin: 22px 0 4px;
}
.theme-surprise {
  margin-top: 14px;
}

/* ── Queue modes ──────────────────────────────────────────────────────────── */
.modes {
  padding: clamp(60px, 10vw, 120px) clamp(16px, 4vw, 34px);
  padding-right: max(clamp(16px, 4vw, 34px), env(safe-area-inset-right));
  padding-left: max(clamp(16px, 4vw, 34px), env(safe-area-inset-left));
  background: var(--bg-warm);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow-x: hidden;
  overflow-x: clip;
}
.modes-inner {
  width: min(560px, 100%);
  margin: 0 auto;
  text-align: center;
}
.modes h2 {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  margin-bottom: 28px;
}
.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  padding: 5px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}
.seg {
  border: 0;
  background: transparent;
  color: var(--secondary);
  font-weight: 650;
  font-size: 0.95rem;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  transition: transform 0.3s var(--ease-glass), background-color 0.4s ease, color 0.3s ease;
}
.seg[aria-checked="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}
@media (hover: hover) and (pointer: fine) {
  .seg:hover:not([aria-checked="true"]) {
    background: var(--surface-alt);
  }
}
.seg:active {
  transform: scale(0.96);
}
.modes-caption {
  margin: 22px 0 10px;
  color: var(--subtle);
  min-height: 1.5em;
}
.modes-deck {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 420px;
  margin: 18px auto 0;
}
.modes-deck .mc {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  text-align: left;
  box-shadow: 0 6px 18px rgba(28, 25, 23, 0.04);
}
.modes-deck .mc-title {
  font-weight: 650;
  color: var(--secondary);
}
.modes-deck .mc-due {
  font-size: 0.84rem;
  font-weight: 650;
  color: var(--muted);
  white-space: nowrap;
}
.modes-deck .mc-due.is-overdue {
  color: var(--clay-text);
  background: var(--clay);
  padding: 3px 10px;
  border-radius: var(--r-pill);
}
.modes-deck .mc.is-faded {
  opacity: 0.4;
}
.modes-empty {
  margin-top: 18px;
  color: var(--subtle);
  font-style: italic;
}

/* ── Calm by design ───────────────────────────────────────────────────────── */
.calm {
  padding: clamp(60px, 10vw, 120px) clamp(16px, 4vw, 34px);
  padding-right: max(clamp(16px, 4vw, 34px), env(safe-area-inset-right));
  padding-left: max(clamp(16px, 4vw, 34px), env(safe-area-inset-left));
}
.calm-inner {
  width: min(var(--maxw), 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
}
.calm-copy h2 {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  margin: 14px 0 16px;
}
.calm-copy p {
  color: var(--muted);
  font-size: clamp(1.02rem, 1.4vw, 1.18rem);
  max-width: 26em;
}
.calm-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.calm-screen {
  position: relative;
  width: min(340px, 88vw);
  height: 300px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.calm-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px;
  text-align: center;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.55s var(--ease-glass), transform 0.55s var(--ease-glass);
  pointer-events: none;
}
.calm-state.is-active {
  opacity: 1;
  transform: none;
}
.calm-state h3 {
  font-size: clamp(1.4rem, 4vw, 1.9rem);
}
.calm-state p {
  color: var(--muted);
  font-size: 0.98rem;
  max-width: 20em;
}
/* Streak: a quiet add-on after the signature line, never a counter. */
.streak-note {
  display: block;
  margin-top: 8px;
  color: var(--subtle);
  font-size: 0.86rem;
  font-weight: 600;
}
.calm-pulse {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgb(var(--accent-rgb) / 0.35);
  position: relative;
  margin-bottom: 4px;
}
.calm-pulse::after {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  background: var(--accent-deep);
  opacity: 0.8;
}
.calm-dots {
  display: flex;
  gap: 4px;
}
/* 9px visual dot, ~31px tappable area (transparent padding shows via content-box).
   content-box is required: the global border-box would otherwise fold the 9px
   width inside the 12px padding, collapsing the painted area to nothing. */
.calm-dots button {
  box-sizing: content-box;
  width: 9px;
  height: 9px;
  padding: 11px;
  border: 0;
  /* A muted ink so inactive dots actually read on the warm-stone bg —
     var(--border) was near-invisible, leaving only the active dot showing. */
  background: rgba(28, 25, 23, 0.3);
  background-clip: content-box;
  border-radius: 50%;
  transition: background-color 0.3s ease, transform 0.3s var(--ease-glass);
}
@media (hover: hover) and (pointer: fine) {
  .calm-dots button:hover {
    /* background-color (not the shorthand) so the content-box clip is preserved. */
    background-color: rgba(28, 25, 23, 0.5);
  }
}
/* Touch press feedback (the active dot is now colour-only, so a press-in dip
   reads as a tap without a competing scale). */
.calm-dots button:active {
  transform: scale(0.85);
}
/* background-color, NOT `background:` — the shorthand resets background-clip to
   border-box, which is what made the active dot balloon to the full tap area. */
.calm-dots button[aria-pressed="true"] {
  background-color: var(--accent-deep);
}
/* Quiet caption inviting the tap — the lone tinted dot doesn't read as a control. */
.calm-hint {
  margin-top: -8px;
  color: var(--subtle);
  font-size: 0.85rem;
}

/* ── Quietly capable ──────────────────────────────────────────────────────── */
.capable {
  text-align: center;
  padding: clamp(64px, 10vw, 120px) clamp(16px, 4vw, 34px) clamp(40px, 7vw, 80px);
  padding-right: max(clamp(16px, 4vw, 34px), env(safe-area-inset-right));
  padding-left: max(clamp(16px, 4vw, 34px), env(safe-area-inset-left));
}
.capable-line {
  color: var(--muted);
  font-size: clamp(1.05rem, 1.7vw, 1.3rem);
  max-width: 32em;
  margin: 0 auto 12px;
}
.capable-line--strong {
  color: var(--ink);
  font-weight: 700;
}
/* Wider column so the full feature run stays on one line on desktop (it wraps
   gracefully once the viewport is genuinely too narrow). */
.capable-line--features {
  max-width: 44em;
}
.capable-platforms {
  margin-top: 26px;
  color: var(--subtle);
  font-weight: 650;
  letter-spacing: 0.02em;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.footer {
  text-align: center;
  /* Keep the CTA / fine print clear of the home indicator, and the sides clear
     of the notch in landscape. */
  padding: clamp(60px, 9vw, 110px) max(clamp(16px, 4vw, 34px), env(safe-area-inset-right))
    max(clamp(48px, 7vw, 80px), calc(env(safe-area-inset-bottom, 0px) + 24px))
    max(clamp(16px, 4vw, 34px), env(safe-area-inset-left));
  border-top: 1px solid var(--border);
  background: var(--bg-warm);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.footer-icon {
  width: 60px;
  height: 60px;
  border-radius: 15px;
  box-shadow: 0 12px 26px rgb(var(--accent-rgb) / 0.4);
  margin-bottom: 22px;
}
.footer-tagline {
  font-size: clamp(1.7rem, 5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 26px;
}
.footer-cta {
  margin-bottom: 24px;
}
.footer-contact {
  color: var(--subtle);
}
.footer-fine {
  margin-top: 10px;
  color: var(--subtle);
  font-size: 0.88rem;
}
.footer-meta {
  margin-top: 16px;
}

/* Decorative demo surfaces: stop a press-and-hold (most likely during the
   scroll-scrubbed Collapse, where mini-card text sits under the finger) from
   popping the iOS selection/callout over text that's never meant to be selected.
   Real body copy elsewhere stays selectable. */
.collapse-stack,
.modes-deck,
.calm-screen {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* ── Scroll-reveal ────────────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease-glass), transform 0.7s var(--ease-glass);
}
.reveal.in {
  opacity: 1;
  transform: none;
}
.no-js .reveal {
  opacity: 1;
  transform: none;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }
  .hero-copy {
    order: 2;
  }
  .hero-icon {
    margin-inline: auto;
  }
  .hero-stage {
    order: 1;
  }
  .hero-sub {
    margin-inline: auto;
  }
  .how-row,
  .how-row--rev .how-copy {
    grid-template-columns: 1fr;
    order: 0;
  }
  .how-copy {
    text-align: center;
  }
  .how-copy p {
    margin-inline: auto;
  }
  .calm-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .calm-copy p {
    margin-inline: auto;
  }
}

@media (max-width: 430px) {
  .hero {
    padding-top: 84px;
  }
  .focus-actions {
    grid-template-columns: 1fr 1fr;
  }
  /* A wrapped 999px pill reads as broken; become a clean 2x2 grid instead. */
  .segmented {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    width: 100%;
    border-radius: var(--r-md);
  }
  .seg {
    padding: 9px 13px;
    font-size: 0.92rem;
  }
}

/* ── Reduced motion ───────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
  .scroll-hint,
  .hero-hint-glyph::after,
  .collapse-progress {
    display: none;
  }
  /* No pointless scroll-runway: the Collapse becomes a normal section showing
     its resolved end-state (one card), since there's no scrubbed animation. */
  .collapse {
    height: auto;
  }
  .collapse-sticky {
    position: static;
    height: auto;
    min-height: 78vh;
  }
}
