/* CUA-SWE project site. Academic layout: centered paper front matter, figure-led sections, mono for numbers. */
:root {
  --ink: #1f1f1f;
  --text: #333;
  --muted: #666;
  --line: #e4e4e4;
  --link: #1a73e8;
  --bg: #fff;
  --pass: #188038;
  --fail: #d93025;
  --sans: "Noto Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Inconsolata", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --w: 1120px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 64px; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote, pre { margin: 0; }
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
a { color: inherit; }
a:hover { color: var(--link); }
button { font: inherit; cursor: pointer; }
.skip { position: fixed; z-index: 100; left: 16px; top: -100px; background: #fff; padding: 10px 16px; }
.skip:focus { top: 10px; }
.wrap { max-width: var(--w); margin: 0 auto; padding: 0 28px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Navigation */
.nav { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.nav-inner { max-width: var(--w); margin: 0 auto; padding: 0 28px; display: flex; align-items: center; justify-content: center; gap: 30px; min-height: 50px; font-size: 14px; }
.nav .brand { font-family: var(--mono); font-weight: 700; font-size: 16px; text-decoration: none; letter-spacing: .02em; }
.nav ul { list-style: none; display: flex; gap: 22px; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
.nav ul::-webkit-scrollbar { display: none; }
.nav a { text-decoration: none; white-space: nowrap; }
.nav a[aria-current="page"] { color: var(--link); }

/* Front matter */
.hero { text-align: center; padding: 46px 0 8px; }
.hero h1 { font-family: var(--mono); font-size: clamp(28px, 3.3vw, 40px); font-weight: 700; line-height: 1.22; color: var(--ink); letter-spacing: -.01em; }
.hero h1 em { font-style: normal; font-family: var(--sans); font-weight: 700; letter-spacing: -.01em; }
.hero .authors { margin-top: 18px; font-size: 17px; color: var(--link); line-height: 1.6; }
.hero .authors a { color: var(--link); text-decoration: none; }
.hero .authors a:hover { text-decoration: underline; text-underline-offset: 3px; }
.hero .authors .plain { color: var(--ink); }
.hero .authors sup, .hero .affil sup { font-size: .7em; line-height: 0; }
.hero .affil { margin-top: 6px; font-size: 13px; color: #444; }
.buttons { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.pill { display: inline-flex; align-items: center; gap: 8px; background: #363636; color: #fff; text-decoration: none; font-size: 14px; padding: 9px 18px; border-radius: 999px; transition: background-color .15s; }
.pill:hover { background: #111; color: #fff; }
.pill svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cta { text-align: center; margin-top: 26px; }

/* Sections */
.section { padding-top: 58px; }
.section h2 { font-family: var(--mono); font-size: 30px; font-weight: 700; text-align: center; letter-spacing: .02em; color: var(--ink); margin-bottom: 22px; }
.section h3 { font-size: 20px; font-weight: 700; color: var(--ink); margin: 34px 0 12px; }
.section h2 + h3 { margin-top: 0; }
.intro, .abstract, .prose-p { max-width: 900px; margin: 0 auto 22px; font-size: 16px; line-height: 1.65; }
.abstract { text-align: left; }
.note { font-size: 13.5px; line-height: 1.55; color: var(--muted); margin-top: 12px; }
.stats { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 34px; font-family: var(--mono); font-size: 15px; color: #333; }
.stats b { font-weight: 700; color: var(--ink); }

/* Overview strip: one task per domain */
.strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; margin-top: 30px; }
.strip .col h4 { font-size: 14px; margin-bottom: 8px; color: var(--ink); }
.strip .col h4 .dom { font-family: var(--mono); font-weight: 700; margin-right: 4px; }
.strip .shot { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border: 1px solid var(--line); background: #f4f6f9; }
.strip .shot img { width: 100%; height: 100%; object-fit: cover; }
.strip .game .shot, .strip .devops .shot { background: #0b1220; }
.strip .game .shot img, .strip .devops .shot img { object-fit: contain; }
.strip .tag { position: absolute; left: 8px; top: 8px; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 3px; color: #fff; background: var(--fail); }
.strip .after .tag { background: var(--pass); }
.strip .cap { font-size: 13px; line-height: 1.4; color: #333; margin: 6px 0 12px; }
.strip figcaption { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* Results panels */
.panels { display: grid; grid-template-columns: 1.45fr 1fr; gap: 22px 28px; margin-top: 8px; }
.panel { border: 1px solid var(--line); padding: 14px 16px 8px; }
.panel-b { grid-column: 1 / -1; }
.panel figcaption { font-size: 14px; color: var(--ink); margin-bottom: 8px; }
.panel figcaption b { font-family: var(--mono); font-weight: 700; margin-right: 6px; }
.chart svg { display: block; width: 100%; height: auto; font-family: var(--sans); }
.chart-title { font-size: 13px; font-weight: 700; color: var(--ink); margin: 6px 0 2px 34px; }
.domain-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 28px; }
.legend { font-size: 13.5px; margin-top: 16px; color: #333; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 2px; vertical-align: -1px; margin-right: 3px; background: #1a73e8; }
.sw.tint { background: #1a73e8; opacity: .35; }
.legend .gain { color: var(--fail); font-weight: 700; }
.legend .fam { font-weight: 700; }
.legend .fam.openai { color: #1f9d8f; } .legend .fam.anthropic { color: #d2603a; } .legend .fam.xai { color: #4d5566; } .legend .fam.system { color: #7a5fc7; }
.table-wrap { overflow-x: auto; }
.score-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.score-table th, .score-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.score-table thead th { font-weight: 700; color: var(--ink); border-bottom: 2px solid #bbb; font-size: 13px; }
.score-table thead th.group { text-align: center; border-bottom: 1px solid #bbb; }
.score-table th:first-child, .score-table td:first-child { text-align: left; }
.score-table tbody th { font-weight: 400; color: var(--ink); }
.score-table td.best { font-weight: 700; color: #167d8d; }
.score-table td.na { color: #999; }
.score-table tr.system-start th, .score-table tr.system-start td { border-top: 1px solid #999; }
.score-table td.code { color: #555; }
.score-table tbody tr:hover { background: #f7f9fc; }

/* Episode player (kept for the interactive examples) */
.episode { border: 1px solid var(--line); overflow: hidden; background: #fff; }
.episode-body { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(290px, 1fr); }
.screen { background: #0e191e; color: #e9eeee; min-width: 0; display: flex; flex-direction: column; }
.screen .media { min-height: 392px; display: flex; align-items: center; }
.screen img { width: 100%; height: auto; }
.screen .pane { width: 100%; padding: 28px; font-family: var(--mono); font-size: 13.5px; line-height: 1.6; overflow-wrap: anywhere; }
.screen .pane pre { margin: 0 0 14px; white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; }
.screen .pane pre:last-child { margin-bottom: 0; }
.screen .hdr { color: #bcc9ce; margin-bottom: 7px; }
.screen .ctx { color: #b0c2c7; }
.screen .add, .screen .ok { color: #9fdec0; }
.screen .cmd { color: #f4bf8a; }
.screen .note { margin-top: auto; border-top: 1px solid #314047; padding: 14px 24px; font-size: 13px; color: #c2cdd0; }
.steps { list-style: none; margin: 0; padding: 14px 0; display: flex; flex-direction: column; justify-content: center; }
.steps button { display: grid; grid-template-columns: 30px 1fr; gap: 12px; text-align: left; width: 100%; border: 0; background: transparent; color: var(--text); padding: 16px 24px; border-left: 3px solid transparent; }
.steps button:hover { background: #f5f8fc; }
.steps button[aria-pressed="true"] { background: #eef4fd; border-left-color: var(--link); }
.steps button[aria-pressed="true"] .step-number { color: var(--link); }
.steps .step-number { font-family: var(--mono); font-size: 13px; color: var(--muted); padding-top: 3px; }
.steps .t { font-size: 16px; font-weight: 700; color: var(--ink); line-height: 1.4; display: block; }
.steps .d { display: block; font-size: 14px; line-height: 1.5; margin-top: 5px; }
.steps button[aria-pressed="false"] .d { display: none; }
.episode-foot { border-top: 1px solid var(--line); padding: 14px 22px; font-size: 13.5px; line-height: 1.55; color: var(--muted); }

/* Tasks */
.domains { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 40px; }
.domain h3 { margin: 0 0 8px; font-size: 20px; }
.domain h3 span { font-family: var(--mono); font-weight: 400; font-size: 14px; color: var(--muted); margin-left: 10px; }
.domain p { font-size: 15px; line-height: 1.55; }
.domain blockquote { margin-top: 10px; padding: 10px 14px; border-left: 3px solid #cfd6df; background: #f7f8fa; font-size: 14px; line-height: 1.5; color: #333; }

/* Analysis */
.two { display: grid; grid-template-columns: 1.15fr 1fr; gap: 36px; align-items: start; }
.prose p { font-size: 15.5px; line-height: 1.65; }
.prose p + p { margin-top: 14px; }
.fig { margin: 0; }
.fig img { border: 1px solid var(--line); }
.fig.wide { max-width: 900px; margin: 0 auto 26px; }
.overview-fig { max-width: 980px; margin-top: 30px; }
.overview-fig img { border: 0; }
.examples-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 22px; }
.panel-img { display: block; width: 100%; height: auto; max-width: 520px; margin: 4px auto 8px; }
.info-table { border-collapse: collapse; font-size: 13.5px; margin: 16px 0; width: 100%; }
.info-table caption { text-align: left; font-size: 13px; color: var(--muted); padding-bottom: 6px; caption-side: bottom; }
.info-table th, .info-table td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.info-table th:nth-child(-n+2), .info-table td:nth-child(-n+2) { text-align: left; }
.info-table thead th { border-bottom: 2px solid #bbb; font-weight: 700; color: var(--ink); }
.info-table td.up { color: var(--fail); font-weight: 700; }
.fig figcaption, .case figcaption { font-size: 13.5px; line-height: 1.55; color: #444; margin-top: 10px; }
.zoomable img { cursor: zoom-in; }
.cases { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.case img { border: 1px solid var(--line); }
.case figcaption b { color: var(--ink); }
.fails { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.fail-media { height: 280px; display: flex; align-items: center; justify-content: center; background: #0b1420; border: 1px solid var(--line); overflow: hidden; }
.fail-media img { width: 100%; height: 100%; object-fit: contain; }
.fail-media.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; background: #eef1f5; }
.fail figcaption { font-size: 14px; line-height: 1.55; margin-top: 10px; }
.fail figcaption b { color: var(--ink); }

/* Evaluation */
.checks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; margin-top: 8px; }
.checks div { border-top: 2px solid #ccc; padding-top: 12px; }
.checks h3 { font-size: 17px; margin: 0 0 6px; }
.checks p { font-size: 14.5px; line-height: 1.55; }
.prose-p { margin-top: 24px; font-size: 15.5px; }

/* Citation and footer */
.paper-title { max-width: 900px; margin: 0 auto 16px; font-size: 15px; }
.bibtex { font-family: var(--mono); font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; background: #f6f6f6; border: 1px solid var(--line); padding: 16px 18px; max-width: 900px; margin: 0 auto; }
footer { text-align: center; font-size: 13px; color: var(--muted); padding: 60px 28px 30px; }
footer a { margin-left: 10px; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.82); display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; }
.lightbox img { max-width: min(1100px, 96vw); max-height: 94vh; width: auto; height: auto; background: #fff; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lightbox-close { position: absolute; top: 14px; right: 16px; border: 0; background: #fff; border-radius: 999px; width: 36px; height: 36px; font-size: 16px; }

/* Task explorer page */
.explorer-head { padding-top: 40px; text-align: center; }
.explorer-head h1 { font-family: var(--mono); font-size: clamp(28px, 3.3vw, 38px); color: var(--ink); }
.explorer-head p { max-width: 70ch; margin: 12px auto 0; font-size: 16px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 30px; }
.seg { display: inline-flex; border-bottom: 1px solid var(--line); }
.seg button { padding: 10px 14px; background: transparent; color: var(--text); border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 15px; }
.seg button:first-child { padding-left: 0; }
.seg button[aria-pressed="true"] { border-color: var(--link); color: var(--link); }
.filters select, .filters input { font-size: 14px; border: 1px solid #b9c2cc; border-radius: 4px; padding: 10px 12px; background: #fff; color: var(--ink); min-width: 0; }
.filters input { flex: 1; }
.count-line { margin-top: 22px; font-size: 14px; font-family: var(--mono); }
.tasklist { list-style: none; margin: 10px 0 0; padding: 0; border-top: 2px solid #bbb; }
.task { border-bottom: 1px solid var(--line); scroll-margin-top: 70px; }
.task > button { display: grid; grid-template-columns: 80px minmax(0, 1fr) 24px; gap: 18px; align-items: baseline; width: 100%; text-align: left; border: 0; background: transparent; color: var(--text); padding: 16px 0; }
.task > button:hover .title { color: var(--link); }
.task .dom { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.task .title { font-weight: 700; font-size: 15.5px; color: var(--ink); line-height: 1.5; overflow-wrap: anywhere; }
.task .expand { font-size: 20px; text-align: center; line-height: 1; color: var(--muted); }
.task[open] { background: #f7f9fc; box-shadow: 18px 0 #f7f9fc, -18px 0 #f7f9fc; }
.task .detail { display: none; padding: 0 44px 24px 98px; }
.task[open] .detail { display: block; }
.task .detail h3 { font-size: 18px; margin: 0 0 12px; }
.task .instr { white-space: pre-line; font-size: 15px; max-width: 78ch; overflow-wrap: anywhere; }
.task dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 24px; margin: 20px 0 0; font-size: 14px; }
.task dt { font-weight: 700; color: var(--ink); }
.task dd { margin: 0; overflow-wrap: anywhere; }
.task .id { font-family: var(--mono); font-size: 13px; }
.task .out { font-size: 14px; margin-top: 18px; }
.task .detail-links { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 16px; font-size: 14px; }
.empty-state { margin-top: 30px; }
.empty-state button { border: 0; background: transparent; text-decoration: underline; color: var(--link); padding: 0; margin-top: 12px; }

@media (max-width: 1000px) {
  .strip { grid-template-columns: repeat(2, 1fr); }
  .panels { grid-template-columns: 1fr; }
  .domain-charts { grid-template-columns: 1fr; }
  .cases { grid-template-columns: repeat(2, 1fr); }
  .two { grid-template-columns: 1fr; }
  .examples-grid { grid-template-columns: 1fr; }
  .episode-body { grid-template-columns: 1.3fr 1fr; }
  .screen .media { min-height: 320px; }
}
@media (max-width: 720px) {
  .wrap { padding: 0 18px; }
  .nav-inner { justify-content: flex-start; padding: 0 18px; gap: 18px; }
  .hero { padding-top: 30px; }
  .hero .authors { font-size: 15px; }
  .stats { gap: 4px 20px; font-size: 14px; }
  .section h2 { font-size: 26px; }
  .domains, .fails, .checks { grid-template-columns: 1fr; }
  .episode-body { grid-template-columns: 1fr; }
  .screen .media { min-height: 0; }
  .screen .pane { padding: 18px; font-size: 12.5px; }
  .fail-media { height: 220px; }
  .panel { overflow-x: auto; }
  .chart svg { min-width: 520px; }
  .domain-charts { gap: 12px 0; }
  .task > button { grid-template-columns: 64px minmax(0, 1fr) 20px; gap: 12px; }
  .task .detail { padding: 0 0 20px; }
}
@media (max-width: 520px) {
  .strip { grid-template-columns: 1fr; }
  .cases { grid-template-columns: 1fr; }
  .task > button { grid-template-columns: minmax(0, 1fr) 22px; gap: 4px 12px; }
  .task .dom { grid-column: 1; }
  .task .title { grid-row: 2; grid-column: 1; }
  .task .expand { grid-column: 2; grid-row: 1 / 3; align-self: center; }
  .task dl { grid-template-columns: 1fr; gap: 4px; }
  .task dd { margin-bottom: 8px; }
  .filters select, .filters input { width: 100%; flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
