:root {
  --ink: #111719;
  --ink-soft: #1a2225;
  --paper: #f2f3f0;
  --white: #fbfcf9;
  --line: #cfd4d1;
  --line-dark: #303a3d;
  --muted: #697478;
  --cyan: #78aeb5;
  --gold: #c59b57;
  --display: "Avenir Next Condensed", "Arial Narrow", sans-serif;
  --body: "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; background: var(--paper); }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--body); -webkit-font-smoothing: antialiased; }
body.viewer-open { overflow: hidden; }
button, input, textarea { font: inherit; }
button, a { color: inherit; }
img { display: block; max-width: 100%; }

.topbar { position: sticky; z-index: 20; top: 0; min-height: 58px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; padding: 0 4vw; color: #d9dfdc; background: rgba(17, 23, 25, .96); border-bottom: 1px solid var(--line-dark); }
.topbar .brand { color: white; text-decoration: none; font: 700 14px/1 var(--display); letter-spacing: .08em; }
.topbar > span { color: #899599; font: 650 9px/1 var(--mono); letter-spacing: .1em; }
.made-with { justify-self: end; display: flex; align-items: center; gap: 8px; color: #b9c4c3; text-decoration: none; }
.made-with small { color: #748185; font: 650 7px/1 var(--mono); letter-spacing: .08em; }
.made-with span { font-size: 13px; white-space: nowrap; }
.made-with b, .prota-credit b { color: white; font-weight: 750; }
.made-with i, .prota-credit i { margin: 0 2px; color: #d7554b; font-style: normal; }
.made-with:hover { color: white; }

main { width: min(1640px, 100%); margin: 0 auto; }
.intro { display: grid; grid-template-columns: 1.2fr .8fr; gap: 7vw; align-items: end; min-height: 430px; padding: 90px 5vw 72px; color: white; background: var(--ink); }
.intro > p { grid-column: 1 / -1; align-self: start; margin: 0; color: var(--cyan); font: 650 10px/1 var(--mono); letter-spacing: .13em; }
.intro h1 { margin: 0; font: 620 clamp(58px, 6.8vw, 108px)/.84 var(--display); letter-spacing: -.04em; text-transform: uppercase; }
.intro-copy { max-width: 470px; padding-bottom: 8px; }
.intro-copy p { margin: 0 0 26px; color: #aeb8b7; font-size: 17px; line-height: 1.55; }
.intro-copy a { color: white; text-decoration: none; border-bottom: 1px solid var(--cyan); font: 650 10px/2 var(--mono); letter-spacing: .08em; text-transform: uppercase; }

.cohort { display: grid; grid-template-columns: 170px 1fr; border: 1px solid var(--line); border-top: 0; background: var(--white); }
.cohort-heading { display: flex; flex-direction: column; justify-content: center; gap: 7px; padding: 22px 26px; border-right: 1px solid var(--line); }
.cohort-heading span { font: 700 10px/1 var(--mono); letter-spacing: .1em; }
.cohort-heading small { color: var(--muted); font-size: 11px; }
.cohort ol { display: grid; grid-template-columns: repeat(5, 1fr); margin: 0; padding: 0; list-style: none; }
.cohort li { min-width: 0; padding: 20px; border-right: 1px solid var(--line); }
.cohort li:last-child { border-right: 0; }
.cohort li span { display: block; margin-bottom: 7px; color: var(--cyan); font: 650 10px/1 var(--mono); }
.cohort li b { display: block; font: 650 19px/1 var(--display); text-transform: uppercase; }

.test-bed, .conclusions { padding: 86px 4vw; }
.section-title, .compare-heading { display: flex; justify-content: space-between; align-items: end; gap: 40px; margin-bottom: 28px; }
.section-title span, .compare-heading span { display: block; margin-bottom: 10px; color: #54848b; font: 700 9px/1 var(--mono); letter-spacing: .12em; }
.section-title h2, .compare-heading h2 { margin: 0; font: 620 48px/.9 var(--display); text-transform: uppercase; }
.section-title > p { max-width: 540px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; text-align: right; }

.chunk-tabs { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); background: var(--white); }
.chunk-tab { min-height: 76px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 0 20px; border: 0; border-right: 1px solid var(--line); color: var(--muted); background: transparent; text-align: left; cursor: pointer; }
.chunk-tab:last-child { border-right: 0; }
.chunk-tab:hover { color: var(--ink); background: #e9ece9; }
.chunk-tab.active { color: white; background: var(--ink); }
.chunk-tab > span { color: var(--cyan); font: 650 10px/1 var(--mono); }
.chunk-tab b { font: 650 17px/1 var(--display); text-transform: uppercase; }
.chunk-tab small { font: 650 8px/1 var(--mono); letter-spacing: .06em; }

.source-panel { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); min-height: 440px; margin: 18px 0 82px; color: white; background: var(--ink); }
.source-image { position: relative; margin: 0; overflow: hidden; }
.source-image img { width: 100%; height: 100%; object-fit: cover; }
.source-image figcaption { position: absolute; inset: auto 16px 16px; display: flex; justify-content: space-between; gap: 20px; padding: 11px 13px; color: #dce3e1; background: rgba(12, 17, 19, .88); font: 650 8px/1.35 var(--mono); letter-spacing: .07em; }
.source-image a { color: var(--cyan); text-decoration: none; }
.source-copy { padding: 42px; }
.source-copy > span { color: var(--gold); font: 700 9px/1 var(--mono); letter-spacing: .1em; }
.source-copy h3 { margin: 12px 0 18px; font: 620 38px/.95 var(--display); text-transform: uppercase; }
.source-copy > p { color: #b4bdbc; font-size: 14px; line-height: 1.6; }
.beat-list { margin-top: 28px; border-top: 1px solid var(--line-dark); }
.beat-list div { display: grid; grid-template-columns: 62px 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line-dark); }
.beat-list time { color: var(--cyan); font: 650 9px/1.4 var(--mono); }
.beat-list p { margin: 0; color: #d1d8d6; font-size: 12px; line-height: 1.4; }

.compare-heading { margin-bottom: 18px; }
.compare-heading > p { margin: 0; color: var(--muted); font: 650 10px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.compare-heading > p b { color: var(--ink); font-size: 18px; }
.transport { min-height: 58px; display: flex; align-items: center; gap: 14px; padding: 10px 14px; color: #dbe2df; background: var(--ink); }
.transport button { min-height: 34px; padding: 0 14px; border: 1px solid var(--line-dark); color: #dbe2df; background: transparent; cursor: pointer; font: 650 9px/1 var(--mono); text-transform: uppercase; }
.transport button:hover { border-color: var(--cyan); }
.transport input[type="range"] { flex: 1; accent-color: var(--cyan); }
.transport output { min-width: 60px; color: var(--cyan); font: 650 10px/1 var(--mono); }
.transport label { display: flex; align-items: center; gap: 5px; font: 650 8px/1 var(--mono); text-transform: uppercase; }
.transport input[type="checkbox"] { accent-color: var(--cyan); }

.model-grid { display: grid; grid-template-columns: repeat(5, minmax(225px, 1fr)); border: 1px solid var(--line); border-top: 0; background: var(--white); }
.model-card { min-width: 0; border-right: 1px solid var(--line); }
.model-card:last-child { border-right: 0; }
.model-card > header { height: 132px; display: grid; grid-template-columns: auto 1fr; gap: 10px; align-content: start; padding: 18px; border-bottom: 1px solid var(--line); }
.model-index { color: var(--cyan); font: 650 13px/1 var(--mono); }
.model-card h3 { margin: 0; font: 650 24px/.95 var(--display); text-transform: uppercase; }
.model-route { min-height: 32px; margin: 8px 0 0; color: var(--muted); font: 550 8px/1.35 var(--mono); overflow-wrap: anywhere; }
.model-state { grid-column: 1 / -1; margin-top: 10px; color: #8b6c38; font: 700 7px/1 var(--mono); letter-spacing: .08em; }
.video-shell { position: relative; aspect-ratio: 16/9; overflow: hidden; background: #070a0b; }
.video-shell video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: black; }
.video-empty { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 7px; color: #6d7a7e; background: #101719; }
.video-empty b { color: #aeb9b8; font: 650 14px/1 var(--display); text-transform: uppercase; }
.video-empty span { font-size: 10px; }
.video-empty[hidden] { display: none; }
.load-video, .view-full, .remove-video { position: absolute; z-index: 3; bottom: 8px; min-height: 27px; display: flex; align-items: center; padding: 0 9px; border: 1px solid #384346; color: #cbd4d2; background: rgba(14, 20, 22, .9); font: 650 7px/1 var(--mono); text-transform: uppercase; cursor: pointer; }
.load-video { left: 8px; }
.load-video input { display: none; }
.view-full { right: 8px; }
.remove-video { top: 8px; right: 8px; bottom: auto; }
.model-contract { min-height: 112px; padding: 16px; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 10px; line-height: 1.45; }
.model-contract dl { margin: 0 0 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.model-contract dt { color: #899396; font: 650 7px/1 var(--mono); text-transform: uppercase; }
.model-contract dd { margin: 3px 0 0; color: var(--ink); font: 650 9px/1.25 var(--mono); }
.model-contract p { margin: 0; }
.receipt-grid { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.receipt-grid label { min-height: 55px; padding: 9px 12px; color: var(--muted); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font: 650 7px/1 var(--mono); text-transform: uppercase; }
.receipt-grid label:nth-child(even) { border-right: 0; }
.receipt-grid label:nth-last-child(-n+2) { border-bottom: 0; }
.receipt-grid input { width: 100%; margin-top: 7px; padding: 0; border: 0; color: var(--ink); background: transparent; outline: 0; font: 650 15px/1 var(--display); }
.model-card details summary { min-height: 47px; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 0 14px; color: #435055; list-style: none; cursor: pointer; font: 650 8px/1 var(--mono); text-transform: uppercase; }
.model-card details summary::-webkit-details-marker { display: none; }
.score-total { color: #5c888e; }
.submission { display: grid; grid-template-columns: 90px 1fr; gap: 12px; padding: 12px; background: #e7eae7; }
.submission-reference img { width: 90px; height: 54px; object-fit: cover; }
.submission-reference span { display: block; margin-top: 5px; color: var(--muted); font: 600 6px/1.3 var(--mono); overflow-wrap: anywhere; }
.submission b { color: #5c6b6f; font: 700 7px/1 var(--mono); }
.submission p { margin: 6px 0 0; color: var(--muted); font-size: 9px; line-height: 1.4; }
.rubric { padding: 10px 14px; }
.rubric label { display: grid; grid-template-columns: 1fr 62px 17px; align-items: center; gap: 7px; min-height: 27px; color: var(--muted); font-size: 8px; }
.rubric input { width: 100%; accent-color: var(--cyan); }
.rubric output { font: 650 8px/1 var(--mono); }
.notes-label { display: block; padding: 8px 14px; color: var(--muted); font: 650 7px/1 var(--mono); text-transform: uppercase; }
.notes-label textarea { width: 100%; min-height: 70px; margin-top: 7px; padding: 8px; resize: vertical; border: 1px solid var(--line); background: white; font: 400 10px/1.4 var(--body); text-transform: none; }
.usable { display: flex; gap: 7px; padding: 8px 14px 15px; color: var(--muted); font: 650 7px/1 var(--mono); text-transform: uppercase; }
.usable input { accent-color: var(--cyan); }

.community-vote { margin-top: 48px; padding: 30px; color: white; background: var(--ink); }
.community-vote > header { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 22px; }
.community-vote > header span { display: block; margin-bottom: 8px; color: var(--cyan); font: 700 8px/1 var(--mono); letter-spacing: .1em; }
.community-vote h2 { margin: 0; font: 620 34px/1 var(--display); text-transform: uppercase; }
#voteSummary { margin: 0; color: #9ca8a8; font: 650 9px/1.4 var(--mono); text-transform: uppercase; }
.vote-grid { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--line-dark); }
.vote-option { min-height: 112px; display: grid; grid-template-columns: 1fr auto; align-content: space-between; gap: 15px; padding: 16px; border: 0; border-right: 1px solid var(--line-dark); color: #cbd4d2; background: transparent; text-align: left; cursor: pointer; }
.vote-option:last-child { border-right: 0; }
.vote-option:hover { background: #1c272a; }
.vote-option:disabled { opacity: .52; cursor: not-allowed; }
.vote-option:disabled:hover { background: transparent; }
.vote-option[aria-pressed="true"] { color: white; background: #223236; box-shadow: inset 0 3px var(--cyan); }
.vote-option b { font: 650 18px/1 var(--display); text-transform: uppercase; }
.vote-option strong { color: var(--cyan); font: 550 25px/1 var(--display); }
.vote-option span { grid-column: 1 / -1; color: #7f8c8f; font: 650 8px/1 var(--mono); text-transform: uppercase; }
.vote-option[aria-pressed="true"] span { color: #b7c6c6; }
.vote-note { margin: 13px 0 0; color: #778487; font-size: 10px; }

.conclusions { border-top: 1px solid var(--line); background: #e4e7e4; }
.export-actions { display: flex; gap: 8px; }
.export-actions button { min-height: 34px; padding: 0 12px; border: 1px solid #aeb6b2; background: transparent; cursor: pointer; font: 650 8px/1 var(--mono); text-transform: uppercase; }
.decision-grid { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); background: var(--white); }
.decision-grid label { padding: 17px; color: var(--muted); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font: 700 8px/1 var(--mono); text-transform: uppercase; }
.decision-grid label:nth-child(even) { border-right: 0; }
.decision-grid label:nth-last-child(-n+2) { border-bottom: 0; }
.decision-grid textarea { width: 100%; min-height: 90px; margin-top: 11px; padding: 10px; resize: vertical; border: 1px solid var(--line); background: #f6f7f4; font: 400 13px/1.5 var(--body); text-transform: none; }

.viewer { width: 100vw; max-width: none; height: 100vh; max-height: none; margin: 0; padding: 0; border: 0; color: white; background: #070a0b; }
.viewer::backdrop { background: #070a0b; }
.viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.viewer > header { min-height: 64px; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 10px 20px; border-bottom: 1px solid var(--line-dark); }
.viewer > header > div:first-child { display: flex; align-items: center; gap: 12px; }
#viewerIndex { color: var(--cyan); font: 650 12px/1 var(--mono); }
.viewer h2 { margin: 0; font: 650 30px/1 var(--display); text-transform: uppercase; }
.viewer-actions { display: flex; gap: 7px; }
.viewer-actions button, .viewer-nav { min-height: 34px; padding: 0 11px; border: 1px solid var(--line-dark); color: #d7dfdc; background: transparent; cursor: pointer; font: 650 8px/1 var(--mono); text-transform: uppercase; }
.viewer-main { position: relative; min-height: 0; display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px; padding: 12px 0; overflow: hidden; }
#viewerVideo { width: 100%; height: 100%; object-fit: contain; background: black; }
.viewer-nav { border: 0; font-size: 22px; }
#viewerDrawer { position: absolute; z-index: 5; top: 12px; right: 64px; bottom: 12px; width: min(430px, 44vw); padding: 22px; overflow: auto; color: var(--ink); background: var(--paper); border-left: 1px solid var(--line); transform: translateX(calc(100% + 64px)); transition: transform .2s ease; }
.viewer.details-open #viewerDrawer { transform: translateX(0); }
#viewerDrawer > span { display: block; margin: 0 0 8px; color: #567e84; font: 700 8px/1 var(--mono); letter-spacing: .1em; }
#viewerDrawer > p { margin: 0 0 24px; color: var(--muted); font-size: 13px; line-height: 1.5; }
#viewerReference { width: 100%; margin-bottom: 20px; }
#viewerMeta { margin: 0; border: 1px solid var(--line); }
#viewerMeta div { display: grid; grid-template-columns: 112px 1fr; border-bottom: 1px solid var(--line); }
#viewerMeta div:last-child { border-bottom: 0; }
#viewerMeta dt, #viewerMeta dd { margin: 0; padding: 9px; font: 600 8px/1.4 var(--mono); overflow-wrap: anywhere; }
#viewerMeta dt { color: var(--muted); background: #e0e4e1; }
.viewer > footer { min-height: 44px; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 8px 20px; color: #899699; border-top: 1px solid var(--line-dark); font: 650 8px/1.4 var(--mono); text-transform: uppercase; }

.page-footer { min-height: 110px; display: grid; grid-template-columns: 1fr 1.4fr auto; align-items: center; gap: 30px; padding: 24px 4vw; color: #7c898c; background: var(--ink); font-size: 10px; }
.page-footer span, .page-footer a { color: #c3ccca; font: 650 8px/1 var(--mono); letter-spacing: .08em; text-decoration: none; }
.page-footer p { margin: 0; }
.page-footer .prota-credit { color: #bdc7c5; font: inherit; letter-spacing: 0; }

button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

@media (max-width: 1200px) {
  .model-grid { grid-template-columns: repeat(2, minmax(260px, 1fr)); border-bottom: 0; }
  .model-card { border-bottom: 1px solid var(--line); }
  .model-card:nth-child(even) { border-right: 0; }
  .model-card:last-child { border-right: 1px solid var(--line); }
  .cohort { grid-template-columns: 1fr; }
  .cohort-heading { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 760px) {
  .topbar { grid-template-columns: 1fr auto; }
  .topbar > span:nth-child(2) { display: none; }
  .made-with small { display: none; }
  .intro { grid-template-columns: 1fr; min-height: 0; padding: 70px 6vw 56px; }
  .intro > p { grid-column: 1; }
  .intro h1 { font-size: clamp(50px, 14vw, 74px); }
  .cohort ol { grid-template-columns: 1fr; }
  .cohort li { border-right: 0; border-bottom: 1px solid var(--line); }
  .cohort li:last-child { border-bottom: 0; }
  .test-bed, .conclusions { padding: 62px 5vw; }
  .section-title { align-items: start; flex-direction: column; gap: 18px; }
  .section-title > p { text-align: left; }
  .chunk-tabs { grid-template-columns: 1fr; }
  .chunk-tab { border-right: 0; border-bottom: 1px solid var(--line); }
  .chunk-tab:last-child { border-bottom: 0; }
  .source-panel { grid-template-columns: 1fr; }
  .source-image { min-height: 320px; }
  .model-grid { grid-template-columns: 1fr; }
  .model-card { border-right: 0 !important; }
  .transport { flex-wrap: wrap; }
  .transport input[type="range"] { order: 3; flex-basis: calc(100% - 76px); }
  .transport output { order: 4; }
  .decision-grid { grid-template-columns: 1fr; }
  .decision-grid label { border-right: 0; border-bottom: 1px solid var(--line) !important; }
  .decision-grid label:last-child { border-bottom: 0 !important; }
  .community-vote { padding: 22px; }
  .community-vote > header { align-items: start; flex-direction: column; }
  .vote-grid { grid-template-columns: 1fr; }
  .vote-option { min-height: 76px; border-right: 0; border-bottom: 1px solid var(--line-dark); }
  .vote-option:last-child { border-bottom: 0; }
  .viewer-main { grid-template-columns: 38px minmax(0, 1fr) 38px; }
  #viewerDrawer { right: 38px; width: calc(100% - 76px); transform: translateX(calc(100% + 38px)); }
  #viewerFullscreen { display: none; }
  .viewer > footer { flex-direction: column; align-items: start; justify-content: center; }
  .page-footer { grid-template-columns: 1fr; gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
