@font-face {
  font-family: Inter;
  src: url('/fonts/InterVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

/* Cortea light tokens and control sizing; provenance in web/README.md. */
:root {
  color-scheme: light;
  --surface: #fff;
  --canvas: #f9f9f9;
  --hover: #0000000f;
  --rule: #00000017;
  --control-border: #00000024;
  --text: #141414;
  --secondary: #525252;
  --muted: #757575;
  --solid-hover: #292929;
  --focus: #2b71e8;
  --focus-ring: #175cd321;
  --link: #175cd3;
  --brand-muted: #e3ffc6;
  --brand-ink: #253d4d;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font: 425 14px/20px Inter, system-ui, sans-serif;
}
.shell { width: min(100%, 68rem); margin-inline: auto; padding-inline: 24px; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--rule); }
.brand-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-block: 20px 16px; }
.brand-lockup { display: flex; align-items: center; gap: 16px; }
.brand-home { display: inline-flex; border-radius: 4px; flex-shrink: 0; }
.brand-home img { display: block; width: 120px; height: 24px; }
.brand-divider { height: 20px; width: 1px; background: var(--control-border); }
.product-name { font-weight: 475; white-space: nowrap; }
.preview-label { color: var(--secondary); font-size: 13px; line-height: 19px; }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding-bottom: 10px; }
.site-nav > a { color: var(--secondary); text-decoration: none; font-weight: 475; padding: 5px 10px; border-radius: 6px; }
.site-nav > a:hover, .site-nav > a[aria-current="page"] { color: var(--text); background: var(--hover); }
.sign-out { margin-left: auto; }
.page-shell { padding-block: 24px 40px; }
.page-content { min-width: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 24px; }
.page-content > :first-child { margin-top: 0; }
h1, h2 { color: var(--text); font-weight: 550; margin: 24px 0 12px; }
h1 { font-size: 20px; line-height: 26px; letter-spacing: -.15px; }
h2 { font-size: 16px; line-height: 22px; letter-spacing: -.12px; }
p { margin: 8px 0 16px; }
.page-content > p { max-width: 72ch; color: var(--secondary); }
.page-content > [role="alert"] { color: #dc2626; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration: none; }
.intro { max-width: 44rem; }
.intro > p { color: var(--secondary); }
.eyebrow { display: inline-block; font-size: 13px; line-height: 19px; font-weight: 475; padding: 2px 8px; border-radius: 4px; background: var(--brand-muted); color: var(--brand-ink); }
.intro .notice, .notice { padding: 10px 12px; border: 1px solid var(--rule); border-radius: 6px; color: var(--secondary); background: var(--canvas); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
label, th, dt { font-weight: 475; }
label { display: grid; gap: 6px; }
button, input, textarea, select, .button {
  font: inherit;
  border-radius: 6px;
  border: 1px solid var(--control-border);
  padding: 4px 8px;
  min-height: 30px;
  max-width: 100%;
}
input, textarea, select { background: var(--surface); color: var(--text); }
input:hover, textarea:hover, select:hover { border-color: #00000033; }
textarea { resize: vertical; }
button, .button { display: inline-flex; align-items: center; justify-content: center; font-weight: 475; background: var(--text); color: var(--surface); border-color: transparent; cursor: pointer; text-decoration: none; }
button:hover, .button:hover { background: var(--solid-hover); }
.button-secondary { background: var(--surface); color: var(--text); border-color: var(--control-border); }
.button-secondary:hover { background: var(--canvas); border-color: #00000033; }
button:disabled { opacity: .5; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 4px var(--focus-ring); }
.skip-link { position: absolute; top: -100px; left: 16px; z-index: 1; padding: 8px 12px; background: var(--surface); border-radius: 6px; }
.skip-link:focus { top: 8px; }
.stack { display: grid; gap: 16px; max-width: 24rem; justify-items: start; margin-top: 20px; }
.stack label { width: 100%; }
#join-result { max-width: 30rem; margin-top: 24px; }
.inline { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin: 16px 0; }
pre { margin: 12px 0; white-space: pre-wrap; overflow-wrap: anywhere; border: 1px solid var(--rule); border-radius: 6px; background: var(--canvas); padding: 12px; font-size: 13px; }
dd { margin: 4px 0 16px; overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 6px; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 8px 12px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
th { color: var(--secondary); background: var(--canvas); white-space: nowrap; }
td { font-variant-numeric: tabular-nums; }
td:first-child, td:last-child { white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--canvas); }
.controls li { margin: 12px 0; overflow-wrap: anywhere; }
.controls form { display: inline-block; margin: 4px 0 4px 6px; }

/* Participant brief: reuse the compact Cortea shell, without affecting admin or Swagger. */
.landing { overflow-wrap: anywhere; }
.landing-hero { padding: 16px 0 24px; max-width: 52rem; }
.landing-hero h1 { color: var(--brand-ink); font-size: clamp(28px, 4.5vw, 44px); line-height: 1.12; letter-spacing: -.9px; margin-block: 20px; }
.landing-hero .landing-lead { color: var(--brand-ink); font-size: 19px; line-height: 28px; font-weight: 550; }
.landing p, .landing li, .landing dd { color: var(--secondary); }
.landing p { max-width: 80ch; }
.landing h3 { font-size: 15px; line-height: 22px; font-weight: 550; color: var(--text); margin: 0 0 8px; }
.landing .actions { align-items: center; }
.landing .button { padding: 8px 14px; min-height: 40px; }
.landing-text-link { padding: 8px 4px; }
.landing-hero .landing-caption { font-size: 13px; line-height: 20px; margin-top: 16px; }
.landing-preview { border-left: 3px solid var(--brand-ink); padding: 16px 20px; }
.landing-preview h2 { margin-top: 0; }
.landing-preview p:last-child, .landing-card p:last-child { margin-bottom: 0; }
.landing-contents { display: flex; flex-wrap: wrap; gap: 8px 20px; padding-block: 24px; border-bottom: 1px solid var(--rule); }
.landing-contents a { padding-block: 4px; }
.landing-section { padding-block: 32px; border-bottom: 1px solid var(--rule); scroll-margin-top: 16px; }
.landing-section > h2, .landing-footer h2 { font-size: 22px; line-height: 30px; margin-top: 12px; }
.landing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-block: 20px; }
.landing-card { border: 1px solid var(--rule); border-radius: 8px; padding: 20px; background: var(--canvas); }
.landing ul { padding-left: 20px; margin-block: 12px; }
.landing li { padding-left: 4px; margin-bottom: 8px; }
.landing-glossary { display: grid; gap: 16px; margin: 24px 0 0; }
.landing-glossary > div { border-left: 2px solid var(--brand-muted); padding-left: 16px; }
.landing-glossary dd { margin-bottom: 0; }
.landing-steps { padding-left: 24px; margin: 24px 0 0; }
.landing-steps > li { padding-left: 12px; margin-bottom: 24px; }
.landing-steps > li::marker { color: var(--brand-ink); font-weight: 650; }
.landing-steps > li:last-child { margin-bottom: 0; }
.landing-weight { display: block; color: var(--brand-ink); font-size: 28px; line-height: 36px; font-weight: 600; margin-bottom: 12px; }
.landing-prize { padding: 16px; border-radius: 6px; background: var(--brand-muted); }
.landing-faq details { border-bottom: 1px solid var(--rule); padding-block: 16px; }
.landing-faq details:last-child { border-bottom: 0; }
.landing-faq summary { cursor: pointer; font-weight: 550; padding-block: 4px; }
.landing-faq p { margin: 12px 0 0; }
.landing-footer { padding-top: 24px; }

@media (max-width: 680px) {
  .landing-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .landing-card, .landing-preview { padding: 16px; }
  .landing-section { padding-block: 24px; }
}

@media (max-width: 600px) {
  .shell { padding-inline: 16px; }
  .brand-bar { padding-block: 16px 12px; }
  .brand-lockup { gap: 12px; }
  .page-shell { padding-block: 16px 24px; }
  .page-content { padding: 16px; }
  .sign-out { margin-left: 0; }
}

/* Leaderboard */
.board th, .board td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.board tbody tr:last-child td { border-bottom: 0; }
.board .num { text-align: right; font-variant-numeric: tabular-nums; }
.board .rank { width: 3ch; color: var(--secondary); font-variant-numeric: tabular-nums; }
.board .podium .rank { color: var(--brand-ink); font-weight: 600; }
.board .podium td { background: var(--canvas); }
.board tbody tr:hover td { background: var(--brand-muted); }
.board .units { min-width: 7rem; }
.board th, .board td { padding-inline: 10px; }
.board meter { display: block; width: 100%; height: 6px; margin-top: 4px; }
.board .miss { color: #a4262c; }
.board .none { color: var(--secondary); }
.board .podium:first-child .rank::before { content: "\2605  "; color: var(--brand-ink); }
/* Links inside the brief read as text, not as blue links. */
.landing a:not(.button) { color: inherit; text-decoration: underline; text-decoration-color: var(--control-border); text-underline-offset: 3px; }
.landing a:not(.button):hover { text-decoration-color: currentColor; }
/* Field guide */
.field-guide > p, .field-guide .guide > p, .field-guide ol, .field-guide ul { max-width: 72ch; }
.field-guide .guide { border-top: 1px solid var(--rule); margin-top: 32px; padding-top: 8px; }
.field-guide th, .field-guide td { padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--rule); font-size: 13px; white-space: nowrap; }
.field-guide .guide-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.field-guide figure { margin: 0; }
.field-guide .shot { display: block; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); overflow: hidden; }
.field-guide .shot:hover { border-color: var(--control-border); }
.field-guide .shot img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: contain; }
.field-guide .shot.tall img { object-fit: cover; object-position: top; }
.field-guide figcaption { margin-top: 6px; font-size: 13px; color: var(--secondary); }
.field-guide figcaption b { color: var(--text); }
.lightbox { border: 0; border-radius: 8px; padding: 12px; width: min(96vw, 60rem); max-height: 96vh; background: var(--surface); color: var(--text); }
.lightbox[open] { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; }
.lightbox::backdrop { background: #000000b3; }
.lightbox figure { margin: 0; min-width: 0; text-align: center; }
.lightbox img { max-width: 100%; border: 1px solid var(--rule); }
.lightbox figcaption { margin-top: 8px; }
.lightbox p { margin: 8px 0 0; font-size: 13px; }
.lightbox button { font: inherit; border: 1px solid var(--control-border); border-radius: 6px; background: var(--surface); color: var(--text); padding: 4px 10px; cursor: pointer; }
.lightbox button[data-go] { position: sticky; top: 40vh; align-self: start; font-size: 22px; line-height: 28px; }
/* Team page */
#team-key { width: 100%; font-family: ui-monospace, monospace; font-size: 12px; }
.team-cards { display: flex; flex-wrap: wrap; gap: 16px; margin: 12px 0; }
.team-card { margin: 0; width: min(100%, 22rem); }
.team-card figcaption p { margin: 6px 0 0; color: var(--secondary); }
.team-card img { display: block; border-radius: 8px; border: 1px solid var(--rule); }
.team-card figcaption { display: grid; gap: 2px; margin-top: 6px; font-size: 13px; }

/* Long identifiers wrap on narrow screens. */
li code, p code { overflow-wrap: anywhere; }

/* Answers */
.answer-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 24px 20px; margin: 12px 0 28px; }
.answer-cards .team-card { width: auto; }
