:root {
  color-scheme: light dark;
  --canvas: #f5f7fa;
  --paper: #fff;
  --ink: #162637;
  --muted: #536579;
  --line: #d9e2eb;
  --rule: #e7edf3;
  --band: #ebf1f7;
  --accent: #0d685f;
  --accent-tint: #e6f3f0;
  --alt: #fafcfe;
  --ours: #eef8f4;
  --hover: #eef3f8;
  --focus: #226da7;
  --model-width: 13.4rem;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #111821;
    --paper: #17212d;
    --ink: #edf3f9;
    --muted: #b1c2d4;
    --line: #36495d;
    --rule: #293b4d;
    --band: #213244;
    --accent: #8bdcc6;
    --accent-tint: #1d3e3b;
    --alt: #1a2532;
    --ours: #1b352f;
    --hover: #263a4e;
    --focus: #8ac6f9;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-size: .92rem; line-height: 1.55; }
a { color: var(--accent); text-underline-offset: .2em; }
button, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.shell { width: min(100% - 4rem, 91rem); margin-inline: auto; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.site-header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 3.7rem; gap: 1rem; }
.wordmark { color: var(--ink); text-decoration: none; font-size: 1.1rem; font-weight: 750; letter-spacing: -.03em; }
.site-header nav { display: flex; align-items: center; gap: 1.5rem; }
.site-header nav a { color: var(--muted); text-decoration: none; font-size: .85rem; font-weight: 650; }
.site-header nav a:hover { color: var(--ink); text-decoration: underline; }

.intro { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .8rem 1.5rem; padding-block: 2.75rem 1.8rem; }
.intro h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.15rem, 4.8vw, 3.4rem);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -.045em;
}
.intro p { margin: .65rem 0 0; color: var(--muted); }
.download { display: inline-flex; align-items: center; gap: .65rem; color: var(--accent); font-weight: 700; font-size: .86rem; text-decoration: none; }
.download:hover { text-decoration: underline; }

.results { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .7rem 1rem; padding: .85rem 1rem; }
.dimensions { display: flex; flex-wrap: wrap; gap: .3rem; }
.dimensions button {
  min-height: 2.15rem;
  padding: .35rem .65rem;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: .825rem;
  font-weight: 650;
}
.dimensions button:hover { background: var(--hover); color: var(--ink); }
.dimensions button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-tint); color: var(--accent); }
.benchmark select { width: 10.6rem; min-height: 2.15rem; padding: .3rem .5rem; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); font-size: .825rem; }
.status { margin: 0; padding: 1rem; color: var(--muted); }

.table-frame { max-width: 100%; overflow-x: auto; border-block: 1px solid var(--line); }
.table-frame:focus-visible { outline-offset: -3px; }
table { width: max-content; min-width: 100%; border-spacing: 0; text-align: left; font-size: .8125rem; font-variant-numeric: tabular-nums; }
thead { background: var(--band); }
thead th { font-weight: 700; white-space: nowrap; }
.group { padding: .5rem .65rem .42rem; border-bottom: 1px solid var(--line); color: var(--ink); text-align: left; }
.subgroup { padding: .32rem .65rem .04rem; color: var(--muted); font-size: .72rem; text-align: center; }
.metric { min-width: 4.6rem; }
.metric button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  width: 100%;
  min-height: 1.85rem;
  padding: .1rem .4rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: .74rem;
  font-weight: 700;
}
.metric button:hover, .metric[aria-sort] button { background: var(--accent-tint); color: var(--accent); }
.metric button:focus-visible { outline-offset: -2px; }
.direction { color: var(--muted); font-size: .68rem; }
.group-start { border-left: 1px solid var(--line); }
.bench-start { border-left: 1px solid var(--rule); }
th.model { position: sticky; left: 0; z-index: 1; width: var(--model-width); min-width: var(--model-width); max-width: var(--model-width); border-right: 1px solid var(--line); text-align: left; }
thead .model { background: var(--band); }
th.model, .size { padding: .42rem .72rem; }
.size { text-align: center; white-space: nowrap; }
tbody tr { --row: var(--paper); }
tbody tr:nth-child(even) { --row: var(--alt); }
tbody tr:hover { --row: var(--hover); }
tbody tr.ours { --row: var(--ours); }
tbody th, tbody td { background: var(--row); border-top: 1px solid var(--rule); }
tbody th { line-height: 1.35; font-weight: 550; }
tbody td { padding: .45rem .66rem; text-align: right; }
tbody .size { color: var(--muted); }
.ours .model { padding-left: calc(.72rem - 3px); border-left: 3px solid var(--accent); color: var(--accent); font-weight: 750; }
.missing { color: var(--muted); }
ins { text-decoration-thickness: 1px; text-underline-offset: .16em; }

.table-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3rem 1rem; padding: .58rem 1rem; color: var(--muted); font-size: .78rem; }
.table-footer p { margin: 0; }
.legend { display: flex; flex-wrap: wrap; gap: .3rem .9rem; }
.legend strong, .legend ins { color: var(--ink); }
.notes { margin: 1.35rem 0 2.5rem; color: var(--muted); font-size: .82rem; }
.notes h2 { margin: 0 0 .4rem; color: var(--ink); font-size: .9rem; }
.notes p { margin: .4rem 0; }
.metric-definitions { display: flex; flex-wrap: wrap; gap: 0 1.2rem; }
.metric-definitions strong { margin-right: .24rem; color: var(--ink); }

@media (max-width: 640px) {
  :root { --model-width: 8.1rem; }
  .shell { width: calc(100% - 1.5rem); }
  .site-header-inner { min-height: 3.35rem; }
  .site-header nav { gap: .85rem; }
  .intro { padding-block: 1.55rem 1.2rem; }
  .controls { padding: .65rem; }
  .dimensions { gap: .14rem; }
  .dimensions button { padding-inline: .38rem; font-size: .77rem; }
  .benchmark select { min-height: 2.25rem; }
  .metric { min-width: 4rem; }
  th.model, .size, tbody td { padding-inline: .44rem; }
  .ours .model { padding-left: calc(.44rem - 3px); }
  .table-footer { padding-inline: .65rem; }
}

.case-studies { margin: 2.5rem 0 3.5rem; scroll-margin-top: 1.2rem; }
.cases-heading h2 {
  margin: 0 0 .75rem;
  font: 600 clamp(1.7rem, 3vw, 2.35rem)/1.15 Georgia, "Times New Roman", serif;
  letter-spacing: -.035em;
}
.case-jump { display: flex; flex-wrap: wrap; gap: .45rem; }
.case-jump a {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .15rem .65rem;
  padding: .45rem .72rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
}
.case-jump a:hover { border-color: var(--accent); }
.case-jump span { color: var(--accent); font-size: .78rem; }
.example-group { margin: 1.65rem 0 2rem; scroll-margin-top: 1.25rem; }
.group-heading { margin-bottom: .8rem; }
.group-heading h3 { margin: 0 0 .24rem; font-size: 1.25rem; letter-spacing: -.015em; }
.group-heading p, .case-credit { max-width: 58rem; margin: 0; color: var(--muted); }
.group-heading .score-note { margin-top: .38rem; font-size: .81rem; }
.case-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; align-items: start; }
.case-card {
  min-width: 0;
  padding: 1rem 1.05rem .85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  scroll-margin-top: 1.25rem;
  overflow-wrap: anywhere;
}
.case-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .35rem .85rem; margin-bottom: .7rem; }
.case-top h4 { margin: .1rem 0 0; font-size: 1.12rem; line-height: 1.3; }
.case-dimension { margin: 0; color: var(--accent); font-size: .8rem; font-weight: 700; }
.case-dimension span { color: var(--muted); font-weight: 550; }
.human-choice { display: inline-flex; align-items: center; gap: .48rem; color: var(--accent); background: var(--accent-tint); border-radius: 5px; padding: .28rem .52rem; font-size: .78rem; }
.human-choice strong { min-width: 1.35rem; text-align: center; background: var(--paper); border: 1px solid var(--line); border-radius: 3px; }
.case-content { display: grid; gap: .72rem; }
.case-videos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.case-clip { min-width: 0; margin: 0; }
.case-clip figcaption { margin: 0 0 .26rem; font-size: .8rem; color: var(--muted); }
.case-clip figcaption strong { display: inline-block; min-width: 1.32rem; margin-right: .25rem; text-align: center; color: var(--ink); background: var(--band); border-radius: 3px; }
.case-clip video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #111821; border-radius: 6px; }
.single-card .case-clip video { aspect-ratio: 2 / 1; }
.case-verdicts { min-width: 0; }
.single-card .case-verdicts { margin-top: .72rem; }
.case-verdicts table { width: 100%; min-width: 0; table-layout: fixed; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.case-verdicts th, .case-verdicts td { padding: .38rem .45rem; }
.case-verdicts thead th { white-space: normal; line-height: 1.2; }
.case-verdicts thead th:first-child { width: 43%; }
.single-card .case-verdicts thead th:first-child { width: 39%; }
.case-verdicts abbr { text-decoration: none; }
.case-verdicts thead th:not(:first-child), .case-verdicts td { text-align: center; }
.case-verdicts .ours th, .case-verdicts .agrees { color: var(--accent); font-weight: 700; }
.single-card .case-verdicts .ours td { color: var(--accent); font-weight: 700; }
.case-verdicts td span[aria-label] { color: var(--muted); }
.case-prompt { margin-top: .62rem; color: var(--muted); font-size: .83rem; }
.case-prompt summary { width: fit-content; max-width: 100%; color: var(--ink); cursor: pointer; font-weight: 600; }
.case-prompt p { margin: .34rem 0 .25rem; padding-left: .65rem; border-left: 2px solid var(--line); }
.case-credit, .case-source { margin: .54rem 0 0; color: var(--muted); font-size: .78rem; overflow-wrap: anywhere; }

@media (max-width: 800px) {
  .case-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .site-header nav { flex-wrap: wrap; justify-content: flex-end; gap: .3rem .65rem; }
  .site-header nav a { font-size: .78rem; }
  .case-card { padding: .72rem; }
  .case-verdicts table { font-size: .78rem; }
  .case-verdicts th, .case-verdicts td { padding: .33rem .27rem; }
}
