/* Kairanex landing — tokens follow the round-2 design canvas (light / dark palettes). */
:root {
  color-scheme: light dark;
  --bg: #F7F5F0;
  --surface: #FFFFFF;
  --soft: #FBFAF7;
  --ink: #1A1A1A;
  --ink2: #4A4A4A;
  --muted: #6B6B6B;
  --rule: #D9D5CC;
  --seal: #C8372D;
  --seal-text: #A12C24;
  --on-seal: #FFFFFF;
  --track: #E6E2D8;
  --bar1: #A39E93;
  --bar2: #4A4A4A;
  --seal-wash: rgba(200, 55, 45, 0.12);
  --band: #141311;

  --serif-cn: 'Noto Serif SC', 'Source Serif 4', 'Songti SC', serif;
  --serif: 'Source Serif 4', 'Noto Serif SC', Georgia, serif;
  --sans: 'IBM Plex Sans', 'Noto Sans SC', system-ui, -apple-system, 'PingFang SC', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;

  --gutter: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141311;
    --surface: #1E1C19;
    --soft: #191715;
    --ink: #EFEBE3;
    --ink2: #C9C3B8;
    --muted: #9B958A;
    --rule: #3A3631;
    --seal: #E0574B;
    --seal-text: #F07C70;
    --on-seal: #141311;
    --track: #2A2723;
    --bar1: #6B655C;
    --bar2: #C9C3B8;
    --seal-wash: rgba(224, 87, 75, 0.18);
    --band: #0B0A09;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
html[lang="en"] body { font-family: 'IBM Plex Sans', system-ui, -apple-system, sans-serif; }
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
.mono { font-family: var(--mono); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.tw-g { white-space: nowrap; }
.nb { white-space: nowrap; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 18px;
  font: inherit; font-weight: 500; text-decoration: none; cursor: pointer;
  border: 1px solid var(--ink); background: transparent; color: var(--ink);
  transition: background-color .2s, color .2s, transform .2s var(--ease);
}
.btn-primary { min-height: 52px; padding: 0 28px; font-size: 17px; border-color: var(--seal); background: var(--seal); color: var(--on-seal); }
.btn-primary:hover { transform: translateY(-1px); }
.btn-ghost:hover { background: var(--ink); color: var(--bg); }
.btn.disabled { border-color: var(--rule); color: var(--muted); cursor: default; }
.btn.disabled:hover { background: transparent; color: var(--muted); }
.link { font-weight: 500; color: var(--seal-text); text-decoration: none; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.small { font-size: 14px; }
:focus-visible { outline: 2px solid var(--seal); outline-offset: 3px; }

.eyebrow { font-family: var(--mono); font-size: 13px; letter-spacing: .08em; color: var(--muted); }
.lead { font-size: 16px; line-height: 1.75; color: var(--ink2); }
.fine { font-size: 13px; line-height: 1.7; color: var(--muted); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.nav.scrolled { border-bottom-color: var(--rule); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { height: 20px; width: auto; }
.brand-cn { font-family: var(--serif-cn); font-size: 14px; letter-spacing: .24em; color: var(--ink2); white-space: nowrap; }
.nav-links { display: flex; gap: 28px; font-size: 15px; }
.nav-links a { text-decoration: none; position: relative; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px;
  background: var(--seal); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease);
}
.nav-links a:hover::after { transform: scaleX(1); }
.nav-actions { display: flex; align-items: center; gap: 14px; }
.lang { display: flex; border: 1px solid var(--rule); }
.lang button {
  min-height: 36px; min-width: 40px; padding: 0 10px; border: 0; cursor: pointer;
  background: transparent; color: var(--ink); font: inherit; font-size: 13px;
  transition: background-color .2s, color .2s;
}
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

@media (max-width: 900px) {
  .nav-links { display: none; }
}
@media (max-width: 520px) {
  .brand-cn { display: none; }
  .nav-actions .btn { display: none; }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 64px); align-items: center;
  padding-top: clamp(40px, 7vw, 88px); padding-bottom: clamp(56px, 8vw, 104px);
}
.hero-copy { display: flex; flex-direction: column; gap: 26px; }
.hero-title {
  font-family: var(--serif-cn); font-weight: 700;
  font-size: clamp(44px, 6.4vw, 82px); line-height: 1.12; letter-spacing: .01em;
}
.hero-title .line { display: block; }
html[lang="en"] .hero-title { font-family: var(--serif); font-weight: 600; font-size: clamp(40px, 5.6vw, 72px); line-height: 1.06; letter-spacing: -.02em; }
.pleading { display: none; }
@media (min-width: 1360px) {
  /* court pleading paper: numbered lines and a double rule in the left margin */
  .pleading {
    display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end;
    position: absolute; top: 28px; bottom: 28px; left: -60px; width: 40px; padding-right: 12px;
    font: 10px/1 var(--mono); color: var(--muted);
  }
  .pleading span { opacity: .5; }
  .pleading::after {
    content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 4px;
    border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); transform-origin: top;
  }
}
.hero-sub { max-width: 34em; font-size: 18px; line-height: 1.7; color: var(--ink2); }
.hero-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; }
.hero-note { font-size: 13px; line-height: 1.6; color: var(--muted); }

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- hero case card ---------- */
.case {
  position: relative; min-width: 0;
  background: var(--surface); border: 1px solid var(--rule);
  padding: clamp(18px, 3vw, 28px);
  display: flex; flex-direction: column; gap: 20px;
}
.case-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.case-title { font-family: var(--serif); font-weight: 600; font-size: 20px; line-height: 1.4; text-wrap: balance; }

.timeline { position: relative; height: 70px; margin: 0 4px; }
.tl-axis { position: absolute; left: 0; right: 0; top: 30px; height: 1px; background: var(--ink); transform-origin: left; }
.tl-dot {
  position: absolute; top: 30px; left: var(--x); width: 9px; height: 9px;
  background: var(--surface); border: 1.5px solid var(--ink);
  transform: translate(-50%, -50%);
}
.tl-dot.tl-end { background: var(--ink); }
.tl-now {
  position: absolute; left: var(--x); top: 18px; width: 2px; height: 24px; margin-left: -1px;
  background: var(--seal); transform-origin: top;
}
.tl-label { position: absolute; top: 44px; left: var(--x); font-size: 12px; color: var(--muted); white-space: nowrap; }
.tl-label-end { transform: translateX(-100%); color: var(--ink); }
@media (max-width: 520px) {
  /* stack word over date so the labels never collide on a phone */
  .timeline { height: 86px; }
  .tl-label > span { display: block; }
  .tl-label-end { text-align: right; }
}
.tl-now-label {
  position: absolute; top: 0; left: var(--x); transform: translateX(-50%);
  font-size: 12px; font-weight: 500; color: var(--seal-text); white-space: nowrap;
}

.qa { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; border-top: 1px solid var(--rule); }
.q { font-size: 14px; color: var(--ink2); }
.a { font-size: 17px; line-height: 1.75; }
.cite {
  font-family: var(--mono); font-size: 12px; color: var(--seal-text);
  vertical-align: super; line-height: 0; padding: 0 1px;
}
.cite-2 { border-bottom: 2px solid var(--seal); }

.evidence { display: flex; align-items: stretch; }
.connector { flex: none; position: relative; width: 22px; margin-bottom: 30px; }
.connector::before, .connector::after { content: ""; position: absolute; left: 0; background: var(--seal); }
.connector::before { top: 0; bottom: 0; width: 2px; transform-origin: top; }
.connector::after { right: 0; bottom: 0; height: 2px; transform-origin: left; }
.evidence-card {
  position: relative; flex: 1 1 auto; min-width: 0;
  border: 1px solid var(--rule); background: var(--soft);
  padding: 12px 56px 12px 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.ev-meta { font-size: 12px; color: var(--ink2); overflow-wrap: anywhere; }
.ev-quote { font-family: var(--serif); font-style: italic; font-size: 15px; line-height: 1.5; }
.seal {
  position: absolute; top: 12px; right: 12px; width: 30px; height: 30px;
  background: var(--seal);
}
.seal::after {
  /* the ink of a real stamp is never perfectly even */
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 70%, rgba(255,255,255,.18) 0 1.5px, transparent 2px),
              radial-gradient(circle at 72% 28%, rgba(255,255,255,.14) 0 1px, transparent 1.5px);
}
.replay {
  position: absolute; right: 12px; bottom: -36px;
  border: 0; background: none; padding: 6px 4px; cursor: pointer;
  font-size: 12px; color: var(--muted);
}
.replay:hover { color: var(--seal-text); }

/* ---------- sections ---------- */
section[id] { scroll-margin-top: 56px; }
.section { position: relative; padding-top: clamp(56px, 7vw, 88px); padding-bottom: clamp(56px, 7vw, 88px); border-top: 1px solid var(--rule); }
.section-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 32px; }
h2 { font-family: var(--serif-cn); font-weight: 700; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.3; }
html[lang="en"] h2 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; }
h3 { font-family: var(--serif-cn); font-size: 22px; line-height: 1.35; }
html[lang="en"] h3 { font-family: var(--serif); font-weight: 600; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--rule); padding: 28px;
  display: flex; flex-direction: column; gap: 14px;
  transition: border-color .25s, transform .25s var(--ease);
}
.card:hover { border-color: var(--ink); transform: translateY(-2px); }
.card .num { font-size: 14px; color: var(--seal-text); }
.card p { font-size: 15px; line-height: 1.7; color: var(--ink2); }
.card .stat .n { font-weight: 500; color: var(--ink); }
.card .stat { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--rule); font-size: 13px; color: var(--muted); }

/* why */
.why-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 2px solid var(--ink); }
.why-col { padding: 22px 24px 26px 0; display: flex; flex-direction: column; gap: 10px; }
.why-col + .why-col { padding-left: 24px; border-left: 1px solid var(--rule); }
.why-col p { font-size: 15px; line-height: 1.7; color: var(--ink2); }
.why-col h3 { font-size: 20px; }
.why-us { position: relative; }
.why-us::before { content: ""; position: absolute; left: -1px; right: 0; top: -2px; height: 2px; background: var(--seal); }
.why-us h3 { font-family: var(--serif); font-weight: 600; }
@media (max-width: 760px) {
  .why-grid { grid-template-columns: minmax(0, 1fr); }
  .why-col, .why-col + .why-col { padding: 18px 0; border-left: 0; border-top: 1px solid var(--rule); }
  .why-col:first-child { border-top: 0; }
  .why-us::before { left: 0; top: -1px; }
}

.proof { margin-top: 40px; max-width: 760px; display: flex; flex-direction: column; gap: 22px; }
.proof-cap { font-size: 15px; color: var(--ink2); }
.bar { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.bar-us .bar-row { font-weight: 600; }
.bar-us .bar-row .mono { color: var(--seal-text); }
.track { height: 14px; background: var(--track); overflow: hidden; }
.fill { display: block; height: 100%; width: var(--w); transform-origin: left; }
.f1 { background: var(--bar1); }
.f2 { background: var(--bar2); }
.f3 { background: var(--seal); }
.proof-note { max-width: 46em; }

/* chain */
.chain { list-style: none; margin: 0; padding: 0; position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.chain::before {
  content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 2px;
  background: linear-gradient(to right, var(--ink) 75%, var(--seal) 75%);
  transform-origin: left;
}
.chain li { position: relative; padding: 30px 24px 8px 0; display: flex; flex-direction: column; gap: 10px; }
.chain .node {
  position: absolute; top: 0; left: 0; width: 14px; height: 14px;
  background: var(--bg); border: 2px solid var(--ink);
  transition: background-color .3s, border-color .3s, transform .3s var(--ease);
}
.chain li.last .node { border-color: var(--seal); }
.chain .step { font-size: 13px; color: var(--muted); }
.chain li.last .step { color: var(--seal-text); }
.chain h3 { font-family: var(--sans); font-size: 19px; font-weight: 600; }
.chain p { font-size: 14px; line-height: 1.65; color: var(--ink2); }
@media (max-width: 760px) {
  .chain { grid-template-columns: minmax(0, 1fr); }
  .chain::before { left: 6px; right: auto; top: 0; bottom: 0; width: 2px; height: auto; background: linear-gradient(to bottom, var(--ink) 80%, var(--seal) 80%); transform-origin: top; }
  .chain li { padding: 0 0 28px 36px; }
}

/* coverage table */
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); background: var(--surface); }
table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--muted); padding: 14px 18px; border-bottom: 1px solid var(--ink); }
td { padding: 14px 18px; border-bottom: 1px solid var(--rule); vertical-align: top; }
td.mono { font-size: 14px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color .2s; }
tbody tr:hover { background: var(--soft); }
td.ok { font-weight: 500; white-space: nowrap; }
td.ok::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; background: var(--ink); vertical-align: 1px; }
td.wip { font-weight: 500; white-space: nowrap; color: var(--seal-text); }
td.wip::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border: 1.5px solid var(--seal); vertical-align: 1px; }
td.muted { color: var(--muted); white-space: nowrap; }
td.muted::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border: 1px solid var(--muted); vertical-align: 1px; }

/* split sections */
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: clamp(32px, 5vw, 56px); align-items: center; }
.split > div { display: flex; flex-direction: column; gap: 16px; }
.split .btn { align-self: flex-start; }

/* sample report — always printed on white paper */
.report-stack { position: relative; justify-self: center; width: 100%; max-width: 460px; }
.sheet {
  position: absolute; inset: 0; background: #FFFFFF; border: 1px solid var(--rule);
  box-shadow: 0 18px 40px -30px rgba(0,0,0,.3); transform-origin: 50% 100%;
}
.sheet-2 { transform: rotate(2.4deg) translate(12px, 4px); }
.sheet-3 { transform: rotate(-3.2deg) translate(-14px, 8px); background: #FBFAF7; }
.report {
  position: relative; z-index: 1; width: 100%;
  background: #FFFFFF; color: #1A1A1A; border: 1px solid var(--rule);
  padding: 28px 28px 28px 52px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 1px 0 rgba(0,0,0,.03), 0 24px 48px -32px rgba(0,0,0,.25);
  transition: transform .4s var(--ease);
}
.report:hover { transform: rotate(-.6deg) translateY(-3px); }
.report-margin { position: absolute; left: 34px; top: 0; bottom: 0; width: 3px; border-left: 1px solid #D9D5CC; border-right: 1px solid #D9D5CC; }
.report-head { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: #4A4A4A; }
.report-mark { height: 13px; width: auto; }
.report-title { font-family: var(--serif); font-weight: 600; font-size: 18px; line-height: 1.35; padding-top: 10px; border-top: 2px solid #1A1A1A; }
.report-dates { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); font-size: 10px; border-top: 1px solid #1A1A1A; padding-top: 6px; }
.report-dates .now { color: #A12C24; border-left: 2px solid #C8372D; padding-left: 4px; }
.report-line { font-size: 12px; line-height: 1.6; }
.report-line .cite { color: #A12C24; font-size: 10px; }

/* LLM chat */
.chat { background: var(--surface); border: 1px solid var(--rule); padding: 22px; gap: 14px; font-size: 15px; line-height: 1.65; }
.bubble { max-width: 92%; }
.bubble.bot { position: relative; }
.dots { display: none; }
.bubble.user { align-self: flex-end; max-width: 80%; padding: 12px 14px; background: var(--track); }
.source { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.seal-sm { flex: none; width: 9px; height: 9px; background: var(--seal); }

/* closing band */
.verdict {
  --ink: #EFEBE3; --ink2: #C9C3B8; --muted: #9B958A; --rule: #3A3631;
  --seal: #E0574B; --seal-text: #F07C70;
  background: var(--band); color: var(--ink);
}
.verdict-inner {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px 56px; align-items: end;
  padding-top: clamp(88px, 12vw, 168px); padding-bottom: clamp(88px, 12vw, 168px);
}
.verdict-text { display: flex; flex-direction: column; gap: 22px; }
.verdict-quote { margin: 0; }
.verdict-quote p {
  font-family: var(--serif-cn); font-weight: 700; letter-spacing: .04em;
  font-size: clamp(38px, 6.4vw, 88px); line-height: 1.16;
}
html[lang="en"] .verdict-quote p { font-family: var(--serif); font-weight: 600; letter-spacing: -.015em; font-size: clamp(32px, 4.6vw, 62px); line-height: 1.12; }
.verdict-quote .line { display: block; }
.verdict-src { margin-top: 18px; font-size: 13px; letter-spacing: .06em; color: var(--muted); }
.verdict-note { max-width: 36em; font-size: 16px; line-height: 1.75; color: var(--ink2); }
.seal4 {
  --s: clamp(84px, 9vw, 120px);
  position: relative; width: var(--s); height: var(--s); padding: calc(var(--s) * .06);
  display: grid; grid-template-columns: 1fr 1fr; place-items: center;
  background: #C8372D; color: #F7F5F0; border-radius: 3px;
  font-family: 'Noto Serif SC', serif; font-weight: 700; font-size: calc(var(--s) * .36); line-height: 1;
}
.seal4 i { font-style: normal; }
.seal4::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(circle at 22% 78%, rgba(255,255,255,.16) 0 2px, transparent 3px),
              radial-gradient(circle at 81% 18%, rgba(255,255,255,.12) 0 1.5px, transparent 2.5px),
              radial-gradient(circle at 60% 55%, rgba(0,0,0,.08) 0 3px, transparent 5px);
}
@media (max-width: 700px) {
  .verdict-inner { grid-template-columns: minmax(0, 1fr); }
}

/* ask form */
.form { display: flex; flex-direction: column; gap: 16px; }
.form .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 16px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
.form input, .form textarea {
  min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--muted); border-radius: 0; background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 400; transition: border-color .2s, box-shadow .2s;
}
.form textarea { resize: vertical; }
.form input:focus, .form textarea:focus { outline: none; border-color: var(--seal); box-shadow: 0 0 0 3px var(--seal-wash); }
.form button { align-self: flex-start; }
.form-note { font-size: 13px; color: var(--seal-text); }

/* footer */
.footer { border-top: 1px solid var(--rule); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; padding-top: 40px; padding-bottom: 56px; }
.footer-brand { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.footer-brand .fine { flex-basis: 100%; }
.footer-mark { height: 15px; width: auto; }
.footer-legal { max-width: 560px; }

/* ===================================================================
   Motion. Everything above renders as the final state, so the page is
   complete without JS or with reduced motion. The rules below apply
   only once the head script has set html.motion; the classes they key
   on (.play, .cited, .in, .on …) are added by main.js.
   =================================================================== */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes draw-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes draw-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes pop { 0% { transform: translate(-50%, -50%) scale(0); } 70% { transform: translate(-50%, -50%) scale(1.35); } 100% { transform: translate(-50%, -50%) scale(1); } }
@keyframes mark {
  0% { background-color: transparent; }
  30% { background-color: var(--seal-wash); box-shadow: 0 0 0 4px var(--seal-wash); }
  100% { background-color: transparent; box-shadow: 0 0 0 0 transparent; }
}
@keyframes unfold { from { opacity: 0; clip-path: inset(0 0 100% 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }
@keyframes stamp {
  0% { opacity: 0; transform: scale(2.4) rotate(-14deg); }
  55% { opacity: 1; transform: scale(.88) rotate(2deg); }
  75% { transform: scale(1.06) rotate(0); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes stamp-heavy {
  0% { opacity: 0; transform: scale(2.8) rotate(-12deg); filter: blur(3px); }
  48% { opacity: 1; transform: scale(.9) rotate(1.5deg); filter: none; }
  66% { transform: scale(1.045) rotate(0); }
  82% { transform: scale(.99); }
  100% { opacity: 1; transform: none; }
}
@keyframes ripple { from { opacity: .55; transform: scale(1); } to { opacity: 0; transform: scale(2.3); } }
@keyframes thud { 0%, 100% { transform: none; } 25% { transform: translateY(2px); } 55% { transform: translateY(-1px); } }
@keyframes num-in { from { opacity: 0; transform: translateX(-4px); } to { opacity: .5; transform: none; } }
@keyframes dot { 0%, 60%, 100% { transform: none; opacity: .35; } 30% { transform: translateY(-4px); opacity: 1; } }

/* ---------- typesetting: text split into characters, struck one at a time ---------- */
.motion .ch { display: inline-block; opacity: 0; }
.motion .ch.on { opacity: 1; }
.motion sup.ch { display: inline; }
.motion .tw-strike .ch.on { animation: strike .5s cubic-bezier(.16, .84, .3, 1) both; }
.motion .tw-key .ch.on { animation: key .14s ease-out both; }
.motion .tw-strike sup.ch.on, .motion .tw-key sup.ch.on { animation: cite-in .6s ease both; }
.motion .tw-fade .ch {
  filter: blur(4px); transform: translateY(.25em);
  transition: opacity .6s ease, filter .6s ease, transform .6s var(--ease);
  transition-delay: var(--d, 0ms);
}
.motion .tw-fade.go .ch { opacity: 1; filter: none; transform: none; }
@keyframes strike {
  0%   { opacity: 0; transform: translateY(-.24em) scale(1.5); filter: blur(6px); }
  42%  { opacity: 1; transform: translateY(.035em) scale(.955); filter: blur(0); text-shadow: 0 .02em .12em color-mix(in srgb, currentColor 45%, transparent); }
  68%  { transform: translateY(0) scale(1.012); }
  100% { opacity: 1; transform: none; filter: none; text-shadow: none; }
}
@keyframes key { from { opacity: 0; transform: translateY(-.1em); } to { opacity: 1; transform: none; } }
@keyframes cite-in { 0% { opacity: 0; } 35% { opacity: 1; background-color: var(--seal-wash); } 100% { opacity: 1; background-color: transparent; } }

/* the caret: a thin seal-red bar; mono eyebrows get a block cursor */
.caret {
  display: inline-block; width: .08em; height: .95em; margin: 0 -.12em 0 .04em;
  vertical-align: -.12em; background: var(--seal); pointer-events: none;
}
.eyebrow .caret { width: .55em; height: 1.15em; margin-right: -.59em; vertical-align: -.22em; opacity: .85; }
.caret.rest { animation: blink 1s steps(1, end) 2, fade-out .3s ease 2s forwards; }
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* ---------- hero ---------- */
.motion .hero:not(.hero-in) .hero-ctas, .motion .hero:not(.hero-in) .hero-note { opacity: 0; }
.motion .hero.hero-in .hero-ctas { animation: rise .8s var(--ease) .45s both; }
.motion .hero.hero-in .hero-note { animation: rise .8s var(--ease) .7s both; }
.motion .pleading::after { animation: draw-y 2.4s cubic-bezier(.45, 0, .2, 1) .1s both; }
.motion .pleading span { animation: num-in .5s ease both; animation-delay: calc(var(--i) * 60ms + .3s); }

/* the case card: timeline on .play, the typed Q and A follow (main.js), then .cited */
.motion .case:not(.play) { opacity: 0; }
.motion .case.play { animation: rise .8s var(--ease) both; }
.motion .case.play.replaying { animation: none; }
.motion .case.play .tl-axis { animation: draw-x .9s var(--ease) .45s both; }
.motion .case.play .tl-dot { animation: pop .4s var(--ease) both; }
.motion .case.play .tl-dot:nth-of-type(2) { animation-delay: .6s; }
.motion .case.play .tl-dot:nth-of-type(3) { animation-delay: .8s; }
.motion .case.play .tl-dot:nth-of-type(4) { animation-delay: 1.25s; }
.motion .case.play .tl-label { animation: fade .5s ease both; }
.motion .case.play .tl-label:nth-of-type(6) { animation-delay: .7s; }
.motion .case.play .tl-label:nth-of-type(7) { animation-delay: .9s; }
.motion .case.play .tl-label:nth-of-type(8) { animation-delay: 1.35s; }
.motion .case.play .tl-now { animation: draw-y .45s var(--ease) 1.65s both; }
.motion .case.play .tl-now-label { animation: fade .5s ease 1.9s both; }
.tl-now::after {
  content: ""; position: absolute; left: 50%; top: 0; width: 10px; height: 10px; margin: -5px 0 0 -5px;
  border: 1.5px solid var(--seal); opacity: 0; pointer-events: none;
}
.motion .case.play .tl-now::after { animation: ripple 1.8s ease-out 2.1s 3; }

.motion .case.play .evidence-card,
.motion .case.play .seal,
.motion .case.play .replay { opacity: 0; }
.motion .case.play .connector::before, .motion .case.play .connector::after { transform: scale(0); }
.motion .case.cited .a sup.cite-2 { animation: mark 1.2s ease both; }
.motion .case.cited .connector::before { animation: draw-y .35s ease-in .3s both; }
.motion .case.cited .connector::after { animation: draw-x .3s var(--ease) .65s both; }
.motion .case.cited .evidence-card { animation: unfold .6s var(--ease) .9s both, thud .32s ease 2.02s; }
.motion .case.cited .seal { animation: stamp .55s cubic-bezier(.3, 0, .2, 1) 1.65s both; }
.motion .case.cited .seal::before {
  content: ""; position: absolute; inset: 0; border: 2px solid var(--seal);
  animation: ripple .7s ease-out 1.95s both;
}
.motion .case.cited .replay { animation: fade .5s ease 2.5s both; }

/* ---------- section rules draw across, like a ledger being ruled ---------- */
.motion .section { border-top-color: transparent; }
.motion .section::before {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px; background: var(--rule);
  transform: scaleX(0); transform-origin: left; transition: transform 1.4s cubic-bezier(.6, 0, .2, 1);
}
.motion .section.ruled::before { transform: scaleX(1); }

/* ---------- scroll reveals ---------- */
.motion .reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.motion .reveal.in { opacity: 1; transform: none; }
.motion .cards .card:nth-child(2) { transition-delay: .12s; }
.motion .cards .card:nth-child(3) { transition-delay: .24s; }
.motion .why-grid .why-col:nth-child(2) { transition-delay: .12s; }
.motion .why-grid .why-col:nth-child(3) { transition-delay: .24s; }
/* once revealed, elements go back to their own quick hover transitions */
.motion .reveal.in.settled { transition: border-color .25s, transform .3s var(--ease); transition-delay: 0s; }

.motion [data-bars] .fill { transform: scaleX(0); transition: transform 1.4s var(--ease); }
.motion [data-bars] .bar:nth-of-type(2) .fill { transition-delay: .15s; }
.motion [data-bars] .bar:nth-of-type(3) .fill { transition-delay: .3s; }
.motion [data-bars].in .fill { transform: scaleX(1); }

.motion [data-chain]::before { transform: scaleX(0); transition: transform 1.6s var(--ease) .1s; }
.motion [data-chain].in::before { transform: scaleX(1); }
.motion [data-chain] li { opacity: .25; transition: opacity .5s ease; }
.motion [data-chain].in li { opacity: 1; }
.motion [data-chain].in .node { background: var(--ink); }
.motion [data-chain].in li.last .node { background: var(--seal); transform: scale(1.15); }
.motion [data-chain] li:nth-child(1), .motion [data-chain] li:nth-child(1) .node { transition-delay: .15s; }
.motion [data-chain] li:nth-child(2), .motion [data-chain] li:nth-child(2) .node { transition-delay: .55s; }
.motion [data-chain] li:nth-child(3), .motion [data-chain] li:nth-child(3) .node { transition-delay: .95s; }
.motion [data-chain] li:nth-child(4), .motion [data-chain] li:nth-child(4) .node { transition-delay: 1.4s; }
@media (max-width: 760px) {
  .motion [data-chain]::before { transform: scaleY(0); }
  .motion [data-chain].in::before { transform: scaleY(1); }
}

/* coverage rows arrive one by one; their status marks are stamped */
tbody tr:nth-child(2) { --r: 1; }
tbody tr:nth-child(3) { --r: 2; }
tbody tr:nth-child(4) { --r: 3; }
tbody tr:nth-child(5) { --r: 4; }
tbody tr:nth-child(6) { --r: 5; }
tbody tr:nth-child(7) { --r: 6; }
.motion .table-wrap tbody tr { opacity: 0; transition: opacity .5s ease calc(var(--r, 0) * 90ms + .25s), background-color .2s; }
.motion .table-wrap.in tbody tr { opacity: 1; }
.motion .table-wrap td::before { transform: scale(0); transition: transform .4s cubic-bezier(.3, 1.8, .5, 1) calc(var(--r, 0) * 90ms + .75s); }
.motion .table-wrap.in td::before { transform: none; }

/* the sample report fans out into its four pages */
.motion .report-stack .sheet { transition: transform 1.1s var(--ease) .35s; }
.motion .report-stack:not(.in) .sheet { transform: none; }
.motion .report-stack .report-dates,
.motion .report-stack .report-line { opacity: 0; transform: translateX(-8px); transition: opacity .5s ease, transform .5s var(--ease); }
.motion .report-stack.in .report-dates,
.motion .report-stack.in .report-line { opacity: 1; transform: none; }
.motion .report-stack.in .report-dates { transition-delay: .7s; }
.motion .report-stack.in .report-line:nth-child(5) { transition-delay: .95s; }
.motion .report-stack.in .report-line:nth-child(6) { transition-delay: 1.1s; }
.motion .report-stack.in .report-line:nth-child(7) { transition-delay: 1.25s; }
.motion .report-stack.in .report-dates .now { animation: mark 1.2s ease 1.6s; }

/* chat: the question, a typing indicator, then the answer is typed out */
.motion [data-chat] .bubble, .motion [data-chat] .source { opacity: 0; }
.motion [data-chat].in .bubble.user { animation: rise .5s var(--ease) .1s both; }
.motion [data-chat].thinking .bubble.bot,
.motion [data-chat].answering .bubble.bot { animation: rise .45s var(--ease) both; }
.motion [data-chat].thinking .dots { display: inline-flex; gap: 5px; position: absolute; left: 0; top: .6em; }
.dots i { display: block; width: 6px; height: 6px; background: var(--muted); animation: dot 1s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
.motion [data-chat] .bubble.bot > sup { opacity: 0; }
.motion [data-chat].sourced .bubble.bot > sup { animation: cite-in .6s ease both; }
.motion [data-chat].sourced .source { animation: rise .5s var(--ease) .25s both; }

/* closing band: the quote is struck slowly, then the four-character seal comes down */
.motion [data-verdict] .verdict-src, .motion [data-verdict] .verdict-note, .motion [data-verdict] .seal4 { opacity: 0; }
.motion [data-verdict].quoted .verdict-src { animation: rise .7s var(--ease) both; }
.motion [data-verdict].quoted .verdict-note { animation: rise .7s var(--ease) .2s both; }
.motion [data-verdict].sealed .seal4 { animation: stamp-heavy .65s cubic-bezier(.3, 0, .2, 1) both; }
.motion [data-verdict].sealed .seal4::before {
  content: ""; position: absolute; inset: 0; border: 2px solid #C8372D; border-radius: inherit;
  animation: ripple .9s ease-out .3s both;
}
.motion [data-verdict].sealed .verdict-text { animation: thud .34s ease .31s; }

/* language switch: a brief cross-fade instead of a hard swap */
.switching main, .switching .nav-links, .switching .footer { opacity: 0; }
.motion main, .motion .nav-links, .motion .footer { transition: opacity .18s ease; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
