/* dvait website. One dark theme, taken from the app's dark mode: pure black, the app's accent
   palettes, 18px chat bubbles with one 4px corner, pill-shaped controls. */

/* Registered so the page colour and accent can animate between chapters */
@property --bg { syntax: "<color>"; inherits: true; initial-value: #000000; }
@property --accent { syntax: "<color>"; inherits: true; initial-value: #FFAA55; }

:root {
  --text: #FFFFFF;
  --text-2: #A8A8A8;
  --muted: #777777;
  --line: #262626;
  --surface: #141414;
  --card: #0B0B0B;
  --bubble-bot: #2C2C2C;
  --error: #EF4444;
  --success: #10B981;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: Roboto, "Google Sans Text", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100svh;
  background: var(--bg); color: var(--text);
  font: 400 16px/1.6 var(--font); -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  transition: --bg 1s ease, --accent 1s ease;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.05; letter-spacing: -0.03em; }
p { margin: 0; }
code { font: .9em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface); padding: .1em .4em; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--accent) 40%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.muted { color: var(--muted); }

/* Soft light behind the phone, in the current chapter's colour */
.glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(42% 48% at 50% 52%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 72%);
}
body:not(.home) .glow { background: radial-gradient(50% 40% at 85% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; padding: 0 26px; border-radius: 999px; border: 0;
  background: var(--accent); color: #111; font: 500 15px/1 var(--font); cursor: pointer;
  text-decoration: none !important; transition: transform .25s var(--ease), filter .25s;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.06); }
.btn:active { transform: scale(.97); }

/* ------------------------------------------------------------ nav, skip, footer */

.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px; height: 64px; padding: 0 clamp(16px, 4vw, 40px);
  background: linear-gradient(var(--bg) 30%, transparent);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 19px; letter-spacing: -.3px; text-decoration: none !important; }
.brand img { width: 32px; height: 32px; border-radius: 9px; }
.nav-links { margin-left: auto; display: flex; gap: 22px; }
.nav-links a { color: var(--text-2); font-size: 15px; }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--text); text-decoration: none; }

.skip {
  position: fixed; z-index: 30; right: 24px; bottom: 24px;
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 999px;
  background: rgb(255 255 255 / .08); border: 1px solid rgb(255 255 255 / .14); color: var(--text);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  font-size: 14px; font-weight: 500; text-decoration: none !important;
  transition: background-color .25s, color .25s, opacity .4s, transform .4s var(--ease);
}
.skip svg { width: 16px; height: 16px; }
.skip:hover { background: var(--accent); color: #111; border-color: transparent; }
body[data-chapter="download"] .skip { opacity: 0; transform: translateY(12px); pointer-events: none; }

.footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px;
  padding: 28px clamp(16px, 4vw, 40px) 36px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 14px;
}
.footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer a { color: var(--text-2); }

/* ------------------------------------------------------------ the story */

body.home { --ph: min(640px, 78svh); --pw: calc(var(--ph) * .48); }
body[data-chapter="apps"] { --accent: #2DD4A8; --bg: #03140F; }
body[data-chapter="ask"] { --bg: #050D1E; --accent: #60A5FA; }
body[data-chapter="voice"] { --bg: #190C02; }
body[data-chapter="privacy"] { --bg: #0D0D0D; --accent: #EEEEEE; }
body[data-chapter="download"] { --bg: #1A0E04; }

.story {
  display: grid; grid-template-columns: 1fr var(--pw) 1fr; column-gap: clamp(32px, 6vw, 104px);
  padding-inline: clamp(24px, 5vw, 72px);
}
.stage { grid-column: 2; grid-row: 1 / 7; }
.dock { position: sticky; top: calc(50svh - var(--ph) / 2); }

.chapter { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; gap: 20px; }
.chapter.left { grid-column: 1; align-items: flex-end; text-align: right; }
.chapter.right { grid-column: 3; align-items: flex-start; }
.chapter h2 { font-size: clamp(2rem, 3.3vw, 3.2rem); max-width: 11em; }
.chapter p { color: var(--text-2); font-size: 18px; max-width: 24em; }
.more { font-weight: 500; }
[data-chapter="intro"] { grid-row: 1; }
[data-chapter="apps"] { grid-row: 2; }
[data-chapter="ask"] { grid-row: 3; }
[data-chapter="voice"] { grid-row: 4; }
[data-chapter="privacy"] { grid-row: 5; }
[data-chapter="try"] { grid-row: 6; }

.chapter.intro {
  grid-column: 1 / -1; display: grid; grid-template-columns: 1fr var(--pw) 1fr;
  column-gap: inherit; align-items: center;
}
.intro .side { grid-column: 1; display: flex; flex-direction: column; align-items: flex-end; gap: 32px; text-align: right; }
.intro h1 { font-size: clamp(2.6rem, 4.6vw, 4.6rem); line-height: 1; letter-spacing: -0.04em; }

/* Chapters out of view fade back so the one beside the phone stands out */
html.js .chapter > * { opacity: .18; transform: translateY(16px); transition: opacity .6s ease, transform .8s var(--ease); }
html.js body[data-chapter="intro"] [data-chapter="intro"] > *,
html.js body[data-chapter="apps"] [data-chapter="apps"] > *,
html.js body[data-chapter="ask"] [data-chapter="ask"] > *,
html.js body[data-chapter="voice"] [data-chapter="voice"] > *,
html.js body[data-chapter="privacy"] [data-chapter="privacy"] > *,
html.js body[data-chapter="try"] [data-chapter="try"] > * { opacity: 1; transform: none; }
html.js .chapter > :nth-child(2) { transition-delay: .08s; }
html.js .chapter > :nth-child(3) { transition-delay: .16s; }

.asks { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.asks button {
  font: 500 14.5px/1.3 var(--font); color: var(--text); text-align: left;
  background: rgb(255 255 255 / .04); border: 1px solid var(--line); border-radius: 999px;
  padding: 11px 18px; cursor: pointer; transition: border-color .2s, background-color .2s, transform .2s var(--ease);
}
.asks button:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); transform: translateX(4px); }
.asks button.htmx-request { opacity: .6; }

.download { min-height: 86svh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; padding: 64px 24px; }
.download img { width: 112px; height: 112px; border-radius: 28px; box-shadow: 0 24px 80px -12px color-mix(in srgb, var(--accent) 70%, transparent); margin-bottom: 12px; }
.download h2 { font-size: clamp(2.6rem, 6vw, 4.4rem); letter-spacing: -0.04em; }
.download p { color: var(--text-2); font-size: 18px; margin-bottom: 12px; }

/* ------------------------------------------------------------ the phone */

.phone {
  position: relative; width: var(--pw); height: var(--ph); margin-inline: auto;
  border-radius: calc(var(--pw) * .15); background: #000; overflow: hidden;
  box-shadow: 0 0 0 1px #333, 0 0 0 9px #161616, 0 0 0 10px #2A2A2A,
              0 50px 120px -40px color-mix(in srgb, var(--accent) 55%, transparent);
  font-size: 14px; line-height: 1.45;
}
.notch { position: absolute; top: 12px; left: 50%; width: 11px; height: 11px; margin-left: -5px; border-radius: 50%; background: #1c1c1c; z-index: 2; }

.screen {
  position: absolute; inset: 0; padding: 38px 14px 14px;
  display: flex; flex-direction: column;
  opacity: 0; transform: scale(.96); pointer-events: none;
  transition: opacity .45s ease, transform .6s var(--ease);
}
body[data-chapter="intro"] .s-intro,
body[data-chapter="apps"] .s-apps,
body[data-chapter="ask"] .s-ask,
body[data-chapter="voice"] .s-voice,
body[data-chapter="privacy"] .s-privacy,
body[data-chapter="try"] .s-try,
body[data-chapter="download"] .s-try { opacity: 1; transform: none; pointer-events: auto; }

.bar { display: flex; align-items: center; gap: 14px; height: 44px; padding: 0 4px; font-size: 17px; }
.bar b { font-weight: 600; }
.menu { width: 18px; height: 2px; border-radius: 2px; background: #fff; box-shadow: 0 -6px 0 #fff, 0 6px 0 #fff; }
.back { width: 10px; height: 10px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(45deg); margin-left: 4px; }

.input { margin-top: auto; display: flex; align-items: center; gap: 8px; padding-top: 10px; }
.pill {
  flex: 1; min-width: 0; height: 46px; display: flex; align-items: center; padding: 0 18px;
  border-radius: 999px; background: var(--bubble-bot); font-size: 14px; white-space: nowrap; overflow: hidden;
}
.placeholder { color: rgb(168 168 168 / .6); }
/* The app's voice button: equaliser icon on a grey circle, swapped for Send while typing */
.voice { flex: none; position: relative; width: 46px; height: 46px; border-radius: 50%; background: var(--bubble-bot); }
.voice svg { position: absolute; inset: 11px; width: 24px; height: 24px; fill: #fff; }
.voice .send { opacity: 0; }

.av { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--bgc); }
.av i { width: 58%; height: 58%; background: var(--fg); -webkit-mask: var(--logo) center / contain no-repeat; mask: var(--logo) center / contain no-repeat; }
.app-whatsapp { --bgc: #25D366; --fg: #fff; --logo: url("/static/img/apps/whatsapp.svg"); }
.app-chrome { --bgc: #fff; --fg: #4285F4; --logo: url("/static/img/apps/googlechrome.svg"); }
.app-gmail { --bgc: #fff; --fg: #EA4335; --logo: url("/static/img/apps/gmail.svg"); }
.app-amazon { --bgc: #232F3E; --fg: #FF9900; --logo: url("/static/img/apps/amazon.svg"); }
.app-instagram { --bgc: linear-gradient(45deg, #FEDA75, #FA7E1E 30%, #D62976 60%, #962FBF 85%, #4F5BD5); --fg: #fff; --logo: url("/static/img/apps/instagram.svg"); }
.app-youtube { --bgc: #fff; --fg: #FF0000; --logo: url("/static/img/apps/youtube.svg"); }
.app-spotify { --bgc: #191414; --fg: #1ED760; --logo: url("/static/img/apps/spotify.svg"); }

/* Chat */
.thread { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 6px 2px; scrollbar-width: none; }
.thread::-webkit-scrollbar { display: none; }
.thread > :first-child { margin-top: auto; }
.exchange { display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 86%; padding: 9px 13px; border-radius: 18px; }
.bubble.user { align-self: flex-end; background: var(--accent); color: #111; border-bottom-right-radius: 4px; }
.bubble.bot { align-self: flex-start; background: var(--bubble-bot); border-bottom-left-radius: 4px; }
.source { display: block; margin-top: 6px; font-size: 11.5px; color: #9a9a9a; }
.typing { display: flex; gap: 5px; align-items: center; height: 36px; overflow: hidden; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: #9a9a9a; animation: bounce 1s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
.empty { margin: auto; color: var(--muted); }
.thread .empty:not(:only-child) { display: none; }

@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes collapse { to { opacity: 0; height: 0; padding-block: 0; margin-block: -4px; } }
@keyframes fade-out { to { opacity: 0; } }

.exchange .user { animation: pop .4s var(--ease) both; }
.exchange .typing { animation: pop .3s var(--ease) .35s both, collapse .25s ease-in 1.55s forwards; }
.exchange .answer { animation: pop .45s var(--ease) 1.75s both; }

/* Intro: the app's empty chat */
.s-intro { align-items: center; justify-content: center; gap: 18px; }
.intro-logo { width: 82%; margin-bottom: -8%; height: auto; aspect-ratio: 1; border-radius: 26%; margin-top: auto; animation: hover 5s ease-in-out infinite; }
.intro-hint { color: var(--text-2); font-size: 15px; text-align: center; }
.s-intro .input { width: 100%; }
@keyframes hover { 50% { transform: translateY(-8px); } }

/* Apps: switches turn on one by one, bank and photos stay off */
.search { flex: none; height: 40px; display: flex; align-items: center; padding: 0 16px; margin: 6px 0 8px; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 13.5px; }
.apps { list-style: none; margin: 0; padding: 0; }
.apps li { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-bottom: 1px solid #1a1a1a; }
.toggle { margin-left: auto; position: relative; width: 38px; height: 22px; border-radius: 999px; background: #3a3a3a; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #9a9a9a; }
.apps li:nth-child(1) { --n: 0; } .apps li:nth-child(2) { --n: 1; } .apps li:nth-child(4) { --n: 2; }
body[data-chapter="apps"] .apps li.on .toggle { animation: toggle-track .3s ease forwards; animation-delay: calc(.4s + var(--n) * .28s); }
body[data-chapter="apps"] .apps li.on .toggle::after { animation: toggle-knob .3s var(--ease) forwards; animation-delay: calc(.4s + var(--n) * .28s); }
@keyframes toggle-track { to { background: var(--accent); } }
@keyframes toggle-knob { to { transform: translateX(16px); background: #111; } }

/* Ask: the question is typed, sent, and answered */
.typed { color: var(--text) !important; }
.typed { clip-path: inset(0 100% 0 0); }
body[data-chapter="ask"] .typed { animation: type 1.3s steps(32) .3s forwards, fade-out .2s ease 1.9s forwards; }
body[data-chapter="ask"] .s-ask .send { animation: swap-in 1.6s linear .3s both; }
body[data-chapter="ask"] .s-ask .eq { animation: swap-out 1.6s linear .3s both; }
@keyframes swap-in { 0%, 100% { opacity: 0; } 6%, 94% { opacity: 1; } }
@keyframes swap-out { 0%, 100% { opacity: 1; } 6%, 94% { opacity: 0; } }
@keyframes type { to { clip-path: inset(0 0 0 0); } }
.s-ask .bubble { opacity: 0; }
body[data-chapter="ask"] .s-ask .user { animation: pop .4s var(--ease) 2s both; }
body[data-chapter="ask"] .s-ask .typing { animation: pop .3s var(--ease) 2.35s both, collapse .25s ease-in 3.5s forwards; }
body[data-chapter="ask"] .s-ask .answer { animation: pop .45s var(--ease) 3.7s both; }

/* Voice: the orb listens while the transcript appears word by word */
.s-voice { align-items: center; justify-content: center; gap: 30px; text-align: center; padding-inline: 22px; }
.orb { position: relative; width: 46%; aspect-ratio: 1; }
.orb span { position: absolute; inset: 0; border-radius: 50%; }
.orb span:nth-child(1) { inset: 18%; background: var(--accent); box-shadow: 0 0 50px color-mix(in srgb, var(--accent) 80%, transparent); animation: breathe 2.2s ease-in-out infinite; }
.orb span:nth-child(2), .orb span:nth-child(3) { border: 2px solid var(--accent); opacity: 0; animation: ring 2.2s ease-out infinite; }
.orb span:nth-child(3) { animation-delay: 1.1s; }
@keyframes breathe { 50% { transform: scale(1.1); } }
@keyframes ring { 0% { transform: scale(.6); opacity: .7; } 100% { transform: scale(1.15); opacity: 0; } }
.words { font-size: 19px; font-weight: 500; line-height: 1.35; min-height: 2.7em; }
.words span { display: inline-block; opacity: 0; }
.words span:nth-child(1) { --n: 0; } .words span:nth-child(2) { --n: 1; } .words span:nth-child(3) { --n: 2; }
.words span:nth-child(4) { --n: 3; } .words span:nth-child(5) { --n: 4; } .words span:nth-child(6) { --n: 5; }
.words span:nth-child(7) { --n: 6; }
body[data-chapter="voice"] .words span { animation: word .4s var(--ease) forwards; animation-delay: calc(.4s + var(--n) * .3s); }
@keyframes word { from { opacity: 0; transform: translateY(8px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.spoken { color: var(--accent); font-size: 15px; opacity: 0; }
body[data-chapter="voice"] .spoken { animation: pop .5s var(--ease) 3s forwards; }

/* Privacy: what's on the phone, and what leaves it */
.vault { margin: 22px 0 18px; padding: 22px 16px; border-radius: 22px; background: var(--surface); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.lock { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); margin-bottom: 8px; }
.lock svg { width: 24px; height: 24px; }
.vault b { font-size: 34px; letter-spacing: -1px; }
.vault span { color: var(--text-2); font-size: 13px; }
.rows div { display: flex; justify-content: space-between; gap: 12px; padding: 14px 4px; border-bottom: 1px solid #1a1a1a; }
.rows em { font-style: normal; color: var(--muted); font-size: 13px; text-align: right; }
.rows .danger { color: var(--error); border: 0; }
body[data-chapter="privacy"] .vault { animation: pop .5s var(--ease) .2s both; }
body[data-chapter="privacy"] .rows div { animation: pop .4s var(--ease) both; }
body[data-chapter="privacy"] .rows div:nth-child(1) { animation-delay: .5s; }
body[data-chapter="privacy"] .rows div:nth-child(2) { animation-delay: .65s; }
body[data-chapter="privacy"] .rows div:nth-child(3) { animation-delay: .8s; }

/* ------------------------------------------------------------ policy pages */

body:not(.home) main { padding-top: 64px; }
.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); }
.doc-hero { padding: 64px 0 36px; }
.doc-hero h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); letter-spacing: -0.04em; margin-bottom: 14px; }
.lede { color: var(--text-2); font-size: 18px; max-width: 36em; }

.doc { display: grid; grid-template-columns: 200px minmax(0, 760px); gap: 56px; align-items: start; }
.toc { position: sticky; top: 88px; display: grid; gap: 2px; border-left: 1px solid var(--line); }
.toc a { color: var(--muted); font-size: 14px; padding: 5px 14px; margin-left: -1px; border-left: 1px solid transparent; text-decoration: none; }
.toc a:hover { color: var(--text); border-left-color: var(--accent); }

.prose { font-size: 16.5px; }
.prose h2 { font-size: 24px; letter-spacing: -0.02em; margin: 48px 0 14px; scroll-margin-top: 90px; }
.prose p, .prose ul, .prose ol { color: var(--text-2); margin: 0 0 14px; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 6px; }
.prose strong, .prose b { color: var(--text); font-weight: 600; }

.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; scroll-margin-top: 90px; }
.sum-card { padding: 20px 22px; background: var(--card); }
.sum-card b { display: block; color: var(--text); margin-bottom: 4px; font-weight: 600; }
.sum-card span { color: var(--text-2); font-size: 15px; }

.data-list { margin: 20px 0; border-top: 1px solid var(--line); }
.data-list > div { padding: 16px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 180px 1fr; gap: 20px; }
.data-list dt { font-weight: 600; color: var(--text); }
.data-list dd { margin: 0; color: var(--text-2); font-size: 15.5px; }

.table { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin: 18px 0; font-size: 15px; }
.row { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 16px; padding: 14px 18px; border-top: 1px solid var(--line); color: var(--text-2); }
.row span:first-child { color: var(--text); font-weight: 500; }
.row.head { border-top: 0; background: var(--surface); font-size: 13px; color: var(--muted); }
.row.head span { color: var(--muted) !important; }

.del-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 16px; align-items: start; margin-bottom: 40px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 28px; }
.del-card h2 { font-size: 22px; margin-bottom: 10px; letter-spacing: -0.02em; }
.del-card > p { color: var(--text-2); margin-bottom: 14px; }
.mini-steps { counter-reset: s; list-style: none; padding: 0; margin: 4px 0 18px; display: grid; gap: 10px; }
.mini-steps li { counter-increment: s; display: flex; align-items: center; gap: 12px; color: var(--text-2); }
.mini-steps li::before { content: counter(s); flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface); color: var(--accent); font-weight: 700; font-size: 14px; }
.mini-steps b { color: var(--text); }

.del-form { display: grid; gap: 16px; margin-top: 8px; }
.field { display: grid; gap: 6px; font-size: 14px; color: var(--text-2); font-weight: 500; }
.field em { color: var(--muted); font-style: normal; font-weight: 400; }
.field input, .field textarea {
  font: 16px/1.4 var(--font); color: var(--text); background: #000; border: 1px solid #3a3a3a;
  border-radius: 12px; padding: 13px 15px; width: 100%; resize: vertical; transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; color: var(--text-2); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--error); flex: none; }
.hp { position: absolute; left: -9999px; }
.btn-danger { background: var(--error); color: #fff; width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }
.spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgb(255 255 255 / .4); border-top-color: #fff; animation: spin .7s linear infinite; }
.del-form.htmx-request .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.result { padding: 16px 18px; border-radius: 12px; animation: pop .4s var(--ease) both; font-size: 15px; display: grid; gap: 4px; }
.result h3 { font-size: 16px; letter-spacing: 0; }
.result p { color: var(--text-2); }
.result.ok { background: color-mix(in srgb, var(--success) 12%, transparent); border: 1px solid color-mix(in srgb, var(--success) 40%, transparent); }
.result.err { background: color-mix(in srgb, var(--error) 10%, transparent); border: 1px solid color-mix(in srgb, var(--error) 40%, transparent); }
.del-form.done > :not(#del-result) { display: none; }

/* ------------------------------------------------------------ small screens */

@media (max-width: 900px) {
  /* The phone sits at the top; each chapter's text scrolls up underneath it */
  body.home { --ph: min(520px, 48svh); }
  .story { grid-template-columns: 1fr; padding-inline: 20px; }
  .stage { grid-column: 1; position: relative; z-index: 2; pointer-events: none; }
  .dock { top: 0; margin-inline: -20px; pointer-events: auto; padding: 68px 0 28px; background: linear-gradient(var(--bg) 82%, transparent); }
  .chapter, .chapter.left, .chapter.right, .chapter.intro {
    grid-column: 1; display: flex; flex-direction: column; justify-content: flex-end;
    align-items: flex-start; text-align: left; gap: 14px;
    padding-bottom: 6svh;
  }
  .intro .side { align-items: flex-start; text-align: left; gap: 20px; }
  .intro h1 { font-size: clamp(2rem, 8.4vw, 2.8rem); }
  .chapter h2 { font-size: clamp(1.7rem, 7.4vw, 2.3rem); }
  .chapter p { font-size: 16px; }
  .nav { background: linear-gradient(var(--bg) 60%, transparent); }
  body.home .nav-links { display: none; }
  .skip { top: 12px; bottom: auto; right: 16px; height: 40px; }
  .doc { grid-template-columns: 1fr; gap: 24px; }
  .toc { position: static; display: flex; overflow-x: auto; gap: 6px; border: 0; scrollbar-width: none; }
  .toc a { white-space: nowrap; border: 1px solid var(--line); border-radius: 999px; margin: 0; }
  .del-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .summary { grid-template-columns: 1fr; }
  .data-list > div { grid-template-columns: 1fr; gap: 4px; }
  .row { grid-template-columns: 1fr; gap: 2px; }
  .row.head { display: none; }
  .card { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .typing { display: none !important; }
}
