/* IICPC AI Hackathon: dark theme. Near-black navy, indigo light, metallic headings, mono labels. */

:root {
  color-scheme: dark;

  --blue: #0056d2;              /* IICPC brand blue: primary buttons */
  --blue-600: #004bb8;
  --accent: #a5b4fc;            /* indigo 300: links, labels and active states */
  --accent-2: #818cf8;          /* indigo 400: lines, markers, focus rings */
  --accent-3: #6366f1;          /* indigo 500: ticked checkboxes and radios */
  --accent-tint: rgba(129, 140, 248, 0.12);

  --night: #05080f;             /* darkest: hero, page headers, call to action */
  --canvas: #070b16;            /* page background */
  --surface: #0a0f1f;           /* alternate sections */
  --card: rgba(255, 255, 255, 0.025);
  --field: #0b1122;             /* form inputs */
  --black: #04060c;             /* footer */

  --ink: #eef1ff;
  --ink-2: #c9cfe6;
  --text-2: #a3abc8;
  --text-3: #7d86a6;
  --rule: rgba(165, 180, 252, 0.12);
  --rule-strong: rgba(165, 180, 252, 0.22);

  --success: #4ade80;
  --danger: #f87171;

  --metal: linear-gradient(180deg, #ffffff 28%, #aeb7d8 100%);
  --metal-accent: linear-gradient(180deg, #eef2ff 18%, #8b9cf7 100%);

  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --fast: 150ms;
  --base: 200ms;
  --slow: 300ms;

  --radius: 6px;
  --radius-lg: 10px;
  --container: 1200px;
  --gutter: clamp(20px, 4vw, 40px);
  --nav-h: 68px;
  --section-y: clamp(72px, 9vw, 120px);
}

/* ---------- Reset & base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 24px); background: var(--canvas); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
::selection { background: rgba(129, 140, 248, 0.45); color: #fff; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--blue); color: #fff; padding: 10px 16px; border-radius: var(--radius); font-weight: 500;
}
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }

.tabular { font-variant-numeric: tabular-nums; }

/* ---------- Type ---------- */

/* Small labels above sections: code font, wide tracking */
.eyebrow {
  display: block;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Terminal-prompt label at the top of every dark band: "> IICPC WINTER AI HACKATHON 2026" */
.eyebrow.prompt {
  display: inline-block;
  font-size: 13px;
  letter-spacing: 0.18em;
  color: rgba(224, 231, 255, 0.82);
}
.eyebrow.prompt::before {
  content: ">";
  content: ">" / "";               /* decorative: screen readers skip it */
  margin-right: 0.75em;
  color: var(--accent-2);
  text-shadow: 0 0 12px rgba(129, 140, 248, 0.8);
}

.h2 {
  font-size: clamp(30px, 3.4vw, 44px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.035em;
  max-width: 22ch;
}
.h3 { font-size: 19px; font-weight: 500; line-height: 1.35; letter-spacing: -0.02em; color: var(--ink); }
.lead { font-size: 18px; font-weight: 400; line-height: 1.65; color: var(--text-2); max-width: 60ch; }
.body { color: var(--text-2); max-width: 64ch; }
.small { font-size: 14px; line-height: 1.5; color: var(--text-3); }

/* Metallic headings, like the hero's */
.h2, .page-head__title, .cta__title, .result h2, .hero__title .line {
  padding-bottom: 0.05em;
  background: var(--metal);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.figure__num {
  background: var(--metal-accent);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
@media (forced-colors: active) {
  .h2, .page-head__title, .cta__title, .result h2, .hero__title .line, .hero__accent, .figure__num {
    background: none; -webkit-text-fill-color: CanvasText; color: CanvasText;
  }
}

.link {
  color: var(--accent);
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0 1px; background-position: 0 100%; background-repeat: no-repeat;
  transition: background-size var(--slow) var(--ease), color var(--base) var(--ease);
}
.link:hover { background-size: 100% 1px; color: #c7d2fe; }

/* A link inside running copy that keeps the copy's colour */
.link-inherit { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.link-inherit:hover { text-decoration-thickness: 2px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 46px; padding: 0 22px;
  font-size: 15px; font-weight: 500; letter-spacing: -0.005em; white-space: nowrap;
  border: 1px solid transparent; border-radius: var(--radius); cursor: pointer;
  transition: background-color var(--base) var(--ease), border-color var(--base) var(--ease), color var(--base) var(--ease), box-shadow var(--base) var(--ease);
}
.btn svg { width: 16px; height: 16px; flex: none; transition: transform var(--base) var(--ease); }
.btn:hover svg { transform: translateX(4px); }
.btn--primary {
  color: #fff;
  background: linear-gradient(180deg, #2f6fe6 0%, var(--blue) 100%);
  box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 10px 30px -12px rgba(59, 130, 246, 0.85);
}
.btn--primary:hover { background: linear-gradient(180deg, #3b7cf2 0%, var(--blue-600) 100%); }
.btn--outline-light, .btn--outline {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--rule-strong);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.btn--outline-light:hover, .btn--outline:hover { border-color: rgba(224, 231, 255, 0.6); background: rgba(255, 255, 255, 0.07); }
.btn--white { background: #fff; color: #0b1430; }
.btn--white:hover { background: #e0e7ff; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.6; cursor: progress; }

/* ---------- Navigation ---------- */

.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--nav-h);
  color: #fff;
  background: rgba(5, 8, 15, 0.35);
  -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid rgba(165, 180, 252, 0.08);
  transition: background-color var(--slow) var(--ease), border-color var(--slow) var(--ease), box-shadow var(--slow) var(--ease);
}
.nav.is-scrolled, .nav.is-open {
  background: rgba(5, 8, 15, 0.82);
  border-bottom-color: var(--rule);
  box-shadow: 0 10px 30px -20px rgba(0, 0, 0, 0.9);
}
.nav__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.wordmark { display: inline-flex; align-items: center; gap: 10px; font-size: 17px; line-height: 1; }
.wordmark__logo {
  width: 40px; height: 40px; flex: none; margin-right: 2px; border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(165, 180, 252, 0.25), 0 6px 20px -4px rgba(99, 102, 241, 0.6);
  transition: transform var(--slow) var(--ease);
}
.wordmark:hover .wordmark__logo { transform: rotate(-8deg) scale(1.04); }
.wordmark__org { font-weight: 700; letter-spacing: 0.06em; }
.wordmark__sep { width: 1px; height: 14px; background: currentColor; opacity: 0.3; align-self: center; }
.wordmark__event { font-weight: 300; letter-spacing: -0.01em; }

.nav__links { display: flex; align-items: center; gap: 32px; font-size: 15px; }
.nav__link { position: relative; opacity: 0.75; transition: opacity var(--base) var(--ease); padding: 6px 0; }
.nav__link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--slow) var(--ease);
}
.nav__link:hover, .nav__link[aria-current="page"] { opacity: 1; }
.nav__link:hover::after, .nav__link[aria-current="page"]::after { transform: scaleX(1); }
.nav .btn { height: 38px; padding: 0 16px; font-size: 14px; }

.nav__toggle {
  display: none; width: 40px; height: 40px; margin-right: -8px;
  background: none; border: 0; cursor: pointer; color: inherit;
}
.nav__toggle span { display: block; width: 20px; height: 1.5px; margin: 5px auto; background: currentColor; transition: transform var(--base) var(--ease), opacity var(--base) var(--ease); }
.nav.is-open .nav__toggle span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav.is-open .nav__toggle span:nth-child(2) { opacity: 0; }
.nav.is-open .nav__toggle span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

@media (max-width: 760px) {
  .nav__toggle { display: block; }
  .nav__links {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--gutter) 24px;
    background: rgba(5, 8, 15, 0.97); color: var(--ink);
    border-bottom: 1px solid var(--rule);
    display: none;
  }
  .nav.is-open .nav__links { display: flex; }
  .nav__link { padding: 14px 0; border-bottom: 1px solid var(--rule); opacity: 1; }
  .nav__link::after { display: none; }
  .nav__links .btn { margin-top: 20px; height: 46px; }
}

/* ---------- Dark bands: hero, page headers, call to action, 404 ---------- */

.night {
  position: relative;
  color: #fff;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(42% 60% at 50% 48%, rgba(79, 70, 229, 0.18), transparent 70%),
    radial-gradient(40% 70% at 50% -20%, rgba(0, 86, 210, 0.36), transparent 70%),
    linear-gradient(180deg, var(--night) 0%, #070b1c 60%, #0a1024 100%);
}
/* A faint dot field around the title */
.night::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: radial-gradient(rgba(165, 180, 252, 0.16) 1px, transparent 1.3px);
  background-size: 22px 22px; background-position: center top;
  -webkit-mask-image: radial-gradient(42% 60% at 50% 60%, #000 0%, transparent 100%);
  mask-image: radial-gradient(42% 60% at 50% 60%, #000 0%, transparent 100%);
}
/* Hairline of light along the bottom edge */
.night::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(129, 140, 248, 0.7) 50%, transparent);
}
/* Halftone light shards and beams, drawn by shards.js */
.shards { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }

/* ---------- Hero (home) ---------- */

.hero {
  display: flex; flex-direction: column;
  min-height: clamp(700px, 100svh, 1000px);
  padding-top: calc(var(--nav-h) + clamp(40px, 6vw, 88px));
  text-align: center;
  background:
    radial-gradient(42% 38% at 50% 42%, rgba(79, 70, 229, 0.22), transparent 70%),
    radial-gradient(38% 55% at 50% -12%, rgba(0, 86, 210, 0.42), transparent 70%),
    linear-gradient(180deg, var(--night) 0%, #070b1c 55%, #0a1024 100%);
}
.night.hero::before {
  -webkit-mask-image: radial-gradient(40% 44% at 50% 58%, #000 0%, transparent 100%);
  mask-image: radial-gradient(40% 44% at 50% 58%, #000 0%, transparent 100%);
}
.hero__inner {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding-bottom: clamp(48px, 6vw, 80px);
}

/* Big, tight, metallic headline */
.hero__title {
  margin-top: 30px;
  font-size: clamp(44px, 6.1vw, 96px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.048em;
  text-wrap: balance;
}
.hero__title .line { display: block; padding-bottom: 0.06em; }
.hero__accent {
  background: linear-gradient(100deg, #e0e7ff 0%, #a5b4fc 30%, #7dd3fc 52%, #eef2ff 70%, #a5b4fc 100%);
  background-size: 220% 100%; background-position: 0% 0;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero__sub {
  margin: 22px auto 0; max-width: 56ch;
  font-size: clamp(17px, 1.4vw, 20px); font-weight: 400; line-height: 1.6;
  color: rgba(224, 231, 255, 0.68);
}
.hero__actions { margin-top: 38px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.hero .btn, .cta .btn { height: 52px; padding: 0 26px; font-size: 16px; }

/* "Registration closes in 10d 08h 42m 51s" */
.hero__countdown {
  margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px;
  font-size: 14px; color: rgba(224, 231, 255, 0.6);
}
.cd-group { display: inline-flex; gap: 6px; }
.cd { display: inline-flex; align-items: baseline; font-family: var(--mono); }
.cd b {
  min-width: 2.4ch; padding: 3px 6px; border-radius: 4px; text-align: center;
  font-weight: 500; color: #fff; font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(165, 180, 252, 0.18);
}
.cd i { margin-left: 3px; font-style: normal; font-size: 12px; color: rgba(165, 180, 252, 0.85); }

/* Event facts along the bottom edge, where a logo strip would usually sit */
.hero__specs { border-top: 1px solid rgba(165, 180, 252, 0.1); background: linear-gradient(180deg, rgba(5, 8, 15, 0) 0%, rgba(5, 8, 15, 0.5) 100%); }
.specs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 auto; }
.spec { padding: 22px 16px; border-left: 1px solid rgba(165, 180, 252, 0.08); }
.spec:first-child { border-left: 0; }
.spec dt { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(165, 180, 252, 0.75); }
.spec dd { margin-top: 6px; font-size: 15px; font-weight: 500; color: rgba(255, 255, 255, 0.9); }

@media (max-width: 760px) {
  .hero { min-height: 0; }
  .hero__inner { padding-top: 8px; }
  .hero .btn { flex: 1 1 100%; }
  .specs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spec { padding: 16px 8px; }
  .spec:nth-child(3) { border-left: 0; }
  .spec:nth-child(n + 3) { border-top: 1px solid rgba(165, 180, 252, 0.08); }
}

/* Hero load sequence */
@media (prefers-reduced-motion: no-preference) {
  .js .hero__title .line, .js .hero .reveal {
    opacity: 0; transform: translateY(14px);
    animation: rise 700ms var(--ease) forwards;
  }
  .js .hero__title .line:nth-child(2) { animation-delay: 90ms; }
  .js .hero .reveal-1 { animation-delay: 280ms; }
  .js .hero .reveal-2 { animation-delay: 360ms; }
  .js .hero .reveal-3 { animation-delay: 460ms; }
  /* Light catches the accent line as the beams light up */
  .hero__accent { animation: shimmer 2.6s cubic-bezier(0.45, 0, 0.2, 1) 0.7s both; }
}
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0% 0; } }

/* ---------- Page header band (rules, register, 404): a small version of the hero ---------- */

.page-head { padding: calc(var(--nav-h) + clamp(56px, 8vw, 104px)) 0 clamp(56px, 7vw, 96px); text-align: center; }
.page-head__title {
  margin-top: 24px;
  font-size: clamp(38px, 5.2vw, 68px); font-weight: 600; line-height: 1.04; letter-spacing: -0.045em;
  text-wrap: balance;
}
.page-head__sub { margin: 18px auto 0; font-size: 18px; color: rgba(224, 231, 255, 0.68); max-width: 56ch; }
.page-head__meta {
  margin-top: 22px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(165, 180, 252, 0.6);
}

/* ---------- Sections ---------- */

.section { padding: var(--section-y) 0; }
.section--white { background: var(--surface); }
.section--rule { border-top: 1px solid var(--rule); }
.section--dots {
  background-color: var(--canvas);
  background-image: radial-gradient(rgba(165, 180, 252, 0.09) 1px, transparent 1.2px);
  background-size: 18px 18px;
}

/* Split: label in the margin, content in the measure */
.split { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 20px; }
.split__label { grid-column: 1 / span 3; padding-top: 14px; }
.split__body { grid-column: 4 / span 9; }
@media (max-width: 900px) {
  .split__label, .split__body { grid-column: 1 / -1; }
  .split__label { padding-top: 0; }
}
.split__body > .lead { margin-top: 24px; }

/* ---------- Numbers strip ---------- */

.figures { background: var(--canvas); border-bottom: 1px solid var(--rule); }
.figures__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; }
.figures__label { grid-column: 1 / span 3; padding: 40px 0; }
.figures__label p { margin-top: 10px; font-size: 14px; color: var(--text-3); max-width: 24ch; }
.figures__list { grid-column: 4 / span 9; display: grid; grid-template-columns: repeat(2, 1fr); }
.figure { padding: 40px 0 40px 24px; border-left: 1px solid var(--rule); }
.figure__num { font-size: clamp(44px, 4.8vw, 64px); font-weight: 600; line-height: 1; letter-spacing: -0.045em; padding-bottom: 0.04em; font-variant-numeric: tabular-nums; }
.figure__cap { margin-top: 14px; font-size: 14px; line-height: 1.45; color: var(--text-2); max-width: 24ch; }
@media (max-width: 900px) {
  .figures__label { grid-column: 1 / -1; padding: 32px 0 8px; }
  .figures__list { grid-column: 1 / -1; grid-template-columns: 1fr; }
  .figure { display: grid; grid-template-columns: 128px 1fr; align-items: baseline; gap: 16px; padding: 20px 0; border-left: 0; border-top: 1px solid var(--rule); }
  .figure__num { font-size: 36px; }
  .figure__cap { margin-top: 0; }
}

/* ---------- Tracks ---------- */

.tracks { margin-top: 56px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.track {
  position: relative; overflow: hidden;
  padding: 24px; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-lg);
}
.track::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(129, 140, 248, 0.85), transparent);
}
.track p { margin-top: 10px; font-size: 15px; color: var(--text-2); }
@media (max-width: 760px) { .tracks { grid-template-columns: 1fr; } }

/* ---------- Ledger table ---------- */

.ledger { margin-top: 56px; width: 100%; border-collapse: collapse; font-size: 15px; }
.ledger caption { text-align: left; padding-bottom: 14px; font-size: 14px; color: var(--text-3); }
.ledger th, .ledger td { text-align: left; vertical-align: top; padding: 16px 24px 16px 0; border-top: 1px solid var(--rule); }
.ledger thead th { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); padding-top: 12px; padding-bottom: 12px; }
.ledger tbody tr:last-child td, .ledger tbody tr:last-child th { border-bottom: 1px solid var(--rule); }
.ledger tbody th { font-weight: 500; white-space: nowrap; width: 1%; }
.ledger td { color: var(--text-2); }
@media (max-width: 640px) {
  .ledger thead { display: none; }
  .ledger tr { display: block; padding: 14px 0; border-top: 1px solid var(--rule); }
  .ledger tbody tr:last-child { border-bottom: 1px solid var(--rule); }
  .ledger th, .ledger td { display: block; padding: 2px 0; border: 0 !important; width: auto; }
}

/* ---------- Timeline (selection process) ---------- */

.timeline { margin-top: 64px; display: grid; grid-template-columns: repeat(5, 1fr); counter-reset: step; }
.step { position: relative; padding: 28px 20px 0 0; border-top: 1px solid var(--rule-strong); }
.step::before {
  content: ""; position: absolute; top: -5px; left: 0;
  width: 9px; height: 9px; border-radius: 2px; background: var(--canvas); border: 1px solid var(--text-3);
}
.step__num { display: inline-block; margin-right: 10px; font-family: var(--mono); font-size: 12.5px; font-weight: 500; color: var(--accent); font-variant-numeric: tabular-nums; }
.step__date { font-family: var(--mono); font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.step .h3 { margin-top: 18px; }
.step p { margin-top: 8px; font-size: 15px; color: var(--text-2); }
.step__now {
  display: none; margin-top: 14px; width: max-content;
  font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); padding: 4px 8px; background: var(--accent-tint); border: 1px solid rgba(129, 140, 248, 0.3); border-radius: 4px;
}
.step.is-current { border-top-color: var(--accent-2); }
.step.is-current::before { background: var(--accent-2); border-color: var(--accent-2); box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.18), 0 0 14px rgba(129, 140, 248, 0.8); }
.step.is-current .step__num, .step.is-current .step__date { color: var(--accent); }
.step.is-current .step__now { display: block; }
.step.is-done .step__num, .step.is-done .h3, .step.is-done p { opacity: 0.55; }
.step.is-done::before { background: var(--text-3); }
@media (max-width: 980px) {
  .timeline { grid-template-columns: 1fr; gap: 0; }
  .step { border-top: 0; border-left: 1px solid var(--rule-strong); padding: 0 0 36px 28px; }
  .step::before { top: 4px; left: -5px; }
  .step.is-current { border-left-color: var(--accent-2); }
  .step .h3 { margin-top: 10px; }
}

/* ---------- Offer cards ---------- */

.offers { margin-top: 56px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.offer { padding: 28px; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-lg); }
.offer--primary {
  border-color: rgba(129, 140, 248, 0.4);
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.14) 0%, rgba(255, 255, 255, 0.02) 100%);
  box-shadow: 0 0 44px -20px rgba(129, 140, 248, 0.8);
}
.offer p { margin-top: 10px; font-size: 15px; color: var(--text-2); }
@media (max-width: 900px) { .offers { grid-template-columns: 1fr; } }

/* ---------- FAQ ---------- */

.faq { margin-top: 40px; border-top: 1px solid var(--rule-strong); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 22px 0; cursor: pointer; list-style: none;
  font-size: 18px; font-weight: 500; letter-spacing: -0.015em; color: var(--ink);
  transition: color var(--base) var(--ease);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--accent); }
.faq summary .plus { position: relative; flex: none; width: 14px; height: 14px; color: var(--accent); }
.faq summary .plus::before, .faq summary .plus::after {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1.5px; margin-top: -0.75px;
  background: currentColor; transition: transform var(--base) var(--ease);
}
.faq summary .plus::after { transform: rotate(90deg); }
.faq details[open] summary .plus::after { transform: rotate(0deg); }
.faq details > div { padding: 0 0 24px; max-width: 64ch; color: var(--text-2); }
.faq details > div p + p { margin-top: 10px; }

/* ---------- Closing call to action (a dark band, like the hero) ---------- */

.cta { padding: clamp(88px, 11vw, 140px) 0; text-align: center; }
.cta__inner { display: flex; flex-direction: column; align-items: center; gap: 32px; }
.cta__title {
  margin: 24px auto 0; max-width: 20ch;
  font-size: clamp(32px, 4.2vw, 56px); font-weight: 600; line-height: 1.06; letter-spacing: -0.045em;
  text-wrap: balance;
}
.cta__sub { margin-top: 14px; color: rgba(224, 231, 255, 0.68); }

/* ---------- Footer ---------- */

.footer { position: relative; background: var(--black); color: var(--text-2); padding: 64px 0 40px; font-size: 14px; }
.footer::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(129, 140, 248, 0.45) 50%, transparent);
}
.footer__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 32px; }
.footer__brand { grid-column: 1 / span 3; }
.footer__brand .wordmark { color: #fff; gap: 12px; font-size: 18px; }
.footer__brand .wordmark__logo { width: 56px; height: 56px; margin-right: 4px; }
.footer__brand p { margin-top: 16px; max-width: 36ch; }
.footer__brand .footer__company { font-size: 13px; line-height: 1.6; color: var(--text-3); }
.footer__company strong { font-weight: 500; color: var(--ink-2); }
.footer__brand .footer__company + p { margin-top: 8px; }
.footer__col { grid-column: span 2; }
.footer__col h2 { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(165, 180, 252, 0.6); }
.footer__col ul { margin-top: 16px; display: grid; gap: 10px; }
.footer__col a { color: var(--ink-2); transition: color var(--base) var(--ease); }
.footer__col a:hover { color: #fff; }
.footer__col--contact { grid-column: span 3; }
.footer__col--contact a { overflow-wrap: anywhere; }
.footer__label { display: block; margin-bottom: 2px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); }
.footer__base { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; color: var(--text-3); }
.footer__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.footer__meta a {
  color: var(--text-2); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
  text-decoration-color: rgba(165, 180, 252, 0.35); transition: color var(--base) var(--ease);
}
.footer__meta a:hover, .footer__meta a[aria-current="page"] { color: #fff; }
/* "Systems Operational" tag, as on the other IICPC sites, with the dot in the theme's indigo */
.status {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-2);
}
.status__dot {
  position: relative; flex: none; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-2); box-shadow: 0 0 10px rgba(129, 140, 248, 0.85);
  animation: status-breathe 2s ease-in-out infinite;
}
.status__dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent-2);
  animation: status-ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes status-breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
@keyframes status-ping { 0% { opacity: 0.75; scale: 1; } 80%, 100% { opacity: 0; scale: 2.75; } }

@media (max-width: 980px) {
  .footer__brand { grid-column: 1 / -1; }
  .footer__col { grid-column: span 4; }
  .footer__col--contact { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .footer__col { grid-column: span 6; }
  .footer__col--contact { grid-column: 1 / -1; }
}

/* ---------- Rules page ---------- */

.rules-layout { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; padding-top: clamp(48px, 6vw, 80px); padding-bottom: var(--section-y); }
.toc { grid-column: 1 / span 3; }
.toc__inner { position: sticky; top: calc(var(--nav-h) + 32px); }
.toc ol { margin-top: 16px; border-left: 1px solid var(--rule-strong); }
.toc a {
  display: flex; gap: 12px; padding: 7px 0 7px 16px; margin-left: -1px;
  font-size: 14px; color: var(--text-2); border-left: 1px solid transparent;
  transition: color var(--base) var(--ease), border-color var(--base) var(--ease);
}
.toc a span { font-family: var(--mono); font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; width: 1.6em; padding-top: 1px; }
.toc a:hover { color: var(--ink); }
.toc a.is-active { color: var(--accent); border-left-color: var(--accent-2); }
.toc a.is-active span { color: var(--accent); }

.rules { grid-column: 4 / span 9; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-lg); overflow: hidden; }
.rule-section { padding: clamp(28px, 4vw, 48px); border-top: 1px solid var(--rule); counter-reset: clause; }
.rule-section:first-child { border-top: 0; }
.rule-section > h2 { display: flex; gap: 16px; align-items: baseline; font-size: 24px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.25; color: var(--ink); }
.rule-section > h2 .n { font-family: var(--mono); color: var(--accent); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; min-width: 1.8em; }
.rule-section > p { margin-top: 14px; color: var(--text-2); max-width: 64ch; }
.clauses { margin-top: 20px; display: grid; gap: 14px; }
/* Number in the margin; the text stays one flow so inline links don't become grid cells */
.clauses li { position: relative; padding-left: 3em; color: var(--ink-2); max-width: 70ch; counter-increment: clause; }
.clauses li::before { content: attr(data-n); position: absolute; left: 0; top: 3px; font-family: var(--mono); color: var(--text-3); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.rule-section strong { font-weight: 600; color: var(--ink); }

/* Bulleted lists on the legal pages */
.bullets { margin-top: 16px; display: grid; gap: 12px; max-width: 70ch; }
.bullets li { position: relative; padding-left: 24px; color: var(--ink-2); }
.bullets li::before {
  content: ""; position: absolute; left: 4px; top: 0.68em; width: 6px; height: 6px; border-radius: 1px;
  background: var(--accent-2); box-shadow: 0 0 8px rgba(129, 140, 248, 0.6);
}
.rule-section > .bullets + p { margin-top: 18px; }

/* The one section that must not be skimmed past (privacy: data kept for recruitment) */
.rule-section--notice {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.12), rgba(99, 102, 241, 0.03));
  box-shadow: inset 2px 0 0 var(--accent-2);
}

.dates { margin-top: 20px; width: 100%; border-collapse: collapse; font-size: 15px; }
.dates th, .dates td { text-align: left; padding: 12px 16px 12px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.dates tr:first-child th, .dates tr:first-child td { border-top: 1px solid var(--rule); }
.dates th { font-weight: 400; color: var(--text-2); width: 50%; }
.dates td { font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }

.rules-cta { padding: clamp(28px, 4vw, 48px); border-top: 1px solid var(--rule); background: rgba(99, 102, 241, 0.07); display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .toc { display: none; }
  .rules { grid-column: 1 / -1; }
  .clauses li { padding-left: 2.6em; }
}

/* ---------- Register page ---------- */

.register-layout { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 32px; padding-top: clamp(40px, 5vw, 72px); padding-bottom: var(--section-y); align-items: start; }
.register-aside { grid-column: 1 / span 4; position: sticky; top: calc(var(--nav-h) + 32px); }
.register-main { grid-column: 5 / span 8; }

/* Registration clock: an indigo glass panel with code-font digits */
.clock {
  padding: 28px; color: #fff;
  background: linear-gradient(160deg, rgba(55, 65, 170, 0.35) 0%, rgba(10, 15, 31, 0.75) 100%);
  border: 1px solid rgba(129, 140, 248, 0.3); border-radius: var(--radius-lg);
  box-shadow: 0 0 50px -24px rgba(129, 140, 248, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.clock__label { font-size: 14px; color: var(--text-2); }
.clock__digits { margin-top: 14px; display: grid; grid-template-columns: repeat(4, auto); justify-content: start; column-gap: 18px; }
.clock__unit { display: flex; flex-direction: column; }
.clock__num { font-family: var(--mono); font-size: clamp(34px, 3.2vw, 44px); font-weight: 500; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.clock__cap { margin-top: 8px; font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(165, 180, 252, 0.75); }
.clock__closed { margin-top: 14px; font-size: 26px; font-weight: 600; line-height: 1.2; letter-spacing: -0.03em; }
.clock__facts { margin: 24px 0 0; border-top: 1px solid rgba(165, 180, 252, 0.18); }
.clock__fact { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid rgba(165, 180, 252, 0.18); font-size: 14px; }
.clock__fact dt { color: var(--text-2); }
.clock__fact dd { text-align: right; font-weight: 500; }
.clock__fact:last-child { border-bottom: 0; padding-bottom: 0; }
.clock--compact { padding: 24px; }
.clock--compact .clock__digits { column-gap: 14px; }

.ready { margin-top: 16px; padding: 24px; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-lg); }
.ready h2 { font-size: 15px; font-weight: 600; color: var(--ink); }
.ready ul { margin-top: 14px; display: grid; gap: 10px; }
.ready li { position: relative; padding-left: 20px; font-size: 14px; color: var(--text-2); }
.ready li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 8px; height: 1px; background: var(--accent-2); }
.ready p { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--text-2); }

@media (max-width: 980px) {
  .register-aside { grid-column: 1 / -1; position: static; }
  .register-main { grid-column: 1 / -1; }
}

/* Form */
.form-card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-lg); }
.fieldset { margin: 0; padding: clamp(24px, 4vw, 40px); border: 0; border-top: 1px solid var(--rule); min-width: 0; }
.fieldset:first-of-type { border-top: 0; }
/* Float takes the legend out of the fieldset border so it sits inside the padding like a heading */
.fieldset__head { float: left; display: flex; gap: 16px; align-items: baseline; width: 100%; margin: 0 0 12px; padding: 0; }
.fieldset__head + * { clear: left; }
.fieldset__num { font-family: var(--mono); color: var(--accent); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.fieldset__title { font-size: 22px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.3; color: var(--ink); }
.fieldset__intro { margin: 0 0 24px; font-size: 15px; color: var(--text-2); max-width: 60ch; }
.fieldset__head + .fields { padding-top: 12px; }

.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 20px; }
.field { display: flex; flex-direction: column; min-width: 0; }
.field--full { grid-column: 1 / -1; }
@media (max-width: 640px) { .fields { grid-template-columns: 1fr; } }

.label { font-size: 14px; font-weight: 500; color: var(--ink); }
.label .opt { font-weight: 400; color: var(--text-3); }

/* Required marker in front of every question (all of them are required). Screen readers skip
   the star; the inputs carry the required attribute instead. */
.form-card .label::before,
.form-card .check > span::before {
  content: "*";
  content: "*" / "";
  margin-right: 0.3em;
  font-weight: 600;
  color: var(--accent-2);
}
.form-note { padding: 20px clamp(24px, 4vw, 40px) 0; font-size: 13px; color: var(--text-3); }
.form-note span { margin-right: 0.3em; font-weight: 600; color: var(--accent-2); }
.hint { margin-top: 4px; font-size: 13px; line-height: 1.45; color: var(--text-3); }
.input, .select {
  margin-top: 8px; width: 100%; height: 46px; padding: 0 14px;
  color: var(--ink); background: var(--field);
  border: 1px solid var(--rule-strong); border-radius: var(--radius);
  font-size: 15px; letter-spacing: -0.005em;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.select {
  appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23a5b4fc' stroke-width='1.5'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.select option { background: var(--field); color: var(--ink); }
.input::placeholder { color: #5d6687; }
.input:hover, .select:hover { border-color: rgba(165, 180, 252, 0.38); }
.input:focus, .select:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.22); }
/* Keep browser autofill dark */
.input:-webkit-autofill { -webkit-text-fill-color: var(--ink); caret-color: var(--ink); box-shadow: 0 0 0 100px var(--field) inset; }
.field.has-error .input, .field.has-error .select { border-color: var(--danger); }
.field.has-error .input:focus, .field.has-error .select:focus { box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.2); }
.field__error { display: none; margin-top: 6px; font-size: 13px; color: var(--danger); }
.field.has-error .field__error { display: block; }

/* Long answers */
.textarea { height: auto; min-height: 96px; padding: 12px 14px; line-height: 1.55; resize: vertical; }
.field > .hint + .input, .field > .hint + .textarea { margin-top: 10px; }
.label--sub { font-weight: 400; color: var(--text-2); font-size: 13px; }

/* "Other" answers and follow-up questions revealed by an earlier choice */
.field__other { margin-top: 14px; }
.field__other[hidden], .field[hidden] { display: none; }

/* Multiple-choice chips (checkboxes and radios) */
.choices { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.choice {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 14px 9px 12px; min-height: 40px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--rule-strong); border-radius: 999px;
  font-size: 14px; line-height: 1.3; color: var(--ink-2); cursor: pointer; user-select: none;
  transition: border-color var(--fast) var(--ease), background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.choice:hover { border-color: rgba(165, 180, 252, 0.4); }
.choice input {
  appearance: none; -webkit-appearance: none; flex: none; margin: 0; width: 16px; height: 16px;
  display: grid; place-content: center; background: var(--field); border: 1px solid rgba(165, 180, 252, 0.35); border-radius: 4px; cursor: pointer;
  transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.choice input[type="radio"] { border-radius: 50%; }
.choice input[type="checkbox"]::after { content: ""; width: 8px; height: 4.5px; border-left: 1.75px solid #fff; border-bottom: 1.75px solid #fff; transform: rotate(-45deg) translate(0.5px, -0.5px); opacity: 0; }
.choice input[type="radio"]::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; opacity: 0; }
.choice input:checked { background: var(--accent-3); border-color: var(--accent-3); }
.choice input:checked::after { opacity: 1; }
.choice input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice:has(input:checked) { border-color: var(--accent-2); background: rgba(99, 102, 241, 0.16); color: #e0e7ff; }
.field.has-error .choices .choice:not(:has(input:checked)) { border-color: rgba(248, 113, 113, 0.5); }

.text-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 0;
  background: none; border: 0; cursor: pointer;
  font-size: 14px; font-weight: 500; color: var(--text-2);
  transition: color var(--base) var(--ease);
}
.text-btn:hover { color: var(--danger); }

/* Checkbox */
.check { display: grid; grid-template-columns: 20px 1fr; gap: 12px; align-items: start; cursor: pointer; font-size: 15px; color: var(--ink-2); }
.check input {
  appearance: none; -webkit-appearance: none; margin: 2px 0 0; width: 20px; height: 20px;
  border: 1px solid rgba(165, 180, 252, 0.35); border-radius: 4px; background: var(--field); cursor: pointer;
  display: grid; place-content: center; transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.check input::after { content: ""; width: 10px; height: 6px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.check input:checked { background: var(--accent-3); border-color: var(--accent-3); }
.check input:checked::after { opacity: 1; }
.check input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.field.has-error .check input { border-color: var(--danger); }

/* Honeypot: off-screen, not display:none (some bots skip hidden inputs) */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.verify { margin-top: 28px; min-height: 65px; }
.verify__msg { font-size: 14px; color: var(--text-2); }
.verify__msg.is-error { color: var(--danger); }

.submit-row { margin-top: 28px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.submit-row .small { max-width: 40ch; }

.alert {
  display: none; margin-top: 24px; padding: 14px 16px;
  border-left: 3px solid var(--danger); border-radius: 0 var(--radius) var(--radius) 0;
  background: rgba(248, 113, 113, 0.08); color: #fecaca; font-size: 15px;
}
.alert.is-visible { display: block; }

.spinner { width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; border-radius: 50%; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Result panels (success / closed) */
.result {
  padding: clamp(32px, 5vw, 56px);
  background: var(--card); border: 1px solid var(--rule); border-top: 2px solid var(--accent-2); border-radius: var(--radius-lg);
}
.result--success { border-top-color: var(--success); }
.result__mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: rgba(74, 222, 128, 0.14); color: var(--success); box-shadow: 0 0 24px -6px rgba(74, 222, 128, 0.6); }
.result__mark svg { width: 20px; height: 20px; }
.result h2 { margin-top: 24px; font-size: clamp(26px, 3vw, 34px); font-weight: 600; letter-spacing: -0.035em; line-height: 1.2; }
.result p { margin-top: 14px; color: var(--text-2); max-width: 56ch; }
.result p strong { color: var(--ink); }
.result .actions { margin-top: 28px; display: flex; gap: 12px; flex-wrap: wrap; }
.result:focus { outline: none; }

/* State switches driven by site.js */
[data-when-closed] { display: none !important; }
.reg-closed [data-when-closed] { display: revert !important; }
.reg-closed [data-when-open] { display: none !important; }

/* ---------- 404 ---------- */
.notfound { min-height: 100vh; display: flex; align-items: center; text-align: center; }
.notfound .btn { margin-top: 32px; }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
