@font-face { font-family: "LM Roman 10"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/lmroman10-regular.otf") format("opentype"); }
@font-face { font-family: "LM Roman 10"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/lmroman10-italic.otf") format("opentype"); }

:root {
  --ink: #1d1d1f; --muted: #6e6e73; --faint: #a1a1a6; --line: #e3e3e6; --soft: #f5f5f7; --bg: #fff;
  /* alpha ramp, same as the paper's figures: base (light) -> RLVR (dark) */
  --a0: #86B6EF; --a25: #3987E5; --a50: #256ABF; --a75: #184F95; --a100: #0D366B;
  --warm: #C8642A; --warm-soft: #fbeee6; --good: #2E7D3A;
  --serif: "LM Roman 10", "Latin Modern Roman", "Computer Modern Serif", Georgia, serif;
  --sans: Lato, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--a50); }
.m { font-family: var(--serif); font-style: italic; }            /* inline math, LaTeX look */
.m .up { font-style: normal; }
sub, sup { line-height: 0; }

/* ---------- header ---------- */
.hero { max-width: 900px; margin: 56px auto 0; padding: 0 20px; text-align: center; }
.hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.9rem, 4.4vw, 3rem); line-height: 1.14; letter-spacing: -.005em; margin: 0 0 22px; }
.authors { font-size: 1.08rem; line-height: 1.7; margin: 0; }
.affils { color: var(--muted); font-size: .98rem; margin: 4px 0 0; }
.links { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 24px 0 0; }
.links a, .links span { display: inline-flex; align-items: center; gap: 7px; font-size: 15px; padding: 9px 20px; border-radius: 999px;
  text-decoration: none; border: 1px solid var(--line); color: var(--ink); background: #fff; transition: border-color .2s, box-shadow .2s; }
.links a:hover { border-color: #cfcfd4; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.links svg { width: 16px; height: 16px; }
.links .soon { color: var(--faint); cursor: default; }
.links .soon em { font-style: normal; font-size: 12px; }

.tldr { max-width: 760px; margin: 34px auto 0; padding: 0 20px; text-align: center; font-size: 1.18rem; line-height: 1.6; }
.tldr b { font-weight: 700; }

.abstract { max-width: 820px; margin: 48px auto 0; padding: 0 20px; }
.kicker { font-size: 12.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; text-align: center; }
.abstract p:not(.kicker) { font-size: 1.04rem; line-height: 1.72; text-align: justify; hyphens: auto; margin: 0; }

.section-head { max-width: 820px; margin: 72px auto 0; padding: 0 20px; text-align: center; }
.section-head h2 { font-family: var(--serif); font-weight: 400; font-size: 1.9rem; margin: 0 0 8px; }
.section-head p { color: var(--muted); font-size: 1rem; line-height: 1.6; margin: 0; }

/* ---------- shared controls ---------- */
.seg { display: inline-flex; flex-wrap: wrap; justify-content: center; background: var(--soft); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { font: inherit; font-size: 14px; letter-spacing: .01em; border: 0; background: transparent; color: var(--muted);
  padding: 7px 16px; border-radius: 999px; cursor: pointer; transition: background .2s, color .2s, box-shadow .2s; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 700; }
.pill { font: inherit; font-size: 14px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 16px; cursor: pointer; color: var(--ink);
  transition: border-color .2s, box-shadow .2s; }
.pill:hover { border-color: #cfcfd4; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.pill:disabled { color: #c7c7cc; cursor: default; box-shadow: none; border-color: var(--line); }

/* ---------- teaser (hero animation) ---------- */
#teaser { max-width: 1120px; margin: 26px auto 0; padding: 0 16px; }
.chapters { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 14px; }
.chapters button { font: inherit; font-size: 15px; padding: 8px 18px; border: 1px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 999px; cursor: pointer; transition: all .2s; }
.chapters button:hover { color: var(--ink); border-color: #cfcfd4; }
.chapters button[aria-selected="true"] { color: #fff; border-color: transparent; background: var(--a50); }
.chapters button .n { opacity: .6; margin-right: 6px; font-variant-numeric: tabular-nums; }
.frame { position: relative; aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; cursor: pointer; user-select: none; }
.frame svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.frame svg text { font-family: var(--sans); }
.frame svg .serif { font-family: var(--serif); }
.frame .paused { position: absolute; right: 14px; top: 12px; font-size: 12px; color: var(--muted); background: rgba(255,255,255,.92);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; opacity: 0; transition: opacity .2s; }
.frame.is-paused .paused { opacity: 1; }
.frame .caption { position: absolute; left: 6%; right: 6%; bottom: 4.2%; text-align: center; font-size: clamp(12px, 1.75vw, 19px);
  line-height: 1.4; color: var(--ink); pointer-events: none; }
.frame .caption i { font-family: var(--serif); }
.progress { position: relative; height: 3px; background: var(--soft); border-radius: 2px; margin-top: 8px; overflow: hidden; cursor: pointer; }
.progress > div { height: 100%; width: 0; background: #c7c7cc; }
.progress::before { content: ""; position: absolute; inset: -8px 0; }
.note { text-align: center; color: var(--faint); font-size: 12.5px; margin-top: 10px; line-height: 1.5; }

/* ---------- result cards ---------- */
.res { max-width: 1040px; margin: 28px auto 0; padding: 0 16px; }
.res-card { border: 1px solid var(--line); border-radius: 14px; padding: 24px 22px 18px; margin: 0 0 30px; background: #fff; }
.res-card h3 { font-family: var(--serif); font-weight: 400; font-size: 1.5rem; margin: 0 0 6px; text-align: center; }
.res-card .sub { color: var(--muted); font-size: .96rem; line-height: 1.55; text-align: center; margin: 0 auto 16px; max-width: 780px; }
.res-ctrl { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; margin: 0 0 10px; }
.res-ctrl .lbl { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.res svg { width: 100%; height: auto; display: block; overflow: visible; }
.res svg text { font-family: var(--sans); }
.res .dot { transition: cx .5s ease, cy .5s ease, opacity .3s, r .3s; cursor: pointer; }
.res .bar { transition: y .5s ease, height .5s ease, x .5s ease, width .5s ease, opacity .3s; cursor: pointer; }
.res .ln { transition: opacity .3s, stroke-width .2s; }
.res .muted { opacity: .18; }
.res-legend { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); margin: 8px 0 0; }
.res-legend span { cursor: default; white-space: nowrap; }
.res-legend i { display: inline-block; width: 18px; height: 0; border-top: 3px solid; margin-right: 6px; vertical-align: 3px; }
.res-legend i.dash { border-top-style: dashed; }
.res-legend i.dot { border-top-style: dotted; }
.res-legend i.sq { width: 12px; height: 12px; border: 0; border-radius: 3px; vertical-align: -1px; }
.res-note { text-align: center; color: #b0b0b5; font-size: 12.5px; margin-top: 10px; line-height: 1.55; }
.readout { text-align: center; font-size: 15px; line-height: 1.55; color: var(--ink); min-height: 48px; margin: 4px auto 6px; max-width: 800px; }
.readout .good { color: var(--good); font-weight: 700; }
.readout .warm { color: var(--warm); font-weight: 700; }
.readout b { font-weight: 700; }
.tip { position: fixed; pointer-events: none; z-index: 50; background: rgba(29,29,31,.94); color: #fff; font-size: 12.5px; line-height: 1.5;
  padding: 9px 12px; border-radius: 8px; max-width: 300px; opacity: 0; transition: opacity .12s; }
.tip b { font-weight: 700; }
.tip .k { color: #b8b8bd; }

/* stepper (play through alpha) */
.steps { display: flex; gap: 8px; justify-content: center; align-items: center; margin: 4px 0 8px; flex-wrap: wrap; }
.pips { display: flex; gap: 7px; align-items: center; }
.pips span { width: 10px; height: 10px; border-radius: 50%; background: #d9d9de; cursor: pointer; transition: background .2s, transform .2s; }
.pips span.on { transform: scale(1.3); }

/* answer explorer */
.qbox { max-width: 820px; margin: 4px auto 12px; background: var(--soft); border-radius: 12px; padding: 14px 18px; font-size: 15px; line-height: 1.6; }
.qbox .katex-display { overflow-x: auto; overflow-y: hidden; padding: 2px 0; }
.qbox .gold { margin-top: 8px; font-size: 14px; color: var(--muted); }
.qbox .gold span { color: var(--good); font-weight: 700; }
.ex-rows { max-width: 900px; margin: 6px auto 0; }
.ex-row { display: grid; grid-template-columns: 130px 1fr 150px; gap: 14px; align-items: center; margin: 0 0 10px; }
.ex-name { font-size: 14.5px; font-weight: 700; text-align: right; }
.ex-name small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }
.ex-bar { display: flex; height: 34px; border-radius: 8px; overflow: hidden; background: #f0f0f2; }
.ex-seg { height: 100%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12.5px; font-weight: 700;
  transition: flex-basis .55s ease; cursor: pointer; overflow: hidden; white-space: nowrap; box-shadow: inset -1px 0 0 rgba(255,255,255,.7); }
.ex-seg.light { color: var(--ink); }
.ex-stat { font-size: 13.5px; color: var(--muted); line-height: 1.35; font-variant-numeric: tabular-nums; }
.ex-stat b { color: var(--ink); font-size: 15px; }
.ex-stat b.ok { color: var(--good); }
.ex-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: center; font-size: 13.5px; color: var(--muted); margin: 12px auto 0; max-width: 900px; }
.ex-legend span { white-space: nowrap; }
.ex-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* sliders (token-level demo) */
.sliders { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 28px; max-width: 760px; margin: 6px auto 4px; }
.slider label { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.slider label b { color: var(--ink); font-variant-numeric: tabular-nums; }
.slider input[type=range] { width: 100%; accent-color: var(--a50); }
.slider.warm input[type=range] { accent-color: var(--warm); }

/* use-case cards */
.uses { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.use { border: 1px solid var(--line); border-radius: 12px; padding: 16px 14px 14px; background: #fff; transition: box-shadow .2s, transform .2s; }
.use:hover { box-shadow: 0 4px 14px rgba(0,0,0,.07); transform: translateY(-2px); }
.use .a { font-family: var(--serif); font-size: 1.7rem; line-height: 1; margin: 0 0 8px; }
.use .a small { font-size: .95rem; color: var(--muted); }
.use h4 { margin: 0 0 6px; font-size: 14.5px; font-weight: 700; }
.use p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.use .sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }

/* tables */
.res details { margin-top: 12px; font-size: 13.5px; }
.res summary { cursor: pointer; color: var(--muted); text-align: center; list-style: none; }
.res summary::-webkit-details-marker { display: none; }
.res summary::after { content: " \25BE"; }
.res details[open] summary::after { content: " \25B4"; }
.tblwrap { overflow-x: auto; }
.res table { border-collapse: collapse; width: 100%; margin-top: 10px; font-variant-numeric: tabular-nums; }
.res th, .res td { padding: 6px 8px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.res th:first-child, .res td:first-child { text-align: left; }
.res th { font-size: 12px; color: var(--muted); font-weight: 700; }
.res tr.mean td { background: var(--soft); font-weight: 700; }

/* try it */
.try { max-width: 860px; margin: 22px auto 0; padding: 0 16px; }
/* macOS-style window */
.code { margin: 8px 0 0; border-radius: 12px; overflow: hidden; background: #1e1e1e;
  box-shadow: 0 0 0 1px rgba(0,0,0,.55), 0 1px 0 rgba(255,255,255,.06) inset, 0 18px 40px -12px rgba(0,0,0,.35), 0 6px 14px -6px rgba(0,0,0,.25); }
.code .titlebar { position: relative; display: flex; align-items: center; height: 38px; padding: 0 12px;
  background: linear-gradient(#3a3a3c, #2c2c2e); border-bottom: 1px solid #0f0f10; }
.code .lights { display: flex; gap: 8px; }
.code .lights i { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.35); }
.code .lights i:nth-child(1) { background: #ff5f57; }
.code .lights i:nth-child(2) { background: #febc2e; }
.code .lights i:nth-child(3) { background: #28c840; }
.code .ttl { position: absolute; left: 50%; transform: translateX(-50%); font-size: 13px; color: #a1a1a6; font-weight: 700; letter-spacing: .01em;
  white-space: nowrap; pointer-events: none; }
.code .copy { margin-left: auto; font: inherit; font-size: 12px; color: #d1d1d6; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  border-radius: 6px; padding: 3px 10px; cursor: pointer; transition: background .2s; }
.code .copy:hover { background: rgba(255,255,255,.16); }
.code pre { background: transparent; color: #e5e5ea; padding: 16px 20px 18px; font-size: 13px; line-height: 1.65; overflow-x: auto; margin: 0;
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; }
.code pre .c { color: #7f8c98; }
.code pre .p { color: #30d158; user-select: none; }
.code pre .k { color: #ff7ab2; }
.code pre .s { color: #fc6a5d; }
.code pre .n { color: #d0bf69; }
.code + .res-note, .code .res-note { margin: 0; padding: 0 20px 14px; color: #8e8e93; }
.try-notes { margin: 16px 0 0; padding-left: 20px; }
.try-notes li { font-size: .98rem; line-height: 1.62; margin: 0 0 8px; }
.try-notes b { font-weight: 700; }

/* limitations + citation */
.prose { max-width: 820px; margin: 24px auto 0; padding: 0 20px; }
.prose ul { margin: 0; padding-left: 20px; }
.prose li { font-size: 1rem; line-height: 1.65; margin: 0 0 8px; }
.prose li b { font-weight: 700; }
.bib { position: relative; max-width: 820px; margin: 18px auto 0; padding: 0 20px; }
.bib pre { background: var(--soft); border-radius: 12px; padding: 18px 20px; font-size: 13px; line-height: 1.55; overflow-x: auto; margin: 0; }
.bib .pill { position: absolute; top: 10px; right: 30px; font-size: 12.5px; padding: 5px 12px; }
footer { text-align: center; color: var(--faint); font-size: 12.5px; margin: 72px 0 36px; padding: 0 16px; }

@media (max-width: 760px) {
  .hero { margin-top: 36px; }
  .frame { aspect-ratio: auto; }
  .frame svg { position: relative; height: auto; aspect-ratio: 16 / 9; }
  .frame .caption { position: static; padding: 2px 12px 12px; font-size: 13.5px; min-height: 3.2em; }
  .frame .paused { top: 6px; right: 8px; font-size: 11px; }
  .chapters button { font-size: 13.5px; padding: 6px 12px; }
  .uses { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ex-row { grid-template-columns: 1fr auto; gap: 4px 10px; }
  .ex-name { text-align: left; grid-column: 1; }
  .ex-name small { display: inline; margin-left: 6px; }
  .ex-stat { grid-column: 2; grid-row: 1; text-align: right; }
  .ex-stat br { display: none; }
  .ex-stat span { margin-left: 6px; }
  .ex-bar { grid-column: 1 / -1; height: 28px; }
  .ex-name .full, .ex-stat .long { display: none; }
  .ex-name small { margin-left: 6px; font-size: 14px; color: var(--muted); font-weight: 400; }
  .ex-name .full + small { margin-left: 0; color: var(--ink); font-weight: 700; }
  #ex-prob { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; justify-content: flex-start; }
  #ex-prob button { white-space: nowrap; }
  .qbox { font-size: 14px; padding: 12px 14px; }
  .sliders { grid-template-columns: 1fr; }
  .res-card { padding: 18px 12px 14px; }
  .tldr { font-size: 1.05rem; }
  .abstract p:not(.kicker) { text-align: left; }
}
@media (max-width: 640px) {
  .frame svg { aspect-ratio: 900 / 1040; }
  .frame .caption { padding-bottom: 30px; }
  .frame .paused { top: auto; bottom: 6px; }
}
@media (max-width: 420px) { .uses { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
