:root {
  --ink: #152238;
  --ink-2: #33425c;
  --muted: #5d687b;
  --faint: #8d97a8;
  --line: #dfe4ec;
  --line-2: #eceff4;
  --wash: #f5f7fa;
  --paper: #ffffff;
  --night: #0a1322;
  --night-2: #101d33;
  --teal: #0d7f78;
  --teal-bar: #1f9d91;
  --teal-glow: #50d1c4;
  --teal-soft: #dcf2ee;
  --rose: #a8364f;
  --rose-bar: #d05a74;
  --rose-soft: #f9e4e9;
  --amber: #b7791f;
  --amber-soft: #fbf1df;
  --sans: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.3, .7, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 16px/1.65 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3, p, ol, ul, figure, pre { margin: 0; }
a { color: inherit; }
button, select { font: inherit; color: inherit; cursor: pointer; }
var { font-family: var(--serif); font-style: italic; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
main, .topbar { width: min(1240px, calc(100% - 64px)); margin: 0 auto; }

/* Scroll progress */
.scroll-progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 30; pointer-events: none; }
.scroll-progress i { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--teal-bar), var(--teal-glow)); box-shadow: 0 0 12px var(--teal-glow); }

/* Top bar: transparent over the hero, solid after */
.topbar-wrap { position: fixed; inset: 0 0 auto 0; z-index: 20; transition: background .3s, border-color .3s, color .3s; border-bottom: 1px solid transparent; color: #e7eef8; }
.topbar-wrap.solid { background: rgba(255, 255, 255, .86); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-color: var(--line); color: var(--ink); }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 62px; gap: 20px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -.3px; text-decoration: none; }
.wordmark svg { width: 24px; height: 24px; }
.wordmark rect { fill: var(--ink); }
.topbar-wrap:not(.solid) .wordmark rect { fill: rgba(255, 255, 255, .1); }
.wordmark path { fill: none; stroke: var(--teal-glow); stroke-width: 4; }
.topbar nav { display: flex; align-items: center; gap: 26px; font-size: 14px; }
.topbar nav a { text-decoration: none; opacity: .82; position: relative; transition: opacity .2s; }
.topbar nav a:hover, .topbar nav a.active { opacity: 1; }
.topbar nav a.active:not(.nav-paper)::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; border-radius: 2px; background: var(--teal-glow); }
.topbar .nav-paper { border: 1px solid currentColor; border-radius: 999px; padding: 5px 14px; opacity: .9; }

/* Hero */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: grid; place-items: center; overflow: hidden; background: radial-gradient(120% 90% at 50% 0%, #15294a 0%, var(--night) 58%, #070d18 100%); color: #eef3fa; text-align: center; isolation: isolate; }
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero-glow { position: absolute; width: 900px; height: 900px; left: 50%; top: 42%; transform: translate(-50%, -50%); background: radial-gradient(circle, rgba(80, 209, 196, .16), transparent 62%); z-index: -1; pointer-events: none; animation: breathe 7s ease-in-out infinite; }
@keyframes breathe { 50% { transform: translate(-50%, -50%) scale(1.12); opacity: .7; } }
.hero-inner { width: min(1100px, calc(100% - 40px)); padding: 110px 0 120px; }
.hero-title { margin-top: 18px; font: 600 clamp(64px, 11vw, 148px)/1 var(--serif); letter-spacing: -.04em; }
.split .ch { display: inline-block; opacity: 0; transform: translateY(.45em) rotateX(-70deg); filter: blur(8px); animation: ch-in .9s var(--ease) forwards; animation-delay: calc(var(--i) * 55ms + 120ms); background: linear-gradient(180deg, #ffffff 30%, #a9e9e1 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
@keyframes ch-in { to { opacity: 1; transform: none; filter: none; } }
.paper-title { margin-top: 24px; font-size: clamp(19px, 2.4vw, 27px); line-height: 1.45; font-weight: 500; color: #c9d6e6; }
.strike-word { position: relative; color: #8a9bb2; }
.strike-word::after { content: ""; position: absolute; left: -2px; right: -2px; top: 55%; height: 2px; background: var(--rose-bar); transform-origin: 0 50%; transform: scaleX(0); animation: strike .6s var(--ease) 1.5s forwards; }
@keyframes strike { to { transform: scaleX(1); } }
.glow-word { color: #fff; background: linear-gradient(90deg, #7ff0e2, #fff 40%, #7ff0e2 60%, #50d1c4); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 5s linear 1.8s infinite; }
@keyframes shimmer { to { background-position: -250% 0; } }
.authors { margin: 28px auto 0; max-width: 940px; font-size: 15.5px; line-height: 1.9; color: #b9c7d8; }
.authors sup { color: var(--teal-glow); margin-left: 1px; }
.affiliations { margin: 8px auto 0; max-width: 900px; font-size: 13.5px; color: #8fa3bb; line-height: 1.8; }
.affiliations summary { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.affiliations summary::-webkit-details-marker { display: none; }
.affiliations summary:hover { color: #e7eef8; }
.affil-toggle { display: inline-block; transition: transform .15s; }
.affiliations[open] .affil-toggle { transform: rotate(45deg); }
.affil-list { margin: 8px 0 0; }
.affil-list span { white-space: nowrap; margin: 0 7px; }
.affiliations sup, .correspondence sup { margin-right: 2px; color: var(--teal-glow); }
.correspondence { margin-top: 4px; }
.correspondence a { text-underline-offset: 3px; }
.resource-icon { width: 17px; height: 17px; flex: none; }
.paper-links { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 30px; }
.button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 9px 20px; border: 1px solid rgba(255, 255, 255, .22); border-radius: 999px; background: rgba(255, 255, 255, .05); font-size: 15px; font-weight: 600; text-decoration: none; color: #eef3fa; transition: background .2s, border-color .2s, transform .2s var(--spring), box-shadow .2s; }
.button:hover { background: rgba(255, 255, 255, .12); transform: translateY(-2px); }
.button.primary { background: var(--teal-glow); border-color: var(--teal-glow); color: var(--night); box-shadow: 0 0 0 0 rgba(80, 209, 196, .5); }
.button.primary:hover { box-shadow: 0 10px 34px -6px rgba(80, 209, 196, .6); }
.button.unavailable { opacity: .55; cursor: default; }
.button.unavailable:hover { transform: none; background: rgba(255, 255, 255, .05); }
.button-tag { font-size: 12px; font-weight: 500; }
.hero-message { margin-top: 54px; font: 400 clamp(26px, 3.6vw, 40px)/1.28 var(--serif); letter-spacing: -.02em; color: #dfe8f3; }
.hero-message em { font-style: italic; color: var(--teal-glow); }
.reveal-up { opacity: 0; transform: translateY(18px); animation: up .9s var(--ease) forwards; animation-delay: calc(var(--d, 0) * 110ms + 300ms); }
@keyframes up { to { opacity: 1; transform: none; } }
.scroll-cue { position: absolute; left: 50%; bottom: 28px; width: 26px; height: 42px; margin-left: -13px; border: 2px solid rgba(255, 255, 255, .35); border-radius: 14px; }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--teal-glow); animation: cue 1.8s var(--ease) infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--d, 0) * 110ms); }
.reveal.in { opacity: 1; transform: none; }

/* Sections */
.section { padding: 110px 0 20px; }
.section-head { max-width: 780px; margin-bottom: 34px; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--teal); margin-bottom: 10px; }
.section-head h2 { font: 500 clamp(30px, 3.8vw, 44px)/1.18 var(--serif); letter-spacing: -.02em; }
.section-head p:not(.eyebrow) { margin-top: 14px; font-size: 17px; line-height: 1.7; color: var(--muted); }
.note { margin-top: 18px; max-width: 920px; font-size: 13.5px; line-height: 1.75; color: var(--muted); }

/* Case tabs */
.case-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.case-tabs button { display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 15px; font-weight: 600; color: var(--ink-2); transition: all .25s var(--ease); }
.case-tabs button span { font: 500 13px var(--mono); color: var(--faint); }
.case-tabs button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: 0 12px 30px -14px rgba(21, 34, 56, .6); }
.case-tabs button[aria-selected="true"] span { color: var(--teal-glow); }

/* Stage */
.stage { border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: 0 30px 80px -44px rgba(21, 34, 56, .35); overflow: hidden; }
.stage-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 28px; padding: 28px 30px 20px; align-items: start; }
.case-title { display: flex; gap: 16px; align-items: baseline; }
.case-no { font: 300 38px/1 var(--sans); color: var(--faint); }
.case-title h3 { font: 500 26px/1.25 var(--serif); letter-spacing: -.015em; }
.case-title p { margin-top: 8px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.request { display: flex; gap: 16px; align-items: flex-start; padding: 16px 18px; border-radius: 14px; background: linear-gradient(135deg, #eefaf8, #f4f6fb); border: 1px solid #d7ece8; border-left: 3px solid var(--teal-bar); }
.request-who { display: inline-flex; align-items: center; gap: 8px; flex: none; font-size: 12.5px; font-weight: 600; color: var(--teal); padding-top: 3px; }
.request-who svg { width: 22px; height: 22px; padding: 3px; border-radius: 50%; border: 1px solid #b9dcd7; fill: none; stroke: var(--teal); stroke-width: 1.8; background: #fff; }
.request p { font: 400 16.5px/1.55 var(--serif); }
.request mark { background: none; color: var(--teal); font-weight: 500; }

.tracker { list-style: none; display: flex; gap: 6px; padding: 0 30px; margin: 4px 0 0; }
.tracker li { flex: 1; min-width: 0; font-size: 12.5px; color: var(--faint); padding: 9px 0 10px; border-bottom: 2px solid var(--line-2); display: flex; gap: 8px; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .3s, border-color .3s; }
.tracker li b { flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--line-2); font-size: 11px; color: var(--muted); transition: background .3s, color .3s; }
.tracker li span { overflow: hidden; text-overflow: ellipsis; }
.tracker li.active { color: var(--ink); border-color: var(--teal-bar); }
.tracker li.active b { background: var(--teal-bar); color: #fff; box-shadow: 0 0 0 4px var(--teal-soft); }
.tracker li.done { color: var(--ink-2); border-color: #9fd8d1; }
.tracker li.done b { background: var(--teal-soft); color: var(--teal); }
.tracker li.slip.done { border-color: #efb3c1; }
.tracker li.slip.done b { background: var(--rose-soft); color: var(--rose); }

.stage-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) 290px minmax(0, 1fr); border-top: 1px solid var(--line-2); margin-top: 16px; }
.panel { padding: 18px 22px 22px; min-width: 0; }
.panel + .panel { border-left: 1px solid var(--line-2); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.ph-title { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.ph-title svg { width: 17px; height: 17px; fill: none; stroke: var(--teal); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ph-title .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--teal-bar); box-shadow: 0 0 0 3px var(--teal-soft); }
.arrows { color: var(--faint); font-weight: 400; }
.ph-status { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; font-variant-numeric: tabular-nums; }
.ph-status.busy::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--teal-soft); border-top-color: var(--teal-bar); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Conversation */
.convo-panel { display: flex; flex-direction: column; }
.convo { flex: 1 1 auto; height: 0; min-height: 500px; overflow-y: auto; scroll-behavior: smooth; padding-right: 6px; display: flex; flex-direction: column; gap: 12px; }
.convo::-webkit-scrollbar { width: 6px; }
.convo::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.msg { border: 1px solid var(--line-2); border-radius: 14px; padding: 12px 14px; background: #fbfcfd; animation: pop-in .45s var(--ease); }
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.msg-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.msg-head strong { color: var(--ink); font-size: 13.5px; display: inline-flex; align-items: center; gap: 7px; }
.msg-head strong::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--teal-bar); transform: rotate(45deg); }
.msg-turn { font: 500 11.5px var(--mono); color: var(--faint); }
.think-label { font-size: 12px; color: var(--muted); }
.think { font-style: italic; color: var(--ink-2); font-size: 14px; line-height: 1.6; min-height: 1.6em; }
.caret::after { content: ""; display: inline-block; width: 7px; height: 1.05em; margin-left: 2px; vertical-align: -2px; background: var(--teal-bar); animation: blink .9s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.code { margin-top: 9px; border-radius: 10px; background: var(--night-2); color: #d7e3f2; font: 12.5px/1.65 var(--mono); padding: 10px 12px; white-space: pre-wrap; word-break: break-word; position: relative; overflow: hidden; }
.code:empty { display: none; }
.code .k { color: #7ff0e2; }
.code .s { color: #f5c67a; }
.code .n { color: #c7a6ff; }
.code.streaming::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(127, 240, 226, .07), transparent); animation: sweep 1.2s linear infinite; }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.env-msg { border-style: dashed; background: #fff; }
.env-msg .msg-head strong::before { background: var(--faint); border-radius: 50%; transform: none; }
.env-out { font: 12.5px/1.6 var(--mono); color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }
.env-msg.done-msg { border-color: #b9dcd7; background: #f3fbf9; }
.env-msg.fail-msg { border-color: #efc4ce; background: #fdf6f8; }
.convo-empty { margin: auto; text-align: center; color: var(--faint); font-size: 14px; }

/* Phone */
.phone-panel { display: flex; flex-direction: column; align-items: center; background: linear-gradient(180deg, #fafbfd, #f3f6fa); }
.phone-panel .panel-head { align-self: stretch; }
.phone { position: relative; width: 236px; height: 450px; border-radius: 38px; background: #0f1523; padding: 10px; box-shadow: 0 0 0 2px #2a3346, 0 30px 60px -24px rgba(10, 19, 34, .55), inset 0 0 0 1px #3a4458; transition: transform .5s var(--ease); }
.phone::before { content: ""; position: absolute; right: -4px; top: 110px; width: 3px; height: 54px; border-radius: 2px; background: #2a3346; }
.phone-notch { position: absolute; top: 18px; left: 50%; width: 70px; height: 18px; margin-left: -35px; border-radius: 12px; background: #000; z-index: 2; }
.phone-status { position: absolute; top: 18px; left: 30px; right: 30px; display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; color: var(--ink); z-index: 1; }
.bars { display: inline-flex; gap: 2px; align-items: flex-end; }
.bars i { width: 3px; background: var(--ink); border-radius: 1px; }
.bars i:nth-child(1) { height: 5px; } .bars i:nth-child(2) { height: 7px; } .bars i:nth-child(3) { height: 9px; }
.phone-app { position: relative; height: 100%; border-radius: 30px; background: #f6f7fb; padding: 48px 14px 14px; overflow: hidden; }
.app-title { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 12px; padding-left: 4px; }
.app-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.app-row { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 12px 14px; border-radius: 16px; background: #fff; box-shadow: 0 1px 2px rgba(10, 19, 34, .06); transition: background .4s, box-shadow .4s, opacity .4s; }
.app-row .lbl { display: block; font-size: 11.5px; color: var(--muted); }
.app-row .tm { display: block; font-size: 27px; font-weight: 600; line-height: 1.15; letter-spacing: -.02em; font-variant-numeric: tabular-nums; transition: color .3s; }
.app-row.off .tm { color: #b3bccb; }
.app-row .flip { display: inline-block; animation: flip .6s var(--ease); }
@keyframes flip { 0% { transform: rotateX(90deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
.app-row.flash { animation: flash 1.1s var(--ease); }
@keyframes flash { 0% { box-shadow: 0 0 0 0 rgba(31, 157, 145, .6); background: #e6f7f4; } 100% { box-shadow: 0 0 0 12px rgba(31, 157, 145, 0); } }
.app-row.flash-bad { animation: flash-bad 1.1s var(--ease); }
@keyframes flash-bad { 0% { box-shadow: 0 0 0 0 rgba(208, 90, 116, .6); background: #fdecef; } 100% { box-shadow: 0 0 0 12px rgba(208, 90, 116, 0); } }
.app-row.reading::after { content: ""; position: absolute; inset: 0; border-radius: 16px; background: linear-gradient(90deg, transparent, rgba(80, 209, 196, .25), transparent); animation: sweep .9s var(--ease); }
.tgl { width: 42px; height: 25px; border-radius: 999px; background: #34c759; position: relative; transition: background .35s; }
.tgl::after { content: ""; position: absolute; top: 2px; left: 19px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: left .35s var(--spring); }
.app-row.off .tgl { background: #d3d8e0; }
.app-row.off .tgl::after { left: 2px; }
.toast { position: absolute; left: 14px; right: 14px; bottom: 16px; padding: 10px 12px; border-radius: 14px; background: rgba(21, 34, 56, .92); color: #fff; font-size: 12px; line-height: 1.4; opacity: 0; transform: translateY(12px); transition: opacity .35s, transform .35s var(--ease); }
.toast.show { opacity: 1; transform: none; }
.toast.ok { background: rgba(13, 127, 120, .95); }
.toast.bad { background: rgba(168, 54, 79, .95); }
.phone-caption { margin-top: 16px; font-size: 12.5px; color: var(--muted); text-align: center; max-width: 240px; line-height: 1.55; min-height: 3em; }

/* Ledger */
.checks { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 7px; position: relative; }
.check { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line-2); font-size: 13.5px; background: #fff; transition: background .35s, border-color .35s; position: relative; overflow: hidden; }
.check .ic { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; transition: all .35s var(--spring); }
.check .ic svg { width: 12px; height: 12px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 20; stroke-dashoffset: 20; transition: stroke-dashoffset .4s .1s var(--ease); }
.check.pass { background: #f1faf8; border-color: #bfe5df; }
.check.pass .ic { background: var(--teal-bar); border-color: var(--teal-bar); transform: scale(1.08); }
.check.pass .ic svg { stroke-dashoffset: 0; }
.check.lost { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
.checks.scan .check::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(80, 209, 196, .28), transparent); animation: sweep .7s var(--ease); animation-delay: calc(var(--i) * 90ms); }
.stair-wrap { margin-top: 14px; border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 10px 4px; background: linear-gradient(180deg, #fbfcfd, #fff); }
.stair { display: block; width: 100%; height: 118px; overflow: visible; }
.stair .grid { stroke: var(--line-2); stroke-width: 1; }
.stair .axis-t { font: 10px var(--sans); fill: var(--faint); }
.stair .path { fill: none; stroke: var(--teal-bar); stroke-width: 2.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; filter: drop-shadow(0 2px 6px rgba(31, 157, 145, .35)); }
.stair .area { fill: url(#stair-fill); }
.stair .pt { fill: #fff; stroke: var(--teal-bar); stroke-width: 2; }
.stair .pt.down { stroke: var(--rose-bar); }
.stair .pt.new { animation: pt-pop .6s var(--spring); transform-box: fill-box; transform-origin: center; }
@keyframes pt-pop { from { transform: scale(0); } }
.stair .rt { font: 600 10.5px var(--mono); fill: var(--teal); }
.stair .rt.neg { fill: var(--rose); }
.stair .rt.zero { fill: var(--faint); }

.scoring { margin-top: 16px; animation: pop-in .5s var(--ease); }
.scoring-title { font-size: 13.5px; font-weight: 600; margin-bottom: 10px; }
.scoring-title span { font-weight: 400; color: var(--muted); }
.verdicts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.verdict { padding: 9px 11px; border-radius: 10px; background: var(--wash); font-size: 12.5px; line-height: 1.45; }
.verdict span { display: block; font-weight: 700; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.verdict strong { display: block; font-weight: 600; color: var(--ink); margin-top: 2px; }
.verdict.pro { background: var(--teal-soft); }
.verdict.pro span { color: var(--teal); }
.credit-rows { display: flex; flex-direction: column; gap: 3px; }
.cr-group { font-size: 11.5px; font-weight: 600; color: var(--muted); margin: 8px 0 2px; display: flex; justify-content: space-between; }
.cr-group:first-child { margin-top: 0; }
.cr-group em { font-style: normal; font-weight: 500; }
.cr-group em.ok { color: var(--teal); } .cr-group em.fail { color: var(--rose); }
.cr { display: grid; grid-template-columns: 108px 1fr 1fr; gap: 8px; align-items: center; font-size: 11.5px; opacity: 0; transform: translateX(-8px); transition: opacity .4s var(--ease), transform .4s var(--ease); }
.cr.show { opacity: 1; transform: none; }
.cr .act { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr.slip .act { color: var(--rose); }
.cr-head { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); opacity: 1; transform: none; }
.cbar { position: relative; display: block; height: 18px; border-radius: 4px; background: var(--wash); }
.cbar::before { content: ""; position: absolute; left: 50%; top: 2px; bottom: 2px; width: 1px; background: #c8d0dc; }
.cbar i { position: absolute; top: 3px; bottom: 3px; border-radius: 3px; transform: scaleX(0); transition: transform .8s var(--ease); }
.cr.show .cbar i { transform: scaleX(1); }
.cbar.pos i { background: linear-gradient(90deg, var(--teal-bar), #3cc2b4); transform-origin: 0 50%; }
.cbar.neg i { background: linear-gradient(270deg, var(--rose-bar), #e27d93); transform-origin: 100% 50%; }
.cbar b { position: absolute; top: 0; line-height: 18px; font: 600 10.5px var(--mono); white-space: nowrap; }
.cbar.pos b { color: var(--teal); } .cbar.neg b { color: var(--rose); } .cbar.zero b { color: var(--faint); left: calc(50% + 5px); }
.grpo-flat .cbar.zero::before { background: var(--rose-bar); box-shadow: 0 0 8px var(--rose-bar); animation: flat-pulse 1.4s ease-in-out infinite; }
@keyframes flat-pulse { 50% { opacity: .35; } }
.credit-key { display: flex; gap: 16px; margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.credit-key span { display: inline-flex; align-items: center; gap: 6px; }
.key { width: 10px; height: 10px; border-radius: 2px; }
.key.pos { background: var(--teal-bar); } .key.neg { background: var(--rose-bar); }

/* Controls */
.controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 22px; border-top: 1px solid var(--line-2); background: #fbfcfd; }
.ctl { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 13.5px; font-weight: 600; transition: background .2s, transform .2s var(--spring); }
.ctl:hover { background: var(--wash); }
.ctl:active { transform: scale(.96); }
.ctl svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ctl.primary { background: var(--ink); color: #fff; border-color: var(--ink); min-width: 98px; }
.ctl.primary:hover { background: #26375a; }
.ctl.primary .i-play { display: none; fill: currentColor; stroke: none; }
.ctl.primary.paused .i-play { display: block; }
.ctl.primary.paused .i-pause { display: none; }
.ctl-speed { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.ctl-speed select { border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px; background: #fff; font-size: 13px; }
.ctl-count { font: 500 12.5px var(--mono); color: var(--muted); }
.ctl-spacer { flex: 1; }
.ctl-note { font-size: 12px; color: var(--faint); }
.timeline { height: 3px; background: var(--line-2); }
.timeline i { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--teal-bar), var(--teal-glow)); transition: transform .3s linear; }

/* Method */
.steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step-card { position: relative; padding: 26px 24px 20px; border: 1px solid var(--line); border-radius: 18px; background: #fff; transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s; overflow: hidden; }
.step-card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), rgba(80, 209, 196, .14), transparent 45%); opacity: 0; transition: opacity .3s; pointer-events: none; }
.step-card:hover { transform: translateY(-4px); box-shadow: 0 24px 50px -28px rgba(21, 34, 56, .35); border-color: #bfe5df; }
.step-card:hover::before { opacity: 1; }
.step-no { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--teal-glow); font-weight: 700; font-size: 14px; }
.step-card h3 { margin-top: 14px; font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.step-card .eq { margin: 14px 0; padding: 12px 14px; border-radius: 10px; background: var(--wash); font: 18px/1.4 var(--serif); text-align: center; }
.step-card p:not(.eq) { font-size: 15px; line-height: 1.65; color: var(--muted); }
.step-art { display: block; width: 100%; height: 70px; margin-top: 14px; }
.art-checks rect { fill: var(--wash); stroke: var(--line); }
.art-checks path { fill: none; stroke: var(--teal-bar); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 30; }
.step-card.in .art-checks path { animation: draw 0.7s var(--ease) forwards .6s; }
.step-card.in .art-checks path:nth-of-type(2) { animation-delay: 1.1s; }
.art-stair { fill: none; stroke: var(--teal-bar); stroke-width: 3; stroke-linejoin: round; stroke-dasharray: 320; stroke-dashoffset: 320; }
.step-card.in .art-stair { animation: draw 1.6s var(--ease) forwards .5s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.art-pop { fill: var(--teal-glow); opacity: 0; transform-box: fill-box; transform-origin: center; }
.step-card.in .art-pop { animation: pop 2.4s ease-out 1.1s infinite; }
.step-card.in .art-pop.p2 { animation-delay: 1.5s; }
@keyframes pop { 0% { opacity: .9; transform: scale(.4); } 60%, 100% { opacity: 0; transform: scale(2.4); } }
.art-bars rect { fill: var(--teal-bar); transform-box: fill-box; transform-origin: bottom; transform: scaleY(0); }
.step-card.in .art-bars rect { animation: grow .8s var(--spring) forwards; }
.step-card.in .art-bars rect:nth-child(1) { animation-delay: .5s; } .step-card.in .art-bars rect:nth-child(2) { animation-delay: .62s; }
.step-card.in .art-bars rect:nth-child(3) { animation-delay: .74s; opacity: .8; } .step-card.in .art-bars rect:nth-child(4) { animation-delay: .86s; opacity: .6; }
@keyframes grow { to { transform: scaleY(1); } }
.method-figure { margin-top: 26px; border: 1px solid var(--line); border-radius: 18px; padding: 20px; background: #fff; }
.method-figure img { display: block; width: 100%; height: auto; }

/* Results charts */
.chart-toolbar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.seg { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--wash); border: 1px solid var(--line-2); }
.seg button { border: 0; background: none; padding: 7px 16px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--muted); transition: all .25s var(--ease); }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 2px 8px -2px rgba(21, 34, 56, .2); }
.charts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.chart { border: 1px solid var(--line); border-radius: 18px; padding: 18px 18px 12px; background: #fff; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.chart-head h3 { font: 600 20px var(--sans); }
.chart-head span { font-size: 12.5px; color: var(--muted); }
.chart-head b { color: var(--teal); font-variant-numeric: tabular-nums; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .gl { stroke: var(--line-2); }
.chart .gt { font: 10px var(--sans); fill: var(--faint); }
.chart .ml { font: 10.5px var(--sans); fill: var(--muted); }
.chart .ml.ours { fill: var(--teal); font-weight: 700; }
.chart .bar { fill: #cdd5e1; transform-box: fill-box; transform-origin: left center; transform: scaleX(0); transition: transform 1s var(--ease), fill .3s; transition-delay: calc(var(--i) * 70ms); }
.chart .bar.phi { fill: #b2c0d4; }
.chart .bar.ours { fill: url(#ours-grad); filter: drop-shadow(0 6px 12px rgba(31, 157, 145, .35)); }
.chart .err { stroke: var(--ink-2); stroke-width: 1.2; opacity: 0; transition: opacity .4s; transition-delay: calc(var(--i) * 70ms + .8s); }
.chart .val { font: 600 10.5px var(--sans); fill: var(--ink-2); opacity: 0; transition: opacity .4s; transition-delay: calc(var(--i) * 70ms + .7s); font-variant-numeric: tabular-nums; }
.chart .val.ours { fill: var(--teal); font-size: 12px; }
.chart .bar:hover { fill: #aebbd0; }
.chart .bar.ours:hover { fill: url(#ours-grad); }
.charts.go .bar { transform: scaleX(1); }
.charts.go .err, .charts.go .val { opacity: 1; }
.chart .brk { stroke: var(--faint); stroke-width: 1.2; fill: none; }

/* Cite */
.bibtex { position: relative; border-radius: 16px; background: var(--night); color: #d7e3f2; padding: 22px 24px; overflow-x: auto; }
.bibtex pre { font: 13.5px/1.7 var(--mono); }
.copy { position: absolute; top: 14px; right: 14px; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .06); color: #fff; border-radius: 8px; padding: 5px 12px; font-size: 13px; }
.copy:hover { background: rgba(255, 255, 255, .14); }

footer { display: flex; align-items: center; gap: 18px; justify-content: space-between; padding: 70px 0 50px; margin-top: 60px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }

/* Responsive */
@media (max-width: 1180px) {
  .stage-grid { grid-template-columns: minmax(0, 1fr) 290px; }
  .ledger-panel { grid-column: 1 / -1; border-left: 0 !important; border-top: 1px solid var(--line-2); display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
  .ledger-panel .panel-head { grid-column: 1 / -1; }
  .ledger-panel .scoring { grid-column: 2; grid-row: 2 / span 2; margin-top: 0; }
  .ledger-panel .checks { grid-column: 1; }
  .ledger-panel .stair-wrap { grid-column: 1; }
}
@media (max-width: 900px) {
  main, .topbar { width: calc(100% - 32px); }
  .topbar nav { gap: 16px; }
  .topbar nav a:not(.nav-paper):nth-child(n+3) { display: none; }
  .steps, .charts { grid-template-columns: 1fr; }
  .stage-head { grid-template-columns: 1fr; gap: 16px; padding: 22px 18px 16px; }
  .tracker { padding: 0 18px; }
  .tracker li span { display: none; }
  .tracker li { justify-content: center; }
  .stage-grid { grid-template-columns: 1fr; }
  .panel + .panel { border-left: 0; border-top: 1px solid var(--line-2); }
  .ledger-panel { display: block; }
  .ledger-panel .scoring { margin-top: 16px; }
  .convo { height: 420px; min-height: 0; flex: none; }
  .phone { transform: scale(.92); }
  .ctl-note { width: 100%; }
  .wide-break { display: none; }
}
@media (max-width: 480px) {
  .request { flex-direction: column; gap: 8px; }
  .case-tabs button { width: 100%; }
  .controls { padding: 12px 14px; }
  footer { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .reveal, .reveal-up, .split .ch { opacity: 1; transform: none; filter: none; }
}
