/* Layout: a retro sunburst poster on top, then cream paper. A few things are
   outlined in ink like stickers (buttons, the byte board, the heat cards), and
   bytes are laid out as tiles, one per byte, the way the format sees them. */
:root {
  color-scheme: light;
  --paper: #fdf6e6;
  --paper-alt: #f8ebcb;
  --card: #fffbf2;
  --ink: #2b2820;
  --ink-soft: #645c49;
  --rule: #2b2820;
  --drop: #2b2820;
  --hairline: #e4d3a9;
  --dots: #ead9b0;
  --sun-a: #ef7432;
  --sun-b: #f6b844;
  --sun-glow: #fff3d6;
  --heat-hot: #ef7432;
  --heat-mild: #f6b844;
  --heat-not: #f8ebcb;
  --eyebrow: #d65a1f;
  --link: #2b7130;
  --go: #8edc5c;
  --go-ink: #1d3511;
  --chili: #cc3b24;
  --chili-bg: #fbd9cd;
  --win-bg: #d9f1c4;
  --win-ink: #22501a;
  --lose-bg: #fde3c3;
  --lose-ink: #874510;
  --code-bg: #fffaf0;
  --foot-bg: #2b2820;
  --foot-ink: #f6ead0;
  --foot-soft: #c9bd9c;
  --col-1: #c6eca6;
  --col-2: #fde197;
  --col-3: #fcc39d;
  --col-4: #f8c3d1;
  --col-5: #c9ddf6;
  --col-6: #e2d5f4;

  --font-display: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Arial Rounded MT Bold", system-ui, sans-serif;
  --font-body: "M PLUS 2", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "M PLUS 1 Code", ui-monospace, "SFMono-Regular", Menlo, Consolas, "DejaVu Sans Mono", monospace;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3rem;
  --step-2: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);
  --step-3: clamp(2.1rem, 1.5rem + 3vw, 3.4rem);

  --radius: 16px;
  --wrap: 72rem;
  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #16180f;
    --paper-alt: #1c1f14;
    --card: #22261a;
    --ink: #f6ead0;
    --ink-soft: #c3b99c;
    --rule: #575440;
    --drop: #050604;
    --hairline: #3b3f2d;
    --dots: #2a2d1f;
    --sun-a: #5a2a10;
    --sun-b: #3d240b;
    --sun-glow: #6b3a12;
    --heat-hot: #9a3a16;
    --heat-mild: #6a5216;
    --heat-not: #2a2e20;
    --eyebrow: #f6a35c;
    --link: #a3e277;
    --go: #8edc5c;
    --go-ink: #15260b;
    --chili: #ff8466;
    --chili-bg: #4b2017;
    --win-bg: #263f1a;
    --win-ink: #bdf097;
    --lose-bg: #4a3113;
    --lose-ink: #ffcf8f;
    --code-bg: #1b1e14;
    --foot-bg: #0d0e09;
    --foot-ink: #f6ead0;
    --foot-soft: #b0a787;
    --col-1: #35522a;
    --col-2: #5a4a1b;
    --col-3: #5e3720;
    --col-4: #5b2b3b;
    --col-5: #27405d;
    --col-6: #3e3058;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #16180f;
  --paper-alt: #1c1f14;
  --card: #22261a;
  --ink: #f6ead0;
  --ink-soft: #c3b99c;
  --rule: #575440;
  --drop: #050604;
  --hairline: #3b3f2d;
  --dots: #2a2d1f;
  --sun-a: #5a2a10;
  --sun-b: #3d240b;
  --sun-glow: #6b3a12;
  --heat-hot: #9a3a16;
  --heat-mild: #6a5216;
  --heat-not: #2a2e20;
  --eyebrow: #f6a35c;
  --link: #a3e277;
  --go: #8edc5c;
  --go-ink: #15260b;
  --chili: #ff8466;
  --chili-bg: #4b2017;
  --win-bg: #263f1a;
  --win-ink: #bdf097;
  --lose-bg: #4a3113;
  --lose-ink: #ffcf8f;
  --code-bg: #1b1e14;
  --foot-bg: #0d0e09;
  --foot-ink: #f6ead0;
  --foot-soft: #b0a787;
  --col-1: #35522a;
  --col-2: #5a4a1b;
  --col-3: #5e3720;
  --col-4: #5b2b3b;
  --col-5: #27405d;
  --col-6: #3e3058;
}

/* ------------------------------------------------------------------ base -- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 3px; }
:focus-visible { outline: 3px solid var(--eyebrow); outline-offset: 2px; border-radius: 4px; }
code, pre, kbd, samp { font-family: var(--font-mono); }
:not(pre) > code {
  font-size: 0.88em;
  background: var(--paper-alt);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 0.05em 0.35em;
  white-space: pre;
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  text-wrap: balance;
  margin: 0;
}
h2 { font-size: var(--step-2); font-weight: 900; letter-spacing: -0.01em; }
h3 { font-size: var(--step-1); font-weight: 800; }
p { margin: 0; }
ul, ol { margin: 0; padding-left: 1.25em; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -48px; z-index: 10;
  background: var(--card); color: var(--ink); border: 2px solid var(--rule);
  padding: 0.4em 0.8em; border-radius: 999px; font-weight: 700;
}
.skip:focus { top: 12px; }

/* The break byte, wherever it is shown. The spec writes it as U+2400, which
   every font draws as three tiny letters, so it is drawn here instead: a red
   bar one character wide, so the rows of a document still line up. The
   character stays in the page for copying and for screen readers. */
.nul {
  display: inline-block;
  position: relative;
  width: 1ch;
  height: 1em;
  vertical-align: -0.16em;
  overflow: hidden;
  color: transparent;
  font-family: var(--font-mono);
  line-height: 1;
}
.nul::before {
  content: "";
  position: absolute;
  inset: 0.1em 0.14ch 0.04em;
  border-radius: 0.22em;
  background: var(--chili);
}

/* ------------------------------------------------------------- top bar -- */
.topbar {
  background: var(--paper);
  border-bottom: 3px solid var(--rule);
  padding-inline: var(--gutter);
  position: relative;
  z-index: 2;
}
.topbar-in {
  max-width: var(--wrap);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding-block: 0.6rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
}
.brand img { border-radius: 50%; border: 2px solid var(--rule); }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.1rem; }
.nav a {
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  padding-block: 0.2rem;
  border-bottom: 3px solid transparent;
}
.nav a:hover { border-bottom-color: var(--sun-b); }
body[data-page="guide"] .nav a[data-nav="guide"],
body[data-page="spec"] .nav a[data-nav="spec"],
body[data-page="benchmark"] .nav a[data-nav="benchmark"] { border-bottom-color: var(--eyebrow); }
.nav .nav-try {
  background: var(--go);
  color: var(--go-ink);
  border: 2px solid var(--rule);
  border-radius: 999px;
  padding: 0.15rem 0.85rem;
  box-shadow: 2px 2px 0 var(--drop);
}
.nav .nav-try:hover { border-bottom-color: var(--rule); transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--drop); }

/* ----------------------------------------------------------------- hero -- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-bottom: 3px solid var(--rule);
  padding-inline: var(--gutter);
  padding-block: clamp(2.25rem, 6vw, 4.5rem);
  background: var(--sun-b);
}
.hero::before {
  /* The rays: a square much larger than the hero, so it covers it at any
     angle while it turns. */
  content: "";
  position: absolute;
  z-index: -2;
  left: 50%;
  top: 50%;
  width: 220vmax;
  height: 220vmax;
  translate: -50% -50%;
  background: repeating-conic-gradient(from 0deg, var(--sun-a) 0deg 7.5deg, var(--sun-b) 7.5deg 15deg);
  animation: turn 240s linear infinite;
}
.hero::after {
  /* A glow behind the middle, and the grain of a printed poster. */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 55% 60% at 50% 50%, var(--sun-glow) 0%, transparent 72%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.9;
}
@keyframes turn { to { rotate: 360deg; } }

.hero-in {
  max-width: var(--wrap);
  margin-inline: auto;
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: center;
  grid-template-columns: minmax(0, 1fr);
}
.hero-logo { margin: 0; justify-self: center; }
.hero-logo img {
  display: block;
  width: min(100%, 40rem);
  rotate: -3deg;
  filter: drop-shadow(5px 6px 0 rgb(0 0 0 / 0.28));
  transition: rotate 0.3s ease;
}
.hero-logo img:hover { rotate: -1deg; }
.hero-card {
  background: var(--card);
  border: 3px solid var(--rule);
  border-radius: 22px;
  box-shadow: 6px 6px 0 var(--drop);
  padding: clamp(1.25rem, 3vw, 2rem);
  display: grid;
  gap: 1rem;
  max-width: 36rem;
  justify-self: center;
}
.hero-claim {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--step-3);
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.hero-sub { color: var(--ink-soft); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; padding-top: 0.25rem; }
.hero-meta { font-size: var(--step--1); color: var(--ink-soft); font-family: var(--font-mono); }
@media (min-width: 60rem) {
  .hero-in { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .hero-logo { justify-self: end; }
  .hero-card { justify-self: start; }
}

/* -------------------------------------------------------------- buttons -- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.02rem;
  color: var(--ink);
  background: var(--card);
  border: 3px solid var(--rule);
  border-radius: 999px;
  padding: 0.55em 1.15em;
  box-shadow: 4px 4px 0 var(--drop);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--drop); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--drop); }
.btn-go { background: var(--go); color: var(--go-ink); }
.btn-small { font-size: 0.92rem; padding: 0.4em 0.95em; border-width: 2px; box-shadow: 3px 3px 0 var(--drop); }

/* -------------------------------------------------------------- sections -- */
.band { padding-inline: var(--gutter); padding-block: clamp(3rem, 7vw, 5rem); }
.band-alt {
  background-color: var(--paper-alt);
  background-image: radial-gradient(var(--dots) 1.2px, transparent 1.6px);
  background-size: 16px 16px;
  border-block: 3px solid var(--rule);
}
.band > .wrap { display: grid; gap: 1.25rem; }
.eyebrow {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--eyebrow);
  letter-spacing: 0.12em;
  font-size: 0.95rem;
  margin-bottom: -0.75rem;
}
.lede { max-width: 44rem; color: var(--ink-soft); font-size: 1.1rem; }
.aside { max-width: 46rem; color: var(--ink-soft); }

/* ------------------------------------------------------------ code blocks -- */
.code {
  position: relative;
  background: var(--code-bg);
  border: 2px solid var(--hairline);
  border-radius: 12px;
  min-width: 0;
}
.code pre {
  margin: 0;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.6;
  tab-size: 4;
}
.code-lang {
  position: absolute;
  top: -0.7rem;
  left: 0.9rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--paper-alt);
  border: 2px solid var(--hairline);
  border-radius: 999px;
  padding: 0 0.6em;
  color: var(--ink-soft);
}
.code .cm { color: var(--ink-soft); font-style: italic; }
.copy {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  font: 700 0.75rem var(--font-display);
  color: var(--ink-soft);
  background: var(--card);
  border: 1.5px solid var(--hairline);
  border-radius: 999px;
  padding: 0.15em 0.7em;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.code:hover .copy, .copy:focus-visible { opacity: 1; }
@media (hover: none) { .copy { opacity: 1; } }

/* A document's header: the version, then each column in the colour its bytes
   get on the board, then the row count. */
.jj-ver, .jj-count { color: var(--ink-soft); }
.jj-col { border-radius: 4px; padding: 0 0.1em; }
.jj-col.c1 { background: var(--col-1); }
.jj-col.c2 { background: var(--col-2); }
.jj-col.c3 { background: var(--col-3); }
.jj-col.c4 { background: var(--col-4); }
.jj-col.c5 { background: var(--col-5); }
.jj-col.c6 { background: var(--col-6); }
.jj-hash, .jj-type { opacity: 0.75; }

/* --------------------------------------------------------- JSON versus jj -- */
.versus {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr));
  align-items: start;
}
.sheet {
  margin: 0;
  min-width: 0;
  background: var(--card);
  border: 3px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}
.sheet figcaption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  padding: 0.55rem 1rem;
  border-bottom: 3px solid var(--rule);
  background: var(--paper-alt);
  font-family: var(--font-display);
  font-weight: 800;
}
.sheet-jj figcaption { background: var(--go); color: var(--go-ink); }
.sheet .count { font-family: var(--font-mono); font-weight: 400; font-size: var(--step--1); }
.sheet .code { border: 0; border-radius: 0; background: transparent; }
.sheet .code[data-lang="json"] pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.sheet .code-lang { display: none; }

/* --------------------------------------------------------------- the board -- */
.grid-intro { display: grid; gap: 0.5rem; margin-top: 1.5rem; max-width: 46rem; }
.board {
  --cell: 1.65rem;
  background: var(--card);
  border: 3px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--drop);
  padding: clamp(0.9rem, 2.5vw, 1.4rem);
  display: grid;
  gap: 1rem;
  min-width: 0;
}
.board-fallback { color: var(--ink-soft); }
.board-scroll { overflow-x: auto; padding-bottom: 0.4rem; }
.board-rows { display: grid; gap: 6px; width: max-content; }
.byte-row { display: flex; align-items: stretch; gap: 6px; }
.row-label {
  width: 5.2rem;
  flex: none;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.25;
  color: var(--ink-soft);
  display: grid;
  align-content: center;
}
.row-label b { color: var(--ink); font-weight: 600; }
.legend-cell {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.2;
  padding: 0.25rem 0.35rem;
  border-radius: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.legend-cell b { font-weight: 600; }
.field {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--cell);
  gap: 2px;
  padding: 3px;
  margin: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.field:hover { border-color: var(--hairline); }
.field.same-col { border-color: var(--hairline); border-style: dashed; }
.field[aria-pressed="true"] { border-color: var(--rule); border-style: solid; background: var(--paper-alt); }
.tile {
  height: calc(var(--cell) * 1.25);
  display: grid;
  place-items: center;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--tile, var(--col-1));
}
.tile.wide { grid-column: span 2; }
.tile.wide3 { grid-column: span 3; }
.tile.wide4 { grid-column: span 4; }
.tile.z { background: var(--chili-bg); }
.tile.after { opacity: 0.45; }
.tile.nl {
  width: var(--cell);
  background: transparent;
  border: 2px dashed var(--hairline);
  color: var(--ink-soft);
  align-self: center;
}
.c1 { --tile: var(--col-1); } .c2 { --tile: var(--col-2); } .c3 { --tile: var(--col-3); }
.c4 { --tile: var(--col-4); } .c5 { --tile: var(--col-5); } .c6 { --tile: var(--col-6); }
.legend-cell.c1, .legend-cell.c2, .legend-cell.c3, .legend-cell.c4, .legend-cell.c5, .legend-cell.c6 { background: var(--tile); }
.board-caption {
  border-top: 2px dashed var(--hairline);
  padding-top: 0.9rem;
  display: grid;
  gap: 0.45rem;
  min-height: 7.5rem;
}
.board-sum {
  font-family: var(--font-mono);
  font-size: clamp(0.95rem, 0.85rem + 0.5vw, 1.15rem);
  overflow-wrap: anywhere;
}
.board-sum b { color: var(--eyebrow); font-weight: 600; }
.board-call { font-family: var(--font-mono); font-size: 0.92rem; overflow-wrap: anywhere; }
.board-call .arrow { color: var(--ink-soft); padding-inline: 0.4em; }
.board-note { color: var(--ink-soft); max-width: 50rem; }

/* ---------------------------------------------------------- how it works -- */
.steps {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
}
.step {
  background: var(--card);
  border: 2px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.25rem 1.3rem 1.4rem;
  display: grid;
  gap: 0.6rem;
  align-content: start;
}
.step h3 { color: var(--ink); }
.types-title { margin-top: 1rem; }
.types {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.types li {
  background: var(--card);
  border: 2px solid var(--rule);
  border-radius: 999px;
  padding: 0.2rem 0.85rem 0.2rem 0.3rem;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.types li code {
  background: var(--go);
  color: var(--go-ink);
  border: 0;
  border-radius: 999px;
  font-weight: 600;
  min-width: 1.8em;
  text-align: center;
  padding: 0.05em 0.45em;
}

/* ----------------------------------------------------------------- heat -- */
.heat {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  align-items: start;
}
.heat-card {
  background: var(--card);
  border: 3px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: 5px 5px 0 var(--drop);
  overflow: hidden;
}
.heat-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 1.1rem;
  border-bottom: 3px solid var(--rule);
}
.heat-hot header { background: var(--heat-hot); color: #fff8e8; }
.heat-mild header { background: var(--heat-mild); color: var(--ink); }
.heat-not header { background: var(--heat-not); color: var(--ink); }
.heat-card h3 { font-size: 1.45rem; font-weight: 900; }
.heat-card ul { padding: 1rem 1.2rem 1.2rem 2.3rem; display: grid; gap: 0.7rem; }
.heat-card li::marker { color: var(--ink-soft); }
.chilis { display: inline-flex; gap: 0.2rem; }
.chilis i {
  width: 1.7rem;
  height: 1.7rem;
  background: var(--chili);
  -webkit-mask: var(--chili-shape) center / contain no-repeat;
  mask: var(--chili-shape) center / contain no-repeat;
}
.heat-hot .chilis i { background: #fff8e8; }
.chilis i.off { opacity: 0.25; background: var(--ink); }
:root {
  --chili-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14.6 2.2c-.5 1.2-.4 2.4.3 3.4l-1.4.4C12 6.6 11 7.6 10.5 9c-.9 2.5-.3 5.4-2.1 7.7-1.1 1.4-2.8 2.4-5 3 2.7 1.8 6.6 1.9 9.8.2 3.5-1.9 5.8-5.6 5.9-9.4 0-1.7-.5-3.2-1.6-4.2l.9-1.3-1.4-.5c-.8-.9-1-1.9-.8-2.9z'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------- tabs -- */
.tabs { display: grid; gap: 1rem; min-width: 0; }
.tablist { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tablist [role="tab"] {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.98rem;
  color: var(--ink);
  background: var(--card);
  border: 2px solid var(--rule);
  border-radius: 999px;
  padding: 0.3em 1em;
  cursor: pointer;
}
.tablist [role="tab"][aria-selected="true"] { background: var(--ink); color: var(--paper); }
.tab-panel { display: grid; gap: 1rem; min-width: 0; }
.provenance { font-size: var(--step--1); color: var(--ink-soft); max-width: 52rem; }

/* --------------------------------------------------------------- tables -- */
.table-wrap {
  overflow-x: auto;
  background: var(--card);
  border: 2px solid var(--rule);
  border-radius: 12px;
  min-width: 0;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.93rem;
  font-variant-numeric: tabular-nums;
}
th, td { padding: 0.45rem 0.75rem; text-align: left; vertical-align: top; }
th {
  font-family: var(--font-display);
  font-weight: 800;
  background: var(--paper-alt);
  border-bottom: 2px solid var(--rule);
  white-space: nowrap;
}
td { border-top: 1px solid var(--hairline); }
tbody tr.cont td { border-top-color: transparent; }
tbody tr.cont td:first-child { border-top: 0; }
th.num, td.num { text-align: right; white-space: nowrap; }
td strong { font-weight: 700; }
td.faster strong, td.smaller {
  background: var(--win-bg);
  color: var(--win-ink);
  border-radius: 999px;
  padding: 0.1em 0.6em;
  font-weight: 700;
}
td.smaller { background: none; padding: 0.45rem 0.75rem; }
td.slower { color: var(--lose-ink); }
td.slower:not(:empty) { font-weight: 600; }
td.same { color: var(--ink-soft); }

/* ----------------------------------------------------------- doc pages -- */
.doc-page {
  padding-inline: var(--gutter);
  padding-block: clamp(2rem, 5vw, 3.5rem) clamp(3rem, 7vw, 5rem);
  display: grid;
  gap: 2rem;
}
.doc-page.has-toc { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 68rem) {
  .doc-page.has-toc { grid-template-columns: 13.5rem minmax(0, 1fr); gap: 3rem; }
  .toc { position: sticky; top: 1.25rem; align-self: start; max-height: calc(100vh - 2.5rem); overflow-y: auto; }
}
.toc {
  background: var(--card);
  border: 2px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  font-size: 0.92rem;
}
.toc-title { font-family: var(--font-display); font-weight: 800; margin-bottom: 0.4rem; }
.toc ol { list-style: none; padding: 0; display: grid; gap: 0.15rem; }
.toc a { color: var(--ink); text-decoration: none; display: block; padding: 0.15rem 0.4rem; border-radius: 6px; }
.toc a:hover { background: var(--paper-alt); }
@media (max-width: 67.99rem) {
  .toc ol { grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr)); }
}

.prose { max-width: 50rem; min-width: 0; display: grid; gap: 1rem; align-content: start; }
.prose > h1 { font-size: var(--step-3); font-weight: 900; letter-spacing: -0.02em; margin-bottom: 0.25rem; }
.prose > h2 { margin-top: 1.75rem; padding-top: 0.25rem; scroll-margin-top: 1rem; }
.prose > h3 { margin-top: 0.75rem; scroll-margin-top: 1rem; }
.prose > ul { display: grid; gap: 0.4rem; }
.prose blockquote {
  margin: 0;
  background: var(--paper-alt);
  border: 2px solid var(--rule);
  border-left-width: 8px;
  border-left-color: var(--sun-b);
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
  display: grid;
  gap: 0.6rem;
}
.prose .table-wrap { margin-block: 0.25rem; }
.prose .code { margin-block: 0.4rem; }

/* ------------------------------------------------------------ page head -- */
.page-head { padding-inline: var(--gutter); padding-block: clamp(2rem, 5vw, 3.25rem) 0; }
.page-head .wrap { display: grid; gap: 1rem; }
.page-head h1 { font-size: var(--step-3); font-weight: 900; letter-spacing: -0.02em; }

/* ----------------------------------------------------------- playground -- */
.play { padding-top: 1.75rem; }
.play-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem 1.5rem; }
.samples { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.samples-label { font-family: var(--font-display); font-weight: 800; margin-right: 0.25rem; }
.chip {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--ink);
  background: var(--card);
  border: 2px solid var(--rule);
  border-radius: 999px;
  padding: 0.25em 0.9em;
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--sun-b); }
.panes {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
}
.pane { display: grid; gap: 0.5rem; align-content: start; min-width: 0; }
.pane-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.pane-title { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; }
.pane-hint { font-family: var(--font-body); font-weight: 400; color: var(--ink-soft); font-size: var(--step--1); margin-left: 0.35rem; }
.editor {
  width: 100%;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--code-bg);
  border: 2px solid var(--rule);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  margin: 0;
  tab-size: 2;
}
textarea.editor { resize: vertical; min-height: 26rem; display: block; }
.editor-header { min-height: 3.6rem !important; }
.output { min-height: 16rem; max-height: 32rem; overflow: auto; white-space: pre; }
.link-btn {
  font: 700 0.88rem var(--font-display);
  color: var(--link);
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
  cursor: pointer;
}
.verdict {
  font-family: var(--font-display);
  font-weight: 800;
  border: 2px solid var(--rule);
  border-radius: 14px;
  padding: 0.65rem 1rem;
  background: var(--win-bg);
  color: var(--win-ink);
}
.verdict.bad { background: var(--chili-bg); color: var(--chili); }
.verdict .detail { display: block; font-family: var(--font-body); font-weight: 400; color: var(--ink); margin-top: 0.2rem; }
.verdict:empty { display: none; }
.stats {
  margin: 0;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
}
.stats > div {
  background: var(--card);
  border: 2px solid var(--rule);
  border-radius: 14px;
  padding: 0.7rem 0.95rem;
  display: grid;
  gap: 0.15rem;
  align-content: start;
}
.stats dt { font-family: var(--font-display); font-weight: 800; font-size: 0.85rem; color: var(--ink-soft); }
.stats dd { margin: 0; font-variant-numeric: tabular-nums; }
.stats .big { font-family: var(--font-display); font-weight: 900; font-size: 1.45rem; line-height: 1.2; }
.stats .win { color: var(--win-ink); }
.stats .lose { color: var(--lose-ink); }
.stats .note { font-size: var(--step--1); color: var(--ink-soft); }
.probe {
  background: var(--card);
  border: 2px solid var(--rule);
  border-radius: var(--radius);
  padding: 1rem 1.2rem 1.2rem;
  display: grid;
  gap: 0.75rem;
}
.probe h2 { font-size: var(--step-1); }
.probe-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.probe-form label { font-family: var(--font-display); font-weight: 800; }
.probe-form input, .probe-form select {
  font: 1rem var(--font-mono);
  color: var(--ink);
  background: var(--code-bg);
  border: 2px solid var(--rule);
  border-radius: 10px;
  padding: 0.3rem 0.5rem;
}
.probe-form input { width: 7rem; }
.probe-out { display: grid; gap: 0.35rem; }

/* --------------------------------------------------------------- footer -- */
.foot {
  background: var(--foot-bg);
  color: var(--foot-ink);
  padding-inline: var(--gutter);
  padding-block: 2.5rem;
  border-top: 3px solid var(--rule);
}
.foot-in { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.foot-badge { border-radius: 50%; border: 3px solid var(--foot-ink); rotate: -8deg; }
.foot-text { display: grid; gap: 0.35rem; min-width: 0; flex: 1 1 18rem; }
.foot-ja { font-family: var(--font-display); font-weight: 900; font-size: 1.35rem; letter-spacing: 0.04em; }
.foot p { color: var(--foot-soft); }
.foot .foot-ja { color: var(--foot-ink); }
.foot-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.foot-nav a { color: var(--foot-ink); font-weight: 700; }

/* --------------------------------------------------------------- get it -- */
.get-title { margin-top: 1.25rem; }
.get {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}
.get-card {
  background: var(--card);
  border: 2px solid var(--rule);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  display: grid;
  gap: 0.2rem;
  align-content: start;
}
.get-lang { font-family: var(--font-display); font-weight: 800; font-size: 0.85rem; color: var(--eyebrow); letter-spacing: 0.04em; }
.get-card > a { font-family: var(--font-mono); font-weight: 600; font-size: 1.05rem; overflow-wrap: anywhere; }
.get-size { font-size: var(--step--1); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.get-card p { margin-top: 0.4rem; font-size: 0.95rem; }

@media (prefers-reduced-motion: reduce) {
  .hero::before { animation: none; }
  *, *::before, *::after { transition: none !important; }
}
