/* Clinic OS by Lysoro: public site.
   Tokens copied from the app (apps/web/src/app/globals.css): warm paper in light, true black in dark,
   Spectral for anything read slowly, Figtree for the interface, one ink-blue accent. */

:root {
  --bg: #f7f5f0;
  --surface: #fbfaf7;
  --surface-2: #eeeae1;
  --ink: #1c1b18;
  --ink-2: #5c5952;
  --ink-3: #6f6b63;
  --rule: #e2ddd2;
  --rule-2: #cdc6b7;
  --accent: #2c4a7a;
  --accent-ink: #ffffff;
  --accent-soft: #e3e9f2;
  --warn: #8f5410;
  --warn-soft: #f4e7cf;
  --sage: #3f6b47; --sage-soft: #e1ebdc;
  --sky: #2d5f86; --sky-soft: #dce8f1;
  --plum: #73406e; --plum-soft: #eee0eb;
  --teal: #2a6764; --teal-soft: #d8eae6;
  --focus: color-mix(in srgb, #2c4a7a 55%, transparent);
  --shadow: 0 1px 2px rgb(28 27 24 / 0.05), 0 28px 60px -32px rgb(28 27 24 / 0.42);
  --font-sans: "Figtree", "Segoe UI", system-ui, sans-serif;
  --font-display: "Spectral", Georgia, "Times New Roman", serif;
  --wrap: 1180px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #111111;
    --surface-2: #1a1a1a;
    --ink: #f2f2f2;
    --ink-2: #b0b0b0;
    --ink-3: #8a8a8a;
    --rule: #242424;
    --rule-2: #333333;
    --accent: #8fa9d6;
    --accent-ink: #15243d;
    --accent-soft: #1c2438;
    --warn: #e0ac6c;
    --warn-soft: #2e2311;
    --sage: #9fc8a4; --sage-soft: #18261b;
    --sky: #8ec0e2; --sky-soft: #12222e;
    --plum: #d6a5ce; --plum-soft: #281a26;
    --teal: #87cbc3; --teal-soft: #112624;
    --focus: color-mix(in srgb, #8fa9d6 60%, transparent);
    --shadow: 0 10px 30px rgb(0 0 0 / 0.55), 0 1px 2px rgb(0 0 0 / 0.4);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { margin: 0; font-weight: 400; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul { margin: 0; padding: 0; list-style: none; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(20px, 4vw, 40px); }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 14px; border-radius: 8px; background: var(--ink); color: var(--bg); text-decoration: none; font-weight: 600; }
.skip:focus { top: 12px; }

/* ---- Header ------------------------------------------------------------------------------- */
.header { position: sticky; top: 0; z-index: 20; background: color-mix(in oklab, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid color-mix(in oklab, var(--rule) 70%, transparent); }
.bar { display: flex; align-items: center; gap: 28px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); flex-shrink: 0; }
.mark svg { width: 78%; height: 78%; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.brand-name { font-family: var(--font-display); font-size: 22px; letter-spacing: -0.01em; line-height: 1; }
.brand-by { font-size: 13px; color: var(--ink-3); line-height: 1; padding-left: 11px; border-left: 1px solid var(--rule-2); }
.nav { display: flex; gap: 6px; margin-left: 8px; }
.nav a { padding: 8px 12px; border-radius: 8px; color: var(--ink-2); font-size: 15px; font-weight: 500; text-decoration: none; }
.nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-size: 16px; font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color 160ms, border-color 160ms, transform 160ms; }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 180ms; }
.btn:hover svg { transform: translateX(2px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in oklab, var(--accent) 88%, var(--ink)); }
.btn-quiet { background: color-mix(in oklab, var(--surface) 70%, transparent); color: var(--ink); border-color: var(--rule-2); }
.btn-quiet:hover { background: var(--surface); border-color: var(--ink-3); }
.btn-sm { min-height: 40px; padding: 0 15px; font-size: 15px; }

/* ---- Hero --------------------------------------------------------------------------------- */
.hero { position: relative; isolation: isolate; padding: clamp(40px, 7vw, 88px) 0 clamp(48px, 7vw, 96px); overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(60% 55% at 0% 0%, color-mix(in oklab, var(--accent-soft) 75%, transparent), transparent 70%), radial-gradient(40% 35% at 100% 100%, color-mix(in oklab, var(--teal-soft) 50%, transparent), transparent 70%); }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(color-mix(in oklab, var(--ink) 9%, transparent) 1px, transparent 1.3px); background-size: 18px 18px; -webkit-mask-image: radial-gradient(45% 45% at 22% 30%, #000, transparent 78%); mask-image: radial-gradient(45% 45% at 22% 30%, #000, transparent 78%); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.eyebrow::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: var(--accent); transform-origin: 0 50%; }
.hero h1 { margin-top: 18px; font-family: var(--font-display); font-size: clamp(42px, 5.6vw, 72px); line-height: 1.02; letter-spacing: -0.028em; }
.hero h1 em { font-style: italic; color: var(--accent); }
.lead { margin-top: 22px; max-width: 52ch; font-size: clamp(17px, 1.5vw, 19.5px); line-height: 1.6; color: var(--ink-2); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.fine { margin-top: 16px; font-size: 14px; color: var(--ink-3); }
.facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--rule); font-size: 14.5px; color: var(--ink-2); }
.facts li { display: inline-flex; align-items: center; gap: 8px; }
.facts li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }

/* ---- Product preview (static copy of the sign-in page's Today card and WhatsApp card) ------- */
.panel { position: relative; border: 1px solid var(--rule); border-radius: 24px; padding: clamp(22px, 3.4vw, 44px); background: radial-gradient(110% 80% at 78% 12%, color-mix(in oklab, var(--accent-soft) 92%, transparent), color-mix(in oklab, var(--accent-soft) 30%, var(--surface)) 55%, var(--surface)); overflow: hidden; isolation: isolate; }
.panel::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(color-mix(in oklab, var(--accent) 20%, transparent) 1px, transparent 1.3px); background-size: 18px 18px; -webkit-mask-image: radial-gradient(70% 60% at 55% 42%, #000 25%, transparent 85%); mask-image: radial-gradient(70% 60% at 55% 42%, #000 25%, transparent 85%); opacity: 0.7; }
.preview { position: relative; max-width: 480px; margin: 0 auto; padding-bottom: 195px; }
.board, .chat { border: 1px solid var(--rule); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.board { padding: 16px 16px 8px; }
.board-head { display: flex; align-items: baseline; gap: 10px; padding: 0 4px 12px; border-bottom: 1px solid var(--rule); }
.board-title { font-family: var(--font-display); font-size: 22px; letter-spacing: -0.01em; }
.board-sub { font-size: 12.5px; color: var(--ink-3); }
.board-count { margin-left: auto; font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.board-count b { display: inline-block; font-weight: 700; color: var(--ink); }
.rows { margin: 0; padding: 0; list-style: none; }
.row { position: relative; isolation: isolate; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--rule); min-height: 63px; transition: border-color 450ms; }
.row:last-child { border-bottom: 0; }
/* The stage highlight is a pseudo-element so a row can change stage without moving its content. */
.row::before { content: ""; position: absolute; z-index: -1; inset: 0 -8px -1px; border-radius: 10px; background: transparent; opacity: 0; transition: opacity 450ms, background-color 450ms; }
.row[data-stage] { border-bottom-color: transparent; }
.row[data-stage]::before { opacity: 1; }
.row[data-stage="here"]::before { background: color-mix(in oklab, var(--teal-soft) 70%, transparent); }
.row[data-stage="with"]::before { background: color-mix(in oklab, var(--plum-soft) 70%, transparent); }
.row[data-stage="paid"]::before { background: color-mix(in oklab, var(--sage-soft) 75%, transparent); }
.row-time { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.row-who { min-width: 0; }
.row-who b, .row-who span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.row-who b { font-size: 14px; font-weight: 600; }
.row-who span { font-size: 12.5px; color: var(--ink-3); }
.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill[data-tone="ok"] { background: var(--sage-soft); color: var(--sage); }
.pill[data-tone="warn"] { background: var(--warn-soft); color: var(--warn); }
.pill[data-tone="plum"] { background: var(--plum-soft); color: var(--plum); }
.pill[data-tone="teal"] { background: var(--teal-soft); color: var(--teal); }
.pill[data-tone="sky"] { background: var(--sky-soft); color: var(--sky); }

.chat { position: absolute; right: -8px; bottom: 0; width: min(310px, 86%); padding: 12px; background: color-mix(in oklab, var(--surface) 92%, var(--teal-soft)); }
.chat-head { display: flex; align-items: center; gap: 9px; padding: 0 2px 10px; }
.chat-head b, .chat-head small { display: block; }
.chat-head b { font-size: 13px; font-weight: 600; line-height: 1.3; }
.chat-head small { font-size: 11.5px; color: var(--ink-3); line-height: 1.3; }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 999px; background: var(--teal-soft); font-family: var(--font-display); font-size: 13px; color: var(--teal); flex-shrink: 0; }
.bubbles { position: relative; display: flex; flex-direction: column; }
.bot { position: relative; }
.bubble { width: fit-content; max-width: 90%; margin: 6px 0 0; padding: 8px 11px; border-radius: 12px; font-size: 13px; line-height: 1.45; color: var(--ink); }
.bubble.in { align-self: flex-start; border-top-left-radius: 4px; background: var(--surface-2); transform-origin: 0 0; }
.bubble.out { align-self: flex-end; border-top-right-radius: 4px; background: var(--teal-soft); transform-origin: 100% 0; }
.ticks { display: inline-block; margin-left: 6px; vertical-align: -1px; color: var(--sky); }
.ticks svg { display: inline; width: 16px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.caption { margin-top: 14px; text-align: center; font-size: 12.5px; color: var(--ink-3); }

/* ---- Sections ----------------------------------------------------------------------------- */
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section + .section { border-top: 1px solid var(--rule); }
.section-head { max-width: 62ch; }
.section-head h2 { margin-top: 14px; font-family: var(--font-display); font-size: clamp(32px, 3.8vw, 48px); line-height: 1.08; letter-spacing: -0.022em; }
.section-head p { margin-top: 16px; color: var(--ink-2); font-size: 18px; }

.roles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 44px; }
.role { display: flex; flex-direction: column; padding: 26px; border: 1px solid var(--rule); border-radius: 18px; background: var(--surface); }
.role-tag { align-self: flex-start; }
.role h3 { margin-top: 16px; font-family: var(--font-display); font-size: 27px; line-height: 1.15; letter-spacing: -0.015em; }
.role > p { margin-top: 10px; color: var(--ink-2); font-size: 16px; }
.ticklist { margin-top: 18px; display: grid; gap: 12px; }
.ticklist li { position: relative; padding-left: 26px; font-size: 16px; line-height: 1.5; }
.ticklist li::before { content: ""; position: absolute; left: 0; top: 0.45em; width: 14px; height: 8px; border-left: 2px solid var(--teal); border-bottom: 2px solid var(--teal); transform: rotate(-45deg) scale(0.9); transform-origin: 50% 50%; }
.ticklist strong { font-weight: 600; }

.also { margin-top: 28px; padding: 22px 26px; border: 1px dashed var(--rule-2); border-radius: 16px; display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; }
.also-label { font-size: 12.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-right: 6px; }
.chip { display: inline-flex; align-items: center; min-height: 34px; padding: 0 13px; border: 1px solid var(--rule-2); border-radius: 999px; background: var(--surface); font-size: 14.5px; color: var(--ink); }

.split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.split .section-head { max-width: none; }
.split .ticklist { margin-top: 26px; }
.note { margin-top: 24px; padding: 14px 16px; border-left: 3px solid var(--rule-2); font-size: 14.5px; color: var(--ink-2); }

.wa-panel { padding: clamp(20px, 3vw, 36px); }
.wa-card { max-width: 380px; margin: 0 auto; padding: 14px; border: 1px solid var(--rule); border-radius: 16px; background: color-mix(in oklab, var(--surface) 92%, var(--teal-soft)); box-shadow: var(--shadow); }
.wa-card + .wa-card { margin-top: 16px; }
.menu { margin: 8px 0 0; display: grid; gap: 6px; }
.menu li { padding: 8px 11px; border: 1px solid var(--rule-2); border-radius: 10px; background: var(--surface); font-size: 13px; font-weight: 600; color: var(--accent); text-align: center; }

.spec-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.spec-grid .chip { min-height: 44px; padding: 0 18px; font-size: 16px; }
.spec-grid .chip.more { border-style: dashed; color: var(--ink-2); }
.spec-note { margin-top: 26px; max-width: 64ch; color: var(--ink-2); }

.safe { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 44px; }
.safe-card { padding: 24px; border: 1px solid var(--rule); border-radius: 16px; background: var(--surface); }
.safe-card h3 { font-family: var(--font-display); font-size: 22px; line-height: 1.2; letter-spacing: -0.01em; }
.safe-card p { margin-top: 10px; font-size: 16px; color: var(--ink-2); }
.safe-card.wide { grid-column: span 2; }
.safe-links { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 15px; }

.trial { padding: clamp(36px, 5vw, 56px); border: 1px solid var(--rule); border-radius: 24px; background: radial-gradient(90% 120% at 90% 0%, color-mix(in oklab, var(--accent-soft) 90%, transparent), var(--surface) 70%); display: grid; grid-template-columns: minmax(0, 1.4fr) auto; gap: 28px; align-items: center; }
.trial h2 { font-family: var(--font-display); font-size: clamp(30px, 3.4vw, 42px); line-height: 1.1; letter-spacing: -0.02em; }
.trial p { margin-top: 14px; max-width: 58ch; color: var(--ink-2); }
.trial .cta { margin-top: 0; flex-direction: column; align-items: stretch; }

.faq { margin-top: 36px; max-width: 800px; border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 64px; padding: 14px 4px; font-size: 19px; font-weight: 600; cursor: pointer; list-style: none; border-radius: 8px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex-shrink: 0; width: 10px; height: 10px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg); transition: transform 180ms; margin-right: 6px; }
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq details > div { padding: 0 4px 22px; max-width: 66ch; color: var(--ink-2); }
.faq details > div p + p { margin-top: 12px; }

/* ---- Footer ------------------------------------------------------------------------------- */
.footer { border-top: 1px solid var(--rule); background: var(--surface); padding: 52px 0 36px; font-size: 15px; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); gap: 36px; }
.foot-grid h2 { margin-bottom: 12px; font-family: var(--font-sans); font-size: 12.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.foot-grid ul { display: grid; gap: 8px; }
.foot-grid a { color: var(--ink); }
.foot-grid p { color: var(--ink-2); max-width: 36ch; }
.foot-brand { margin-bottom: 14px; }
.legal-line { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; color: var(--ink-3); font-size: 14px; }
.legal-line a { color: var(--ink-2); }

/* ---- 404 ---------------------------------------------------------------------------------- */
.lost { min-height: calc(100svh - 68px - 220px); display: grid; align-content: center; justify-items: start; padding-top: 72px; padding-bottom: 72px; }
.lost h1 { margin-top: 16px; font-family: var(--font-display); font-size: clamp(40px, 5vw, 60px); line-height: 1.05; letter-spacing: -0.025em; }
.lost p { margin-top: 16px; max-width: 46ch; color: var(--ink-2); font-size: 18px; }

/* ---- Responsive --------------------------------------------------------------------------- */
@media (max-width: 1020px) {
  .nav { display: none; }
  .hero-grid, .split { grid-template-columns: minmax(0, 1fr); }
  .roles, .safe { grid-template-columns: minmax(0, 1fr); }
  .safe-card.wide { grid-column: auto; }
  .trial { grid-template-columns: minmax(0, 1fr); }
  .trial .cta { flex-direction: row; flex-wrap: wrap; }
  .foot-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .foot-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  body { font-size: 16.5px; }
  .bar { gap: 12px; min-height: 60px; }
  .brand-by { display: none; }
  .brand-name { font-size: 20px; }
  .btn-signin { display: none; }
  .hero { padding-top: 32px; }
  .panel { padding: 16px; border-radius: 20px; }
  .preview { padding-bottom: 215px; }
  .chat { right: 0; width: 92%; }
  .role { padding: 22px; }
  .cta .btn { flex: 1 1 100%; }
  .legal-line { flex-direction: column; }
}

.section-head p.eyebrow { margin-top: 0; font-size: 12.5px; color: var(--ink-3); }

/* ---- Motion --------------------------------------------------------------------------------
   Everything here is progressive enhancement. Without it (or without /motion.js) every element is
   visible and still. Only transform and opacity move; the one exception is the FAQ, which opens by
   height on a user click. Nothing animates under prefers-reduced-motion: reduce. */

/* State classes that only motion.js adds, and only to things still below the fold. */
.rv { opacity: 0; }
@media print { .rv { opacity: 1 !important; } }

.header { transition: box-shadow 220ms; }
.header.stuck { box-shadow: 0 10px 28px -22px rgb(0 0 0 / 0.5); }
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; pointer-events: none; }

.typing { position: absolute; z-index: 1; display: flex; align-items: center; gap: 4px; padding: 11px 12px; border-radius: 12px; background: var(--surface-2); pointer-events: none; }
.typing.in { border-top-left-radius: 4px; transform-origin: 0 0; }
.typing.out { border-top-right-radius: 4px; background: var(--teal-soft); transform-origin: 100% 0; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--ink-3); animation: dot 1.05s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 60%, 100% { transform: translate3d(0, 0, 0); opacity: 0.45; } 30% { transform: translate3d(0, -3px, 0); opacity: 1; } }

@media (prefers-reduced-motion: no-preference) {
  :root { --ease: cubic-bezier(0.2, 0.7, 0.2, 1); interpolate-size: allow-keywords; }

  @keyframes rise { from { opacity: 0; transform: translate3d(0, 18px, 0); } }
  @keyframes rise-sm { from { opacity: 0; transform: translate3d(0, 8px, 0); } }
  @keyframes word { from { opacity: 0; transform: translate3d(0, 0.42em, 0); } }
  @keyframes grow-x { from { transform: scaleX(0); } }
  @keyframes slide-in { from { opacity: 0; transform: translate3d(24px, 0, 0); } }
  @keyframes panel-in { from { opacity: 0; transform: translate3d(0, 28px, 0) scale(0.97); } }
  @keyframes pop { from { opacity: 0; transform: translate3d(0, 6px, 0) scale(0.86); } }
  @keyframes drift { from { transform: translate3d(-3%, -2%, 0) scale(1); } to { transform: translate3d(3%, 2%, 0) scale(1.05); } }
  @keyframes twinkle { from { opacity: 0.45; } to { opacity: 1; } }
  @keyframes ecg-draw { 0% { stroke-dashoffset: 60; opacity: 0; } 12% { opacity: 1; } 100% { stroke-dashoffset: 0; } }

  /* Brand mark: the ECG line draws itself once. */
  .header .mark svg { stroke-dasharray: 60; animation: ecg-draw 1.1s 0.2s ease-out both; }

  /* Hero background: the two glows drift and the dot field breathes. */
  .hero::before { inset: -5%; animation: drift 24s ease-in-out infinite alternate; }
  .hero::after { animation: twinkle 9s ease-in-out infinite alternate; }

  /* Hero entrance. Pure CSS, so it ends visible even if motion.js never loads. */
  .hero .eyebrow { animation: rise 0.7s var(--ease) both; }
  .hero .eyebrow::before { animation: grow-x 0.7s 0.2s var(--ease) both; }
  .hero h1 .w { display: inline-block; animation: word 0.9s var(--ease) calc(0.15s + var(--i) * 0.07s) both; }
  .hero .lead { animation: rise 0.8s var(--ease) 0.8s both; }
  .hero .cta { animation: rise 0.8s var(--ease) 0.95s both; }
  .hero .fine { animation: rise 0.8s var(--ease) 1.05s both; }
  .hero .facts { animation: rise 0.8s var(--ease) 1.15s both; }
  .hero .facts li { animation: rise-sm 0.6s var(--ease) calc(1.25s + var(--n, 0) * 0.1s) both; }
  .hero .facts li:nth-child(2) { --n: 1; }
  .hero .facts li:nth-child(3) { --n: 2; }

  /* Product preview: panel rises, board rows slide in, then the chat card and its bubbles. */
  .hero .panel { animation: panel-in 1s var(--ease) 0.25s both; }
  .hero .row { animation: slide-in 0.7s var(--ease) calc(0.7s + var(--n, 0) * 0.11s) both; }
  .hero .row:nth-child(2) { --n: 1; }
  .hero .row:nth-child(3) { --n: 2; }
  .hero .row:nth-child(4) { --n: 3; }
  .hero .chat { animation: rise 0.8s var(--ease) 1.35s both; }
  .hero .chat .bubble { animation: pop 0.45s var(--ease) var(--at) both; }
  /* --at: when the bubble lands. --typ: how long the typing dots show before it. motion.js reads both. */
  .hero .chat .bubble:nth-child(1) { --at: 2.5s; --typ: 0.7s; }
  .hero .chat .bubble:nth-child(2) { --at: 3.9s; --typ: 0.9s; }
  .hero .chat .bubble:nth-child(3) { --at: 5.6s; --typ: 0.7s; }

  /* Buttons. */
  .btn { transition: background-color 160ms, border-color 160ms, transform 160ms, box-shadow 200ms; }
  .btn-primary { position: relative; overflow: hidden; isolation: isolate; }
  .btn-primary::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(100deg, transparent 30%, rgb(255 255 255 / 0.24) 50%, transparent 70%); transform: translate3d(-120%, 0, 0); }
  .btn:active { transform: translate3d(0, 0, 0) scale(0.97); transition-duration: 70ms; }
  @media (hover: hover) {
    .btn:hover { transform: translate3d(0, -1px, 0); }
    .btn:active { transform: translate3d(0, 0, 0) scale(0.97); }
    .btn-primary:hover { box-shadow: 0 10px 22px -12px color-mix(in srgb, var(--accent) 80%, transparent); }
    .btn-primary:hover::after { transform: translate3d(120%, 0, 0); transition: transform 700ms var(--ease); }
    .btn-quiet:hover { box-shadow: 0 8px 18px -14px rgb(0 0 0 / 0.45); }

    .role, .safe-card { transition: transform 260ms var(--ease), border-color 260ms, box-shadow 260ms; }
    .role:hover, .safe-card:hover { transform: translate3d(0, -3px, 0); border-color: var(--rule-2); box-shadow: var(--shadow); }
    .chip { transition: transform 200ms var(--ease), border-color 200ms; }
    .chip:hover { transform: translate3d(0, -2px, 0); border-color: var(--accent); }
    .footer a { transition: color 160ms; }
  }

  /* FAQ: height eases open and shut where the browser supports ::details-content; elsewhere it snaps and the text fades in. */
  .faq summary { transition: color 160ms; }
  .faq summary:hover { color: var(--accent); }
  .faq summary::after { transition: transform 260ms var(--ease), border-color 160ms; }
  .faq summary:hover::after { border-color: var(--accent); }
  .faq details::details-content { block-size: 0; overflow-y: clip; transition: block-size 380ms var(--ease), content-visibility 380ms allow-discrete; }
  .faq details[open]::details-content { block-size: auto; }
  .faq details[open] > div { animation: rise-sm 460ms var(--ease) both; }

  /* 404 */
  .lost > * { animation: rise 0.8s var(--ease) both; }
  .lost > :nth-child(2) { animation-delay: 0.1s; }
  .lost > :nth-child(3) { animation-delay: 0.2s; }
  .lost > :nth-child(4) { animation-delay: 0.3s; }
  .lost .eyebrow::before { animation: grow-x 0.7s 0.25s var(--ease) both; }
}
