/* ==========================================================================
   TWMI-Bench — site stylesheet
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --bg-tint: #eef2f9;
  --ink: #101828;
  --ink-2: #344054;
  --ink-3: #667085;
  --ink-4: #98a2b3;
  --line: #e4e7ec;
  --line-2: #d0d5dd;

  --brand: #1d4ed8;
  --brand-dark: #1e3a8a;
  --brand-soft: #e8effd;
  --accent: #0f9d8f;
  --accent-soft: #e3f5f2;
  --warn: #b45309;
  --warn-soft: #fdf3e4;
  --rose: #b42318;
  --rose-soft: #fdecea;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, .07), 0 2px 4px rgba(16, 24, 40, .04);
  --shadow-lg: 0 18px 40px rgba(16, 24, 40, .10);

  --radius: 12px;
  --radius-sm: 8px;
  --maxw: 1120px;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.25; margin: 0; font-weight: 700; letter-spacing: -.01em; }

.container { max-width: var(--maxw); margin: 0 auto; padding-inline: 24px; }
.container--wide { max-width: 1320px; }

/* ------------------------------------------------------------------ nav --- */

.nav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav__inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav__brand {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -.02em;
  color: var(--ink);
  white-space: nowrap;
}
.nav__brand:hover { text-decoration: none; }
.nav__brand span { color: var(--brand); }

.nav__links {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-left: auto;
}
.nav__links::-webkit-scrollbar { display: none; }

.nav__links a {
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
}
.nav__links a:hover { background: var(--bg-tint); color: var(--brand-dark); text-decoration: none; }

/* ----------------------------------------------------------------- hero --- */

.hero {
  padding: 66px 0 34px;
  background:
    radial-gradient(900px 380px at 12% -10%, rgba(29, 78, 216, .10), transparent 62%),
    radial-gradient(760px 340px at 88% 0%, rgba(15, 157, 143, .10), transparent 60%),
    linear-gradient(180deg, #fbfcfe 0%, #ffffff 100%);
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.hero h1 {
  font-size: clamp(34px, 5.4vw, 56px);
  font-weight: 800;
  letter-spacing: -.035em;
  margin-bottom: 14px;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--brand) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__sub {
  font-size: clamp(16px, 2vw, 19px);
  color: var(--ink-2);
  max-width: 880px;
  margin: 0 auto 26px;
  text-wrap: pretty;
}

.authors {
  font-size: 15.5px;
  color: var(--ink-2);
  max-width: 900px;
  margin: 0 auto 8px;
}
.authors__line { display: block; }
.authors a { color: var(--ink-2); border-bottom: 1px solid var(--line-2); }
.authors a:hover { color: var(--brand); text-decoration: none; border-color: var(--brand); }
.authors sup { color: var(--brand); font-weight: 700; margin-left: 1px; }
.authors .sep { color: var(--ink-4); }

.affils {
  font-size: 14.5px;
  color: var(--ink-3);
  margin: 10px auto 6px;
  max-width: 900px;
}
.affils sup { color: var(--brand); font-weight: 700; }

.author-note { font-size: 13px; color: var(--ink-4); margin-bottom: 26px; }

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-md); background: #000; }
.btn--ghost { background: #fff; color: var(--ink); border-color: var(--line-2); }
.btn--ghost:hover { background: var(--bg-soft); border-color: var(--ink-3); }
.btn--disabled { opacity: .55; cursor: not-allowed; }
.btn--disabled:hover { transform: none; box-shadow: none; }

/* ---------------------------------------------------------------- stats --- */

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 40px;
  text-align: center;
}

.hero-stats div { background: #fff; padding: 18px 12px; }
.hero-stats b { display: block; font-size: 27px; font-weight: 800; letter-spacing: -.03em; color: var(--ink); }
.hero-stats span { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }

/* -------------------------------------------------------------- section --- */

.section { padding: 66px 0; }
.section--soft { background: var(--bg-soft); border-block: 1px solid var(--line); }

.section__head { margin-bottom: 30px; }
.section__head--center { text-align: center; }

/* The kicker carries the section name at display size; the sentence beneath it
   is the supporting line, so the usual weighting is inverted here. */
.kicker {
  font-size: clamp(23px, 3.2vw, 32px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.028em;
  text-transform: none;
  color: var(--brand);
  margin-bottom: 7px;
}

.section h2 {
  font-size: 18.5px;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: -.012em;
  color: var(--ink);
  margin-bottom: 11px;
}

.section__lead {
  font-size: 16.5px;
  color: var(--ink-2);
  max-width: 820px;
}
.section__head--center .section__lead { margin-inline: auto; }

h3.subhead {
  font-size: 19px;
  margin: 40px 0 14px;
  letter-spacing: -.02em;
}
h3.subhead:first-child { margin-top: 0; }

p { margin: 0 0 14px; }
.muted { color: var(--ink-3); }
.small { font-size: 14px; }

/* ---------------------------------------------------------------- cards --- */

.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }
.grid--tools { grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid--tools { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Two figures side by side, each held to its own aspect ratio rather than
   stretched to the full column width. */
/* The two columns are sized by the aspect ratios of the figures they hold
   (1432x1251 and 1011x1327), so the pair fills the row while both images end
   up at the same rendered height. */
.figure-row {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 22px;
  margin-top: 26px;
}
@media (min-width: 860px) {
  /* The two figures share the row in proportion to their own aspect ratios, so
     both render at the same height. Each card adds 34px of its own padding and
     border, so the split is computed on the image area alone; the fixed chrome
     is added back per column to keep the ratio exact. */
  .figure-row {
    --fig-chrome: 34px;
    --fig-space: calc(100% - 22px - 2 * var(--fig-chrome));
    grid-template-columns:
      calc(var(--fig-space) * 0.6004 + var(--fig-chrome))
      calc(var(--fig-space) * 0.3996 + var(--fig-chrome));
  }
}
.figure-row .figure--tight { margin: 0; min-width: 0; }
.figure-row .figure--tight img {
  width: 100%;
  height: auto;
  margin: 0 auto;
  display: block;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.card h3 { font-size: 16.5px; margin-bottom: 8px; }
.card p { font-size: 14.5px; color: var(--ink-2); margin: 0; }
.card--flat { box-shadow: none; }
.card--brand { border-color: #cbd9f8; background: linear-gradient(180deg, #f8fbff 0%, #fff 100%); }
.card--accent { border-color: #b9e6e0; background: linear-gradient(180deg, #f4fdfb 0%, #fff 100%); }

/* Collapsible card: the summary is the card's first line, the body follows. */
.card--fold { padding: 0; }
.card--fold > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  cursor: pointer;
  list-style: none;
  border-radius: var(--radius);
}
.card--fold > summary::-webkit-details-marker { display: none; }
.card--fold > summary h3 { margin-bottom: 0; }
.card--fold > summary::after {
  content: "\25be";
  margin-left: auto;
  color: var(--ink-3);
  font-size: 19px;
  line-height: 1;
  /* The bare glyph is drawn thin at this size; the shadow thickens the edges
     so it reads as a control rather than a stray character. */
  text-shadow: 0 0 .6px currentColor, 0 0 .6px currentColor;
  transition: transform .2s ease, color .2s ease;
}
.card--fold > summary:hover::after { color: var(--brand); }
.card--fold[open] > summary::after { transform: rotate(180deg); }
.card--fold > summary:hover { background: var(--bg-soft); }
.card--fold > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.card__body { padding: 0 22px 20px; }
.card__body > p:first-child { margin-top: 0; }

.card__icon {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 17px;
  margin-bottom: 12px;
}

.tagrow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-tint);
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.tag--brand { background: var(--brand-soft); color: var(--brand-dark); border-color: #cbd9f8; }
.tag--accent { background: var(--accent-soft); color: #0a6f65; border-color: #b9e6e0; }

/* The tool inventories are long. The first rows stay legible while the rest
   fade out, so the card keeps its size until the reader opens it. */
.toolfold { display: block; }
.toolfold__toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 3px 2px;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--brand);
  cursor: pointer;
  border-radius: 6px;
}
.toolfold__toggle:hover .toolfold__label { text-decoration: underline; }
.toolfold__toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.card--accent .toolfold__toggle { color: #0a6f65; }
.toolfold__chev {
  width: 7px; height: 7px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform .18s ease;
}
.toolfold.is-open .toolfold__chev { transform: rotate(225deg) translate(-1px, -1px); }
.toolfold.is-open .toolfold__label::after { content: ' — collapse'; font-weight: 500; opacity: .6; }

/* Collapsed: the first rows stay legible and the rest fade out, so the card
   shows what it is hiding. */
.toolfold__body {
  max-height: 74px;
  overflow: hidden;
  transition: max-height .3s cubic-bezier(.22, .8, .28, 1);
  -webkit-mask-image: linear-gradient(180deg, #000 0, #000 34%, rgba(0, 0, 0, .3) 74%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0, #000 34%, rgba(0, 0, 0, .3) 74%, transparent 100%);
}
.toolfold.is-open .toolfold__body {
  max-height: var(--toolfold-h, 1000px);
  -webkit-mask-image: none;
  mask-image: none;
}
.toolfold__body .tagrow { margin-top: 0; }
.tag--warn { background: var(--warn-soft); color: var(--warn); border-color: #f3ddb8; }
.tag--rose { background: var(--rose-soft); color: var(--rose); border-color: #f7cdc8; }

/* --------------------------------------------------------------- figure --- */

.figure {
  margin: 26px 0 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.figure img { border-radius: 6px; width: 100%; }
.figure img[data-zoom] { cursor: zoom-in; }
.figure figcaption {
  font-size: 13.5px;
  color: var(--ink-3);
  margin-top: 12px;
  line-height: 1.6;
}
.figure figcaption b { color: var(--ink-2); }

/* ---------------------------------------------------------- chart (bars) -- */

.chart { margin: 0; }
.chart__row {
  display: grid;
  grid-template-columns: 130px 1fr 58px;
  align-items: center;
  gap: 12px;
  padding: 5px 0;
  border-bottom: 1px dashed rgba(0, 0, 0, .05);
}
.chart__row:last-child { border-bottom: 0; }
.chart__label { font-size: 13px; font-weight: 600; color: var(--ink-2); text-align: right; }
.chart__track { background: var(--bg-tint); border-radius: 5px; height: 20px; overflow: hidden; }
.chart__bar {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--brand) 0%, #4f7ff0 100%);
  width: 0;
  transition: width .8s cubic-bezier(.22, .8, .28, 1);
}
.chart__val { font-size: 13px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.chart__row[data-tone="accent"] .chart__bar { background: linear-gradient(90deg, #0d8b7f 0%, #35b8a9 100%); }
.chart__row[data-tone="warn"] .chart__bar { background: linear-gradient(90deg, #a85d06 0%, #e0a23c 100%); }
.chart__row[data-tone="rose"] .chart__bar { background: linear-gradient(90deg, #9f1f16 0%, #dd6a5f 100%); }

.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--ink-3); margin-top: 14px; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ------------------------------------------------------------ protocols --- */

.proto {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.proto__head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-soft);
}
.proto__head b { font-size: 15.5px; letter-spacing: -.01em; }
.proto__head .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); }
.proto:has(.dot--a) .dot { background: var(--accent); }
.proto__body { padding: 16px 18px; }
.proto__body p { font-size: 14.5px; color: var(--ink-2); margin: 0 0 10px; }
.proto__body p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------- pipeline --- */

.pipeline { display: grid; gap: 14px; }
@media (min-width: 860px) { .pipeline { grid-template-columns: repeat(3, 1fr); } }

.pipe {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 20px 20px 18px;
  box-shadow: var(--shadow-sm);
}
.pipe--b { border-left-color: var(--accent); }
.pipe--c { border-left-color: #c2740c; }
.pipe__step {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 6px;
}
.pipe h4 { font-size: 16.5px; margin-bottom: 8px; }
.pipe p { font-size: 14px; color: var(--ink-2); margin: 0; }
.pipe ul { margin: 10px 0 0; padding-left: 18px; }
.pipe li { font-size: 14px; color: var(--ink-2); margin-bottom: 4px; }

.flow {
  display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px;
  margin: 22px 0 0;
}
.flow__node {
  flex: 1 1 190px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.flow__node b { display: block; font-size: 14.5px; margin-bottom: 4px; }
.flow__node span { font-size: 13.5px; color: var(--ink-3); }
.flow__arrow { display: grid; place-items: center; color: var(--ink-4); font-size: 18px; }
@media (max-width: 780px) { .flow__arrow { transform: rotate(90deg); } }

/* ----------------------------------------------------------------- table -- */

.tablewrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}

table.data {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  min-width: 720px;
  font-size: 13.5px;
}
table.data th, table.data td {
  padding: 9px 10px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
table.data thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-soft);
  font-weight: 700;
  font-size: 12.5px;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line-2);
}
table.data thead tr:first-child th { top: 0; }
table.data th:first-child, table.data td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 1;
  box-shadow: 1px 0 0 var(--line);
}
table.data thead th:first-child { background: var(--bg-soft); z-index: 3; }
table.data tbody tr:hover td { background: #fafcff; }
table.data tbody tr:hover td:first-child { background: #fafcff; }

table.data .group td {
  background: var(--bg-tint);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: left;
}
table.data .sysname { font-weight: 600; color: var(--ink); }
table.data .best { font-weight: 800; color: var(--brand-dark); }
table.data .overall { font-weight: 800; background: #f5f8ff; }
table.data tbody tr:hover td.overall { background: #e9f0ff; }
table.data .proto-cell { color: var(--ink-3); font-size: 12.5px; }

.table-note { font-size: 13px; color: var(--ink-3); margin-top: 12px; line-height: 1.6; }

/* --------------------------------------------------------------- tabs ----- */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.tab {
  border: 1px solid var(--line-2);
  background: #fff;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s ease;
}
.tab:hover { border-color: var(--ink-3); }
.tab[aria-selected="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* -------------------------------------------------------------- gallery --- */

.gallery {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.gallery__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}
.gallery__info { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.gallery__cat {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.01em;
}
.gallery__count {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.gallery__nav { display: flex; gap: 8px; }
.gallery__btn {
  width: 36px; height: 36px;
  border: 1px solid var(--line-2);
  background: #fff;
  border-radius: 50%;
  color: var(--ink-2);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  display: grid;
  place-items: center;
  transition: all .15s ease;
}
.gallery__btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

.gallery__viewport { overflow: hidden; height: 0; }
.gallery__track {
  display: flex;
  align-items: flex-start;
  transition: transform .42s cubic-bezier(.22, .8, .28, 1);
}
.gallery__slide {
  flex: 0 0 100%;
  min-width: 0;
}
.gallery__slide .example {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.gallery__dots {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: center;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
}
.gallery__dot {
  width: 9px; height: 9px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--line-2);
  cursor: pointer;
  transition: all .18s ease;
}
.gallery__dot:hover { background: var(--ink-3); }
.gallery__dot[aria-selected="true"] { background: var(--brand); transform: scale(1.45); }

.example__subhead {
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 8px;
}

/* ------------------------------------------------------------- examples --- */

.example {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 20px;
}.example__head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}
.example__head b { font-size: 15.5px; }
.example__head .id { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); }
.example__body { padding: 20px; }

.example__images {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}
.example__images figure {
  margin: 0;
  flex: 1 1 180px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
}
.example__images img {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfbfc;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  object-fit: contain;
  cursor: zoom-in;
}
.example__images figcaption {
  flex: 0 0 auto;
  font-size: 12.5px;
  color: var(--ink-3);
  text-align: center;
  margin-top: 8px;
}

.qa {
  border: 1px solid #cbd9f8;
  background: linear-gradient(180deg, #f8fbff, #fff);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.qa p { margin: 0 0 8px; font-size: 15px; }
.qa p:last-child { margin-bottom: 0; }
.qa .lbl {
  font-weight: 700;
  color: var(--brand-dark);
  margin-right: 8px;
}
.qa .ans { font-weight: 700; color: var(--accent); }

.trace {
  counter-reset: step;
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
}
.trace li {
  counter-increment: step;
  position: relative;
  padding: 8px 0 8px 38px;
  font-size: 14.5px;
  color: var(--ink-2);
  border-bottom: 1px dashed var(--line);
}
.trace li:last-child { border-bottom: 0; }
.trace li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 8px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 11.5px;
  font-weight: 800;
  display: grid; place-items: center;
}
.trace code { font-family: var(--font-mono); font-size: 13px; color: var(--ink); background: var(--bg-tint); padding: 1px 5px; border-radius: 4px; }

.note {
  border-left: 3px solid var(--line-2);
  padding: 4px 0 4px 14px;
  font-size: 14px;
  color: var(--ink-3);
  margin: 0;
}
.note b { color: var(--ink-2); }

/* ---------------------------------------------------------------- bibtex --- */

pre.bibtex {
  background: #0f172a;
  color: #e2e8f0;
  padding: 22px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  margin: 0;
}
pre.bibtex .k { color: #7dd3fc; }
pre.bibtex .s { color: #a5f3c5; }

/* ------------------------------------------------------------- foldable --- */

.fold {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
  margin-top: 26px;
}
.fold > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
  border-radius: var(--radius);
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after {
  content: "▾";
  margin-left: auto;
  color: var(--ink-3);
  font-size: 18px;
  line-height: 1;
  text-shadow: 0 0 .6px currentColor, 0 0 .6px currentColor;
  transition: transform .2s ease, color .2s ease;
}
.fold > summary:hover::after { color: var(--brand); }
.fold[open] > summary::after { transform: rotate(180deg); }
.fold > summary:hover { background: var(--bg-soft); }
.fold > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.fold__title { font-size: 17px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.fold__hint { font-size: 13px; color: var(--ink-3); }
.fold[open] .fold__hint { display: none; }
.fold__body { padding: 0 20px 20px; }
.fold__body .tablewrap { margin-top: 0; }

/* ---------------------------------------------------------------- radar --- */

.radar {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 26px;
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
}
.radar__head { margin-bottom: 2px; }
.radar__head h3 { font-size: 17px; letter-spacing: -.02em; margin-bottom: 0; }

.radar__body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px 22px;
  margin-top: 6px;
}
.radar__chart { flex: 1 1 380px; min-width: 0; max-width: 500px; }
.radar__chart svg { display: block; width: 100%; height: auto; overflow: visible; }

.radar__legend {
  flex: 0 1 196px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.radar__legend-hint {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 0 8px 5px;
}
.radar__legend-item {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  background: none;
  padding: 5px 8px;
  border-radius: 6px;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink-2);
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, opacity .15s ease;
}
/* The swatch doubles as a checkbox: hollow when the model is not pinned. */
.radar__legend-item i {
  flex: 0 0 auto;
  width: 11px; height: 11px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px currentColor;
  background: transparent !important;
}
.radar__legend-item.is-on i { background: currentColor !important; }
.radar__legend-item.is-on { color: var(--ink); font-weight: 650; }
.radar__legend-item span { min-width: 0; }
.radar__legend-item:hover { background: var(--bg-tint); }
.radar__legend-item.is-dim { opacity: .34; }

table.data tbody tr.is-dim { opacity: .32; }
table.data tbody tr { transition: opacity .15s ease; }

/* --------------------------------------------------------------- footer --- */

.footer {
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  padding: 34px 0;
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-3);
}
.footer p { margin: 0 0 6px; }

/* ---------------------------------------------------------------- lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(9, 14, 26, .88);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  cursor: zoom-out;
}
.lightbox[data-open="true"] { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: var(--shadow-lg); }

/* ----------------------------------------------------------------- misc --- */

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .chart__bar { transition: none; }
  html { scroll-behavior: auto; }
}

.callout {
  border: 1px solid #cbd9f8;
  background: linear-gradient(180deg, #f8fbff, #fff);
  border-radius: var(--radius);
  padding: 20px 22px;
  font-size: 15px;
  color: var(--ink-2);
}
.callout b { color: var(--brand-dark); }

.hr { height: 1px; background: var(--line); border: 0; margin: 36px 0; }

ul.ticks { list-style: none; padding: 0; margin: 0; }
ul.ticks li {
  position: relative;
  padding-left: 26px;
  font-size: 15px;
  color: var(--ink-2);
  margin-bottom: 9px;
}
ul.ticks li::before {
  content: "";
  position: absolute;
  left: 4px; top: 9px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
ul.ticks li b { color: var(--ink); }

@media (max-width: 640px) {
  .container { padding-inline: 18px; }
  .section { padding: 48px 0; }
  .hero { padding: 40px 0 26px; }
  .chart__row { grid-template-columns: 96px 1fr 50px; gap: 8px; }
  .chart__label { font-size: 12px; }
  .example__body { padding: 16px; }
}
