@import url("https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  color-scheme: light;
  --page: #f4f6fb;
  --surface: #fff;
  --inset: #edf1f8;
  --ink: #172347;
  --muted: #4f5c76;
  --line: #cfd8e9;
  --accent: #334bc0;
  --accent-ink: #fff;
  --chart: #435bd1;
  --commit: #166346;
  --reject: #a03942;
  --hold: #805514;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #11182a;
  --surface: #1a243b;
  --inset: #121d32;
  --ink: #edf2ff;
  --muted: #b0bdd8;
  --line: #364462;
  --accent: #a7b6ff;
  --accent-ink: #141e3d;
  --chart: #91a5ff;
  --commit: #88dab8;
  --reject: #ffabb1;
  --hold: #f3cd88;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --page: #11182a;
    --surface: #1a243b;
    --inset: #121d32;
    --ink: #edf2ff;
    --muted: #b0bdd8;
    --line: #364462;
    --accent: #a7b6ff;
    --accent-ink: #141e3d;
    --chart: #91a5ff;
    --commit: #88dab8;
    --reject: #ffabb1;
    --hold: #f3cd88;
  }
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font: 400 1rem/1.6 "Geist", system-ui, sans-serif;
}
h1, h2, h3, p, figure { margin: 0; }
h1, h2 { letter-spacing: -.035em; line-height: 1.05; }
a { color: inherit; text-decoration-thickness: .08em; text-underline-offset: .22em; }
a:hover { color: var(--accent); }
button, select { font: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
[id] { scroll-margin-top: 1.5rem; }
.wrap { width: min(67rem, calc(100% - 4rem)); margin-inline: auto; }
.skip { position: absolute; top: .5rem; left: .5rem; padding: .5rem 1rem; background: var(--surface); transform: translateY(-200%); }
.skip:focus { transform: none; z-index: 1; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4rem;
  border-bottom: 1px solid var(--line);
}
.brand, .site-header nav a { text-decoration: none; }
.brand { font-weight: 700; }
nav { display: flex; gap: clamp(.9rem, 3vw, 2rem); font-size: .88rem; font-weight: 600; }
.site-header nav { color: var(--muted); }
.theme {
  min-height: 2.65rem;
  padding: .32rem .75rem;
  border: 1px solid var(--line);
  border-radius: 2rem;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  font-size: .82rem;
  font-weight: 650;
}
.theme:hover { border-color: var(--accent); }
#theme-icon { display: inline-block; width: 1rem; text-align: center; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: .66rem .95rem;
  min-height: 2.8rem;
  border: 1px solid transparent;
  border-radius: .55rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { color: var(--accent-ink); filter: brightness(.92); }
.section { padding-block: clamp(2.1rem, 5vw, 4.4rem); border-top: 1px solid var(--line); }
.section-heading { display: grid; grid-template-columns: 1fr 1fr; align-items: baseline; gap: 1rem 2rem; margin-bottom: 1.5rem; }
.section-heading h2 { font-size: clamp(2rem, 4vw, 3.15rem); }
.section-heading p, .site-footer p { color: var(--muted); }
.section-heading p { max-width: 34rem; }
.sandbox { overflow: hidden; border: 1px solid var(--line); border-radius: .9rem; background: var(--surface); }
.workbench { display: grid; grid-template-columns: minmax(0, .65fr) minmax(0, 1fr); }
.control-panel { display: grid; align-content: start; gap: .5rem; padding: clamp(1rem, 2.5vw, 1.6rem); }
.control-panel label, .inspection h3 { font-size: .87rem; font-weight: 700; }
select {
  width: 100%;
  min-width: 0;
  min-height: 2.8rem;
  padding: .4rem .6rem;
  border: 1px solid var(--line);
  border-radius: .45rem;
  background: var(--page);
  color: var(--ink);
  font-size: .9rem;
}
.request {
  margin-block: .25rem .65rem;
  padding: .5rem .7rem;
  border-left: 2px solid var(--chart);
  color: var(--muted);
  font-size: .88rem;
}
.control-panel .button { justify-self: start; margin-top: .55rem; }
.inspection {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1fr);
  gap: .8rem;
  padding: clamp(1rem, 2.5vw, 1.6rem);
  border-left: 1px solid var(--line);
  background: var(--inset);
}
.inspection > div { min-width: 0; }
pre {
  height: 12rem;
  overflow: auto;
  margin: .5rem 0 0;
  padding: .65rem;
  border: 1px solid var(--line);
  border-radius: .45rem;
  background: var(--surface);
  font: 400 .76rem/1.65 var(--mono);
}
.verdict { min-height: 3.7rem; padding: .9rem clamp(1rem, 2.5vw, 1.6rem); border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.out { display: inline-block; margin-right: .65rem; font: 500 .8rem/1.6 var(--mono); overflow-wrap: anywhere; }
.verdict[data-state="commit"] .out { color: var(--commit); }
.verdict[data-state="reject"] .out { color: var(--reject); }
.verdict[data-state="hold"] .out { color: var(--hold); }
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .8rem 2rem;
  padding-block: 1.5rem 2.5rem;
  border-top: 1px solid var(--line);
}
.site-footer p { font-size: .85rem; }


.paper-intro { padding-block: clamp(1.8rem, 5vw, 3.5rem); }
.paper-intro h1 { font-size: clamp(2.25rem, 5vw, 3.55rem); font-weight: 750; }
.paper-intro p { max-width: 78ch; }
.author { margin: .6rem 0 1rem; font-size: .92rem; font-weight: 600; color: var(--muted); }
.site-header { flex-wrap: wrap; gap: .65rem 1.25rem; padding-block: .7rem; }
.site-header nav { gap: .35rem clamp(.65rem, 1.5vw, 1.35rem); flex-wrap: wrap; }
.section { padding-block: clamp(1.7rem, 4vw, 2.8rem); }
.technical h2, .section-heading h2 { font-size: clamp(1.7rem, 3.3vw, 2.4rem); }
.technical h3 { margin-top: 1.65rem; font-size: 1.18rem; line-height: 1.3; }
.technical p { margin-top: .75rem; max-width: 84ch; }
code { font: .88em/1.5 var(--mono); overflow-wrap: anywhere; }
.diagram, .example-grid, .table-wrap { margin-block: 1.2rem; }
.diagram figcaption, .example figcaption, caption {
  padding-bottom: .45rem;
  text-align: left;
  font-size: .88rem;
  font-weight: 700;
}
.flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: .4rem;
  background: var(--surface);
}
.flow li { position: relative; padding: .65rem .8rem; font-size: .82rem; }
.flow li + li { border-left: 1px solid var(--line); }
.flow li + li::before {
  content: "→";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translate(-50%, -50%);
  color: var(--accent);
  background: var(--surface);
  line-height: 1;
}
.flow b, .flow span { display: block; }
.flow span { color: var(--muted); line-height: 1.45; margin-top: .22rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
thead { background: var(--inset); }
th, td { padding: .53rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
th { font-weight: 650; }
td { font-variant-numeric: tabular-nums; }
.example-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.example pre { height: auto; margin-top: 0; }
.example pre code { font: inherit; }
.release-list { max-width: 85ch; padding-left: 1.25rem; }
.release-list li + li { margin-top: .55rem; }

@media (max-width: 850px) {
  .site-header nav { order: 1; width: 100%; }
  .section-heading, .workbench { grid-template-columns: 1fr; }
  .inspection { border-top: 1px solid var(--line); border-left: 0; }
}
@media (max-width: 640px) {
  .wrap { width: calc(100% - 2rem); }
  .example-grid, .flow { grid-template-columns: minmax(0, 1fr); }
  .flow li + li { border-left: 0; border-top: 1px solid var(--line); }
  .flow li + li::before { content: "↓"; top: 0; left: 1.25rem; }
  .flow span { display: inline; margin: 0 0 0 .4rem; }
  .flow b { display: inline; }
  th, td { padding: .4rem .45rem; }
  table { min-width: 29rem; }
}
@media (max-width: 510px) {
  .inspection { grid-template-columns: 1fr; }
  .inspection > div:first-child pre { height: 6.7rem; }
}

/* Added: methods section, labs, and closing call to action */
.brand { white-space: normal; max-width: 22rem; line-height: 1.2; }
.site-header nav a[aria-current="location"] { color: var(--ink); text-decoration: underline; }

.formula {
  max-width: 46rem;
  margin-block: 1rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: .4rem;
  background: var(--surface);
}
.equations {
  display: grid;
  justify-items: center;
  gap: .8rem;
  padding: clamp(.85rem, 2vw, 1.25rem) .6rem;
  color: var(--ink);
}
.equations math {
  margin: 0;
  font-size: clamp(.95rem, 2.1vw, 1.24rem);
}
.formula figcaption {
  padding: .65rem .9rem;
  border-top: 1px solid var(--line);
  background: var(--inset);
  color: var(--muted);
  font-size: .84rem;
}
.method-nav {
  flex-wrap: wrap;
  gap: .38rem 1rem;
  margin-top: 1.1rem;
  padding-block: .65rem;
  border-block: 1px solid var(--line);
  color: var(--accent);
}
.technical .references { font-size: .86rem; color: var(--muted); }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin: 1rem 0 .4rem;
  padding: 0;
  list-style: none;
}
.chip {
  padding: .18rem .42rem;
  border: 1px solid var(--line);
  border-radius: .3rem;
  background: var(--surface);
  font: 400 .76rem/1.5 var(--mono);
  color: var(--ink);
}
.chip.mask { color: var(--muted); text-decoration: line-through; }
.chip.tgt { border-color: var(--chart); border-bottom-width: 3px; font-weight: 500; }
.chip.eot { border-color: var(--accent); }
.chips-note { font-size: .82rem; color: var(--muted); max-width: 62ch; }

.lab {
  margin-block: 1.2rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: .9rem;
  background: var(--surface);
}
.lab-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem 1.6rem;
  padding: clamp(.9rem, 2.5vw, 1.4rem);
}
.lab-field { display: grid; gap: .3rem; font-size: .84rem; font-weight: 650; }
.lab-field span { display: flex; justify-content: space-between; gap: .5rem; }
.lab-field output { font: 500 .84rem/1.6 var(--mono); color: var(--accent); }
input[type="range"] { width: 100%; margin: 0; padding: 0; accent-color: var(--chart); }
.lab-out {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .6rem 1.6rem;
  padding: .8rem clamp(.9rem, 2.5vw, 1.4rem);
  border-top: 1px solid var(--line);
  background: var(--inset);
}
.lab-out b {
  display: block;
  margin-bottom: .1rem;
  font-size: .82rem;
  font-weight: 650;
  color: var(--muted);
}
.lab-out span { font: 500 .95rem/1.5 var(--mono); }
.technical .lab-verdict {
  margin: 0;
  max-width: none;
  padding: .8rem clamp(.9rem, 2.5vw, 1.4rem);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .86rem;
}

.technical .lab-caption {
  margin: 0;
  padding: 0 clamp(.9rem, 2.5vw, 1.4rem) .55rem;
  color: var(--muted);
  font-size: .8rem;
}
.groups {
  display: grid;
  gap: 3px;
  align-items: end;
  height: 5.2rem;
  padding: 0 clamp(.9rem, 2.5vw, 1.4rem) .8rem;
}
.groups i { display: block; border-radius: 2px 2px 0 0; background: var(--commit); }
.groups i.zero { background: var(--line); }


.button.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.button.ghost:hover { color: var(--ink); border-color: var(--accent); }
.cta { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.4rem; }

@media (max-width: 640px) {
  .lab-body, .lab-out { grid-template-columns: minmax(0, 1fr); }
  .brand { max-width: 100%; }
}

@media (max-width: 1000px) {
  .site-header nav { order: 1; width: 100%; }
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-block: 1.6rem .4rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: .6rem;
  background: var(--line);
}
.stat { padding: .85rem .95rem; background: var(--surface); }
.stat b {
  display: block;
  font: 700 clamp(1.3rem, 2.4vw, 1.65rem)/1.1 "Geist", system-ui, sans-serif;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.stat span { display: block; margin-top: .32rem; font-size: .78rem; line-height: 1.45; color: var(--muted); }
@media (max-width: 700px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1001px) {
  .site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--page);
  }
  [id] { scroll-margin-top: 5rem; }
}

.totop {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 30;
  display: none;
  padding: .5rem .85rem;
  border: 1px solid var(--line);
  border-radius: 2rem;
  background: var(--surface);
  color: var(--ink);
  font-size: .8rem;
  font-weight: 650;
  text-decoration: none;
  box-shadow: 0 2px 12px rgb(0 0 0 / 12%);
}
.totop[data-show="true"] { display: inline-block; }

/* Added for the reasoning-slm-lab page. */
.lab-input {
  min-height: 2.8rem;
  padding: .4rem .6rem;
  border: 1px solid var(--line);
  border-radius: .45rem;
  background: var(--page);
  color: var(--ink);
  font: 500 .9rem/1.5 var(--mono);
}
.technical > .example {
  margin-block: 1.2rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: .7rem;
  background: var(--inset);
}
.technical > .example pre { margin-top: .4rem; }

.score-controls { display: flex; flex-wrap: wrap; align-items: end; gap: .7rem; }
.score-controls label { display: grid; min-width: 0; gap: .3rem; }
.score-controls input { width: min(100%, 15rem); }
.sandbox .inspection { grid-template-columns: repeat(2, minmax(0, 1fr)); border-left: 0; }
.sandbox .inspection h3 { margin-top: 0; }
.sandbox .inspection pre { height: clamp(12rem, 35vw, 20rem); white-space: pre-wrap; overflow-wrap: anywhere; }
.sandbox .request { max-width: none; }
.technical summary { margin-top: 1rem; cursor: pointer; font-weight: 650; }
@media (max-width: 640px) {
  .sandbox .inspection { grid-template-columns: minmax(0, 1fr); }
  .table-wrap table { min-width: 0; }
}
