/* competitions.c1562 landing
   Palette after SPACE-π posters: blue as the main surface, orange for the
   one action that matters, black and white for everything else. */

:root, :root[data-theme="light"] {
  --page: #ffffff;
  --ink: #000000;
  --muted: #4a5163;
  --line: #dde2ec;
  --blue: #1a47c4;
  --blue-deep: #11328f;
  --on-blue: #ffffff;
  --on-blue-muted: #c9d5f7;
  --orange: #ff6a13;
  --orange-ink: #000000;
  --paper: #ffffff;
  --flag-bg: #fff0e6;
  --flag-ink: #a63d00;
  --ok: #138a4a;
  --miss: #d0261d;

  --font: "Golos Text", "Segoe UI", system-ui, sans-serif;
  --display: "Unbounded", "Golos Text", system-ui, sans-serif;
  --gutter: clamp(16px, 5vw, 64px);
  --wide: 1200px;
}

:root[data-theme="dark"] {
  --page: #000000;
  --ink: #ffffff;
  --muted: #a8afc0;
  --line: #262c3a;
  --blue: #163ba3;
  --blue-deep: #0d2770;
  --on-blue: #ffffff;
  --on-blue-muted: #b4c3ef;
  --orange: #ff7a2b;
  --paper: #0b0e16;
  --flag-bg: #3a1a07;
  --flag-ink: #ffb07a;
  --ok: #43c47f;
  --miss: #ff6b62;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { margin: 0; line-height: 1.05; }
h1, h2 { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Header sits on the blue hero */
.top {
  background: var(--blue);
  color: var(--on-blue);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 18px var(--gutter);
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-mark { width: 34px; height: 34px; flex: none; }
.logo-mark circle { fill: var(--on-blue); }
.logo-mark .star { fill: var(--orange); }
.logo-word { font-family: var(--display); font-weight: 700; font-size: 1.1rem; letter-spacing: -0.01em; }
.logo-tld { font-weight: 500; opacity: .75; }

.top nav { display: flex; align-items: center; gap: 10px; }
.nav-link { text-decoration: none; font-weight: 500; padding: 6px 10px; }
.nav-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.chip {
  font: 600 .85rem var(--font);
  color: inherit;
  background: transparent;
  border: 1.5px solid rgba(255,255,255,.45);
  border-radius: 8px;
  height: 36px;
  min-width: 40px;
  padding: 0 10px;
  cursor: pointer;
}
.chip:hover { border-color: var(--on-blue); }
.chip-icon svg { width: 18px; height: 18px; display: block; margin: auto; fill: none; stroke: currentColor; stroke-width: 2; }
.chip-icon .half { fill: currentColor; stroke: none; }
.nav-signin {
  margin-left: 6px;
  text-decoration: none;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: 8px;
  background: var(--on-blue);
  color: var(--blue);
}
.nav-signin:hover { background: var(--orange); color: var(--orange-ink); }

/* Hero */
.hero {
  background: var(--blue);
  color: var(--on-blue);
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  padding: clamp(32px, 5vw, 72px) var(--gutter) clamp(56px, 7vw, 104px);
}
.hero h1 { font-size: clamp(2.2rem, 4.4vw, 3.6rem); line-height: 1.04; }
.lede { margin-top: 22px; font-size: 1.15rem; color: var(--on-blue-muted); max-width: 40ch; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.small { margin-top: 16px; font-size: .9rem; color: var(--on-blue-muted); }

.btn {
  display: inline-block;
  padding: 14px 22px;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid transparent;
}
.btn-main { background: var(--orange); color: var(--orange-ink); }
.btn-main:hover { background: var(--on-blue); color: #000; }
.btn-plain { border-color: rgba(255,255,255,.6); color: var(--on-blue); }
.btn-plain:hover { border-color: var(--on-blue); background: rgba(255,255,255,.08); }

/* Blueprint */
.blueprint { margin: 0; }
.blueprint svg { display: block; width: 100%; height: auto; border-radius: 6px; }
.bp-bg { fill: var(--blue-deep); }
.grid-line { fill: none; stroke: rgba(255,255,255,.09); stroke-width: 1; }
.bp-frame { fill: none; stroke: rgba(255,255,255,.5); stroke-width: 1.5; }
.draw { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.draw .thin { stroke-width: 1.2; opacity: .8; }
.leader { fill: none; stroke: rgba(255,255,255,.7); stroke-width: 1; stroke-dasharray: 3 3; }
.blueprint text { font-family: var(--font); fill: #fff; }
.t-wk { font-weight: 700; font-size: 14px; }
.t-note { font-size: 13px; fill: var(--on-blue-muted) !important; }
.ok { fill: var(--orange); }
.ok-tick { fill: none; stroke: #000; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.wait { fill: none; stroke: var(--orange); stroke-width: 2; }
.t-wait { font-size: 12px; font-weight: 800; text-anchor: middle; fill: var(--orange) !important; }
.todo { fill: none; stroke: rgba(255,255,255,.55); stroke-width: 1.5; stroke-dasharray: 2 3; }
.dim path { fill: none; stroke: #fff; stroke-width: 1.2; }
.dim .dim-arrow { fill: #fff; stroke: none; }
.t-dim { font-size: 13px; }
.t-end { text-anchor: end; }
.t-mid { text-anchor: middle; font-weight: 700; }
.title-block rect, .title-block path { fill: none; stroke: rgba(255,255,255,.7); stroke-width: 1.2; }
.t-k { font-size: 12px; fill: var(--on-blue-muted) !important; }
.t-v { font-size: 14px; font-weight: 700; }

/* One moment of motion: the drawing is drafted once on load */
@media (prefers-reduced-motion: no-preference) {
  .draw > * { stroke-dasharray: 420; stroke-dashoffset: 420; animation: draft 1.4s ease-out forwards; }
  .stage:nth-of-type(2) .draw > * { animation-delay: .25s; }
  .stage:nth-of-type(3) .draw > * { animation-delay: .5s; }
  .stage:nth-of-type(4) .draw > * { animation-delay: .75s; }
  @keyframes draft { to { stroke-dashoffset: 0; } }
}

/* Shared section rhythm */
.formats, .participants, .organisers, .judging, .makers {
  padding: clamp(56px, 8vw, 104px) var(--gutter);
}
.formats > *, .participants > *, .judging > *, .makers > * {
  max-width: var(--wide);
  margin-left: auto;
  margin-right: auto;
}

/* Formats */
.format-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(24px, 3vw, 44px);
  margin-top: 44px;
  margin-bottom: 0;
}
.format { border-top: 3px solid var(--ink); padding-top: 18px; }
.format svg { width: 44px; height: 44px; fill: none; stroke: var(--blue); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
:root[data-theme="dark"] .format svg { stroke: var(--orange); }
.format dt { margin-top: 14px; font-weight: 800; font-size: 1.15rem; line-height: 1.2; }
.format dd { margin: 10px 0 0; color: var(--muted); }

/* Participants: a blue block with a real sequence */
.participants { background: var(--blue); color: var(--on-blue); }
.section-head p { margin-top: 12px; font-size: 1.15rem; color: var(--on-blue-muted); max-width: 46ch; }
.steps {
  list-style: none;
  padding: 0;
  margin-top: 48px;
  margin-bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  counter-reset: step;
}
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step);
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 3rem;
  line-height: 1;
  color: var(--orange);
  margin-bottom: 14px;
}
.steps p { margin-top: 8px; color: var(--on-blue-muted); max-width: 32ch; }

/* Organisers */
.organisers {
  max-width: calc(var(--wide) + 2 * var(--gutter));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: start;
}
.org-text p { margin-top: 18px; max-width: 48ch; }
.org-text h2 + p { margin-top: 24px; }
.sheet-fig { margin: 0; }
.sheet {
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  font-size: .95rem;
}
.sheet-head {
  display: flex;
  justify-content: space-between;
  padding: 14px 18px;
  font-weight: 800;
  background: var(--blue);
  color: var(--on-blue);
}
.sheet-count { font-weight: 500; color: var(--on-blue-muted); }
.sheet table { width: 100%; border-collapse: collapse; }
.sheet th { text-align: left; font-weight: 500; color: var(--muted); padding: 10px 18px 8px; font-size: .85rem; }
.sheet td { padding: 12px 18px; border-top: 1px solid var(--line); white-space: nowrap; }
.sheet td:first-child { font-weight: 600; }
.sheet .ok { color: var(--ok); font-weight: 800; fill: none; }
.sheet .miss { color: var(--miss); font-size: .82rem; font-weight: 700; }
.sheet .flag { color: var(--flag-ink); background: var(--flag-bg); font-size: .82rem; font-weight: 700; }
.sheet .wait { color: var(--blue); font-size: .82rem; font-weight: 700; fill: none; stroke: none; }
:root[data-theme="dark"] .sheet .wait { color: var(--on-blue-muted); }
.sheet-foot { padding: 12px 18px; border-top: 1px solid var(--line); font-weight: 700; font-size: .9rem; color: var(--blue); }
:root[data-theme="dark"] .sheet-foot { color: var(--orange); }

/* Judging */
.judging { border-top: 3px solid var(--ink); }
.judging-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 4vw, 56px); margin-top: 40px; }
.judging-cols p { margin-top: 10px; color: var(--muted); max-width: 36ch; }

/* Makers */
.makers { background: var(--ink); color: var(--page); }
.makers p { margin-top: 16px; margin-bottom: 30px; font-size: 1.15rem; max-width: 56ch; opacity: .85; }
.makers .btn { display: inline-block; }
.makers .btn-main:hover { background: var(--page); color: var(--ink); }

/* Stub pages for links that aren't built yet */
.stub {
  background: var(--blue);
  color: var(--on-blue);
  padding: clamp(64px, 12vw, 160px) var(--gutter);
}
.stub-in { max-width: var(--wide); margin: 0 auto; }
.stub-tag { color: var(--orange); font-weight: 700; }
.stub h1 { margin-top: 12px; font-size: clamp(2rem, 4.4vw, 3.4rem); }
.stub-text { margin: 18px 0 32px; font-size: 1.15rem; color: var(--on-blue-muted); max-width: 48ch; }

/* Footer */
.foot {
  max-width: calc(var(--wide) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 28px var(--gutter) 44px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 28px;
  color: var(--muted);
  font-size: .9rem;
}
.fake-note { font-style: italic; }
.foot-links { display: flex; gap: 20px; flex-wrap: wrap; }

/* Tablet */
@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; }
  .format-list { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; row-gap: 40px; }
  .organisers { grid-template-columns: 1fr; }
  .judging-cols { grid-template-columns: 1fr; }
}

/* Phone */
@media (max-width: 640px) {
  .nav-link { display: none; }
  .top { gap: 10px; }
  .top nav { gap: 6px; }
  .logo { gap: 8px; }
  .logo-mark { width: 28px; height: 28px; }
  .logo-word { font-size: .8rem; line-height: 1.05; }
  .logo-tld { display: block; }
  .chip { height: 34px; min-width: 34px; padding: 0 8px; }
  .nav-signin { margin-left: 0; padding: 7px 12px; white-space: nowrap; }
  .format-list, .steps { grid-template-columns: 1fr; }
  .sheet { overflow-x: auto; }
}
