:root {
  --ink: #111a21;
  --ink-soft: #344b5f;
  --paper: #f7f3e9;
  --white: #fffdf8;
  --yellow: #ffe554;
  --cyan: #3cc3d4;
  --coral: #ff6b4a;
  --green: #00bf63;
  --line: rgba(17, 26, 33, 0.2);
  --muted: #667078;
  --max: 1440px;
  color: var(--ink);
  background: var(--paper);
  font-family: "Arial", "Noto Sans SC", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); }
button, textarea, input { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3, dl, dd, figure { margin: 0; }
img { display: block; width: 100%; height: auto; }

.site-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--ink);
  padding: 0 clamp(20px, 4vw, 64px);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand { display: flex; align-items: center; gap: 14px; font-weight: 700; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 50px;
  height: 42px;
  background: var(--yellow);
  border: 2px solid var(--ink);
  font-family: "Courier New", monospace;
  font-size: 18px;
}
.brand-copy { font-size: 14px; text-transform: uppercase; }
.site-nav { display: flex; gap: 32px; align-items: center; }
.site-nav a { font-size: 13px; font-weight: 700; text-transform: uppercase; padding: 28px 0 24px; border-bottom: 4px solid transparent; }
.site-nav a:hover, .site-nav a:focus-visible, .site-nav a.is-active { border-bottom-color: var(--coral); }
.nav-toggle { display: none; border: 1px solid var(--ink); background: transparent; padding: 8px 12px; }

main { overflow: hidden; }
.workspace-intro, .company-directory, .protocol-band, .package-section, .role-grid-section, .source-band, .simulation-head, .round-workspace, .session-band {
  width: min(100%, var(--max));
  margin-inline: auto;
}

.workspace-intro {
  min-height: 570px;
  padding: clamp(70px, 9vw, 132px) clamp(20px, 7vw, 112px) 56px;
  position: relative;
  background: var(--paper);
}
.workspace-intro::before {
  content: "";
  position: absolute;
  inset: 0 14% 0 72%;
  background: var(--yellow);
  z-index: 0;
}
.workspace-intro > * { position: relative; z-index: 1; }
.workspace-intro::after {
  content: "";
  position: absolute;
  width: 170px;
  height: 170px;
  right: 6%;
  top: 86px;
  border: 24px solid var(--ink);
  border-right-color: var(--cyan);
  transform: rotate(12deg);
}
.eyebrow { font: 700 12px/1.2 "Courier New", monospace; text-transform: uppercase; letter-spacing: 0; margin-bottom: 18px; }
h1, h2, h3 { letter-spacing: 0; }
.workspace-intro h1, .company-hero h1, .simulation-head h1 {
  font-size: clamp(52px, 8vw, 112px);
  line-height: 0.9;
  max-width: 1020px;
}
.intro-copy, .simulation-lede { max-width: 680px; font-size: clamp(18px, 2vw, 26px); line-height: 1.45; margin-top: 36px; }
.signal-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 72px; border-top: 1px solid var(--ink); max-width: 920px; }
.signal-strip div { padding: 18px 18px 0 0; border-right: 1px solid var(--line); }
.signal-strip dt { font: 700 11px "Courier New", monospace; text-transform: uppercase; color: var(--muted); }
.signal-strip dd { font-size: 26px; font-weight: 700; margin-top: 8px; }

.company-directory, .package-section, .role-grid-section { padding: 88px clamp(20px, 5vw, 72px); }
.section-heading { display: flex; justify-content: space-between; gap: 40px; align-items: end; padding-bottom: 28px; border-bottom: 2px solid var(--ink); }
.section-heading h2, .protocol-band h2, .source-band h2, .session-band h2 { font-size: clamp(32px, 4vw, 58px); line-height: 1; }
.section-heading > p { max-width: 520px; color: var(--ink-soft); line-height: 1.5; }
.company-row, .empty-row {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) minmax(190px, 0.4fr) 44px;
  align-items: center;
  min-height: 210px;
  border-bottom: 1px solid var(--ink);
  gap: 28px;
}
.company-row { transition: background 160ms ease, transform 160ms ease; }
.company-row:hover, .company-row:focus-visible { background: var(--yellow); transform: translateX(6px); outline: none; }
.company-index, .package-number { font: 700 clamp(30px, 4vw, 52px) "Courier New", monospace; }
.company-main h3, .empty-row h3 { font-size: clamp(24px, 3vw, 40px); }
.company-main p, .empty-row p { margin-top: 12px; color: var(--ink-soft); line-height: 1.5; }
.company-meta { display: grid; gap: 10px; font-size: 13px; }
.row-arrow { font-size: 32px; }
.empty-row { opacity: 0.45; grid-template-columns: 100px 1fr 190px; }
.status-dot { display: inline-flex; align-items: center; gap: 8px; font: 700 12px "Courier New", monospace; text-transform: uppercase; }
.status-dot::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.status-yellow::before { background: var(--yellow); border: 1px solid var(--ink); }

.protocol-band, .source-band {
  background: var(--ink);
  color: var(--white);
  padding: 72px clamp(20px, 5vw, 72px);
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1.3fr);
  gap: 72px;
}
.protocol-steps { list-style: none; margin: 0; padding: 0; border-top: 1px solid rgba(255,255,255,0.35); }
.protocol-steps li { display: grid; grid-template-columns: 58px 1fr; gap: 18px; padding: 18px 0; border-bottom: 1px solid rgba(255,255,255,0.35); font-size: 18px; }
.protocol-steps span { color: var(--yellow); font-family: "Courier New", monospace; }

.site-footer { max-width: var(--max); margin: auto; min-height: 90px; padding: 28px clamp(20px, 5vw, 72px); display: flex; justify-content: space-between; gap: 24px; border-top: 1px solid var(--ink); font: 700 11px "Courier New", monospace; text-transform: uppercase; }

.company-hero {
  min-height: 590px;
  max-width: var(--max);
  margin: auto;
  background: var(--yellow);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  align-items: center;
  padding: 72px clamp(20px, 6vw, 92px);
  overflow: hidden;
}
.company-hero-copy { position: relative; z-index: 2; }
.company-hero-copy > p:last-child { max-width: 720px; font-size: 20px; line-height: 1.55; margin-top: 30px; }
.back-link { display: inline-block; font: 700 12px "Courier New", monospace; text-transform: uppercase; margin-bottom: 58px; border-bottom: 1px solid currentColor; padding-bottom: 4px; }
.company-puzzle { height: 390px; position: relative; }
.puzzle { position: absolute; width: 120px; height: 120px; border: 3px solid var(--ink); }
.p1 { background: var(--cyan); top: 25px; left: 20px; transform: rotate(8deg); }
.p2 { background: var(--coral); top: 55px; right: 20px; transform: rotate(-12deg); }
.p3 { background: var(--green); bottom: 30px; left: 70px; border-radius: 50%; }
.p4 { background: var(--paper); bottom: 8px; right: 45px; transform: rotate(18deg); }
.p5 { width: 46px; height: 46px; background: var(--ink); left: 48%; top: 44%; transform: rotate(45deg); }

.active-package { display: grid; grid-template-columns: 150px minmax(0, 1fr) 210px; gap: 34px; align-items: center; padding: 44px 0; border-bottom: 2px solid var(--ink); }
.active-package:hover .package-action strong, .active-package:focus-visible .package-action strong { background: var(--yellow); }
.package-number { align-self: start; }
.package-number span { display: block; color: var(--coral); }
.package-copy h3 { font-size: clamp(28px, 4vw, 50px); line-height: 1.05; }
.package-copy > p { margin-top: 18px; line-height: 1.55; max-width: 760px; color: var(--ink-soft); }
.inline-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0; margin: 22px 0 0; font: 700 12px "Courier New", monospace; text-transform: uppercase; }
.inline-list li::before { content: "+ "; color: var(--coral); }
.package-action { display: grid; gap: 30px; justify-items: start; }
.package-action strong { padding: 12px 0; border-bottom: 2px solid var(--ink); }

.role-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-left: 1px solid var(--ink); }
.role-grid article { min-height: 180px; padding: 22px; border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.role-grid article:nth-child(-n+4) { border-top: 1px solid var(--ink); }
.role-grid article.is-selected { background: var(--yellow); }
.role-grid span { font: 700 13px "Courier New", monospace; color: var(--coral); }
.role-grid h3 { margin-top: 34px; font-size: 20px; }
.role-grid p { margin-top: 8px; color: var(--muted); font-size: 13px; }
.source-band { grid-template-columns: 0.8fr 1fr auto; align-items: end; }
.source-band > p { line-height: 1.6; color: rgba(255,255,255,0.75); }
.source-band a { color: var(--yellow); border-bottom: 1px solid var(--yellow); padding-bottom: 5px; white-space: nowrap; }

.simulation-head { display: grid; grid-template-columns: minmax(0, 1.4fr) 340px; gap: 60px; padding: 72px clamp(20px, 5vw, 72px) 64px; }
.simulation-head h1 { font-size: clamp(48px, 7vw, 96px); }
.simulation-controls { border-top: 2px solid var(--ink); align-self: end; }
.mode-control { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--ink); }
.mode-control button { border: 0; border-right: 1px solid var(--ink); background: transparent; padding: 15px; font-weight: 700; cursor: pointer; }
.mode-control button:last-child { border-right: 0; }
.mode-control button.is-active { background: var(--yellow); }
.timer, .progress-readout { padding: 20px 0; border-bottom: 1px solid var(--ink); display: grid; gap: 9px; }
.timer > span, .progress-readout > span { font: 700 11px "Courier New", monospace; text-transform: uppercase; color: var(--muted); }
.timer strong { font: 700 48px "Courier New", monospace; }
.timer strong.is-expired { color: var(--coral); }
.timer button, .session-actions button { border: 1px solid var(--ink); background: transparent; padding: 8px 14px; cursor: pointer; }
.timer button:hover, .session-actions button:hover { background: var(--yellow); }
.progress-readout strong { font-size: 28px; }

.round-workspace { display: grid; grid-template-columns: 300px minmax(0, 1fr); border-top: 1px solid var(--ink); }
.round-rail { padding: 36px 28px 40px clamp(20px, 4vw, 56px); border-right: 1px solid var(--ink); background: var(--white); }
.round-rail nav { display: grid; }
.round-nav-item { display: grid; grid-template-columns: 40px 1fr; gap: 12px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 17px 8px; cursor: pointer; }
.round-nav-item > span:first-child { font: 700 13px "Courier New", monospace; color: var(--muted); }
.round-nav-item > span:last-child { display: grid; gap: 4px; }
.round-nav-item strong { font-size: 14px; }
.round-nav-item small { color: var(--muted); }
.round-nav-item.is-active { background: var(--yellow); }
.round-nav-item.is-complete > span:first-child { color: var(--green); }
.round-nav-item.is-complete > span:first-child::after { content: " ✓"; }
.truth-gate { margin-top: 34px; border-top: 2px solid var(--ink); padding-top: 18px; }
.truth-gate p { margin-top: 10px; font-size: 13px; line-height: 1.5; color: var(--ink-soft); }

.round-content { min-width: 0; background: var(--paper); }
.round-visual { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--yellow); }
.round-visual img { width: 100%; height: 100%; object-fit: cover; }
.round-visual figcaption { position: absolute; left: 0; bottom: 0; background: var(--ink); color: var(--white); padding: 13px 20px; display: flex; gap: 16px; font: 700 11px "Courier New", monospace; text-transform: uppercase; }
.round-visual figcaption span { color: var(--yellow); }
.round-title { padding: 54px clamp(24px, 5vw, 70px); border-bottom: 1px solid var(--ink); }
.round-title h2 { font-size: clamp(36px, 5vw, 68px); line-height: 1; max-width: 900px; }
.round-title > p:last-child { margin-top: 22px; font-size: 18px; line-height: 1.55; max-width: 800px; color: var(--ink-soft); }
.round-columns, .pressure-grid, .round-evidence { display: grid; grid-template-columns: 1fr 1fr; }
.round-columns > section, .pressure-grid > section, .round-evidence > div { padding: 42px clamp(22px, 4vw, 54px); border-bottom: 1px solid var(--ink); }
.round-columns > section:first-child, .pressure-grid > section:first-child, .round-evidence > div:first-child { border-right: 1px solid var(--ink); }
.round-content h3 { font-size: 19px; margin-bottom: 22px; }
.prompt-section ol { list-style: none; padding: 0; margin: 0; }
.prompt-section li { display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); line-height: 1.45; }
.prompt-section li span { font: 700 11px "Courier New", monospace; color: var(--coral); }
.answer-section { background: var(--yellow); position: relative; min-height: 380px; }
.answer-heading { display: flex; justify-content: space-between; gap: 20px; }
.answer-heading button, .answer-cover button { border: 1px solid var(--ink); background: var(--paper); padding: 7px 12px; cursor: pointer; height: fit-content; }
.answer-body ul, .pressure-grid ul { padding-left: 20px; margin: 0; }
.answer-body li, .pressure-grid li { margin: 12px 0; line-height: 1.5; }
.answer-cover { display: none; position: absolute; inset: 0; place-content: center; justify-items: center; gap: 18px; background: var(--ink); color: var(--white); text-align: center; padding: 30px; }
.answer-is-hidden .answer-cover { display: grid; }
.dialogue-section { padding: 48px clamp(24px, 5vw, 70px); border-bottom: 1px solid var(--ink); position: relative; }
.dialogue-section > h3 { margin-bottom: 10px; }
.dialogue-intro { color: var(--ink-soft); line-height: 1.5; margin-bottom: 26px; }
.dialogue-row { display: grid; grid-template-columns: 130px 1fr; gap: 24px; padding: 18px 0; border-top: 1px solid var(--line); }
.dialogue-row:last-child { border-bottom: 1px solid var(--line); }
.dialogue-role { font: 700 11px "Courier New", monospace; text-transform: uppercase; color: var(--coral); }
.dialogue-row.is-candidate .dialogue-role { color: var(--green); }
.dialogue-row p { max-width: 920px; line-height: 1.6; }
.dialogue-section.answer-is-hidden .dialogue-transcript { filter: blur(9px); user-select: none; pointer-events: none; }
.dialogue-section.answer-is-hidden::after { content: "Model dialogue hidden in Mock mode"; position: absolute; inset: 94px 0 0; display: grid; place-items: center; background: rgba(17, 26, 33, 0.82); color: var(--white); font: 700 12px "Courier New", monospace; text-transform: uppercase; }
.pressure-grid > section:first-child { background: var(--white); }
.pass-gate { display: grid; grid-template-columns: 160px 1fr; gap: 24px; align-items: start; padding: 30px clamp(24px, 5vw, 70px); background: var(--cyan); border-bottom: 1px solid var(--ink); }
.pass-gate span { font: 700 12px "Courier New", monospace; text-transform: uppercase; }
.pass-gate p { font-size: 18px; line-height: 1.45; }
.round-evidence textarea, .session-fields textarea { width: 100%; resize: vertical; border: 1px solid var(--ink); background: var(--white); padding: 14px; line-height: 1.5; border-radius: 0; }
.score-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.score-grid label { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 9px; font-size: 13px; }
.score-grid input { width: 52px; border: 1px solid var(--ink); background: var(--white); padding: 7px; text-align: center; }
.complete-button { width: 100%; margin-top: 28px; border: 2px solid var(--ink); background: transparent; padding: 13px; font-weight: 700; cursor: pointer; }
.complete-button.is-complete { background: var(--green); }
.round-pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 25px clamp(24px, 5vw, 70px); }
.round-pagination button { border: 0; background: transparent; font-weight: 700; cursor: pointer; }
.round-pagination button:last-child { justify-self: end; }
.round-pagination button:disabled { opacity: 0.25; cursor: default; }
.round-pagination span { font: 700 12px "Courier New", monospace; }

.session-band { background: var(--ink); color: var(--white); padding: 70px clamp(20px, 5vw, 72px); }
.session-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 42px; }
.session-fields label { display: grid; gap: 12px; font: 700 12px "Courier New", monospace; text-transform: uppercase; }
.session-fields textarea { text-transform: none; font-family: Arial, sans-serif; }
.session-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; font: 700 11px "Courier New", monospace; text-transform: uppercase; }
.session-actions button { color: var(--white); border-color: var(--white); }

@media (max-width: 980px) {
  .company-hero, .simulation-head { grid-template-columns: 1fr; }
  .company-puzzle { display: none; }
  .active-package { grid-template-columns: 100px 1fr; }
  .package-action { grid-column: 2; grid-template-columns: 1fr 1fr; align-items: center; }
  .role-grid { grid-template-columns: repeat(2, 1fr); }
  .role-grid article:nth-child(3), .role-grid article:nth-child(4) { border-top: 0; }
  .source-band { grid-template-columns: 1fr; align-items: start; }
  .round-workspace { grid-template-columns: 220px 1fr; }
  .round-columns, .pressure-grid, .round-evidence { grid-template-columns: 1fr; }
  .round-columns > section:first-child, .pressure-grid > section:first-child, .round-evidence > div:first-child { border-right: 0; }
  .session-fields { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .site-header { min-height: 66px; }
  .brand-copy { display: none; }
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 65px; left: 0; right: 0; background: var(--paper); border-bottom: 1px solid var(--ink); padding: 0 20px; }
  .site-nav.is-open { display: grid; }
  .site-nav a { padding: 16px 0; }
  .workspace-intro { min-height: 620px; background: var(--paper); }
  .workspace-intro::before { display: none; }
  .workspace-intro::after { width: 80px; height: 80px; border-width: 12px; top: 40px; right: 20px; }
  .workspace-intro h1, .company-hero h1, .simulation-head h1 { font-size: clamp(44px, 15vw, 72px); }
  .signal-strip { grid-template-columns: 1fr 1fr; }
  .signal-strip div { padding-bottom: 16px; }
  .section-heading { align-items: start; flex-direction: column; }
  .company-row, .empty-row { grid-template-columns: 58px 1fr; gap: 12px; padding: 26px 0; }
  .company-meta, .row-arrow, .empty-row > .status-dot { grid-column: 2; }
  .protocol-band { grid-template-columns: 1fr; gap: 40px; }
  .site-footer { flex-direction: column; }
  .company-hero { min-height: 520px; }
  .active-package { grid-template-columns: 1fr; }
  .package-action { grid-column: 1; }
  .role-grid { grid-template-columns: 1fr; }
  .role-grid article:nth-child(n) { border-top: 0; }
  .role-grid article:first-child { border-top: 1px solid var(--ink); }
  .round-workspace { display: block; }
  .round-rail { border-right: 0; border-bottom: 1px solid var(--ink); padding: 24px 20px; }
  .round-rail nav { grid-template-columns: 1fr 1fr; }
  .round-nav-item { min-height: 78px; }
  .truth-gate { display: none; }
  .round-visual { aspect-ratio: 4 / 3; }
  .round-visual img { object-position: 64% center; }
  .round-visual figcaption { right: 0; flex-wrap: wrap; }
  .pass-gate { grid-template-columns: 1fr; }
  .score-grid { grid-template-columns: 1fr; }
  .dialogue-row { grid-template-columns: 1fr; gap: 7px; }
}

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