/* Kliva website. Plain CSS, no build step. */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-latin-wght-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}

:root {
  --paper: #F5F6F3;
  --surface: #FFFFFF;
  --ink: #16222C;
  --ink-2: #4A5761;
  --ink-3: #7E8992;
  --rule: #DCE0DB;
  --rule-2: #C9CFC9;
  --teal: #0C7C74;
  --teal-ink: #08605A;
  --teal-tint: #DCEFEA;
  --miss: #CF5236;
  --miss-tint: #FBE7E1;
  --amber: #A9690F;
  --amber-tint: #F6EBD7;
  --night: #0F2B2A;
  --night-2: #17403E;

  --sans: "Schibsted Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;

  --frame: 1240px;
  --gut: clamp(16px, 4vw, 48px);
  --sec: clamp(72px, 10vw, 128px);

  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);

  --r-s: 8px;
  --r-m: 14px;
  --r-l: 22px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  font-feature-settings: "ss01", "tnum" 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-s); text-decoration: none; }
.skip:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 4px; }

/* ---------- type ---------- */
.display {
  font-size: clamp(2.4rem, 4.3vw, 3.8rem);
  line-height: 1.02;
  letter-spacing: -0.038em;
  font-weight: 600;
}
.display .line { display: block; }
.display .line--soft { color: var(--ink-3); }
.h2 {
  font-size: clamp(1.85rem, 3.5vw, 2.85rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 600;
  max-width: 22ch;
  text-wrap: balance;
}
.h3 { font-size: 1.2rem; line-height: 1.3; letter-spacing: -0.012em; }
.lede { font-size: clamp(1.06rem, 1.3vw, 1.2rem); color: var(--ink-2); max-width: 36em; line-height: 1.6; }
.body-l { font-size: 1.08rem; color: var(--ink-2); max-width: 38em; line-height: 1.6; text-wrap: pretty; }
.fineprint { font-size: .84rem; color: var(--ink-3); line-height: 1.5; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px;
  border-radius: 999px; border: 1px solid transparent;
  font-weight: 550; font-size: .97rem; text-decoration: none; cursor: pointer;
  transition: transform .18s var(--ease-out), background-color .2s, border-color .2s, color .2s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn--lg { height: 52px; padding: 0 26px; font-size: 1.02rem; }
.btn--ink { background: var(--ink); color: #fff; }
.btn--ink:hover { background: #24343F; }
.btn--teal { background: var(--teal); color: #fff; }
.btn--teal:hover { background: var(--teal-ink); }
.btn--ghost { border-color: var(--rule-2); background: var(--surface); }
.btn--ghost:hover { border-color: var(--ink-3); }
.btn--light { border-color: rgba(255,255,255,.28); color: #fff; justify-self: start; }
.btn--light:hover { border-color: #fff; }

.pill {
  display: inline-block; padding: 6px 14px; border: 1px solid var(--rule-2);
  border-radius: 999px; font-size: .88rem; color: var(--ink-2); background: var(--surface);
}

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.nav.is-scrolled { border-bottom-color: var(--rule); }
.nav__inner {
  max-width: var(--frame); margin: 0 auto; height: 72px;
  padding: 0 var(--gut); display: flex; align-items: center; gap: 32px;
}
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); }
.brand__mark { width: 28px; height: 28px; }
.brand__word { font-weight: 650; font-size: 1.42rem; letter-spacing: -0.04em; line-height: 1; transform: translateY(-1px); }
.nav__links { display: flex; gap: 28px; margin-left: auto; }
.nav__links a { text-decoration: none; color: var(--ink-2); font-size: .97rem; position: relative; padding: 6px 0; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1.5px; background: var(--ink);
  transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease-out);
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after, .nav__links a[aria-current="true"]::after { transform: scaleX(1); }
.nav__links a[aria-current="true"], .nav__links a[aria-current="page"] { color: var(--ink); }
.nav__links a[aria-current="page"]::after { transform: scaleX(1); }
.nav__toggle { display: none; margin-left: auto; width: 44px; height: 44px; border: 1px solid var(--rule-2); border-radius: 999px; background: var(--surface); cursor: pointer; position: relative; }
.nav__bars, .nav__bars::before { position: absolute; left: 13px; right: 13px; height: 1.5px; background: var(--ink); transition: transform .3s var(--ease-out); }
.nav__bars { top: 18px; }
.nav__bars::before { content: ""; left: 0; right: 0; top: 7px; }
.nav__toggle[aria-expanded="true"] .nav__bars { transform: translateY(3.5px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__bars::before { transform: translateY(-7px) rotate(-90deg); }
.lang { display: inline-flex; border: 1px solid var(--rule-2); border-radius: 999px; padding: 2px; font-size: .82rem; font-weight: 550; }
.lang a { text-decoration: none; color: var(--ink-3); padding: 5px 10px; border-radius: 999px; line-height: 1; transition: color .2s, background-color .2s; }
.lang a:hover { color: var(--ink); }
.lang a[aria-current="true"] { background: var(--ink); color: var(--paper); }
.mobilemenu[hidden] { display: none; }
.mobilemenu { display: grid; gap: 4px; padding: 8px var(--gut) 20px; border-bottom: 1px solid var(--rule); }
.mobilemenu a:not(.btn) { padding: 12px 0; text-decoration: none; font-size: 1.15rem; border-bottom: 1px solid var(--rule); }
.mobilemenu .btn { margin-top: 12px; }

/* ---------- frame ---------- */
.frame {
  max-width: var(--frame); margin: 0 auto;
  border-left: 1px solid var(--rule); border-right: 1px solid var(--rule);
  background: var(--paper);
}
.section { padding: var(--sec) var(--gut); border-top: 1px solid var(--rule); }
.section__head { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px 64px; align-items: end; margin-bottom: clamp(40px, 6vw, 72px); }
.section__head--narrow { grid-template-columns: 1fr; }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 5vw, 72px);
  align-items: center; padding: clamp(48px, 7vw, 96px) var(--gut) clamp(56px, 7vw, 96px);
}
.hero__copy { display: grid; gap: 22px; justify-items: start; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }

.ticks-list.hero__points { margin-top: -8px; gap: 6px; color: var(--ink); font-weight: 500; }
.hero__calm { max-width: 34em; padding-left: 14px; border-left: 2px solid var(--teal); color: var(--ink-2); font-size: .95rem; line-height: 1.55; }

.hero .pill, .hero .display .line, .hero .lede, .hero__points, .hero__actions, .hero__calm { opacity: 0; transform: translateY(14px); }
.is-ready .hero .pill, .is-ready .hero .display .line, .is-ready .hero .lede, .is-ready .hero__points, .is-ready .hero__actions, .is-ready .hero__calm {
  opacity: 1; transform: none;
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
}
.is-ready .hero .display .line:nth-child(1) { transition-delay: .08s; }
.is-ready .hero .display .line:nth-child(2) { transition-delay: .2s; }
.is-ready .hero .lede { transition-delay: .32s; }
.is-ready .hero__points { transition-delay: .4s; }
.is-ready .hero__actions { transition-delay: .48s; }
.is-ready .hero__calm { transition-delay: .56s; }

/* pairs chart */
.pairs {
  margin: 0; background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--r-l); padding: 22px 22px 18px;
  box-shadow: 0 1px 0 rgba(22,34,44,.03), 0 24px 48px -28px rgba(22,34,44,.22);
  opacity: 0; transform: translateY(18px) scale(.985);
}
.is-ready .pairs { opacity: 1; transform: none; transition: opacity 1s var(--ease-out) .25s, transform 1s var(--ease-out) .25s; }
.pairs__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--rule); }
.pairs__title { font-weight: 600; font-size: 1.02rem; }
.pairs__sub { font-size: .84rem; color: var(--ink-3); margin-top: 2px; }
.pairs__meter { text-align: right; }
.pairs__pct { display: block; font-size: 1.9rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink); transition: color .4s; }
.pairs__pct.is-good { color: var(--teal); }
.pairs__pctlabel { font-size: .78rem; color: var(--ink-3); }
.pairs__svg { width: 100%; height: auto; margin-top: 10px; overflow: visible; }
.pairs__grid line { stroke: var(--rule); stroke-width: 1; }
.pairs__grid line.axis { stroke: var(--rule-2); }
.pairs__grid text { fill: var(--ink-3); font-size: 10px; font-family: var(--sans); }
.pr__line { fill: none; stroke: var(--teal); stroke-width: 1.6; stroke-linecap: round; opacity: .55; }
.pr__line.is-miss { stroke: var(--miss); stroke-dasharray: 3 4; opacity: .7; }
.pr__a { fill: var(--surface); stroke: var(--ink-2); stroke-width: 1.5; }
.pr__b { fill: var(--teal); }
.pr__b.is-miss { fill: var(--surface); stroke: var(--miss); stroke-width: 1.5; }
.pr__ping { fill: none; stroke: var(--teal); stroke-width: 1.5; }
.pairs__axis { display: flex; justify-content: space-between; padding: 0 9% 0 13%; font-size: .8rem; color: var(--ink-2); font-weight: 500; }
.pairs__cap { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rule); font-size: .8rem; color: var(--ink-2); }
.pairs__note { margin-left: auto; color: var(--ink-3); }
.legend { display: inline-flex; align-items: center; gap: 7px; }
.legend::before { content: ""; width: 18px; height: 0; border-top: 2px solid var(--teal); }
.legend--miss::before { border-top: 2px dashed var(--miss); }

/* ---------- strip ---------- */
.strip {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 14px 36px;
  padding: 22px var(--gut); border-top: 1px solid var(--rule);
  background: var(--surface);
}
.strip__lead { color: var(--ink-3); font-size: .95rem; }
.strip__list { display: flex; flex-wrap: wrap; gap: 10px 30px; }
.strip__list li { display: inline-flex; align-items: center; gap: 9px; font-weight: 550; }
.strip__list svg { width: 18px; height: 18px; fill: none; stroke: var(--ink-2); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- problem ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--ink); }
.stat { padding: 28px 28px 8px 0; display: grid; gap: 12px; align-content: start; }
.stat + .stat { padding-left: 28px; border-left: 1px solid var(--rule); }
.stat__num { font-size: clamp(2.6rem, 4.6vw, 3.9rem); line-height: 1; letter-spacing: -0.045em; font-weight: 550; font-variant-numeric: tabular-nums; }
.stat__num span { color: var(--ink-3); font-weight: 400; margin: 0 .04em; }
.stat__txt { color: var(--ink-2); max-width: 30ch; }
.stat__src { font-size: .82rem; color: var(--ink-3); text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; }
.stat__src:hover { color: var(--ink); text-decoration-color: currentColor; }
.problem .fineprint { margin-top: 36px; }

/* ---------- journey (before/after) ---------- */
.journey { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
.journey__intro { display: grid; gap: 22px; position: sticky; top: 112px; }
.journey .h2 { max-width: 18ch; }
.seg { position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; padding: 4px; background: #E8EBE6; border-radius: 999px; justify-self: start; margin-top: 8px; }
.seg__btn { position: relative; z-index: 1; border: 0; background: none; padding: 10px 22px; border-radius: 999px; cursor: pointer; font-weight: 550; color: var(--ink-2); transition: color .3s; }
.seg__btn[aria-selected="true"] { color: #fff; }
.seg__thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); background: var(--ink); border-radius: 999px; transition: transform .5s var(--ease-out), background-color .4s; }
.seg[data-mode="after"] .seg__thumb { transform: translateX(100%); background: var(--teal); }

.board { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-l); padding: 22px clamp(14px, 2.4vw, 28px) 20px; }
.board__cols, .brow { display: grid; grid-template-columns: repeat(4, 1fr) 54px; align-items: center; }
.board__cols { padding: 0 0 12px; border-bottom: 1px solid var(--rule); font-size: .8rem; color: var(--ink-3); }
.board__cols span:not(.board__status) { text-align: center; }
.board__status { text-align: right; }
.brow { position: relative; height: 54px; border-bottom: 1px solid var(--rule); }
.brow:last-child { border-bottom: 0; }
.brow__track { position: absolute; left: calc((100% - 54px) * .125); top: 50%; height: 1px; background: var(--rule-2); width: calc((100% - 54px) * .75); }
.pairs__replay { border: 0; background: none; padding: 0; font-size: .8rem; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rule-2); cursor: pointer; }
.pairs__replay:hover { color: var(--ink); }
.brow__name { position: absolute; left: 0; top: 4px; font-size: .72rem; color: var(--ink-3); }
.dot {
  position: absolute; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border-radius: 50%; background: var(--ink-2);
  left: calc((100% - 54px) * var(--x));
  transition: left .8s var(--ease-out), background-color .45s, border-color .45s, transform .45s var(--ease-out), opacity .4s;
  transition-delay: calc(var(--d, 0) * 1ms);
  border: 2px solid transparent;
}
.dot.is-miss { background: var(--surface); border: 2px dashed var(--miss); }
.board[data-mode="after"] .dot { background: var(--teal); }
.board[data-mode="after"] .dot.is-miss { background: var(--surface); border-color: var(--miss); }
.dot.is-reminded::after {
  content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 1.5px solid var(--teal);
  animation: ping 1.4s var(--ease-out) both; animation-delay: calc(var(--d, 0) * 1ms + 300ms);
}
@keyframes ping { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.brow__ok { position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; transition: background-color .4s, color .4s; }
.brow__ok svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.brow__ok.is-yes { background: var(--teal-tint); color: var(--teal-ink); }
.brow__ok.is-no { background: var(--miss-tint); color: var(--miss); }
.board__foot { margin-top: 16px; font-size: .88rem; color: var(--ink-2); min-height: 2.8em; }
.board__foot strong { color: var(--ink); font-weight: 600; }

/* ---------- how (scrollytelling) ---------- */
.how__grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(32px, 5vw, 80px); }
.how__stage { order: 2; }
.how__sticky { position: sticky; top: 104px; }
.flow { width: 100%; height: auto; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-l); }
.wires path { fill: none; stroke: var(--rule-2); stroke-width: 2; transition: stroke .5s, stroke-width .5s; }
.node rect { fill: var(--surface); stroke: var(--rule-2); stroke-width: 1.2; transition: stroke .5s, fill .5s; }
.node__t { font: 600 14.5px var(--sans); fill: var(--ink); }
.node__s { font: 400 12px var(--sans); fill: var(--ink-3); }
.node > g { transition: opacity .5s; opacity: .45; }
.hub__body { fill: var(--ink); transition: fill .5s; }
.hub__mark circle:first-child, .hub__mark path { stroke: #fff; }
.hub__dot { fill: #5FD0C3; }
.hub__t { font: 650 16px var(--sans); fill: #fff; letter-spacing: -.02em; }
.hub__s { font: 400 11.5px var(--sans); fill: #A9B9C0; }
.hub__stem { stroke: var(--rule-2); stroke-width: 1.5; stroke-dasharray: 3 4; }
.flow[data-step="2"] .hub__stem { stroke: var(--teal); }
.ticks line { stroke: var(--rule-2); stroke-width: 1.5; }
.ticks circle { fill: var(--surface); stroke: var(--rule-2); stroke-width: 1.5; transition: fill .4s, stroke .4s; transition-delay: calc(var(--i) * 140ms); }
.ticks text { font: 500 12px var(--sans); fill: var(--ink-3); }
.ticks { opacity: .5; transition: opacity .5s; }
.pulses circle { fill: var(--teal); }
.pulses { opacity: 0; transition: opacity .4s; }

.flow[data-step="1"] .node--src > g,
.flow[data-step="2"] .node--src > g { opacity: 1; }
.flow[data-step="1"] .node--src rect { stroke: var(--teal); }
.flow[data-step="1"] .wires--in path,
.flow[data-step="2"] .wires--in path { stroke: color-mix(in srgb, var(--teal) 55%, var(--rule)); }
.flow[data-step="1"] .pulses--in,
.flow[data-step="2"] .pulses--in { opacity: 1; }
.flow[data-step="2"] .ticks { opacity: 1; }
.flow[data-step="2"] .ticks circle { fill: var(--teal); stroke: var(--teal); }
.flow[data-step="3"] .node--out > g[data-for="3"] { opacity: 1; }
.flow[data-step="3"] .node--out > g[data-for="3"] rect { stroke: var(--teal); }
.flow[data-step="3"] .wires--out path[data-for="3"] { stroke: color-mix(in srgb, var(--teal) 55%, var(--rule)); }
.flow[data-step="3"] .pulses--prove { opacity: 1; }
.flow[data-step="4"] .node--out > g[data-for="4"] { opacity: 1; }
.flow[data-step="4"] .node--out > g[data-for="4"] rect { stroke: var(--teal); fill: var(--teal-tint); }
.flow[data-step="4"] .wires--out path[data-for="4"] { stroke: color-mix(in srgb, var(--teal) 55%, var(--rule)); }
.flow[data-step="4"] .pulses--show { opacity: 1; }
.flow[data-step="3"] .ticks, .flow[data-step="4"] .ticks { opacity: .8; }
.flow[data-step="3"] .ticks circle, .flow[data-step="4"] .ticks circle { fill: var(--teal-tint); stroke: var(--teal); }

.steps { display: grid; gap: 0; counter-reset: s; }
.step { position: relative; padding: 36px 0 44px 64px; border-top: 1px solid var(--rule); min-height: 46vh; opacity: .42; transition: opacity .5s; }
.step.is-active { opacity: 1; }
.step__n {
  position: absolute; left: 0; top: 34px; width: 40px; height: 40px; border-radius: 50%;
  border: 1.5px solid var(--rule-2); display: grid; place-items: center; font-weight: 600; font-variant-numeric: tabular-nums;
  transition: background-color .4s, color .4s, border-color .4s;
}
.step.is-active .step__n { background: var(--ink); border-color: var(--ink); color: #fff; }
.step .h3 { font-size: 1.55rem; letter-spacing: -0.025em; margin: 4px 0 12px; }
.step p { color: var(--ink-2); max-width: 34em; }
.ticks-list { margin-top: 18px; display: grid; gap: 8px; }
.ticks-list li, .list-yes li, .list-no li { position: relative; padding-left: 26px; }
.ticks-list li::before, .list-yes li::before {
  content: ""; position: absolute; left: 2px; top: .45em; width: 12px; height: 7px;
  border-left: 2px solid var(--teal); border-bottom: 2px solid var(--teal); transform: rotate(-45deg);
}
.list-no li::before, .list-no li::after {
  content: ""; position: absolute; left: 3px; top: .72em; width: 13px; height: 2px; background: var(--ink-3); transform: rotate(45deg);
}
.list-no li::after { transform: rotate(-45deg); }

/* ---------- outputs / tabs ---------- */
.tabs__list { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--rule); margin-bottom: 36px; }
.tab {
  border: 0; background: none; padding: 12px 4px 14px; margin-right: 22px; cursor: pointer;
  font-weight: 550; color: var(--ink-3); position: relative; transition: color .25s;
}
.tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease-out); }
.tab:hover { color: var(--ink-2); }
.tab[aria-selected="true"] { color: var(--ink); }
.tab[aria-selected="true"]::after { transform: scaleX(1); }
.panel { display: grid; grid-template-columns: 1.25fr .75fr; gap: clamp(28px, 4vw, 64px); align-items: center; }
.panel[hidden] { display: none; }
.panel.is-entering .panel__window { animation: winIn .6s var(--ease-out) both; }
.panel.is-entering .panel__text { animation: txtIn .6s var(--ease-out) .08s both; }
@keyframes winIn { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes txtIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.panel__text { display: grid; gap: 14px; }
.panel__text p { color: var(--ink-2); }
.panel__window { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-m); overflow: hidden; box-shadow: 0 24px 48px -32px rgba(22,34,44,.28); }
.window__bar { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--rule); background: #FAFBF9; }
.window__bar span { width: 9px; height: 9px; border-radius: 50%; background: var(--rule-2); }
.window__bar p { margin-left: 10px; font-size: .8rem; color: var(--ink-3); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--rule); }
thead th { font-weight: 500; color: var(--ink-3); font-size: .8rem; }
tbody tr:last-child > * { border-bottom: 0; }
tbody th { font-weight: 600; }
.dash td { font-variant-numeric: tabular-nums; }
.dash td:nth-child(3) .bar { margin-right: 10px; vertical-align: middle; }
.bar { display: inline-block; width: 64px; height: 6px; border-radius: 3px; background: var(--rule); position: relative; overflow: hidden; }
.bar::after { content: ""; position: absolute; inset: 0; width: calc(var(--v) * 100%); background: var(--teal); border-radius: inherit; transform-origin: left; }
.bar--low::after { background: var(--miss); }
.panel.is-entering .bar::after { animation: grow .9s var(--ease-out) .2s both; }
@keyframes grow { from { transform: scaleX(0); } }
.num { font-weight: 600; }
.muted { color: var(--ink-3); font-weight: 400; }
.dict td:first-child { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .84rem; color: var(--teal-ink); }
.dict td:nth-child(2) { color: var(--ink-3); }
.chips { display: flex; gap: 8px; padding: 14px 16px; border-top: 1px solid var(--rule); }
.chips span { padding: 4px 12px; border-radius: 999px; background: var(--teal-tint); color: var(--teal-ink); font-size: .82rem; font-weight: 550; }

.panel__window--paper { background: #FDFDFB; padding: clamp(24px, 3.6vw, 44px) clamp(22px, 4vw, 52px); }
.paper { font-family: var(--serif); font-size: 1.04rem; line-height: 1.65; color: #26282A; max-width: 56ch; }
.paper__kicker { font-family: var(--sans); font-size: .78rem; color: var(--ink-3); margin-bottom: 14px; }
.paper__title { font-family: var(--serif); font-weight: 500; font-size: 1.42rem; line-height: 1.25; letter-spacing: -0.01em; margin-bottom: 20px; }
.paper__h { font-style: italic; margin-bottom: 6px; color: var(--ink-2); }
.caret { display: inline-block; width: 2px; height: 1.05em; background: var(--teal); vertical-align: -0.15em; margin-left: 2px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.strobe { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 22px; font-family: var(--sans); font-size: .76rem; }
.strobe li { padding: 4px 10px; border: 1px solid var(--rule-2); border-radius: 999px; color: var(--ink-3); }
.strobe li.ok { border-color: transparent; background: var(--teal-tint); color: var(--teal-ink); }

.pub { padding: 26px 26px 22px; display: grid; gap: 22px; }
.pub__t { font-size: 1.28rem; font-weight: 600; letter-spacing: -0.02em; }
.pub__row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pub__row > div { border-top: 1px solid var(--ink); padding-top: 10px; }
.pub__n { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.pub__l { font-size: .8rem; color: var(--ink-3); }
.pub__bars { display: grid; gap: 10px; }
.pub__bar { display: grid; grid-template-columns: 1fr 160px; align-items: center; gap: 14px; font-size: .85rem; }
.pub__bar span { height: 10px; border-radius: 5px; background: var(--rule); position: relative; overflow: hidden; }
.pub__bar span::after { content: ""; position: absolute; inset: 0; width: calc(var(--w) * 100%); background: var(--teal); border-radius: inherit; transform-origin: left; }
.pub__bar:nth-child(2) span::after { background: var(--ink-3); }
.pub__bar:nth-child(3) span::after { background: var(--miss); }
.panel.is-entering .pub__bar span::after { animation: grow 1s var(--ease-out) both; }
.panel.is-entering .pub__bar:nth-child(2) span::after { animation-delay: .1s; }
.panel.is-entering .pub__bar:nth-child(3) span::after { animation-delay: .2s; }
.pub__bar em { font-style: normal; color: var(--ink-2); }
.pub__foot { font-size: .8rem; color: var(--ink-3); border-top: 1px solid var(--rule); padding-top: 12px; }

/* ---------- AI ---------- */
.ask { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-l); padding: 8px; margin-bottom: 48px; max-width: 860px; }
.ask__q { display: flex; gap: 14px; align-items: baseline; padding: 18px 20px; background: var(--paper); border-radius: var(--r-m); font-size: 1.08rem; min-height: 64px; }
.ask__label { flex: none; font-size: .78rem; color: var(--ink-3); padding: 2px 9px; border: 1px solid var(--rule-2); border-radius: 999px; }
.ask__q [data-typer]::after { content: ""; display: inline-block; width: 2px; height: 1.1em; background: var(--ink); vertical-align: -0.18em; margin-left: 2px; animation: blink 1.1s steps(1) infinite; }
.ask__q [data-typer].is-done::after { display: none; }
.ask__a { padding: 18px 20px 14px; display: grid; gap: 6px; opacity: 0; transform: translateY(6px); transition: opacity .6s var(--ease-out), transform .6s var(--ease-out); }
.ask__a.is-shown { opacity: 1; transform: none; }
.ask__a strong { font-weight: 650; color: var(--teal-ink); }
.isnot { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--ink); }
.isnot__col { padding: 28px 32px 0 0; }
.isnot__col--no { padding-left: 32px; border-left: 1px solid var(--rule); }
.isnot__col .h3 { margin-bottom: 18px; }
.isnot ul { display: grid; gap: 12px; color: var(--ink-2); }

/* ---------- privacy (dark) ---------- */
.privacy { background: var(--night); color: #E7EFEC; border-top-color: var(--night); }
.privacy__grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.privacy__grid > div:first-child { display: grid; gap: 22px; position: sticky; top: 112px; }
.h2--light { color: #fff; }
.body-l--light { color: #A9C1BC; }
.facts { margin: 0; display: grid; }
.facts > div { padding: 22px 0; border-top: 1px solid var(--night-2); display: grid; grid-template-columns: 200px 1fr; gap: 20px; }
.facts > div:last-child { border-bottom: 1px solid var(--night-2); }
.facts dt { font-weight: 600; color: #fff; }
.facts dd { margin: 0; color: #A9C1BC; }

/* ---------- pricing ---------- */
.plans { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 16px; align-items: stretch; }
.plan { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 28px; display: grid; gap: 12px; align-content: start; }
.plan--founding { background: var(--ink); color: #E8EEF0; border-color: var(--ink); border-radius: var(--r-l); }
.plan__name { font-weight: 600; font-size: 1.05rem; }
.plan__price { color: var(--ink-3); font-size: .95rem; }
.plan__price span { font-size: 2.6rem; font-weight: 600; letter-spacing: -0.04em; color: var(--ink); margin-right: 4px; font-variant-numeric: tabular-nums; }
.plan--founding .plan__price { color: #9DB0B8; }
.plan--founding .plan__price span { color: #fff; }
.plan__note { font-size: .9rem; color: var(--ink-3); padding-bottom: 16px; border-bottom: 1px solid var(--rule); }
.plan--founding .plan__note { color: #9DB0B8; border-bottom-color: #2A3A46; }
.plan ul { display: grid; gap: 10px; margin-top: 6px; color: var(--ink-2); font-size: .96rem; }
.plan--founding ul { color: #CBD6DA; }
.plan--founding .list-yes li::before { border-color: #5FD0C3; }
.plan .btn { margin-top: 14px; justify-self: start; }
.plan__seats { display: flex; align-items: center; gap: 6px; font-size: .84rem; color: #9DB0B8; }
.plan__seats span { width: 10px; height: 10px; border-radius: 50%; background: #5FD0C3; }
.addon { margin-top: 16px; padding: 20px 24px; border: 1px dashed var(--rule-2); border-radius: var(--r-m); color: var(--ink-2); }
.addon strong { color: var(--ink); font-weight: 600; }
.pricing .fineprint { margin-top: 20px; }

/* ---------- faq ---------- */
.faq__grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.faq .h2 { position: sticky; top: 112px; max-width: 12ch; }
.faq__list { border-top: 1px solid var(--ink); }
details { border-bottom: 1px solid var(--rule); }
summary {
  list-style: none; cursor: pointer; padding: 22px 44px 22px 0; position: relative;
  font-weight: 600; font-size: 1.1rem; letter-spacing: -0.01em;
}
summary::-webkit-details-marker { display: none; }
summary::before, summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 14px; height: 1.6px; background: var(--ink); transition: transform .35s var(--ease-out); }
summary::after { transform: rotate(90deg); }
details[open] summary::after { transform: rotate(0); }
details p { color: var(--ink-2); padding: 0 44px 24px 0; max-width: 40em; }
details[open] p { animation: txtIn .4s var(--ease-out) both; }

/* ---------- cta ---------- */
.cta { background: var(--surface); }
.cta__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.cta__grid > div { display: grid; gap: 20px; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 6px; align-content: end; }
.field:nth-child(3), .field:nth-child(4) { grid-column: span 1; }
.field label { font-size: .88rem; font-weight: 550; color: var(--ink-2); }
.field__opt { font-weight: 400; color: var(--ink-3); }
.field input, .field select {
  height: 50px; padding: 0 14px; border-radius: var(--r-s); border: 1px solid var(--rule-2); background: var(--paper);
  font-size: 1rem; transition: border-color .2s, background-color .2s, box-shadow .2s; width: 100%;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--teal); background: var(--surface); box-shadow: 0 0 0 3px var(--teal-tint); }
.field input[aria-invalid="true"] { border-color: var(--miss); }
.form__btn { grid-column: 1 / -1; justify-self: start; margin-top: 6px; }
.form__msg { grid-column: 1 / -1; font-size: .92rem; min-height: 1.4em; color: var(--ink-2); }
.form__msg.is-error { color: var(--miss); }
.form__msg.is-ok { color: var(--teal-ink); font-weight: 550; }
.form__trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form__btn:disabled { opacity: .6; cursor: progress; }
.form .fineprint { grid-column: 1 / -1; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--rule); }
.footer__inner { max-width: var(--frame); margin: 0 auto; padding: 48px var(--gut) 24px; display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.footer__tag { margin-top: 12px; color: var(--ink-3); font-size: .92rem; max-width: 32ch; }
.footer__nav { display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: start; }
.footer__nav a { text-decoration: none; color: var(--ink-2); }
.footer__nav a:hover { color: var(--ink); }
.footer__legal { max-width: var(--frame); margin: 0 auto; padding: 16px var(--gut) 40px; color: var(--ink-3); font-size: .82rem; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .plans { grid-template-columns: 1fr 1fr; }
  .plan--founding { grid-column: 1 / -1; }
}
@media (max-width: 960px) {
  .nav__links, .nav__cta { display: none; }
  .nav__toggle { display: block; margin-left: 0; }
  .nav__inner { gap: 14px; }
  .lang { margin-left: auto; }
  .hero { grid-template-columns: 1fr; }
  .section__head { grid-template-columns: 1fr; }
  .journey { grid-template-columns: 1fr; }
  .journey__intro { position: static; }
  .how__grid { grid-template-columns: 1fr; gap: 0; }
  .how__stage { order: 0; position: sticky; top: 72px; z-index: 2; background: var(--paper); padding: 10px 0; margin: 0 calc(var(--gut) * -1); padding-inline: var(--gut); }
  .how__sticky { position: static; }
  .flow { max-height: 34vh; }
  .step { min-height: 0; padding: 28px 0 32px 56px; }
  .panel { grid-template-columns: 1fr; }
  .privacy__grid, .faq__grid, .cta__grid { grid-template-columns: 1fr; }
  .privacy__grid > div:first-child, .faq .h2 { position: static; }
  .faq .h2 { max-width: 20ch; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .stats { grid-template-columns: 1fr; }
  .stat, .stat + .stat { padding: 24px 0; border-left: 0; }
  .stat + .stat { border-top: 1px solid var(--rule); }
  .isnot { grid-template-columns: 1fr; }
  .isnot__col, .isnot__col--no { padding: 24px 0 0; border-left: 0; }
  .isnot__col--no { margin-top: 12px; border-top: 1px solid var(--rule); }
  .facts > div { grid-template-columns: 1fr; gap: 6px; }
  .plans { grid-template-columns: 1fr; }
  .form { grid-template-columns: 1fr; }
  .pairs { padding: 16px 14px 14px; }
  .pairs__head { flex-direction: column; }
  .pairs__meter { text-align: left; }
  .pairs__note { margin-left: 0; width: 100%; }
  .pub__row { grid-template-columns: 1fr 1fr; }
  .pub__row > :last-child { grid-column: 1 / -1; }
  .pub__bar { grid-template-columns: 1fr; gap: 4px; }
  .tab { margin-right: 10px; font-size: .92rem; }
  .board__cols { font-size: .7rem; }
  .board__cols, .brow { grid-template-columns: repeat(4, 1fr) 36px; }
  .dot { left: calc((100% - 36px) * var(--x)); width: 14px; height: 14px; margin: -7px 0 0 -7px; }
  .brow__track { left: calc((100% - 36px) * .125); width: calc((100% - 36px) * .75); }
  .brow__ok { width: 22px; height: 22px; }
  .strip { justify-content: flex-start; }
  .frame { border: 0; }
  th, td { padding: 11px 10px; }
  .dash .bar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
  .pulses { display: none; }
  .caret, .ask__q [data-typer]::after { display: none; }
}

/* =========================================================
   Privacy page
   ========================================================= */

/* status colours, shared by chips, dots and the tally bar */
.st-built   { --st: var(--teal);  --st-bg: var(--teal-tint); --st-ink: var(--teal-ink); }
.st-partial { --st: var(--teal);  --st-bg: var(--teal-tint); --st-ink: var(--teal-ink); }
.st-planned { --st: var(--ink-3); --st-bg: #ECEEEA;           --st-ink: var(--ink-2); }
.st-open    { --st: var(--amber); --st-bg: var(--amber-tint); --st-ink: #7A4C0B; }

.sdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--st); }
.sdot.st-partial { background: linear-gradient(90deg, var(--st) 50%, var(--st-bg) 50%); box-shadow: inset 0 0 0 1.5px var(--st); }
.sdot.st-planned { background: transparent; box-shadow: inset 0 0 0 1.5px var(--st); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 3px 10px 3px 8px; border-radius: 999px; white-space: nowrap;
  font-size: .8rem; font-weight: 550; color: var(--st-ink); background: var(--st-bg);
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--st); }
.chip.st-partial::before { background: linear-gradient(90deg, var(--st) 50%, transparent 50%); box-shadow: inset 0 0 0 1.2px var(--st); }
.chip.st-planned::before { background: transparent; box-shadow: inset 0 0 0 1.2px var(--st); }

/* hero */
.pv-hero {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 5vw, 72px);
  align-items: center; padding: clamp(48px, 7vw, 96px) var(--gut) clamp(56px, 7vw, 96px);
}
.pv-hero__copy { display: grid; gap: 26px; justify-items: start; }
.pv-hero .pill, .pv-hero .display .line, .pv-hero .lede, .tally { opacity: 0; transform: translateY(14px); }
.is-ready .pv-hero .pill, .is-ready .pv-hero .display .line, .is-ready .pv-hero .lede, .is-ready .tally {
  opacity: 1; transform: none; transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
}
.is-ready .pv-hero .display .line:nth-child(1) { transition-delay: .08s; }
.is-ready .pv-hero .display .line:nth-child(2) { transition-delay: .2s; }
.is-ready .pv-hero .lede { transition-delay: .32s; }
.is-ready .tally { transition-delay: .2s; }

.tally { margin: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-l); padding: 26px 24px 20px; display: grid; gap: 18px; }
.tally__head { display: flex; align-items: baseline; gap: 12px; }
.tally__total { font-size: clamp(2.6rem, 4vw, 3.4rem); font-weight: 600; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.tally__label { color: var(--ink-2); }
.tally__bar { display: flex; gap: 3px; height: 14px; }
.tally__seg { flex: var(--n) 1 0; border-radius: 3px; background: var(--st); transform: scaleX(0); transform-origin: left; }
.tally__seg:first-child { border-radius: 999px 3px 3px 999px; }
.tally__seg:last-child { border-radius: 3px 999px 999px 3px; }
.tally__seg.st-partial { background: repeating-linear-gradient(135deg, var(--teal) 0 4px, #7FBFB8 4px 8px); }
.tally__seg.st-planned { background: var(--rule-2); }
.is-ready .tally__seg { transform: scaleX(1); transition: transform 1s var(--ease-out); }
.is-ready .tally__seg:nth-child(1) { transition-delay: .55s; }
.is-ready .tally__seg:nth-child(2) { transition-delay: .7s; }
.is-ready .tally__seg:nth-child(3) { transition-delay: .85s; }
.is-ready .tally__seg:nth-child(4) { transition-delay: 1s; }
.tally__legend { display: grid; }
.tally__legend a {
  display: grid; grid-template-columns: 10px 30px 1fr; gap: 10px; align-items: baseline;
  padding: 10px 8px; margin: 0 -8px; border-radius: var(--r-s); text-decoration: none; color: var(--ink-2); font-size: .95rem;
  transition: background-color .2s;
}
.tally__legend a:hover { background: var(--paper); }
.tally__legend .sdot { transform: translateY(1px); }
.tally__legend strong { color: var(--ink); font-weight: 600; }
.tally__n { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; }
.tally__date { font-size: .84rem; color: var(--ink-3); border-top: 1px solid var(--rule); padding-top: 14px; }

/* roles chain */
.chain { display: grid; grid-template-columns: 1fr 92px 1fr 92px 1fr 92px 1.25fr; align-items: center; }
.chain__node { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 18px; display: grid; align-content: start; gap: 6px; }
.chain__node--you { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-tint); }
.chain__node--kliva { background: var(--night); border-color: var(--night); color: #E7EFEC; }
.chain__node--kliva .chain__role, .chain__node--kliva .chain__note { color: #A9C1BC; }
.chain__role { font-size: .8rem; color: var(--ink-3); }
.chain__name { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; }
.chain__note { font-size: .9rem; color: var(--ink-2); line-height: 1.45; }
.chain__subs { display: grid; gap: 10px; margin-top: 4px; }
.chain__subs li { border-top: 1px solid var(--rule); padding-top: 10px; display: grid; gap: 2px; }
.chain__sub { font-weight: 600; font-size: .95rem; }
.chain__link { position: relative; align-self: stretch; }
.chain__link::before { content: ""; position: absolute; left: 6px; right: 10px; top: 50%; height: 1.5px; background: var(--ink-3); transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease-out) calc(var(--i) * .25s); }
.chain__link::after { content: ""; position: absolute; right: 8px; top: calc(50% - 4px); border: 4.5px solid transparent; border-left: 7px solid var(--ink-3); border-right: 0; opacity: 0; transition: opacity .2s calc(var(--i) * .25s + .5s); }
.chain__link span { position: absolute; bottom: calc(50% + 8px); left: 6px; right: 10px; font-size: .74rem; color: var(--ink-3); text-align: center; line-height: 1.25; opacity: 0; transition: opacity .4s calc(var(--i) * .25s + .3s); }
.chain.is-in .chain__link::before { transform: scaleX(1); }
.chain.is-in .chain__link::after, .chain.is-in .chain__link span { opacity: 1; }
.roles__aside { margin-top: 28px; max-width: 46em; color: var(--ink-2); font-size: .95rem; }

/* one patient, three forms */
.morph__stages { display: grid; grid-template-columns: repeat(3, 1fr); gap: 44px; }
.stage { position: relative; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-l); padding: 22px; display: grid; gap: 8px; align-content: start; }
.stage:not(:last-child)::after {
  content: ""; position: absolute; right: -32px; top: 50%; width: 20px; height: 1.5px; background: var(--ink-3);
}
.stage:not(:last-child)::before {
  content: ""; position: absolute; right: -33px; top: calc(50% - 4px); border: 4.5px solid transparent; border-left: 7px solid var(--ink-3); border-right: 0;
}
.stage__n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 600; background: var(--ink); color: #fff; }
.stage__t { font-size: 1.1rem; letter-spacing: -0.01em; }
.stage__d { font-size: .92rem; color: var(--ink-2); min-height: 2.9em; }
.rec { margin: 8px 0 4px; display: grid; border-top: 1px solid var(--rule); }
.rec > div { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: .92rem; }
.rec dt { color: var(--ink-3); }
.rec dd { margin: 0; font-weight: 550; font-variant-numeric: tabular-nums; }
.rec .is-changed dd { color: var(--teal-ink); }
.rec .is-changed dd span { background: var(--teal-tint); border-radius: 4px; padding: 1px 5px; margin-left: -5px; }
.agg { width: 100%; border-collapse: collapse; margin: 8px 0 4px; font-size: .92rem; }
.agg th, .agg td { text-align: left; padding: 9px 0; border-bottom: 1px solid var(--rule); font-variant-numeric: tabular-nums; }
.agg thead th { color: var(--ink-3); font-weight: 500; border-top: 1px solid var(--rule); }
.agg tbody th { font-weight: 550; }
.agg__hidden th, .agg__hidden td { color: var(--ink-3); font-weight: 400; font-style: italic; }
.stage__tag { justify-self: start; margin-top: 8px; padding: 4px 11px; border-radius: 999px; font-size: .8rem; font-weight: 550; }
.stage__tag--personal { background: var(--ink); color: #fff; }
.stage__tag--pseudo { background: var(--amber-tint); color: #7A4C0B; }
.stage__tag--anon { background: var(--teal-tint); color: var(--teal-ink); }
.morph + .fineprint, .morph .fineprint { margin-top: 22px; }
.morph__stages.is-armed .stage:nth-child(n+2) { opacity: .38; transition: opacity .6s var(--ease-out); }
.morph__stages.is-armed.is-s2 .stage:nth-child(2), .morph__stages.is-armed.is-s3 .stage:nth-child(3) { opacity: 1; }

/* opt-out */
.optout__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.optout__grid > div:first-child { display: grid; gap: 22px; }
.flowsteps { counter-reset: fs; display: grid; gap: 0; margin-top: 8px; }
.flowsteps li { counter-increment: fs; display: grid; grid-template-columns: 32px 1fr; column-gap: 14px; padding: 14px 0; border-top: 1px solid var(--rule); }
.flowsteps li::before { content: counter(fs); grid-row: span 2; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--ink); display: grid; place-items: center; font-size: .8rem; font-weight: 600; }
.flowsteps__t { font-weight: 600; }
.flowsteps p:not(.flowsteps__t) { color: var(--ink-2); font-size: .95rem; }
.dest { margin: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-l); padding: 10px 22px 18px; }
.dest__row { display: grid; grid-template-columns: 1fr auto 72px; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.dest__name { font-weight: 550; }
.dest__dots { display: flex; gap: 6px; }
.dest__dots i, .dest__legend i { width: 12px; height: 12px; border-radius: 50%; background: var(--ink-3); opacity: .35; display: inline-block; }
.dest__dots i.is-patient, .dest__legend i.is-patient { background: var(--teal); opacity: 1; box-shadow: 0 0 0 3px var(--teal-tint); transition: transform .5s var(--ease-out), opacity .5s, background-color .3s, box-shadow .3s; }
.dest__row.is-out i.is-patient { transform: scale(.45); background: var(--miss); box-shadow: none; opacity: .0; }
.dest__n { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: .95rem; }
.dest__n span { color: var(--ink); font-weight: 600; display: inline-block; transition: color .3s; }
.dest__row.is-out .dest__n span.is-tick { color: var(--miss); }
.dest__legend { display: flex; align-items: center; gap: 10px; padding-top: 14px; font-size: .86rem; color: var(--ink-3); }
.note { margin-top: clamp(32px, 5vw, 56px); display: grid; grid-template-columns: 1fr 1fr; gap: 16px clamp(32px, 6vw, 88px); padding-top: 24px; border-top: 1px dashed var(--rule-2); color: var(--ink-2); }
.note__status { display: flex; align-items: baseline; gap: 10px; color: var(--ink-2); font-size: .95rem; }

/* roadmap */
.filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 40px; }
.filter button {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; cursor: pointer;
  border: 1px solid var(--rule-2); border-radius: 999px; background: var(--surface); font-size: .92rem; font-weight: 550;
  transition: background-color .2s, color .2s, border-color .2s;
}
.filter button span { color: var(--ink-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.filter button:hover { border-color: var(--ink-3); }
.filter button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.filter button[aria-pressed="true"] span { color: #B7C2CA; }
.phases { position: relative; padding-left: 52px; --p: 0; }
.phases::before, .phases::after { content: ""; position: absolute; left: 12px; top: 6px; width: 2px; border-radius: 2px; }
.phases::before { bottom: 6px; background: var(--rule); }
.phases::after { height: calc((100% - 12px) * var(--p)); background: var(--teal); }
.phase { position: relative; padding-bottom: 48px; }
.phase:last-child { padding-bottom: 0; }
.phase[hidden] { display: none; }
.phase__head { display: grid; gap: 6px; margin-bottom: 14px; max-width: 46em; }
.phase__head p { color: var(--ink-2); }
.phase__mark { position: absolute; left: -52px; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--paper); border: 2px solid var(--rule-2); transition: border-color .3s, background-color .3s; }
.phase__mark::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--rule-2); transition: background-color .3s; }
.phase.is-passed .phase__mark { border-color: var(--teal); }
.phase.is-passed .phase__mark::after { background: var(--teal); }
.phase--open.is-passed .phase__mark { border-color: var(--amber); }
.phase--open.is-passed .phase__mark::after { background: var(--amber); }
.items { display: grid; grid-template-columns: 1fr 1fr; column-gap: 40px; }
.item { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 16px 0; border-top: 1px solid var(--rule); }
.item[hidden] { display: none; }
.item.is-entering { animation: itemIn .45s var(--ease-out) both; }
@keyframes itemIn { from { opacity: 0; transform: translateY(6px); } }
.item__t { font-weight: 600; line-height: 1.35; }
.item__d { color: var(--ink-2); font-size: .94rem; margin-top: 4px; line-height: 1.5; }

/* rights */
.rights__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 32px; }
.rights__grid li { border-top: 1px solid var(--rule); padding: 18px 0 26px; display: grid; gap: 4px; align-content: start; }
.rights__art { font-size: .8rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.rights__t { font-weight: 600; font-size: 1.05rem; }
.rights__d { color: var(--ink-2); font-size: .94rem; }
.rights .section__head > div { display: grid; gap: 16px; }

/* retention chart */
.span-chart { margin: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-l); padding: 18px 24px 10px; }
.span-chart__axis, .span-row { display: grid; grid-template-columns: minmax(180px, 300px) 1fr; gap: 24px; }
.span-chart__axis { height: 28px; }
.span-chart__ticks { position: relative; }
.span-chart__ticks span { position: absolute; top: 4px; transform: translateX(-50%); font-size: .78rem; color: var(--ink-3); white-space: nowrap; }
.span-chart__ticks span:first-child { transform: none; }
.span-chart__ticks span:last-child { transform: translateX(-100%); }
.span-row { padding: 14px 0; border-top: 1px solid var(--rule); align-items: center; row-gap: 2px; }
.span-row__t { font-weight: 550; line-height: 1.35; }
.span-row__v { grid-column: 1; font-size: .86rem; color: var(--ink-3); }
.span-row > .span-row__t { grid-column: 1; }
.span-row__track { grid-column: 2; grid-row: 1 / span 2; position: relative; height: 12px; }
.span-row__track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--rule); }
.span-row__track .tick { position: absolute; top: -8px; bottom: -8px; width: 1px; background: var(--rule); }
.span-row__bar { position: absolute; top: 0; height: 12px; min-width: 12px; border-radius: 999px; background: var(--teal); transform: scaleX(0); transform-origin: left; transition: transform .9s var(--ease-out); }
.span-chart.is-in .span-row__bar { transform: scaleX(1); }
.retain__end { margin-top: 22px; color: var(--ink-2); max-width: 46em; }

/* laws timeline */
.lawline__axis { position: relative; height: 84px; margin: 0 14px 28px; }
.lawline__axis::before { content: ""; position: absolute; left: -14px; right: -14px; top: 52px; height: 2px; background: var(--rule-2); border-radius: 2px; }
.lawline__dot, .lawline__num {
  width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: .78rem; font-weight: 600; background: var(--surface); border: 2px solid var(--teal); color: var(--teal-ink);
}
.lawline__dot { position: absolute; top: 39px; transform: translateX(-50%); }
.lawline__dot.is-past, .lawline__list li.is-past .lawline__num { border-color: var(--ink-3); background: var(--ink-3); color: #fff; }
.lawline__today { position: absolute; top: 0; height: 53px; width: 0; border-left: 2px dashed var(--ink); }
.lawline__today em { position: absolute; top: -2px; left: 8px; font-style: normal; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.lawline__today::after { content: ""; position: absolute; left: -6px; top: 47px; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
.lawline__year { position: absolute; top: 74px; transform: translateX(-50%); font-size: .76rem; color: var(--ink-3); }
.lawline__list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 32px; }
.lawline__list li { border-top: 1px solid var(--rule); padding: 18px 0 26px; display: grid; gap: 6px; align-content: start; }
.lawline__list li.is-past { opacity: .62; }
.lawline__when { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.lawline__num { width: 24px; height: 24px; font-size: .72rem; }
.lawline__t { font-weight: 600; }
.lawline__d { color: var(--ink-2); font-size: .94rem; }
.laws .fineprint { margin-top: 12px; max-width: 60em; }

/* end */
.pv-end__box { display: grid; grid-template-columns: 1.4fr auto; gap: 32px; align-items: center; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-l); padding: clamp(26px, 4vw, 44px); }
.pv-end__box > div:first-child { display: grid; gap: 14px; }
.pv-end__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.pv-end > .fineprint { margin-top: 22px; max-width: 60em; }

/* ---------- privacy page motion ---------- */
@keyframes pvPing { from { transform: scale(1); opacity: .55; } to { transform: scale(2.6); opacity: 0; } }

/* roles: data travels along each link and gets smaller on the way out (only what is needed) */
.chain__pulse { position: absolute; left: 6px; right: 10px; top: 50%; height: 0; pointer-events: none; }
.chain__pulse::after {
  content: ""; position: absolute; left: 0; top: calc(var(--s) / -2); width: var(--s); height: var(--s);
  border-radius: 50%; background: var(--teal); opacity: 0;
}
.chain__link:nth-child(2) { --s: 9px; }
.chain__link:nth-child(4) { --s: 7px; }
.chain__link:nth-child(6) { --s: 5px; }
.chain.is-live .chain__pulse { animation: travel 2.4s var(--ease-io) infinite; animation-delay: calc(var(--i) * .8s + .9s); }
.chain.is-live .chain__pulse::after { animation: travelDot 2.4s var(--ease-io) infinite; animation-delay: calc(var(--i) * .8s + .9s); }
@keyframes travel { from { transform: translateX(0); } 70%, to { transform: translateX(calc(100% - var(--s))); } }
@keyframes travelDot { 0% { opacity: 0; } 8% { opacity: 1; } 62% { opacity: 1; } 70%, 100% { opacity: 0; } }
.chain__node { transition: box-shadow .4s var(--ease-out); }
.chain.is-armed:not(.is-in) .chain__node { opacity: 0; }
.chain.is-in .chain__node { animation: nodeIn .7s var(--ease-out) both; }
.chain.is-in .chain__node:nth-child(3) { animation-delay: .25s; }
.chain.is-in .chain__node:nth-child(5) { animation-delay: .5s; }
.chain.is-in .chain__node:nth-child(7) { animation-delay: .75s; }
@keyframes nodeIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }

/* morph: source field lights up while its target changes; a dot travels along the arrow */
.rec [data-src] { transition: background-color .35s var(--ease-out); border-radius: 6px; }
.rec [data-src].is-src { background: var(--amber-tint); }
.rec [data-src] dd { transition: color .35s; }
.rec [data-src].is-src dd { color: #7A4C0B; }
.stage__flow { position: absolute; right: -32px; top: calc(50% - 4px); width: 20px; height: 8px; pointer-events: none; }
.stage__flow::after { content: ""; position: absolute; left: 0; top: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); opacity: 0; }
.stage__flow.is-go::after { animation: flowX .7s var(--ease-io) both; }
@keyframes flowY { 0% { opacity: 0; transform: translateY(-6px); } 20% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(16px); } }
@keyframes flowX { 0% { opacity: 0; transform: translateX(-6px); } 20% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateX(16px); } }
.agg tr { transition: color .4s, opacity .4s; }
.agg__hidden.is-pre th, .agg__hidden.is-pre td { color: var(--ink); font-style: normal; font-weight: 550; }
.agg__hidden td span { display: inline-block; transition: opacity .35s var(--ease-out), transform .35s var(--ease-out); }
.agg__hidden.is-hiding td span { opacity: 0; transform: translateY(-4px); }

/* replay link under an explanation */
.replay {
  justify-self: start; margin-top: 14px; padding: 0; border: 0; background: none; cursor: pointer;
  font-size: .86rem; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px;
  transition: color .2s, text-decoration-color .2s;
}
.replay:hover { color: var(--ink); text-decoration-color: var(--ink); }
.replay[disabled] { opacity: .45; cursor: default; }

/* opt-out: steps follow along; the patient pings everywhere, then leaves and the rest closes the gap */
.flowsteps li { transition: opacity .35s var(--ease-out); }
.flowsteps li::before { transition: background-color .3s, color .3s; }
.flowsteps.is-playing li { opacity: .42; }
.flowsteps.is-playing li.is-active { opacity: 1; }
.flowsteps li.is-active::before { background: var(--ink); color: #fff; }
.dest__dots i { transition: transform .5s var(--ease-out), opacity .4s; position: relative; }
.dest__row.is-out i.is-patient ~ i { transform: translateX(-18px); }
.dest__dots i.is-patient::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--teal); opacity: 0; }
.dest__row.is-ping i.is-patient::after { animation: pvPing .9s var(--ease-out); }
.dest__row { transition: background-color .5s var(--ease-out); }
.dest__row.is-flash { background: linear-gradient(90deg, transparent, var(--miss-tint) 40%, transparent); }

/* retention: a time cursor sweeps the log scale */
.span-row__cursor { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s; }
.span-row__cursor::after { content: ""; position: absolute; left: -1px; top: -10px; bottom: -10px; width: 2px; background: var(--ink); border-radius: 2px; }
.span-chart.is-sweeping .span-row__cursor, .span-chart.is-sweeping .span-chart__cursor { opacity: 1; }
.span-chart__cursor {
  position: absolute; left: 0; right: 0; top: 0; height: 24px; pointer-events: none; opacity: 0; transition: opacity .4s;
}
.span-chart__cursor b {
  position: absolute; left: 0; top: 0; transform: translateX(-50%); white-space: nowrap;
  font-size: .76rem; font-weight: 600; color: #fff; background: var(--ink); padding: 2px 8px; border-radius: 999px; font-variant-numeric: tabular-nums;
}
.span-chart.is-sweeping .span-chart__ticks span { opacity: .35; }
.span-chart__ticks span { transition: opacity .3s; }

/* laws: the line draws, dates appear as it reaches them, today pulses */
.lawline__axis::before { transform: scaleX(0); transform-origin: left; transition: transform 1.6s var(--ease-io); }
.lawline.is-in .lawline__axis::before { transform: scaleX(1); }
.lawline__dot { opacity: 0; transform: translateX(-50%) scale(.85); transition: opacity .4s var(--ease-out), transform .4s var(--ease-out), background-color .2s, border-color .2s, color .2s; }
.lawline.is-in .lawline__dot { opacity: 1; transform: translateX(-50%) scale(1); }
.lawline__dot.is-hot { transform: translateX(-50%) scale(1.18) !important; background: var(--teal); border-color: var(--teal); color: #fff; }
.lawline__dot.is-past.is-hot { background: var(--ink); border-color: var(--ink); }
.lawline__list li { transition: opacity .2s; }
.lawline__list li.is-hot { opacity: 1; }
.lawline__list li.is-hot .lawline__t { color: var(--teal-ink); }
.lawline__today { opacity: 0; transition: opacity .4s var(--ease-out) .5s; }
.lawline.is-in .lawline__today { opacity: 1; }
.lawline__today::before { content: ""; position: absolute; left: -6px; top: 47px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--ink); box-sizing: border-box; opacity: 0; }
.lawline.is-live .lawline__today::before { animation: pvPing 2.4s var(--ease-out) infinite 1.2s; }

/* roadmap: per-phase mix bar fills, and the mark pings when the rail reaches it */
.phase__mix { display: flex; gap: 2px; height: 6px; width: min(240px, 60%); margin-top: 6px; }
.phase__mix span { flex: var(--n) 1 0; border-radius: 2px; background: var(--st); transform: scaleX(0); transform-origin: left; transition: transform .8s var(--ease-out); }
.phase__mix span.st-partial { background: repeating-linear-gradient(135deg, var(--teal) 0 3px, #7FBFB8 3px 6px); }
.phase__mix span.st-planned { background: var(--rule-2); }
.phase.has-seen .phase__mix span { transform: scaleX(1); }
.phase.has-seen .phase__mix span:nth-child(2) { transition-delay: .12s; }
.phase.has-seen .phase__mix span:nth-child(3) { transition-delay: .24s; }
.phase.has-seen .phase__mix span:nth-child(4) { transition-delay: .36s; }
.phase__mark::before { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--teal); opacity: 0; }
.phase--open .phase__mark::before { border-color: var(--amber); }
.phase.just-passed .phase__mark::before { animation: pvPing .9s var(--ease-out); }

@media (hover: hover) and (pointer: fine) {
  .lawline__list li { cursor: default; }
}
@media (prefers-reduced-motion: reduce) {
  .chain__pulse, .stage__flow, .span-row__cursor, .span-chart__cursor { display: none; }
  .lawline__axis::before, .phase__mix span { transform: none !important; }
  .lawline__dot { opacity: 1 !important; transform: translateX(-50%) !important; }
  .lawline__today { opacity: 1 !important; }
}

@media (max-width: 1080px) {
  .chain { grid-template-columns: 1fr 1fr; gap: 16px; }
  .chain__link { display: none; }
  .rights__grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 960px) {
  .pv-hero { grid-template-columns: 1fr; }
  .morph__stages { grid-template-columns: 1fr; gap: 40px; }
  .stage:not(:last-child)::after { right: auto; left: 50%; top: auto; bottom: -30px; width: 1.5px; height: 20px; }
  .stage:not(:last-child)::before { right: auto; left: calc(50% - 4px); top: auto; bottom: -33px; border: 4.5px solid transparent; border-top: 7px solid var(--ink-3); border-bottom: 0; }
  .stage__d { min-height: 0; }
  .stage__flow { right: auto; left: calc(50% - 4px); top: auto; bottom: -32px; width: 8px; height: 20px; }
  .stage__flow.is-go::after { animation-name: flowY; }
  .optout__grid, .note { grid-template-columns: 1fr; }
  .items { grid-template-columns: 1fr; }
  .lawline__list { grid-template-columns: 1fr 1fr; }
  .pv-end__box { grid-template-columns: 1fr; }
  .span-chart__axis, .span-row { grid-template-columns: 1fr; gap: 8px; }
  .span-chart__axis > span:first-child { display: none; }
  .span-row__track { grid-column: 1; grid-row: auto; margin: 6px 0 4px; }
}
@media (max-width: 680px) {
  .chain { grid-template-columns: 1fr; }
  .rights__grid, .lawline__list { grid-template-columns: 1fr; }
  .phases { padding-left: 40px; }
  .phases::before, .phases::after { left: 9px; }
  .phase__mark { left: -40px; width: 20px; height: 20px; }
  .phase__mark::after { inset: 4px; }
  .item { flex-direction: column; gap: 8px; }
  .dest { padding: 6px 16px 14px; }
  .dest__row { grid-template-columns: 1fr auto; }
  .dest__dots { grid-column: 1 / -1; grid-row: 2; }
  .lawline__dot { width: 22px; height: 22px; top: 42px; font-size: .7rem; }
  .lawline__today em { left: 6px; }
  .span-chart__ticks span:nth-child(2), .span-chart__ticks span:nth-child(4) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .tally__seg, .span-row__bar, .chain__link::before { transform: none !important; }
  .chain__link::after, .chain__link span { opacity: 1 !important; }
}


/* =========================================================
   Demo page: the same cards and rhythm as the homepage, with made-up data
   ========================================================= */

.panel__link { justify-self: start; }
.pill--amber { border-color: #E5CB9C; background: var(--amber-tint); color: #6B4209; font-weight: 550; }

/* intro */
.demo-intro {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 24px clamp(32px, 5vw, 72px); align-items: end;
  padding: clamp(56px, 8vw, 104px) var(--gut) clamp(40px, 5vw, 64px);
}
.demo-intro__copy { display: grid; gap: 26px; justify-items: start; }
.demo-intro .pill, .demo-intro .display .line, .demo-intro .lede { opacity: 0; transform: translateY(14px); }
.is-ready .demo-intro .pill, .is-ready .demo-intro .display .line, .is-ready .demo-intro .lede {
  opacity: 1; transform: none; transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
}
.is-ready .demo-intro .display .line:nth-child(1) { transition-delay: .08s; }
.is-ready .demo-intro .display .line:nth-child(2) { transition-delay: .2s; }
.is-ready .demo-intro .lede { transition-delay: .32s; }

/* filter bar: light, sticky under the nav, like the language switch */
.dbar {
  position: sticky; top: 72px; z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px;
  padding: 12px var(--gut);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
}
.dbar__group { display: flex; align-items: center; gap: 12px; }
.dbar__label { font-size: .86rem; color: var(--ink-2); }
.dbar__fake {
  margin-left: auto; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  padding: 5px 12px; border-radius: 999px; font-size: .82rem; font-weight: 600;
  background: var(--amber-tint); color: #6B4209; border: 1px solid #E5CB9C;
}
.dbar__fake::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }
.dseg { display: inline-flex; border: 1px solid var(--rule-2); border-radius: 999px; padding: 3px; background: var(--surface); }
.dseg button {
  height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: none;
  color: var(--ink-2); font-size: .92rem; font-weight: 550; cursor: pointer; white-space: nowrap;
  transition: color .2s, background-color .2s;
}
.dseg button:hover { color: var(--ink); }
.dseg button[aria-checked="true"] { background: var(--ink); color: var(--paper); }
.dseg .short { display: none; }

/* the four numbers, like the homepage stats */
.demo-stats { padding: clamp(40px, 5vw, 64px) var(--gut) clamp(56px, 7vw, 88px); }
.dstats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); margin: 0; }
.dstat { padding: 26px 24px 4px 0; display: flex; flex-direction: column; gap: 10px; }
.dstat + .dstat { padding-left: 24px; border-left: 1px solid var(--rule); }
.dstat__num { order: 1; margin: 0; font-size: clamp(2.3rem, 3.8vw, 3.3rem); line-height: 1; letter-spacing: -0.045em; font-weight: 550; min-height: 1em; }
.dstat__num.is-muted { color: #B3BAB4; }
.dstat__txt { order: 2; color: var(--ink-2); max-width: 24ch; text-wrap: balance; }
.dstat__sub { order: 3; margin: 0; font-size: .84rem; color: #66717A; font-variant-numeric: tabular-nums; }

/* sections: text left, card right, as on the homepage */
.dsec { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
.dsec__copy { display: grid; gap: 22px; align-content: start; position: sticky; top: 160px; }
.dsec__copy .h2 { max-width: 16ch; }
.dsec__copy .fineprint { max-width: 46em; }

/* the card, same look as the hero chart */
.dcard {
  margin: 0; background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--r-l); padding: 22px 22px 18px;
  box-shadow: 0 1px 0 rgba(22,34,44,.03), 0 24px 48px -28px rgba(22,34,44,.22);
  min-width: 0;
}
.dcard.is-armed { opacity: 0; transform: translateY(18px) scale(.985); }
.dcard.is-in { opacity: 1; transform: none; transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); }
.dcard .pairs__pct.is-muted { font-size: 1rem; font-weight: 500; letter-spacing: 0; color: var(--ink-3); line-height: 1.9rem; }
.dcard .pairs__cap { margin-top: 10px; }

.dplot { position: relative; margin-top: 10px; }
.dplot__svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.dplot__svg:focus-visible { outline: 2px solid var(--teal); outline-offset: 4px; border-radius: 6px; }
.dplot.is-empty .dplot__svg { display: none; }
.dempty {
  margin: 6px 0 4px; padding: 26px 18px; text-align: center; font-size: .92rem; color: var(--ink-2);
  background: var(--paper); border: 1px dashed var(--rule-2); border-radius: var(--r-m);
}

.dgrid line { stroke: var(--rule); stroke-width: 1; shape-rendering: crispEdges; }
.dgrid line.is-step { stroke: var(--rule-2); }
.dgrid text { fill: #66717A; font-size: 10.5px; font-family: var(--sans); font-variant-numeric: tabular-nums; }
.dgrid text.is-steplabel { fill: var(--ink-2); font-size: 12px; font-weight: 500; }
.dgap { fill: #7E8992; font-size: 11.5px; font-style: italic; }
.dcross { stroke: var(--ink-2); stroke-width: 1; shape-rendering: crispEdges; pointer-events: none; }

.dline__line { fill: none; stroke: var(--teal); stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.dline__band { fill: var(--teal); fill-opacity: .1; }
.dline__area { fill: var(--teal); fill-opacity: .07; }
.dline__dot { fill: var(--teal); stroke: var(--surface); stroke-width: 2; }
.dline.is-context path { fill: none; stroke: #C2C8C3; stroke-width: 1.5; stroke-linecap: round; }
.dline.is-context circle { fill: #C2C8C3; stroke: var(--surface); stroke-width: 1.5; }
.dline__label { font-size: 12px; fill: var(--ink); font-variant-numeric: tabular-nums; }
.dline__label.is-muted { fill: #7E8992; }
.dline__name { font-weight: 600; }
.dline__label.is-muted .dline__name { font-weight: 500; }
.dline__value { fill: var(--ink-2); }
.dline__leader { fill: none; stroke: #B7BEB8; stroke-width: 1; }
.dline__line.is-drawing { stroke-dasharray: 1; stroke-dashoffset: 1; animation: dDraw .9s var(--ease-out) forwards; }
@keyframes dDraw { to { stroke-dashoffset: 0; } }
.dcard.is-armed .dline__line { stroke-dasharray: 1; stroke-dashoffset: 1; }
.dcard.is-in .dline__line { stroke-dasharray: 1; transition: stroke-dashoffset 1.2s var(--ease-out) .25s; }
.dcard.is-armed .dline__band, .dcard.is-armed .dline__area { opacity: 0; }
.dcard.is-in .dline__band, .dcard.is-in .dline__area { transition: opacity .8s var(--ease-out) .7s; }

.dkey { display: inline-flex; align-items: center; gap: 7px; }
.dkey::before { content: ""; width: 18px; height: 10px; border-radius: 3px; }
.dkey--band::before { background: color-mix(in srgb, var(--teal) 14%, transparent); }
.dkey--other::before { height: 0; border-radius: 0; border-top: 1.5px solid #C2C8C3; }

/* columns */
.dcols path { fill: var(--teal); transition: opacity .15s; }
.dcols.has-hot path:not(.is-hot) { opacity: .4; }
.dcols.is-growing path, .dcard.is-in .dcols path { transform-box: fill-box; transform-origin: bottom; animation: dGrow .6s var(--ease-out) both; animation-delay: calc(var(--i) * 6ms); }
.dcard.is-armed .dcols path { transform-box: fill-box; transform-origin: bottom; transform: scaleY(0); }
@keyframes dGrow { from { transform: scaleY(0); } }

/* table beside the chart */
.dtable { font-size: .92rem; }
.dtable thead th { font-size: .78rem; color: #66717A; }
.dtable th, .dtable td { padding: 11px 12px; }
.dtable td { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.dtable td.is-num { color: var(--ink); font-weight: 600; }
.dtable td.is-muted { color: #7E8992; }
.dtable tbody th { padding: 0; }
.dtable tbody tr { transition: background-color .2s; }
.dtable tbody tr.is-selected { background: var(--teal-tint); }
.dtable tbody tr.is-selected td.is-num { color: var(--teal-ink); }
.drow { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border: 0; background: none; font-weight: 600; text-align: left; cursor: pointer; }
.drow__mark { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--rule-2); flex: none; transition: background-color .2s, border-color .2s; }
.drow[aria-pressed="true"] .drow__mark { background: var(--teal); border-color: var(--teal); }
.drow:hover .drow__mark { border-color: var(--teal); }

/* questionnaire meters */
.dmeters { display: grid; gap: 22px; margin: 18px 0 6px; padding: 0; list-style: none; }
.dmeter { display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; align-items: baseline; }
.dmeter__label { font-weight: 550; }
.dmeter__pct { font-size: 1.6rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.dmeter__bar { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: #E9ECE8; position: relative; overflow: hidden; }
.dmeter__bar::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--teal); transform: scaleX(var(--v)); transform-origin: left; transition: transform .8s var(--ease-out); }
.dcard.is-armed .dmeter__bar::after { transform: scaleX(0); }
.dmeter__n { grid-column: 1 / -1; font-size: .84rem; color: #66717A; font-variant-numeric: tabular-nums; }
.dmeter.is-empty .dmeter__label { color: var(--ink-2); }

/* patient quotes: their own words, in the serif */
.dquotes { margin: 16px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.dquotes[hidden] { display: none; }
.dquote { display: grid; gap: 6px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.dquote:last-child { border-bottom: 0; padding-bottom: 4px; }
.dquote__text { font-family: var(--serif); font-size: 1.14rem; line-height: 1.4; color: var(--ink); text-wrap: pretty; }
.dquote__meta { display: flex; align-items: center; gap: 10px; font-size: .8rem; color: #66717A; }
.dquote__score { padding: 1px 8px; border: 1px solid var(--rule-2); border-radius: 999px; color: var(--ink-2); font-weight: 550; }
.dquote--empty { color: var(--ink-2); font-size: .92rem; }

/* hover readout */
.dtip {
  position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none;
  min-width: 150px; padding: 10px 12px; border-radius: 10px;
  background: var(--ink); color: #fff; font-size: .82rem; line-height: 1.35;
  box-shadow: 0 12px 30px -12px rgba(22,34,44,.5);
}
.dtip[hidden] { display: none; }
.dtip__t { color: rgba(255,255,255,.64); margin-bottom: 6px; }
.dtip__row { display: flex; align-items: baseline; gap: 8px; }
.dtip__row + .dtip__row { margin-top: 3px; }
.dtip__row strong { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 2ch; }
.dtip__row span { color: rgba(255,255,255,.8); }
.dtip__row.is-muted strong, .dtip__row.is-muted span { color: rgba(255,255,255,.55); font-weight: 500; }

@media (max-width: 1080px) {
  .dstats { grid-template-columns: 1fr 1fr; }
  .dstat:nth-child(3) { padding-left: 0; border-left: 0; }
  .dstat:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .dbar { gap: 10px 18px; }
}
@media (max-width: 960px) {
  .demo-intro { grid-template-columns: 1fr; }
  .dsec { grid-template-columns: 1fr; }
  .dsec__copy { position: static; }
}
@media (max-width: 680px) {
  .dbar { gap: 8px; padding-block: 10px; }
  .dbar__label { display: none; }
  .dbar__group:first-child { order: 1; }
  .dbar__fake { order: 2; padding: 4px 10px; font-size: .76rem; }
  .dbar__fake::before { display: none; }
  .dbar__group:nth-child(2) { order: 3; width: 100%; }
  .dbar__group:nth-child(2) .dseg { width: 100%; }
  .dbar__group:nth-child(2) .dseg button { flex: 1; }
  .dseg button { height: 30px; padding: 0 11px; font-size: .86rem; }
  .dseg .long { display: none; }
  .dseg .short { display: inline; }
  .dstat { padding: 20px 14px 4px 0; }
  .dstat + .dstat { padding-left: 14px; }
  .dstat:nth-child(3) { padding-left: 0; }
  .dstat__txt { font-size: .92rem; }
  .dcard { padding: 18px 16px 14px; }
  .dtable th, .dtable td { padding: 10px 6px; }
  .drow { padding: 10px 6px; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .demo-intro .pill, .demo-intro .display .line, .demo-intro .lede { opacity: 1; transform: none; }
}
