:root {
  --paper: #EEF2F6;
  --ink: #172233;
  --muted: #5A6B80;
  --line: #CBD5E1;
  --stop: #E5484D;
  --deepseek: #2E5BFF;
  --sol: #F5A300;
  --luna: #8F7CF7;
  --qwen: #0FA88F;
  --font: "Anuphan", "Leelawadee UI", "Tahoma", sans-serif;
  --mono: "IBM Plex Mono", "Consolas", monospace;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.75;
  font-weight: 400;
}
.layout { display: grid; grid-template-columns: minmax(0, 1fr); }
main { min-width: 0; padding: 0 20px; }
section {
  min-height: 72svh;
  padding: 8svh 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
section > * { width: 100%; max-width: 34rem; }
h1 {
  font-size: clamp(2.3rem, 4.6vw, 4rem);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.01em;
  max-width: 14em;
  margin: 0 0 0.65em;
}
h2 {
  font-size: clamp(1.55rem, 2.4vw, 2.15rem);
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 0.9em;
}
p { margin: 0 0 1.1em; }
.lead { font-size: 1.18rem; color: var(--ink); }
.builder, .hint { font-size: 0.875rem; color: var(--muted); }
code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: rgba(23,34,51,0.06);
  padding: 0.08em 0.36em;
  border-radius: 4px;
  overflow-wrap: anywhere;
}
#stage {
  position: sticky;
  top: 0;
  height: 42svh;
  min-width: 0;
  z-index: 2;
  background: var(--paper);
  overflow: hidden;
}
#scene { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity 800ms; }
#scene.is-ready { opacity: 1; }
#scene[hidden] { display: none; }
#stage-caption {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 20px;
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  max-width: 30rem;
}
#stage-caption.is-changing { animation: caption-in 300ms ease both; }
@keyframes caption-in { from { opacity: 0; } to { opacity: 1; } }
#stage-fallback {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 48px);
  max-width: 30rem;
  text-align: center;
  color: var(--muted);
}
ul, ol { list-style: none; padding: 0; margin: 0.6em 0 1.4em; }
li { padding: 0.55em 0; border-top: 1px solid var(--line); }
li:last-child { border-bottom: 1px solid var(--line); }
ol { counter-reset: step; }
ol li { counter-increment: step; }
ol li::before {
  content: counter(step) ".";
  color: var(--muted);
  font-weight: 600;
  min-width: 1.6em;
  display: inline-block;
}
dl { margin: 0.6em 0 1.4em; }
dt { font-weight: 600; border-top: 1px solid var(--line); padding: 0.55em 0 0; }
dd { margin: 0; color: var(--ink); padding: 0 0 0.55em; }
dd:last-child { border-bottom: 1px solid var(--line); }
.swatch {
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  border-radius: 50%;
  margin-right: 0.5em;
  vertical-align: 0.05em;
}
[data-model="deepseek"] { background: var(--deepseek); }
[data-model="sol"] { background: var(--sol); }
[data-model="luna"] { background: var(--luna); }
[data-model="qwen"] { background: var(--qwen); }
.swatch[data-model="claude"] { background: transparent; border: 1.5px solid var(--ink); }
figure.round {
  margin: 1.6em 0;
  padding: 1.1em 1.3em;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 10px;
}
figure.round figcaption { font-size: 0.875rem; color: var(--muted); margin-bottom: 0.6em; }
figure.round p { margin: 0.15em 0; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; margin: 0.6em 0 1.4em; }
th, td {
  padding: 0.5em 0.6em 0.5em 0;
  text-align: left;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
th { font-weight: 600; border-top: 1px solid var(--line); }
th:first-child { width: 47%; }
th:nth-child(2) { width: 33%; }
.bar { display: block; margin-top: 4px; height: 6px; border-radius: 3px; width: calc(var(--v) / 295 * 100%); }
.note { color: var(--muted); border-left: 2px solid var(--line); padding-left: 0.9em; }
a { color: var(--ink); text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
#credits { padding: 10vh clamp(24px, 6vw, 96px) 8vh; border-top: 1px solid var(--line); font-size: 0.95rem; }
#credits p { max-width: 34rem; }
@media (min-width: 960px) {
  .layout { grid-template-columns: minmax(0, 40rem) 1fr; align-items: start; }
  main { grid-column: 1; grid-row: 1; padding-left: clamp(24px, 6vw, 96px); padding-right: 32px; }
  #stage { grid-column: 2; grid-row: 1; height: 100vh; }
  section { min-height: 92vh; padding: 16vh 0; }
  #hero { min-height: 100vh; }
  dl { display: grid; grid-template-columns: minmax(0, 15rem) 1fr; }
  dt, dd { padding: 0.55em 0; border-top: 1px solid var(--line); }
  dt { padding-right: 1em; }
  dt:nth-last-child(2) { border-bottom: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
