:root {
  color-scheme: light;
  --ink: #17202d;
  --muted: #5a6778;
  --line: #d9e1eb;
  --line-strong: #bdc9d8;
  --paper: #f6f8fb;
  --surface: #ffffff;
  --accent: #e54c3f;
  --accent-dark: #b83228;
  --blue: #22577a;
  --blue-soft: #e9f2f8;
  --green: #176f58;
  --green-soft: #e8f5f0;
  --gold: #8a5b00;
  --gold-soft: #fff3d8;
  --code: #6246a8;
  --code-soft: #f0ecfb;
  --shadow: 0 16px 42px rgba(29, 43, 61, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}

a {
  color: inherit;
}

button,
.button,
.submit-link {
  font: inherit;
}

.hero {
  min-height: min(760px, 82vh);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(110deg, rgba(246, 248, 251, 0.97) 0%, rgba(246, 248, 251, 0.9) 48%, rgba(246, 248, 251, 0.68) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='700' viewBox='0 0 1200 700'%3E%3Crect width='1200' height='700' fill='%23edf3f8'/%3E%3Cg fill='none' stroke='%239aaec1' stroke-width='2' opacity='0.48'%3E%3Cpath d='M120 180h220v90H120zM470 120h260v120H470zM850 210h230v95H850zM210 420h260v105H210zM650 390h300v120H650z'/%3E%3Cpath d='M340 225h130M730 180h120M965 305v85M470 470h180'/%3E%3C/g%3E%3Cg font-family='monospace' font-size='22' fill='%2322577a' opacity='0.62'%3E%3Ctext x='150' y='235'%3Etrace evidence%3C/text%3E%3Ctext x='500' y='190'%3Espan tree%3C/text%3E%3Ctext x='885' y='270'%3Eevaluation%3C/text%3E%3Ctext x='245' y='485'%3Ecode check%3C/text%3E%3Ctext x='685' y='455'%3Emanager report%3C/text%3E%3C/g%3E%3C/svg%3E") center / cover;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 22px clamp(20px, 5vw, 64px);
  font-size: 0.92rem;
}

.brand {
  font-weight: 800;
  text-decoration: none;
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.topbar-links a {
  font-weight: 700;
  text-decoration: none;
}

.submit-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  color: white;
  background: var(--ink);
  border-radius: 6px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 410px);
  gap: clamp(36px, 7vw, 90px);
  align-items: center;
  max-width: 1280px;
  min-height: calc(min(760px, 82vh) - 82px);
  margin: 0 auto;
  padding: 56px clamp(20px, 5vw, 64px) 80px;
}

.hero-copy {
  max-width: 820px;
}

.eyebrow,
.section-label {
  margin: 0 0 12px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  text-wrap: pretty;
}

h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(3rem, 6.5vw, 5.8rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.summary {
  max-width: 700px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-weight: 800;
  text-decoration: none;
}

.button.primary {
  color: white;
  background: var(--accent);
  border-color: var(--accent);
}

.button:hover,
.button:focus-visible,
.submit-link:hover,
.submit-link:focus-visible {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(34, 87, 122, 0.15);
  outline: none;
}

.flow-panel {
  overflow: hidden;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.flow-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 0.84rem;
}

.flow-heading span {
  color: var(--muted);
}

.flow {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.flow li {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 14px;
  align-items: start;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
}

.flow li:last-child {
  border-bottom: 0;
}

.flow li > span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 900;
}

.flow strong,
.flow small {
  display: block;
}

.flow small {
  margin-top: 2px;
  color: var(--muted);
}

main,
footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.questions-section {
  padding: 76px 0 42px;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.7fr);
  gap: 48px;
  align-items: end;
  margin-bottom: 30px;
}

.section-heading > p {
  margin: 0;
  color: var(--muted);
}

.inline-code-label {
  color: var(--code);
  font-weight: 800;
}

.case-nav {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.case-nav a {
  min-width: 0;
  padding: 14px;
  border-right: 1px solid var(--line);
  text-decoration: none;
}

.case-nav a:last-child {
  border-right: 0;
}

.case-nav a:hover,
.case-nav a:focus-visible {
  background: var(--blue-soft);
  outline: none;
}

.case-nav b,
.case-nav span {
  display: block;
}

.case-nav b {
  color: var(--blue);
  font-size: 0.84rem;
}

.case-nav span {
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-list {
  border-top: 1px solid var(--line-strong);
}

.case {
  scroll-margin-top: 22px;
  border-bottom: 1px solid var(--line-strong);
  background: transparent;
}

.case summary {
  min-height: 94px;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) 24px;
  gap: 18px;
  align-items: center;
  padding: 18px 12px;
  cursor: pointer;
  list-style: none;
}

.case summary::-webkit-details-marker {
  display: none;
}

.case summary:hover,
.case summary:focus-visible {
  background: rgba(233, 242, 248, 0.65);
  outline: none;
}

.case-number {
  color: var(--accent-dark);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 1.05rem;
  font-weight: 900;
}

.case-title strong,
.case-title small {
  display: block;
}

.case-title strong {
  font-size: 1.12rem;
}

.case-title small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
}

.case-toggle {
  width: 12px;
  height: 12px;
  border-right: 2px solid var(--blue);
  border-bottom: 2px solid var(--blue);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 160ms ease;
}

.case[open] .case-toggle {
  transform: rotate(225deg) translate(-1px, -1px);
}

.case-body {
  padding: 0 12px 34px 98px;
}

.ba-flag {
  max-width: 920px;
  margin: 0 0 20px;
  padding-left: 14px;
  color: var(--muted);
  border-left: 3px solid var(--accent);
}

.question-list {
  counter-reset: question;
  display: grid;
  margin: 0;
  padding-left: 32px;
}

.question {
  counter-increment: question;
  display: grid;
  grid-template-columns: 28px 94px minmax(0, 1fr);
  gap: 16px;
  padding: 15px 0 15px 5px;
  border-bottom: 1px solid var(--line);
}

.question::before {
  content: counter(question, upper-alpha) ".";
  color: var(--blue);
  font-weight: 900;
}

.question:last-child {
  border-bottom: 0;
}

.evidence-badge {
  width: 88px;
  min-height: 28px;
  align-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 900;
}

.evidence-badge.opik {
  color: var(--green);
  background: var(--green-soft);
}

.evidence-badge.code {
  color: var(--code);
  background: var(--code-soft);
}

.evidence-badge.experiment {
  color: var(--gold);
  background: var(--gold-soft);
}

.choices {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.88rem;
}

code,
pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.question code {
  color: #334155;
  font-size: 0.86em;
  overflow-wrap: anywhere;
}

.answer-template {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-top: 22px;
  padding: 18px 0 0;
  border-top: 1px dashed var(--line-strong);
}

.answer-template pre {
  min-width: 250px;
  margin: 0;
  color: #dce8f5;
  background: #101821;
  border-radius: 6px;
  padding: 14px 16px;
  font-size: 0.82rem;
  line-height: 1.45;
}

.answer-template button {
  min-height: 40px;
  padding: 0 15px;
  color: var(--blue);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
}

.answer-template button:hover,
.answer-template button:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(34, 87, 122, 0.12);
  outline: none;
}

.submission-guide {
  scroll-margin-top: 22px;
  margin: 42px 0 80px;
  padding: 72px 0 0;
  border-top: 1px solid var(--line-strong);
}

.submission-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.7fr);
  gap: 48px;
  align-items: end;
  margin-bottom: 32px;
}

.submission-heading > p {
  margin: 0;
  color: var(--muted);
}

.submission-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  list-style: none;
}

.submission-steps li {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 14px;
  padding: 24px 22px;
  border-right: 1px solid var(--line);
}

.submission-steps li:last-child {
  border-right: 0;
}

.submission-steps li > span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 6px;
  font-weight: 900;
}

.submission-steps strong {
  display: block;
  margin-top: 3px;
}

.submission-steps p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.submission-screenshot {
  margin: 40px 0 0;
}

.submission-screenshot img {
  width: 100%;
  height: auto;
  display: block;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.submission-screenshot figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.comment-guide {
  display: grid;
  grid-template-columns: minmax(280px, 0.75fr) minmax(0, 1fr);
  gap: clamp(36px, 7vw, 88px);
  margin-top: 48px;
  padding: 40px 0;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.comment-guide h3 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.15;
}

.comment-guide p:not(.section-label) {
  margin: 12px 0 0;
  color: var(--muted);
}

.comment-guide pre {
  margin: 22px 0 0;
  padding: 16px 18px;
  overflow-x: auto;
  color: #dce8f5;
  background: #101821;
  border-radius: 6px;
  font-size: 0.84rem;
  line-height: 1.5;
}

.grading-rules {
  display: grid;
  align-content: start;
  margin: 0;
  padding: 0;
  list-style: none;
}

.grading-rules li {
  display: grid;
  grid-template-columns: minmax(170px, 0.55fr) minmax(0, 1fr);
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.grading-rules li:first-child {
  padding-top: 0;
}

.grading-rules li:last-child {
  border-bottom: 0;
}

.grading-rules span {
  color: var(--muted);
}

.submission-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 30px 0;
}

.submission-action p {
  margin: 0;
  color: var(--muted);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 0 0 32px;
  color: var(--muted);
  font-size: 0.84rem;
}

@media (max-width: 920px) {
  .hero {
    min-height: auto;
  }

  .hero-grid,
  .section-heading,
  .submission-heading,
  .comment-guide {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    min-height: auto;
    padding-top: 46px;
  }

  .case-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .case-nav a:nth-child(3) {
    border-right: 0;
  }

  .case-nav a:nth-child(-n + 3) {
    border-bottom: 1px solid var(--line);
  }

  .submission-steps {
    grid-template-columns: 1fr;
  }

  .submission-steps li {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .submission-steps li:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 640px) {
  .flow-panel {
    display: none;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar-links {
    gap: 14px;
  }

  .topbar-links > a:not(.submit-link) {
    display: none;
  }

  h1 {
    font-size: clamp(2.8rem, 14vw, 4.1rem);
  }

  main,
  footer {
    width: min(100% - 24px, 1180px);
  }

  .questions-section {
    padding-top: 54px;
  }

  .case-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .case-nav a,
  .case-nav a:nth-child(3) {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .case-nav a:nth-child(2n) {
    border-right: 0;
  }

  .case-nav a:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .case summary {
    min-height: 84px;
    grid-template-columns: 48px minmax(0, 1fr) 18px;
    gap: 10px;
    padding-inline: 4px;
  }

  .case-body {
    padding: 0 4px 30px;
  }

  .question-list {
    padding-left: 28px;
  }

  .question {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 9px;
  }

  .question .evidence-badge,
  .question > div {
    grid-column: 2;
  }

  .answer-template,
  .submission-action {
    align-items: stretch;
    flex-direction: column;
  }

  .answer-template pre {
    min-width: 0;
  }

  .grading-rules li {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .submission-action .button {
    align-self: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .case-toggle {
    transition: none;
  }
}
