/* Colours are the app's night palette: babysleep-mobile/src/theme/colors.ts. */

:root {
  color-scheme: dark;
  --bg: #0E1022;
  --bg-2: #13152E;
  --surface: #171A39;
  --surface-2: #1E2245;
  --line: #2A2E55;
  --ink: #EEECFB;
  --muted: #B3B1D6;
  --faint: #8C8AB0;
  --accent: #A194FF;
  --accent-hover: #B5AAFF;
  --on-accent: #14112E;
  --accent-soft: #262352;
  --moon: #F6C66B;
  --moon-soft: #3A3020;
  --on-moon: #241A05;
  --sleep: #8EA6FF;
  --sleep-soft: #232C5A;
  --feed: #F4A98B;
  --feed-soft: #3A2620;
  --diaper: #7FD1B9;
  --diaper-soft: #173731;
  --error: #FF8A8A;
  --success: #6FD3A6;
  --surface-hover: #272B55;
  --sky: #1A1C44;
  --device: #07081A;
  --avatar-a: #C9C1FF;
  --sleep-track: #33407A;
  --moon-hover: #FFD488;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;

  --s-small: 15px;
  --s-body: 18px;
  --s-mid: clamp(20px, 1.6vw, 24px);
  --s-h2: clamp(30px, 2.8vw, 40px);
  --s-h1: clamp(34px, 3.9vw, 58px);
  --s-fig: clamp(84px, 12.5vw, 192px);

  --margin: clamp(20px, 2.8vw, 40px);
  --section: clamp(112px, 13vw, 200px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--s-body);
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
p, h1, h2, h3, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent); color: var(--on-accent); }
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }

h1 { font-size: var(--s-h1); line-height: 1.04; letter-spacing: -0.032em; font-weight: 650; }
h2 { font-size: var(--s-h2); line-height: 1.1; letter-spacing: -0.025em; font-weight: 650; }
h3 { font-size: var(--s-body); line-height: 1.4; font-weight: 650; }

.sr-only {
  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 {
  position: absolute; left: 16px; top: -80px; z-index: 20; padding: 10px 16px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent); font-weight: 600; text-decoration: none;
}
.skip:focus { top: 16px; }
.wrap { max-width: 1440px; margin-inline: auto; padding-inline: var(--margin); }

/* ---------- header ---------- */
.top {
  position: absolute; inset: 0 0 auto; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 26px var(--margin);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; text-decoration: none; letter-spacing: -0.01em; }
.brand img { width: 32px; height: 32px; border-radius: 9px; }
.langs { display: flex; gap: 20px; font-size: var(--s-small); }
.langs a { color: var(--muted); text-decoration: none; padding: 4px 0; transition: color 0.16s; }
.langs a:hover { color: var(--ink); text-decoration: underline; }
.langs a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 6px; }

/* ---------- buttons and the waitlist form ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border: 0; border-radius: 999px;
  background: var(--accent); color: var(--on-accent); font-weight: 650; font-size: var(--s-body);
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background-color 0.16s, transform 0.16s var(--ease);
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: scale(0.97); }
.btn[disabled] { cursor: progress; background: var(--accent-hover); }

.waitlist { max-width: 540px; }
.wl-label { display: block; margin-bottom: 10px; font-size: var(--s-small); color: var(--muted); }
.wl-row {
  display: flex; gap: 6px; padding: 5px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  transition: border-color 0.16s;
}
.wl-row:focus-within { border-color: var(--accent); }
.wl-row input {
  flex: 1; min-width: 0; height: 48px; padding: 0 16px; border: 0; background: transparent;
  font-size: var(--s-body); outline: none;
}
.wl-row input::placeholder { color: var(--faint); }
.wl-row input[aria-invalid="true"] { color: var(--error); }
.wl-msg { min-height: 1.5em; margin-top: 10px; font-size: var(--s-small); color: var(--muted); }
.wl-msg[data-tone="error"] { color: var(--error); }
.waitlist.is-done .wl-label, .waitlist.is-done .wl-row { display: none; }
.waitlist.is-done .wl-msg {
  display: flex; gap: 12px; align-items: flex-start; margin-top: 0; padding: 16px 20px; border-radius: 20px;
  background: var(--surface); color: var(--ink); font-size: var(--s-body); font-weight: 600;
}
.waitlist.is-done .wl-msg::before {
  content: ""; flex: none; width: 22px; height: 22px; margin-top: 2px; border-radius: 50%;
  background: var(--success) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230E1022' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4L18 8'/%3E%3C/svg%3E") center / 16px no-repeat;
}
.wl-note { margin-top: 10px; font-size: var(--s-small); color: var(--faint); }
.wl-note a { color: var(--muted); }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1fr 1fr; min-height: max(720px, min(100svh, 980px)); }
.hero-copy { display: flex; flex-direction: column; justify-content: flex-end; padding: 120px var(--margin) clamp(40px, 6vh, 72px); }
.hero h1 { max-width: 12.5em; margin-bottom: 28px; }
.lead { max-width: 40ch; font-size: var(--s-mid); line-height: 1.45; margin-bottom: 36px; }
.offer { max-width: 50ch; margin-top: 6px; font-size: var(--s-small); color: var(--muted); }
.offer strong { color: var(--ink); font-weight: 650; }
.hero-stage { position: relative; display: flex; align-items: center; justify-content: center; padding: 92px 24px 48px; background: var(--bg-2); overflow: hidden; }
.hero-art { position: absolute; left: 1%; top: 11%; width: clamp(120px, 12vw, 190px); height: auto; pointer-events: none; animation: float 9s ease-in-out infinite reverse; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* Masked headline in CSS only, so the title never waits for script. */
.mask .line { display: block; overflow: hidden; padding: 0.08em 0 0.12em; margin: -0.08em 0 -0.12em; }
.mask .line > span { display: inline-block; animation: rise 0.9s var(--ease) both; }
.mask .line + .line > span { animation-delay: 0.11s; }
.hero .lead, .hero .waitlist, .hero .offer, .hero .wl-note { animation: fade-up 0.7s var(--ease) 0.45s both; }
@keyframes rise { from { transform: translateY(108%); } to { transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- the app's own pieces ---------- */
.k-sleep { --k: var(--sleep); --k-soft: var(--sleep-soft); }
.k-wake { --k: var(--moon); --k-soft: var(--moon-soft); }
.k-feed { --k: var(--feed); --k-soft: var(--feed-soft); }
.k-diaper { --k: var(--diaper); --k-soft: var(--diaper-soft); }
.k-bell { --k: var(--accent); --k-soft: var(--accent-soft); }
[data-ui] .i { width: 20px; height: 20px; flex: none; }
.art { display: block; flex: none; }
[data-ui] time { font-variant-numeric: tabular-nums; }
.av {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  font-size: 13px; font-weight: 700; color: var(--on-accent);
}
.av-a { background: var(--avatar-a); }
.av-b { background: var(--moon); color: var(--on-moon); }
.ring-track { fill: none; stroke: var(--line); stroke-width: 11; }
.ring-fill { fill: none; stroke: var(--accent); stroke-width: 11; stroke-linecap: round; transition: stroke-dashoffset 0.7s var(--ease), stroke 0.3s; }

/* The phone with the Today screen */
.phone { padding: 9px; border-radius: 54px; background: var(--device); border: 1px solid var(--line); animation: float 7s ease-in-out 1.2s infinite; }
.today {
  position: relative; width: min(344px, calc(100vw - 52px)); padding: 12px 18px 18px;
  border-radius: 45px; background: var(--bg); font-size: 14px; line-height: 1.35;
}
.t-status { display: flex; justify-content: space-between; align-items: center; padding: 4px 12px 12px; font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }
.t-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; }
.t-bars i { width: 3px; border-radius: 1px; background: var(--ink); }
.t-bars i:nth-child(1) { height: 5px; } .t-bars i:nth-child(2) { height: 8px; } .t-bars i:nth-child(3) { height: 11px; }
.t-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.t-title { font-size: 26px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.1; }
.t-baby { font-size: 13px; color: var(--muted); }
.t-avatars { display: flex; }
.t-avatars .av-b { margin-left: -8px; outline: 2px solid var(--bg); }
.t-card { padding: 16px 14px 14px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); text-align: center; }
.t-ring { position: relative; width: 150px; height: 150px; margin: 0 auto 8px; }
.t-ring svg { display: block; }
.t-ring-art { position: absolute; inset: 0; display: grid; place-items: center; }
.t-ring-art .art { width: 90px; height: 90px; grid-area: 1 / 1; opacity: 0; transform: scale(0.92); transition: opacity 0.3s, transform 0.3s var(--ease); }
.t-card[data-state="awake"] .is-awake, .t-card[data-state="window"] .is-window, .t-card[data-state="asleep"] .is-asleep { opacity: 1; transform: none; }
.t-card[data-state="window"] .ring-fill { stroke: var(--moon); }
.t-card[data-state="asleep"] .ring-fill { stroke: var(--sleep); }
.t-top { font-size: 13px; font-weight: 650; color: var(--muted); }
.t-big { font-size: 34px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.t-card[data-state="window"] .t-big { font-size: 26px; line-height: 1.45; color: var(--moon); }
.t-line { font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }
.t-chip { display: inline-block; margin-top: 10px; padding: 4px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 650; }
.t-card[data-state="asleep"] .t-chip { visibility: hidden; }
.t-guide { margin-top: 6px; font-size: 13px; color: var(--faint); }
.t-voice { display: flex; flex-direction: column; align-items: center; padding: 10px 0 4px; }
.t-bubble { min-height: 22px; margin-bottom: 8px; font-size: 14px; font-weight: 600; color: var(--ink); text-align: center; transition: opacity 0.2s; }
.t-bubble:empty { opacity: 0; }
.t-mic {
  position: relative; display: grid; place-items: center; width: 72px; height: 72px; border: 0; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); cursor: pointer; transition: transform 0.16s var(--ease), background-color 0.16s;
}
.t-mic:hover { background: var(--accent-hover); }
.t-mic:active { transform: scale(0.96); }
.t-mic .i { width: 30px; height: 30px; grid-area: 1 / 1; }
.t-mic::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--accent);
  opacity: 0; transform: scale(0.9); pointer-events: none;
}
.t-mic.is-listening::after { animation: halo 1.2s var(--ease) infinite; }
.t-wave { display: none; align-items: center; gap: 4px; height: 26px; grid-area: 1 / 1; }
.t-wave i { width: 4px; height: 24px; border-radius: 2px; background: var(--on-accent); animation: wave 0.9s ease-in-out infinite; transform: scaleY(0.4); }
.t-wave i:nth-child(2) { animation-delay: 0.15s; } .t-wave i:nth-child(3) { animation-delay: 0.3s; } .t-wave i:nth-child(4) { animation-delay: 0.45s; }
.t-mic.is-listening .i { visibility: hidden; }
.t-mic.is-listening .t-wave { display: flex; }
@keyframes wave { 0%, 100% { transform: scaleY(0.35); } 50% { transform: scaleY(1); } }
@keyframes halo { 0% { opacity: 0.8; transform: scale(0.92); } 100% { opacity: 0; transform: scale(1.25); } }
.t-hint { margin-top: 8px; font-size: 13px; color: var(--muted); }
.t-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.t-quick button {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border: 0; border-radius: 16px;
  background: var(--surface-2); font-size: 13px; font-weight: 650; cursor: pointer;
  transition: transform 0.16s var(--ease), background-color 0.16s;
}
.t-quick button:hover { background: var(--surface-hover); }
.t-quick button:active { transform: scale(0.96); }
.t-quick .art { width: 34px; height: 34px; }
.t-quick .art-wake, .today[data-status="asleep"] .t-quick .art-sleep { display: none; }
.today[data-status="asleep"] .t-quick .art-wake { display: block; }
.t-last { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 9px 12px; border-radius: 14px; background: var(--surface); font-size: 13px; }
.t-last-ic { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--k-soft); color: var(--k); }
.t-last-ic .art { width: 22px; height: 22px; }
.t-last-what { flex: 1; font-weight: 650; }
.t-last-who, .t-last time { color: var(--muted); }
.t-last.is-new { animation: pop 0.5s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Fragments in the sections */
.frag { padding: 20px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; line-height: 1.4; }

.v-note { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); }
.v-mic { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--on-accent); }
.v-mic .i { width: 18px; height: 18px; }
.v-text { flex: 1; font-size: 15px; }
.v-len { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.v-from { margin: 16px 4px 4px; font-size: 13px; color: var(--muted); }
.v-row { display: grid; grid-template-columns: 32px 1fr auto auto; align-items: center; gap: 12px; padding: 10px 4px; }
.v-row + .v-row { border-top: 1px solid var(--line); }
.v-ic, .pn-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--k-soft); color: var(--k); }
.v-ic .art { width: 26px; height: 26px; }
.v-what { font-size: 15px; font-weight: 650; }
.v-edit { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-size: 13px; font-weight: 600; }
.v-edit .i { width: 14px; height: 14px; }
.v-save { display: flex; justify-content: flex-end; margin-top: 12px; }
.v-save span { display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 650; }
.v-save .i { width: 16px; height: 16px; }

.d-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 40px; }
.d-title { font-size: 17px; font-weight: 700; }
.d-sub { font-size: 13px; color: var(--muted); }
.d-strip { position: relative; height: 30px; border-radius: 8px; background: var(--surface-2); }
.d-seg { position: absolute; top: 0; bottom: 0; border-radius: 8px; }
.d-night { background: var(--sleep-soft); }
.d-nap { background: var(--sleep); }
.d-win { background: var(--moon); }
.d-now { position: absolute; top: -7px; bottom: -7px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--ink); }
.d-tag { position: absolute; bottom: calc(100% + 10px); font-size: 13px; color: var(--muted); white-space: nowrap; }
.d-tag-now { transform: translateX(-50%); color: var(--ink); font-weight: 650; }
.d-tag-win { top: calc(100% + 10px); bottom: auto; color: var(--moon); font-weight: 650; }
.d-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 52px; }
.d-facts dt { font-size: 13px; color: var(--muted); }
.d-facts dd { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.d-facts div:last-child dd { color: var(--moon); }

.p { background: var(--sky); text-align: center; }
.p-time { font-size: 58px; font-weight: 600; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.p-date { margin: 6px 0 22px; font-size: 14px; color: var(--muted); }
.p-note { display: flex; gap: 12px; padding: 12px 14px; border-radius: 18px; background: var(--surface-2); text-align: left; }
.p-note img { flex: none; width: 24px; height: 24px; border-radius: 6px; margin-top: 2px; }
.p-note > div { flex: 1; }
.p-app { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.p-title { font-size: 15px; font-weight: 650; }
.p-second { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.p-second .i { width: 16px; height: 16px; color: var(--success); }

/* ---------- how it works: one reading column ---------- */
.how { padding-top: var(--section); }
.how-col { width: min(600px, 100%); margin-left: max(0px, calc(29vw - var(--margin))); }
.how h2 { margin-bottom: 48px; }
.how-step + .how-step { margin-top: 72px; }
.how-step > p { line-height: 1.6; }
.how-step strong { font-weight: 700; }
.how-step .frag { margin-top: 22px; }

/* ---------- for both parents: the panel with margin notes ---------- */
.family { margin-top: clamp(112px, 10vw, 160px); padding-block: clamp(80px, 8vw, 128px); background: var(--bg-2); }
.fam-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; }
.fam-left { grid-column: 1 / 5; position: relative; min-height: 740px; }
.fam-center { grid-column: 5 / 9; display: flex; justify-content: center; }
.fam-right { grid-column: 9 / 13; position: relative; }
.fam-head { margin-left: auto; text-align: right; }
.fam-head p { margin-top: 14px; }
.note { position: absolute; width: min(30ch, 100%); padding: 2px 0; cursor: default; border-radius: 8px; }
.fam-left .note { right: 0; text-align: right; }
.fam-right .note { left: 0; }
.note-name { font-weight: 650; transition: color 0.16s; }
.note-text { margin-top: 4px; font-size: var(--s-small); line-height: 1.45; color: var(--muted); }
.note:hover .note-name, .note:focus-visible .note-name, .note.is-active .note-name { color: var(--accent); }
.note-plan { top: 14px; } .note-family { top: 98px; } .note-who { top: 200px; }
.note-nudge { top: 436px; } .note-report { top: 512px; } .note-invite { top: 620px; }

.panel { width: min(380px, 100%); padding: 18px; border-radius: 34px; background: var(--bg); border: 1px solid var(--line); font-size: 14px; line-height: 1.35; }
.panel [data-part] { border-radius: 14px; outline: 2px solid transparent; outline-offset: 4px; transition: outline-color 0.2s; }
.panel[data-active="plan"] [data-part="plan"], .panel[data-active="family"] [data-part="family"], .panel[data-active="who"] [data-part="who"],
.panel[data-active="nudge"] [data-part="nudge"], .panel[data-active="report"] [data-part="report"], .panel[data-active="invite"] [data-part="invite"] { outline-color: var(--accent); }
.pn-head { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.pn-title { font-size: 22px; font-weight: 750; letter-spacing: -0.01em; }
.pn-plan { padding: 4px 10px; border-radius: 999px; background: var(--moon-soft); color: var(--moon); font-size: 13px; font-weight: 650; }
.pn-family { display: flex; align-items: center; gap: 8px; height: 56px; margin-top: 14px; padding: 0 12px; background: var(--surface); }
.pn-family .av { width: 28px; height: 28px; }
.pn-invite { margin-left: auto; color: var(--accent); font-weight: 650; }
.pn-day { display: flex; align-items: flex-end; height: 28px; margin-top: 12px; padding-left: 4px; font-size: 13px; color: var(--muted); }
.pn-list li { display: grid; grid-template-columns: 44px 28px 1fr auto; align-items: center; gap: 10px; height: 46px; padding: 0 4px; }
.pn-list li + li { border-top: 1px solid var(--line); }
.pn-list time { color: var(--muted); font-size: 13px; }
.pn-ic { width: 28px; height: 28px; border-radius: 9px; }
.pn-ic .i { width: 16px; height: 16px; }
.pn-ic .art { width: 22px; height: 22px; }
.pn-what { font-weight: 650; }
.pn-who { font-size: 13px; color: var(--muted); }
.pn-row { display: flex; align-items: center; gap: 12px; min-height: 64px; margin-top: 12px; padding: 8px 14px; background: var(--surface); }
.pn-sub { font-size: 13px; color: var(--muted); }
.pn-toggle { position: relative; flex: none; width: 44px; height: 26px; margin-left: auto; border-radius: 13px; background: var(--accent); }
.pn-toggle::after { content: ""; position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); }
.pn-card { min-height: 96px; margin-top: 12px; padding: 14px 16px; background: var(--surface); }
.pn-card-t { margin-bottom: 6px; font-size: 13px; font-weight: 650; color: var(--muted); }
.pn-code-v { font-size: 24px; font-weight: 750; letter-spacing: 0.14em; line-height: 1.1; font-variant-numeric: tabular-nums; }

/* ---------- the widget: one row, three states ---------- */
.widget { padding-top: clamp(112px, 10vw, 160px); }
.wg-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 48px; }
.wg-title { grid-column: 4 / 10; grid-row: 1; margin-bottom: 40px; }
.wg-text { grid-column: 10 / 13; grid-row: 2 / 5; align-self: start; }
.wg-row { grid-column: 1 / 10; display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); column-gap: 24px; align-items: center; }
.wg-state { grid-column: 1 / 4; text-align: right; font-size: var(--s-mid); color: var(--muted); }
.wg-row .wdg { grid-column: 4 / 10; }

.wdg {
  position: relative; display: grid; grid-template-columns: 1fr auto; grid-template-rows: 1fr auto; align-items: start;
  width: min(338px, 100%); height: 158px; padding: 16px 18px; border-radius: 24px;
  background: var(--surface); border: 1px solid var(--line); line-height: 1.3; overflow: hidden;
}
.wdg-k { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 650; color: var(--muted); }
.wdg-k .i { width: 16px; height: 16px; color: var(--accent); }
.wdg-big { margin-top: 4px; font-size: 32px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.wdg-line { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.wdg-foot { grid-column: 1 / -1; align-self: end; font-size: 13px; color: var(--muted); }
.wdg-ring { align-self: center; }
.wdg-ring svg { display: block; }
.wdg .ring-track, .wdg .ring-fill { stroke-width: 7; }
.wdg-sleep { background: var(--sleep-soft); border-color: transparent; }
.wdg-sleep .ring-fill, .wdg-sleep .wdg-k .i { stroke: var(--sleep); color: var(--sleep); }
.wdg-sleep .ring-track { stroke: var(--sleep-track); }
.wdg-live { grid-template-rows: 1fr; }
.wdg-live .wdg-main { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; height: 100%; }
.wdg-live .wdg-foot { margin-top: auto; }
.wdg-live[data-mode="window"] { background: var(--moon-soft); border-color: transparent; }
.wdg-live[data-mode="window"] .wdg-k .i, .wdg-live[data-mode="window"] .wdg-big { color: var(--moon); }
.wdg-live[data-mode="window"] .wdg-big { font-size: 28px; }
.wdg-live[data-mode="window"] .wdg-asleep, .wdg-live[data-mode="asleep"] .wdg-window { display: none; }
.wdg-live[data-mode="asleep"] { background: var(--sleep-soft); border-color: transparent; }
.wdg-live[data-mode="asleep"] .wdg-k .i { color: var(--sleep); }
.wdg-live[data-mode="asleep"] .wdg-main { animation: pop 0.45s var(--ease); }
.wdg-btn {
  grid-column: 2; grid-row: 1; align-self: center; padding: 10px 16px; border: 0; border-radius: 999px;
  background: var(--moon); color: var(--on-moon); font-size: 14px; font-weight: 700; cursor: pointer;
  transition: transform 0.16s var(--ease), background-color 0.2s;
}
.wdg-btn:hover { background: var(--moon-hover); }
.wdg-btn:active { transform: scale(0.96); }
.wdg-live[data-mode="asleep"] .wdg-btn { background: var(--sleep); color: var(--bg); }

/* ---------- a guide, not a rule: the letter ---------- */
.guide { margin-top: clamp(112px, 10vw, 160px); padding-block: clamp(80px, 8vw, 128px); background: var(--bg-2); }
.letter { width: min(580px, calc(100% - 2 * var(--margin))); margin-inline: auto; }
.letter-icon { width: 44px; height: 44px; margin-bottom: 28px; border-radius: 50%; }
.letter h2 { margin-bottom: 28px; }
.letter p { line-height: 1.62; }
.letter p + p { margin-top: 1.1em; }
.letter mark { padding: 0 0.22em; border-radius: 4px; background: var(--moon); color: var(--on-moon); font-weight: 650; }
.letter .letter-sign { margin-top: 40px; font-size: var(--s-mid); font-style: italic; }
.letter .letter-role { margin-top: 4px; font-size: var(--s-small); color: var(--muted); }

/* ---------- pricing: the price, very large ---------- */
.pricing { padding-top: var(--section); }
.pr-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: start; }
.pr-left { grid-column: 1 / 5; }
.pr-right { grid-column: 6 / 13; }
.pr-intro { margin-top: 20px; }
.pr-free { margin-top: 40px; }
.pr-free h3, .pr-pro h3 { margin-bottom: 6px; }
.pr-free li, .pr-pro li, .pr-lines li { padding: 3px 0; }
.pr-free li { color: var(--muted); }
.pr-left .trial { margin-top: 44px; }
.pr-figure { position: relative; padding-top: clamp(40px, 4vw, 64px); }
.pr-num { font-size: var(--s-fig); font-weight: 650; line-height: 0.85; letter-spacing: -0.05em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pr-cur { position: relative; top: -0.62em; margin-right: 0.04em; font-size: 0.5em; letter-spacing: 0; }
.pr-per { margin-left: 0.5em; font-size: var(--s-body); font-weight: 600; letter-spacing: 0; color: var(--muted); }
.pr-moon { position: absolute; top: 0; right: 0; width: clamp(80px, 10vw, 152px); height: auto; animation: float 8s ease-in-out infinite; }
.pr-lines { margin-top: 40px; }
.pr-lines li:first-child { font-weight: 650; }
.pr-pro { margin-top: 32px; }
.pr-cta { margin-top: 44px; max-width: 560px; }
.pr-formlead { margin-bottom: 16px; font-weight: 650; }
.pr-fine { margin-top: 12px; font-size: var(--s-small); color: var(--muted); }

.trial { max-width: 420px; padding: 22px; }
.tr-title { margin-bottom: 16px; font-size: 16px; font-weight: 700; }
.tr-list li { position: relative; display: grid; grid-template-columns: 16px 1fr; column-gap: 14px; padding-bottom: 18px; }
.tr-list li:last-child { padding-bottom: 0; }
.tr-list li:not(:last-child)::before { content: ""; position: absolute; left: 6px; top: 20px; bottom: 2px; width: 2px; border-radius: 1px; background: var(--line); }
.tr-dot { grid-row: 1 / 3; width: 14px; height: 14px; margin-top: 3px; border-radius: 50%; background: var(--accent); }
.tr-1 .tr-dot { background: var(--moon); }
.tr-2 .tr-dot { background: var(--ink); }
.tr-when { font-size: 15px; font-weight: 700; }
.tr-what { color: var(--muted); }

/* ---------- questions: an index with one answer ---------- */
.faq { margin-top: clamp(112px, 10vw, 160px); padding-block: clamp(80px, 8vw, 128px); background: var(--bg-2); }
.faq-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: start; }
.faq-list { grid-column: 1 / 7; }
.faq h2 { margin-bottom: 28px; }
.qa h3 { font-size: inherit; font-weight: inherit; }
.q {
  display: flex; align-items: baseline; gap: 14px; width: 100%; padding: 10px 0; border: 0; background: none;
  font-size: var(--s-body); text-align: left; color: var(--muted); cursor: pointer; transition: color 0.16s;
}
.q:hover, .q.is-on { color: var(--ink); }
.q-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); transform: translateY(-2px); transition: background-color 0.16s, transform 0.2s var(--ease); }
.q.is-on .q-dot { background: var(--accent); transform: translateY(-2px) scale(1.25); }
.a { padding: 2px 0 14px 22px; color: var(--ink); }
.faq-more { margin-top: 28px; }
.faq-more a { color: var(--accent); font-weight: 600; }
.faq-pane { grid-column: 8 / 13; position: sticky; top: 120px; font-size: clamp(22px, 1.9vw, 28px); line-height: 1.32; transition: opacity 0.15s; }
.faq-pane.is-fading { opacity: 0; }
.js .a { display: none; }
.no-js .faq-pane { display: none; }

/* ---------- footer: a single quiet line ---------- */
.foot {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline; gap: 24px;
  max-width: 1440px; margin: clamp(96px, 16svh, 160px) auto 0; padding: 0 var(--margin) 30px;
  font-size: var(--s-small); color: var(--muted);
}
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; }
.foot a { color: var(--ink); text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.foot-legal { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 16px; }

/* ---------- entrances ---------- */
.reveal-ready [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); transition-delay: var(--d, 0ms); }
.reveal-ready [data-reveal].in { opacity: 1; transform: none; }

/* ---------- secondary pages (legal, help, join) ---------- */
.doc-top { position: static; }
.doc { width: min(720px, calc(100% - 2 * var(--margin))); margin: 40px auto 0; }
.doc h1 { font-size: clamp(32px, 3.4vw, 48px); margin-bottom: 20px; }
.doc h2 { font-size: clamp(22px, 2vw, 28px); margin: 48px 0 12px; }
.doc h3 { margin: 28px 0 6px; }
.doc p, .doc li { line-height: 1.62; }
.doc p + p { margin-top: 0.9em; }
.doc ul { margin-top: 10px; }
.doc ul li { position: relative; padding-left: 20px; }
.doc ul li + li { margin-top: 6px; }
.doc ul li::before { content: ""; position: absolute; left: 2px; top: 0.7em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.doc a { color: var(--accent); }
.draft { margin-bottom: 32px; padding: 14px 18px; border-radius: 16px; background: var(--moon-soft); color: var(--moon); font-weight: 650; font-size: var(--s-small); }
.doc-meta { margin-bottom: 8px; font-size: var(--s-small); color: var(--muted); }

.join { width: min(640px, calc(100% - 2 * var(--margin))); margin: 48px auto 0; }
.join h1 { font-size: clamp(32px, 3.4vw, 48px); margin-bottom: 16px; }
.join-lead { font-size: var(--s-mid); line-height: 1.45; }
.join-code {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin: 36px 0; padding: 28px 28px 24px;
  border-radius: 28px; background: var(--surface);
}
.join-code-v { font-size: clamp(56px, 13vw, 96px); font-weight: 700; line-height: 1; letter-spacing: 0.12em; font-variant-numeric: tabular-nums; }
.join-code-l { width: 100%; font-size: var(--s-small); color: var(--muted); }
.join-copy { border: 0; background: var(--surface-2); color: var(--ink); padding: 10px 18px; border-radius: 999px; font-size: var(--s-small); font-weight: 650; cursor: pointer; transition: transform 0.16s var(--ease), background-color 0.16s; }
.join-copy:hover { background: var(--surface-hover); }
.join-copy:active { transform: scale(0.97); }
.join-steps { counter-reset: step; margin: 8px 0 32px; }
.join-steps li { position: relative; padding-left: 44px; min-height: 32px; line-height: 1.5; }
.join-steps li + li { margin-top: 16px; }
.join-steps li::before {
  counter-increment: step; content: counter(step); position: absolute; left: 0; top: -2px;
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: var(--s-small);
}
.join-steps strong { font-weight: 650; }
.join-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.join-note { margin-top: 28px; font-size: var(--s-small); color: var(--muted); }
.join-langs { display: flex; gap: 16px; margin-bottom: 28px; font-size: var(--s-small); }
.join-langs button { border: 0; background: none; padding: 4px 0; color: var(--muted); cursor: pointer; }
.join-langs button[aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.join-missing { padding: 22px 24px; border-radius: 22px; background: var(--surface); margin: 32px 0; }
.page-foot { margin-top: clamp(96px, 16svh, 160px); }

/* ---------- widths ---------- */
@media (max-width: 1099px) {
  .fam-grid { grid-template-columns: 1fr 1fr; gap: 32px 24px; }
  .fam-side { display: contents; }
  .fam-head { grid-column: 1 / -1; max-width: 34ch; margin: 0; text-align: left; }
  .fam-center { grid-column: 1 / -1; order: 1; }
  .note { position: static; width: auto; order: 2; }
  .fam-left .note { text-align: left; }
  .fam-left { min-height: 0; }

  .wg-grid { display: flex; flex-direction: column; gap: 0; }
  .wg-title { margin-bottom: 20px; }
  .wg-text { max-width: 46ch; margin-bottom: 48px; }
  .wg-row { display: flex; flex-direction: column; align-items: flex-start; }
  .wg-row + .wg-row { margin-top: 48px; }
  .wg-state { order: 2; margin-top: 10px; text-align: left; font-size: 17px; }
}

@media (max-width: 899px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-copy { justify-content: flex-start; padding: 104px var(--margin) 56px; }
  .hero h1 { font-size: clamp(34px, 6vw, 48px); }
  .hero-stage { flex-direction: column; padding: 48px 16px 56px; }
  .hero-art { position: static; order: -1; width: 160px; margin-bottom: 24px; }
  .how-col { margin-left: 0; }
  .pr-grid, .faq-grid { display: block; }
  .pr-right { margin-top: 64px; }
  .faq-pane { display: none; }
  .js .qa.is-open .a { display: block; }
  .foot { grid-template-columns: 1fr; gap: 8px; }
  .foot-links, .foot-legal { justify-content: flex-start; }
}

@media (max-width: 599px) {
  :root { --s-body: 17px; }
  .mask .line { display: inline; overflow: visible; padding: 0; margin: 0; }
  .mask .line > span { display: inline; animation: none; }
  .hero h1 { animation: fade-up 0.8s var(--ease) both; }
  .lead { margin-bottom: 28px; }
  .wl-row { flex-direction: column; padding: 0; border-radius: 0; background: none; border: 0; gap: 10px; }
  .wl-row input { flex: none; height: 52px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
  .wl-row input:focus { border-color: var(--accent); }
  .wl-row .btn { width: 100%; min-height: 52px; }
  .langs { gap: 14px; }
  .how h2 { margin-bottom: 36px; }
  .how-step + .how-step { margin-top: 56px; }
  .frag { padding: 16px; }
  .v-row { grid-template-columns: 32px 1fr auto; }
  .v-edit { display: none; }
  .d-facts { gap: 8px; }
  .d-facts dd { font-size: 15px; }
  .p-time { font-size: 48px; }
  .fam-grid { gap: 28px 16px; }
  .pr-figure { padding-top: 56px; }
  .pr-moon { width: 76px; }
  .letter .letter-sign { margin-top: 32px; }
}

@media (max-width: 380px) {
  .fam-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .mask .line > span, .hero .lead, .hero .waitlist, .hero .offer, .hero .wl-note, .hero h1 { animation: none; }
  .reveal-ready [data-reveal] { opacity: 1; transform: none; }
  .t-mic.is-listening::after { animation: none; opacity: 0.8; }
  .t-wave i { animation: none; transform: scaleY(0.7); }
}
