/* Tandem site. Colors match src/theme in the app (2026-11 palette).
   Variable names are historical: sage = electric teal (primary), tan = matte indigo (pop),
   clay = rosy coral (secondary), gold = sunshine yellow (accent). */
:root {
  --bg: #ECE6DD;
  --card: #FFFFFF;
  --border: #E0D7CA;
  --sage: #00B4A6;
  --sage-dark: #00756C;
  --sage-deep: #005A53;
  --sage-soft: #D9F4F1;
  --tan: #4A4E8C;
  --tan-soft: #E8E9F5;
  --clay: #FF6F91;
  --clay-soft: #FFE5EC;
  --clay-text: #B23B5C;
  --gold: #FFC93C;
  --gold-dark: #8A6200;
  --gold-soft: #FFF2CC;
  --text: #232528;
  --muted: #5C5853; /* darker than the app's muted so small text passes contrast */
  --serif: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --shadow: 0 1px 2px rgba(35, 37, 40, .04), 0 8px 28px rgba(35, 37, 40, .06);
  /* Same in both themes: --ink (charcoal) is the text on bright teal / yellow fills; --sage-fill is the deep teal behind white text. */
  --ink: #232528;
  --sage-fill: #00756C;
  --chip: #FFFFFF;
  --gold-line: #FFE08A;
  --sage-line: #B9EAE4;
  --tan-text: #4A4E8C;
  --top-bg: rgba(236, 230, 221, .9);
  --code-bg: #232528;
  color-scheme: light;
}

/* Dark: the app's dark palette (src/theme). Near-black warm background, the same bright teal,
   coral, yellow and indigo; "-dark" text shades turn lighter and "-soft" fills deeper. */
[data-theme="dark"] {
  --bg: #141518;
  --card: #1F2125;
  --border: #30333A;
  --sage-dark: #3FD3C6;
  --sage-deep: #7FE3DA;
  --sage-soft: #12302D;
  --tan: #5E63B0;
  --tan-soft: #272A45;
  --tan-text: #B4B7EE;
  --clay-soft: #3A1F29;
  --clay-text: #FF94AE;
  --gold-dark: #FFD466;
  --gold-soft: #342B14;
  --text: #ECE6DD;
  --muted: #A9A39B;
  --chip: #26292E;
  --gold-line: #5C4A17;
  --sage-line: #1E4A45;
  --top-bg: rgba(20, 21, 24, .86);
  --code-bg: #0E0F11;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.6 var(--sans); }
img, svg { max-width: 100%; display: block; }
a { color: var(--sage-dark); text-underline-offset: 3px; }
a:hover { color: var(--sage-deep); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(34px, 7vw, 56px); }
h2 { font-size: clamp(27px, 4.4vw, 38px); }
h3 { font-size: 21px; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.lede { font-size: clamp(18px, 2.2vw, 20px); color: var(--muted); max-width: 40em; }
.eyebrow { font: 600 13px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--gold-dark); margin-bottom: 14px; display: block; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .wrap { padding: 0 24px; } }
.narrow { max-width: 760px; }
.section { padding: 64px 0; }
@media (min-width: 900px) { .section { padding: 96px 0; } }
.section-head { max-width: 640px; margin-bottom: 40px; }
.center { text-align: center; margin-left: auto; margin-right: auto; }
.band { background: var(--tan-soft); }
.band-sage { background: var(--sage-soft); }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--card); padding: 8px 14px; border-radius: var(--r-sm); z-index: 100; }
.skip:focus { left: 8px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 24px; border-radius: 999px; background: var(--sage); color: var(--ink); font-weight: 600; text-decoration: none; border: 2px solid var(--sage); transition: background .15s, border-color .15s; }
.btn:hover { background: #00A194; border-color: #00A194; color: var(--ink); }
.btn-ghost { background: transparent; color: var(--sage-dark); border-color: var(--border); }
.btn-ghost:hover { background: var(--card); color: var(--sage-deep); border-color: var(--sage); }
.btn-sm { min-height: 40px; padding: 8px 18px; font-size: 15px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.fineprint { font-size: 14px; color: var(--muted); margin-top: 14px; }

/* Header */
.top { position: sticky; top: 0; z-index: 50; background: var(--top-bg); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; }
.top.scrolled { border-bottom-color: var(--border); }
.bar { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font: 22px/1 var(--serif); }
.brand:hover { color: var(--text); }
.bar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.menu { width: 44px; height: 44px; border: 0; background: transparent; border-radius: var(--r-sm); display: grid; place-content: center; gap: 6px; cursor: pointer; }
.menu span { display: block; width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s; }
.menu[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.menu[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
.nav { display: none; }
.nav a { text-decoration: none; color: var(--text); font-weight: 500; }
.nav a[aria-current="page"] { color: var(--sage-dark); box-shadow: inset 0 -2px 0 var(--gold); }
.nav.open { display: flex; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); padding: 8px 16px 20px; box-shadow: var(--shadow); }
.nav.open a { padding: 14px 4px; border-bottom: 1px solid var(--border); font-size: 18px; }
.nav.open a:last-child { border-bottom: 0; }
.nav.open a[aria-current="page"] { box-shadow: none; }
@media (min-width: 860px) {
  .nav, .nav.open { display: flex; position: static; flex-direction: row; gap: 28px; margin-left: 32px; padding: 0; box-shadow: none; border: 0; background: none; }
  .nav.open a, .nav a { padding: 6px 0; border: 0; font-size: 16px; }
  .nav .nav-signin { margin-left: auto; }
  .nav { flex: 1; }
  .bar-actions { margin-left: 16px; }
  .menu { display: none; }
}

/* Hero */
.hero { padding: 40px 0 64px; overflow-x: clip; }
@media (min-width: 900px) { .hero { padding: 72px 0 96px; } }
.hero-grid { display: grid; gap: 48px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.05fr .95fr; gap: 64px; } }
.hero h1 em { font-style: italic; color: var(--sage-dark); }
.hero .lede { margin-bottom: 28px; }

/* Demo phone card */
.demo { position: relative; max-width: 400px; margin: 0 auto; width: 100%; }
.demo::before { content: ""; position: absolute; inset: -18px -10px 30px 30px; background: var(--sage-soft); border-radius: 40px; z-index: -1; transform: rotate(3deg); }
.phone { background: var(--card); border: 1px solid var(--border); border-radius: 32px; padding: 20px 18px 22px; box-shadow: var(--shadow); }
.phone-head { display: flex; align-items: center; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--gold-soft); color: var(--gold-dark); display: grid; place-content: center; font: 15px/1 var(--serif); flex: none; }
.phone-head strong { font-size: 15px; display: block; line-height: 1.2; }
.phone-head span { font-size: 12px; color: var(--muted); }
.bubble { border-radius: 18px; padding: 10px 14px; font-size: 15px; line-height: 1.45; max-width: 88%; }
.bubble.draft { background: var(--tan-soft); margin-left: auto; border-bottom-right-radius: 6px; }
.coach { margin-top: 14px; border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px; background: var(--chip); }
.coach-label { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; letter-spacing: 0; text-transform: none; }
.pill-clay { background: var(--clay-soft); color: var(--clay-text); }
.pill-sage { background: var(--sage-soft); color: var(--sage-dark); }
.pill-gold { background: var(--gold-soft); color: var(--gold-dark); }
.coach p { font-size: 15px; margin: 0; }
.coach .rewrite { background: var(--sage-soft); border-radius: 12px; padding: 10px 12px; margin-top: 10px; }
.coach-actions { display: flex; gap: 8px; margin-top: 12px; }
.chip { font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); color: var(--text); background: var(--chip); }
.chip-on { background: var(--sage-fill); border-color: var(--sage-fill); color: #fff; }

/* Cards & grids */
.grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .grid-2, .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid { gap: 20px; } }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 24px; }
.card h3 { margin-bottom: 8px; }
.card p:last-child { margin-bottom: 0; }
.card-gold { background: var(--gold-soft); border-color: var(--gold-line); }
.icon { width: 44px; height: 44px; border-radius: 14px; background: var(--sage-soft); color: var(--sage-dark); display: grid; place-content: center; margin-bottom: 16px; }
.icon svg { width: 22px; height: 22px; }
.icon-gold { background: var(--gold-soft); color: var(--gold-dark); }
.icon-tan { background: var(--tan-soft); color: var(--tan); }
a.card { text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
a.card:hover { border-color: var(--sage); transform: translateY(-2px); }
.more { font-weight: 600; font-size: 15px; color: var(--sage-dark); margin-top: 12px; display: inline-block; }

/* Steps */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; counter-reset: step; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 24px; } }
.steps li { counter-increment: step; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 24px; position: relative; }
.steps li::before { content: counter(step); font: 22px/1 var(--serif); color: var(--gold-dark); background: var(--gold-soft); width: 44px; height: 44px; border-radius: 50%; display: grid; place-content: center; margin-bottom: 16px; }
.steps h3 { margin-bottom: 6px; }
.steps p { margin: 0; color: var(--muted); }

/* Feature rows (features page) */
.feature { display: grid; gap: 28px; align-items: center; padding: 48px 0; border-top: 1px solid var(--border); }
.feature:first-of-type { border-top: 0; }
@media (min-width: 900px) { .feature { grid-template-columns: 1fr 1fr; gap: 64px; padding: 72px 0; } .feature.flip > :first-child { order: 2; } }
.feature ul, .checks { padding: 0; margin: 0 0 1em; list-style: none; }
.feature li, .checks li { padding-left: 30px; position: relative; margin-bottom: 10px; }
.feature li::before, .checks li::before { content: ""; position: absolute; left: 4px; top: .5em; width: 12px; height: 7px; border-left: 2px solid var(--sage-dark); border-bottom: 2px solid var(--sage-dark); transform: rotate(-45deg); }
.tag { display: inline-block; font-size: 13px; font-weight: 600; padding: 4px 12px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-dark); margin-bottom: 14px; }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow); }
.layer { border-left: 3px solid var(--sage); padding: 4px 0 4px 14px; margin-top: 14px; }
.layer:nth-of-type(2) { border-color: var(--tan); }
.layer:nth-of-type(3) { border-color: var(--gold); }
.layer strong { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 2px; }
.layer p { margin: 0; font-size: 15px; }
.quote { font: italic 17px/1.5 var(--serif); color: var(--text); margin: 0 0 6px; }
.meter { display: flex; height: 10px; border-radius: 999px; overflow: hidden; margin: 10px 0 6px; }
.meter span:first-child { background: var(--sage); }
.meter span:last-child { background: var(--gold); }
.row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--muted); }
.mini-list { list-style: none; padding: 0; margin: 0; }
.mini-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
.mini-list li:last-child { border: 0; }
.feature .mini-list li { padding-left: 0; margin: 0; }
.feature .mini-list li::before { content: none; }
.dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); flex: none; }
.dot.done { background: var(--gold); border-color: var(--gold); }
.mini-list .when { margin-left: auto; color: var(--muted); font-size: 13px; }

/* Privacy list */
.promise { display: grid; gap: 16px; }
@media (min-width: 760px) { .promise { grid-template-columns: repeat(2, 1fr); } }
.promise div { padding: 20px 22px; background: var(--card); border-radius: var(--r-md); border: 1px solid var(--border); }
.promise strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 19px; margin-bottom: 4px; }
.promise p { margin: 0; color: var(--muted); font-size: 16px; }

/* Flow diagram on privacy page */
.flow { display: grid; gap: 12px; margin: 24px 0; }
@media (min-width: 760px) { .flow { grid-template-columns: 1fr auto 1fr auto 1fr; align-items: stretch; } }
.flow .node { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md); padding: 18px; }
.flow .node strong { display: block; margin-bottom: 4px; }
.flow .node p { margin: 0; font-size: 15px; color: var(--muted); }
.flow .node.stay { border-color: var(--sage); background: var(--sage-soft); }
.flow .arrow { display: grid; place-content: center; color: var(--gold-dark); font-size: 22px; }
@media (max-width: 759px) { .flow .arrow { transform: rotate(90deg); height: 20px; } }

/* FAQ */
.faq { border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary { cursor: pointer; list-style: none; padding: 20px 40px 20px 0; position: relative; font: 19px/1.35 var(--serif); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 8px; top: 50%; width: 10px; height: 10px; border-right: 2px solid var(--sage-dark); border-bottom: 2px solid var(--sage-dark); transform: translateY(-70%) rotate(45deg); transition: transform .2s; }
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details > div { padding: 0 0 20px; color: var(--muted); max-width: 44em; }
.faq details > div p:last-child { margin: 0; }

/* Pricing */
.plans { display: grid; gap: 20px; max-width: 860px; margin: 0 auto; }
@media (min-width: 760px) { .plans { grid-template-columns: 1fr 1fr; } }
.plan { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 28px; display: flex; flex-direction: column; }
.plan.featured { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), var(--shadow); }
.plan h2 { font-size: 28px; margin-bottom: 4px; }
.plan .who { color: var(--muted); margin-bottom: 20px; }
.price { font: 40px/1 var(--serif); margin-bottom: 6px; }
.price small { font: 600 15px/1 var(--sans); color: var(--muted); }
.after { font-size: 14px; color: var(--gold-dark); font-weight: 600; margin-bottom: 20px; }
.plan .checks { flex: 1; margin-bottom: 24px; }
.plan .btn { width: 100%; }

/* Callout / CTA */
.cta { background: var(--tan); color: #fff; border-radius: var(--r-lg); padding: 48px 24px; text-align: center; }
.cta h2 { color: #fff; }
.cta p { color: #E8E9F5; max-width: 34em; margin-left: auto; margin-right: auto; }
.cta .btn { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.cta .btn:hover { background: var(--gold-soft); border-color: var(--gold-soft); }
.cta .btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.cta .btn-ghost:hover { border-color: #fff; background: rgba(255,255,255,.08); color: #fff; }
.cta .actions { justify-content: center; margin-top: 24px; }
.note { background: var(--gold-soft); border: 1px solid var(--gold-line); border-radius: var(--r-md); padding: 18px 20px; }
.note p:last-child { margin: 0; }
.note-sage { background: var(--sage-soft); border-color: var(--sage-line); }
.hotlines { display: grid; gap: 12px; margin: 20px 0; }
@media (min-width: 640px) { .hotlines { grid-template-columns: 1fr 1fr; } }
.hotline { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md); padding: 20px; }
.hotline a { font: 26px/1.2 var(--serif); text-decoration: none; display: inline-block; margin: 4px 0; }

/* Page header for inner pages */
.page-head { padding: 48px 0 24px; }
@media (min-width: 900px) { .page-head { padding: 80px 0 32px; } }

/* Prose (legal) */
.prose { padding-top: 48px; padding-bottom: 64px; }
.prose h1 { font-size: clamp(32px, 6vw, 44px); }
.prose h2 { font-size: 24px; margin-top: 40px; }
.prose ul { padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose .card { border-radius: var(--r-md); margin: 20px 0; }

/* Crisis strip + footer */
.crisis { background: var(--tan-soft); border-top: 1px solid var(--border); }
.crisis p { margin: 0; padding: 18px 0; font-size: 15px; }
.crisis a { font-weight: 600; white-space: nowrap; }
.foot { padding: 48px 0 32px; border-top: 1px solid var(--border); }
.foot-grid { display: grid; gap: 32px; }
@media (min-width: 760px) { .foot-grid { grid-template-columns: 2fr 1fr 1fr; } }
.foot-grid p { margin-top: 12px; max-width: 24em; }
.foot nav { display: flex; flex-direction: column; gap: 10px; }
.foot nav h2 { font: 600 13px/1 var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.foot nav a { text-decoration: none; color: var(--text); font-size: 15px; }
.foot nav a:hover { color: var(--sage-dark); text-decoration: underline; }
.foot-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); }

/* ---------- Hero demo: thread + extras ---------- */
.phone-head .online { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--sage-dark); }
.online i, .listening i { width: 8px; height: 8px; border-radius: 50%; background: var(--sage); display: inline-block; }
.thread { display: flex; flex-direction: column; gap: 10px; }
.bubble.them { background: var(--bg); align-self: flex-start; border-bottom-left-radius: 6px; }
.bubble.draft { align-self: flex-end; transition: background .4s ease; }
.sent-tick { display: none; font-size: 11px; font-weight: 600; color: var(--sage-dark); margin-top: 4px; text-align: right; }
.coach { position: relative; }
.checking { display: none; }
.demo-dots { display: none; justify-content: center; gap: 6px; margin-top: 18px; }
.demo-dots span { width: 7px; height: 7px; border-radius: 99px; background: var(--border); transition: width .3s ease, background .3s ease; }
.demo-dots span.on { width: 22px; background: var(--sage); }

/* ---------- Live panel extras ---------- */
.listening { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted); }
.listening i { background: var(--clay); }
.row b { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }
.meter span { transition: width .9s ease; }
[data-tone], [data-cue] { transition: opacity .3s ease; }
.fading { opacity: 0 !important; }
.dot.done { position: relative; }
.dot.done::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid var(--ink); border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* ---------- More features tiles ---------- */
.more-section { padding-top: 0; }
.tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .tiles { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
@media (min-width: 1100px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md); padding: 20px; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.tile:hover { transform: translateY(-3px); border-color: var(--sage); box-shadow: var(--shadow); }
.tile-icon { width: 44px; height: 44px; border-radius: 14px; background: var(--sage-soft); display: grid; place-content: center; font-size: 22px; margin-bottom: 14px; transition: transform .3s ease; }
.tile:nth-child(4n+2) .tile-icon { background: var(--clay-soft); }
.tile:nth-child(4n+3) .tile-icon { background: var(--gold-soft); }
.tile:nth-child(4n+4) .tile-icon { background: var(--tan-soft); }
.tile:hover .tile-icon { transform: rotate(-8deg) scale(1.08); }
.tile h3 { font-size: 19px; margin-bottom: 6px; }
.tile p { margin: 0; font-size: 15px; color: var(--muted); }

/* ---------- Motion (only when JS runs and motion is welcome) ---------- */
@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(0, 180, 166, .45); } 70% { box-shadow: 0 0 0 8px rgba(0, 180, 166, 0); } 100% { box-shadow: 0 0 0 0 rgba(0, 180, 166, 0); } }
@keyframes pulse-clay { 0% { box-shadow: 0 0 0 0 rgba(255, 111, 145, .5); } 70% { box-shadow: 0 0 0 7px rgba(255, 111, 145, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 111, 145, 0); } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes press { 0% { transform: scale(1); } 40% { transform: scale(.9); } 100% { transform: scale(1); } }
@keyframes bounce-dots { 0%, 80%, 100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-4px); opacity: 1; } }
@keyframes drift { from { transform: rotate(3deg) translateY(0); } to { transform: rotate(-1.5deg) translateY(10px); } }
@keyframes bump { 50% { transform: scale(1.35); } }

@media (prefers-reduced-motion: no-preference) {
  .online i { animation: pulse 2s infinite; }
  .listening i { animation: pulse-clay 1.6s infinite; }
  .demo::before { animation: drift 9s ease-in-out infinite alternate; }

  /* Scroll reveal */
  .js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; transition-delay: var(--rd, 0ms); }
  .js .reveal.in { opacity: 1; transform: none; }

  /* Panels that play when they scroll into view */
  .js [data-play] [data-step] { opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .5s ease; transition-delay: calc(var(--i, 0) * 260ms + 250ms); }
  .js [data-play] .pop[data-step] { transform: scale(.6); }
  .js [data-play].in [data-step] { opacity: 1; transform: none; }
  .js [data-play].in .pop[data-step] { transition-timing-function: cubic-bezier(.34, 1.56, .64, 1); }
  .js [data-play] .dot.done { background: transparent; border-color: var(--border); transition: background .3s ease, border-color .3s ease; transition-delay: calc(var(--i, 0) * 260ms + 650ms); }
  .js [data-play] .dot.done::after { opacity: 0; transform: rotate(45deg) scale(.3); transition: opacity .3s ease, transform .3s cubic-bezier(.34, 1.56, .64, 1); transition-delay: calc(var(--i, 0) * 260ms + 750ms); }
  .js [data-play].in .dot.done { background: var(--gold); border-color: var(--gold); }
  .js [data-play].in .dot.done::after { opacity: 1; transform: rotate(45deg) scale(1); }
  .bump { display: inline-block; animation: bump .4s ease; }

  /* Hero demo, driven by site.js (classes s-check … s-sent, s-out) */
  .demo.is-anim .demo-dots { display: flex; }
  .demo.is-anim .coach, .demo.is-anim .coach-read, .demo.is-anim .rewrite, .demo.is-anim .coach-actions { opacity: 0; transform: translateY(8px); transition: opacity .45s ease, transform .45s ease; }
  .demo.is-anim .checking { display: flex; align-items: center; gap: 4px; position: absolute; left: 14px; top: 14px; font-size: 13px; color: var(--muted); opacity: 0; transition: opacity .3s ease; }
  .demo.is-anim .checking span { width: 6px; height: 6px; border-radius: 50%; background: var(--sage); animation: bounce-dots 1.1s infinite; }
  .demo.is-anim .checking span:nth-child(2) { animation-delay: .15s; }
  .demo.is-anim .checking span:nth-child(3) { animation-delay: .3s; margin-right: 6px; }
  .demo.is-anim.typing [data-d="draft"]::after { content: ""; display: inline-block; width: 2px; height: 1.05em; background: currentColor; margin-left: 2px; vertical-align: -3px; animation: blink 1s steps(1) infinite; }
  .demo.is-anim .chip-use { background: var(--chip); color: var(--text); border-color: var(--border); transition: background .25s ease, color .25s ease, border-color .25s ease; }
  .demo.s-check .coach { opacity: 1; transform: none; }
  .demo.s-check:not(.s-read) .checking { opacity: 1; }
  .demo.s-read .coach-read { opacity: 1; transform: none; }
  .demo.s-read .pill { animation: pop .5s cubic-bezier(.34, 1.56, .64, 1) both; }
  .demo.s-rewrite .rewrite { opacity: 1; transform: none; }
  .demo.s-rewrite .coach-actions { opacity: 1; transform: none; transition-delay: .25s; }
  .demo.s-use .chip-use { background: var(--sage-fill); color: #fff; border-color: var(--sage-fill); animation: press .45s ease; }
  .demo.s-sent .bubble.draft { background: var(--sage-soft); }
  .demo.s-sent .sent-tick { display: block; animation: pop .4s ease both; }
  .demo .thread, .demo .coach-wrap, .demo .phone-head > div { transition: opacity .4s ease; }
  .demo.s-out .thread, .demo.s-out .coach, .demo.s-out .phone-head > div { opacity: 0 !important; }
}

/* Light / dark switch in the header */
.theme { width: 44px; height: 44px; border: 0; background: transparent; border-radius: var(--r-sm); display: grid; place-content: center; color: var(--text); cursor: pointer; }
.theme:hover { background: var(--card); }
.theme svg { width: 20px; height: 20px; }
.theme .i-sun { display: none; }
[data-theme="dark"] .theme .i-sun { display: block; }
[data-theme="dark"] .theme .i-moon { display: none; }
