/* ==========================================================================
   CampusHack — design system
   --------------------------------------------------------------------------
   The visual language comes from the logo: a shield split vertically down the
   middle, black on one side, red on the other. That split is the site's
   signature — it appears as section rules, headline colour breaks, and the
   diagonal shoulders on panels.

   Palette is strictly ink / paper / red. No fourth colour: podium ranks are
   told apart by red intensity rather than by adding gold and silver.
   ========================================================================== */

/* ── Tokens ─────────────────────────────────────────────────────────── */

:root {
  /* Colour */
  --ink:        #0b0b0d;
  --ink-2:      #26262c;
  --ink-3:      #6b6b76;
  --ink-4:      #9a9aa3;
  --paper:      #ffffff;
  --paper-2:    #f7f7f8;
  --paper-3:    #eeeef0;
  --red:        #ff3131;
  --red-deep:   #d81b1b;
  --red-wash:   #fff2f2;
  --red-wash-2: #ffe3e3;
  --line:       #e6e6e9;
  --line-2:     #d5d5da;

  /* A panel that is deliberately darker than the page (footer, CTA, buttons).
     In dark mode this becomes a *raised* surface rather than an inverted one,
     which is why it is a separate token from --ink. */
  --panel:      #0b0b0d;
  --panel-2:    #17171c;
  --panel-fg:   #ffffff;
  --panel-muted:#a9a9b4;
  --panel-line: rgba(255, 255, 255, 0.14);
  --header-bg:  rgba(255, 255, 255, 0.92);

  color-scheme: light;

  /* Type
     League Spartan is the logo face. Aperture (the logo's secondary face) is a
     licensed font — drop it into --font-mono when you have the licence and the
     terminal accents pick it up site-wide. */
  --font-display: "League Spartan", "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body:    "Instrument Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:    "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  /* Scale */
  --step--1: clamp(0.79rem, 0.77rem + 0.1vw, 0.84rem);
  --step-0:  clamp(0.95rem, 0.92rem + 0.15vw, 1.03rem);
  --step-1:  clamp(1.15rem, 1.08rem + 0.35vw, 1.35rem);
  --step-2:  clamp(1.45rem, 1.3rem + 0.7vw, 1.85rem);
  --step-3:  clamp(1.85rem, 1.55rem + 1.4vw, 2.6rem);
  --step-4:  clamp(2.3rem, 1.75rem + 2.6vw, 3.8rem);
  --step-5:  clamp(2.9rem, 1.9rem + 4.6vw, 5.8rem);

  /* Space */
  --sp-1: 0.375rem;
  --sp-2: 0.75rem;
  --sp-3: 1.125rem;
  --sp-4: 1.75rem;
  --sp-5: 2.5rem;
  --sp-6: 3.75rem;
  --sp-7: 5.5rem;
  --sp-8: 7.5rem;

  --radius:    4px;
  --radius-lg: 10px;
  --container: 1180px;
  --header-h:  72px;

  --shadow-sm: 0 1px 2px rgba(11, 11, 13, 0.05);
  --shadow:    0 8px 26px -14px rgba(11, 11, 13, 0.16);
  --shadow-lg: 0 26px 60px -28px rgba(11, 11, 13, 0.26);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--red-deep); }

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

::selection { background: var(--red); color: #fff; }

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.022em;
  margin: 0 0 var(--sp-2);
  text-wrap: balance;
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p { margin: 0 0 var(--sp-3); }
p:last-child { margin-bottom: 0; }

strong { color: var(--ink); font-weight: 600; }

hr {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: var(--sp-5) 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--panel);
  color: var(--panel-fg);
  padding: 0.75rem 1.25rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
}
.skip-link:focus { left: 0; color: #fff; }


/* ── Layout ─────────────────────────────────────────────────────────── */

.wrap {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 4vw, 2.5rem);
}
.wrap--narrow { max-width: 780px; }
.wrap--wide { max-width: 1360px; }

.section { padding-block: var(--sp-7); }
.section--tight { padding-block: var(--sp-6); }
.section--flush-top { padding-top: 0; }
.section--band { background: var(--paper-2); }
.section--ink { background: var(--panel); color: var(--panel-muted); }
.section--ink h1, .section--ink h2, .section--ink h3, .section--ink h4 { color: var(--panel-fg); }

.grid { display: grid; gap: var(--sp-4); }
.grid--2 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
/* Cards keep their own width instead of stretching to fill a short row. */
.grid--cards { grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); }
.grid--cards > * { max-width: 420px; }
.grid--split { grid-template-columns: 1fr; }

@media (min-width: 900px) {
  .grid--split { grid-template-columns: 1.15fr 0.85fr; gap: var(--sp-6); }
  .grid--split-wide { grid-template-columns: 1.5fr 1fr; gap: var(--sp-6); }
  .grid--sidebar { grid-template-columns: minmax(0, 1fr) 300px; gap: var(--sp-6); }
}

.stack > * + * { margin-top: var(--sp-3); }
.stack-lg > * + * { margin-top: var(--sp-5); }


/* ── The split rule: the signature divider ──────────────────────────── */

.split-rule {
  height: 3px;
  border: 0;
  margin: 0;
  background: linear-gradient(to right, var(--ink) 0 50%, var(--red) 50% 100%);
}
.split-rule--thin { height: 2px; }
.split-rule--short { width: 76px; }

/* Eyebrow label above a heading */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: var(--sp-2);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--red);
  flex: none;
}
.eyebrow--plain::before { display: none; }
.section--ink .eyebrow { color: var(--ink-4); }

.section-head { max-width: 660px; margin-bottom: var(--sp-5); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .eyebrow::before { display: none; }
.section-head p {
  color: var(--ink-3);
  font-size: var(--step-1);
  line-height: 1.55;
}
.section--ink .section-head p { color: var(--panel-muted); }

/* The wordmark split: "Campus" ink, "Hack" red */
.wm-a { color: var(--ink); }
.wm-b { color: var(--red); }
.section--ink .wm-a { color: var(--panel-fg); }


/* ── Buttons ────────────────────────────────────────────────────────── */

.btn {
  --btn-bg: var(--panel);
  --btn-fg: var(--panel-fg);
  --btn-bd: var(--panel);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  padding: 0.82em 1.5em;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1.5px solid var(--btn-bd);
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  cursor: pointer;
  transition: transform 0.18s var(--ease), background 0.18s, color 0.18s,
              border-color 0.18s, box-shadow 0.18s;
  text-align: center;
}
.btn:hover {
  color: var(--btn-fg);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.btn:active { transform: translateY(0); }

.btn--red { --btn-bg: var(--red); --btn-bd: var(--red); }
.btn--red:hover { --btn-bg: var(--red-deep); --btn-bd: var(--red-deep); }

.btn--ghost { --btn-bg: transparent; --btn-fg: var(--ink); --btn-bd: var(--line-2); }
.btn--ghost:hover { --btn-bd: var(--ink); --btn-fg: var(--ink); }

.btn--on-ink { --btn-bg: var(--panel-fg); --btn-fg: var(--panel); --btn-bd: var(--panel-fg); }
.btn--on-ink:hover { --btn-fg: var(--ink); }

.btn--ghost-on-ink {
  --btn-bg: transparent; --btn-fg: var(--panel-fg); --btn-bd: var(--panel-line);
}
.btn--ghost-on-ink:hover { --btn-bd: var(--panel-fg); --btn-fg: var(--panel-fg); }

.btn--sm { padding: 0.55em 1em; font-size: 0.85rem; }
.btn--block { width: 100%; }

.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

/* Text link with an arrow that slides */
.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  font-size: 0.95rem;
}
.arrow-link i { font-style: normal; transition: transform 0.22s var(--ease); }
.arrow-link:hover { color: var(--red-deep); }
.arrow-link:hover i { transform: translateX(5px); }


/* ── Header ─────────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.25s, border-color 0.25s;
}
.site-header.is-stuck { box-shadow: var(--shadow-sm); border-color: var(--line-2); }

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: var(--header-h);
}

.brand { display: inline-flex; align-items: center; }
.brand__logo {
  height: 42px;
  width: auto;
  max-width: 100%;
  display: block;
}
.brand--lg .brand__logo { height: 58px; }
.brand--sm .brand__logo { height: 32px; }
@media (max-width: 420px) { .brand__logo { height: 34px; } }

.nav { display: none; align-items: center; gap: 0.15rem; }
@media (min-width: 1000px) { .nav { display: flex; } }

.nav__link {
  position: relative;
  padding: 0.5rem 0.72rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-2);
  border-radius: var(--radius);
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0.72rem; right: 0.72rem; bottom: 0.24rem;
  height: 2px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.24s var(--ease);
}
.nav__link:hover { color: var(--ink); }
.nav__link:hover::after, .nav__link.is-active::after { transform: scaleX(1); }
.nav__link.is-active { color: var(--ink); font-weight: 600; }

.header__actions { display: flex; align-items: center; gap: var(--sp-2); }
.header__actions .btn { display: none; }
@media (min-width: 1000px) { .header__actions .btn { display: inline-flex; } }

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px; height: 42px;
  padding: 0 10px;
  background: none;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  cursor: pointer;
}
@media (min-width: 1000px) { .nav-toggle { display: none; } }
.nav-toggle span {
  display: block; height: 2px; width: 100%;
  background: var(--ink);
  transition: transform 0.25s var(--ease), opacity 0.2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  position: fixed;
  inset: var(--header-h) 0 0;
  z-index: 89;
  background: var(--paper);
  padding: var(--sp-4) 0 var(--sp-6);
  overflow-y: auto;
  transform: translateY(-8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s, transform 0.22s var(--ease), visibility 0.22s;
}
.mobile-nav.is-open { opacity: 1; transform: none; visibility: visible; }
.mobile-nav__link {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.mobile-nav__link span {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--ink-4);
  letter-spacing: 0.1em;
}
.mobile-nav__link.is-active { color: var(--red); }
.mobile-nav .btn-row { margin-top: var(--sp-4); }
body.nav-open { overflow: hidden; }


/* ── Hero ───────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse 70% 55% at 88% 0%, var(--red-wash) 0%, transparent 70%),
    var(--paper);
}
.hero::before {
  /* faint grid, like a scoreboard backdrop */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 74px 74px;
  opacity: 0.5;
  mask-image: radial-gradient(ellipse 80% 70% at 30% 20%, #000 0%, transparent 75%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  display: grid;
  gap: var(--sp-5);
  padding-block: clamp(3rem, 7vw, 6rem);
}
@media (min-width: 980px) {
  .hero__inner { grid-template-columns: 1.06fr 0.94fr; align-items: center; gap: var(--sp-6); }
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.85rem 0.4rem 0.5rem;
  border: 1px solid var(--line-2);
  border-radius: 100px;
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  white-space: nowrap;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: var(--sp-3);
}
.hero__badge b {
  background: var(--panel);
  color: var(--panel-fg);
  padding: 0.2rem 0.5rem;
  border-radius: 100px;
  font-weight: 500;
}
.hero__badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--red);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.82); }
}

.hero h1 {
  font-size: clamp(2.05rem, 1.5rem + 2.35vw, 3.45rem);
  font-weight: 800;
  letter-spacing: -0.032em;
  line-height: 1.06;
  margin-bottom: var(--sp-3);
  max-width: 15ch;
}
/* The wordmark line sits a touch above the sentence it introduces. */
.hero h1 .hero__wordmark {
  display: block;
  font-size: 1.16em;
  letter-spacing: -0.04em;
  margin-bottom: 0.1em;
}
.hero__lead {
  font-size: var(--step-1);
  color: var(--ink-3);
  max-width: 33ch;
  line-height: 1.55;
  margin-bottom: var(--sp-4);
}

/* The typed terminal line — the logo's ">_ Learn. Hack. Defend." made live */
.terminal {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.62rem 0.95rem;
  background: var(--panel);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: var(--panel-fg);
  margin-bottom: var(--sp-4);
  box-shadow: var(--shadow);
}
.terminal__prompt { color: var(--red); font-weight: 500; }
.terminal__caret {
  display: inline-block;
  width: 8px; height: 1.05em;
  background: var(--red);
  animation: blink 1.1s steps(2, start) infinite;
  vertical-align: -0.16em;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* Hero facts strip */
.hero__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  border-top: 1px solid var(--line);
  margin-top: var(--sp-5);
  padding-top: var(--sp-3);
  gap: var(--sp-3);
}
.fact__k {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.03em;
  line-height: 1;
}
.fact__k em { font-style: normal; color: var(--red); }
.fact__v {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 0.4rem;
}

/* Hero shield panel — the split, literally */
.shield-panel { position: relative; }
.shield-panel__frame {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.shield-panel__frame::before {
  /* red half, cut on the diagonal like the shield's shoulder */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--red-wash) 0%, var(--red-wash-2) 100%);
  clip-path: polygon(100% 0, 100% 100%, 22% 100%);
}
.shield-panel__frame::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--line-2) 18%, var(--line-2) 82%, transparent);
}
.shield-panel__body {
  position: relative;
  height: 100%;
  display: grid;
  place-items: center;
  padding: var(--sp-5);
}
.shield-panel__logo { width: min(64%, 300px); }
.shield-panel__caption {
  position: absolute;
  left: var(--sp-3); bottom: var(--sp-3);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-4);
}

/* Small floating stat card on the shield panel */
.float-card {
  position: absolute;
  right: -12px;
  bottom: 34px;
  background: var(--panel);
  color: var(--panel-fg);
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 168px;
}
.float-card__label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--panel-muted);
}
.float-card__value {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 0.2rem;
  letter-spacing: -0.02em;
}
.float-card__value em { font-style: normal; color: var(--red); }
@media (max-width: 979px) { .float-card { right: 8px; } }


/* ── Image placeholders (swap for real photography) ─────────────────── */

.ph {
  position: relative;
  display: grid;
  place-items: center;
  gap: 0.35rem;
  min-height: 150px;
  padding: var(--sp-4) var(--sp-3);
  background:
    repeating-linear-gradient(
      -45deg,
      var(--paper-2) 0 9px,
      var(--paper-3) 9px 18px
    );
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  color: var(--ink-4);
  text-align: center;
  overflow: hidden;
}
.ph__icon {
  width: 26px; height: 26px;
  border: 2px solid var(--line-2);
  border-radius: 3px;
  position: relative;
}
.ph__icon::after {
  content: "";
  position: absolute;
  left: 3px; right: 3px; bottom: 3px;
  height: 8px;
  background: var(--line-2);
  clip-path: polygon(0 100%, 32% 30%, 55% 68%, 74% 42%, 100% 100%);
}
.ph__label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.5;
}
.ph__label b { color: var(--ink-3); display: block; font-weight: 500; }
.ph--ratio-wide { aspect-ratio: 16 / 9; min-height: 0; }
.ph--ratio-photo { aspect-ratio: 4 / 3; min-height: 0; }
.ph--ratio-square { aspect-ratio: 1 / 1; min-height: 0; }
.ph--ratio-portrait { aspect-ratio: 3 / 4; min-height: 0; }
.ph--round { border-radius: 50%; }
.ph--logo { min-height: 90px; background-image: none; background: var(--paper-2); }


/* ── Cards ──────────────────────────────────────────────────────────── */

.card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  transition: transform 0.24s var(--ease), box-shadow 0.24s, border-color 0.24s;
}
.card--hover:hover {
  transform: translateY(-4px);
  border-color: var(--line-2);
  box-shadow: var(--shadow);
}
.card--flush { padding: 0; overflow: hidden; }
.card__body { padding: var(--sp-4); }
.card h3 { margin-bottom: var(--sp-1); }
.card p { color: var(--ink-3); font-size: 0.94rem; }

/* Card with a red top edge that grows on hover */
.card--edge::before {
  content: "";
  position: absolute;
  top: -1px; left: -1px;
  width: 46px; height: 3px;
  background: var(--red);
  border-radius: var(--radius-lg) 0 0 0;
  transition: width 0.3s var(--ease);
}
.card--edge:hover::before { width: calc(100% + 2px); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--line-2);
  border-radius: 100px;
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.63rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}
.chip--red { background: var(--red); border-color: var(--red); color: #fff; }
.chip--ink { background: var(--panel); border-color: var(--panel); color: var(--panel-fg); }
.chip--wash { background: var(--red-wash); border-color: var(--red-wash-2); color: var(--red-deep); }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }


/* ── Phase cards (the two-act model) ───────────────────────────────── */

.phase-grid { display: grid; gap: var(--sp-4); }
@media (min-width: 860px) { .phase-grid { grid-template-columns: 1fr 1fr; } }

.phase {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--sp-5) var(--sp-4) var(--sp-4);
  background: var(--paper);
  overflow: hidden;
  transition: transform 0.24s var(--ease), box-shadow 0.24s;
}
.phase:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.phase__num {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 8vw, 5.5rem);
  font-weight: 800;
  line-height: 0.8;
  letter-spacing: -0.05em;
  color: var(--paper-3);
  position: absolute;
  top: var(--sp-2); right: var(--sp-3);
  pointer-events: none;
  user-select: none;
}
.phase--finals { background: var(--panel); border-color: var(--panel); }
.phase--finals .phase__num { color: rgba(255, 255, 255, 0.07); }
.phase--finals h3 { color: var(--panel-fg); }
.phase--finals p, .phase--finals li { color: var(--panel-muted); }
.phase--finals .chip { background: transparent; border-color: var(--panel-line); color: var(--panel-muted); }
.phase--finals .phase__meta { border-color: var(--panel-line); }
.phase--finals .phase__meta dt { color: var(--panel-muted); }
.phase--finals .phase__meta dd { color: var(--panel-fg); }

.phase__kicker {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: var(--sp-2);
  display: block;
}
.phase__list { list-style: none; margin: var(--sp-3) 0 0; padding: 0; }
.phase__list li {
  position: relative;
  padding-left: 1.35rem;
  margin-bottom: 0.5rem;
  color: var(--ink-3);
  font-size: 0.93rem;
}
.phase__list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.62em;
  width: 8px; height: 2px;
  background: var(--red);
}
.phase__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: var(--sp-2);
  margin: var(--sp-4) 0 0;
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line);
}
.phase__meta dt {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 0.2rem;
}
.phase__meta dd {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--ink);
}


/* ── Leaderboard: the set piece ────────────────────────────────────── */

.board-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--line);
}
.board-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.board-tab {
  padding: 0.42rem 0.85rem;
  border: 1px solid var(--line-2);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  background: var(--paper);
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.board-tab:hover { border-color: var(--ink); color: var(--ink); }
.board-tab.is-active {
  background: var(--panel); border-color: var(--panel); color: var(--panel-fg);
}

.board { width: 100%; }
.board__row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--line);
  position: relative;
  transition: background 0.2s;
}
.board__row:hover { background: var(--paper-2); }
.board__row--head {
  padding-block: 0.5rem;
  border-bottom: 2px solid var(--ink);
}
.board__row--head span {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-3);
}

@media (min-width: 780px) {
  .board__row {
    grid-template-columns: 52px minmax(0, 1fr) 128px 96px 92px;
  }
}

.rank {
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink-4);
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
}
/* Podium told apart by red intensity, not by adding new colours */
.rank--1 { background: var(--red); color: #fff; }
.rank--2 { background: var(--red-wash-2); color: var(--red-deep); border-color: var(--red); }
.rank--3 { background: var(--red-wash); color: var(--red-deep); }

.board__uni { min-width: 0; }
.board__name {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.015em;
}
.board__name a { color: inherit; }
.board__name a:hover { color: var(--red-deep); }
.board__sub {
  font-family: var(--font-mono);
  font-size: 0.63rem;
  letter-spacing: 0.06em;
  color: var(--ink-4);
  margin-top: 0.24rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

/* The capture bar: width is the university's share of the leader's points */
.capture {
  height: 6px;
  background: var(--paper-3);
  border-radius: 100px;
  overflow: hidden;
  margin-top: 0.55rem;
  max-width: 380px;
}
.capture__fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--red-deep), var(--red));
  border-radius: 100px;
  width: 0;
  transition: width 1.1s var(--ease);
}

.board__points {
  font-family: var(--font-display);
  font-size: 1.24rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
  text-align: right;
}
.board__points small {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.56rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-top: 0.1rem;
}
.board__cell { display: none; }
@media (min-width: 780px) { .board__cell { display: block; } }
.board__stat {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--ink-2);
}
.board__stat small {
  display: block;
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-top: 0.15rem;
}

/* Form guide: one square per edition, like a league table's recent form */
.form-guide { display: flex; gap: 3px; }
.form-guide__cell {
  width: 20px; height: 20px;
  display: grid;
  place-items: center;
  border-radius: 3px;
  background: var(--paper-3);
  border: 1px solid var(--line-2);
  font-family: var(--font-mono);
  font-size: 0.56rem;
  color: var(--ink-4);
}
.form-guide__cell--1 { background: var(--red); border-color: var(--red); color: #fff; }
.form-guide__cell--2 { background: var(--red-wash-2); border-color: var(--red); color: var(--red-deep); }
.form-guide__cell--3 { background: var(--red-wash); border-color: var(--red-wash-2); color: var(--red-deep); }
.form-guide__cell--played { background: var(--panel); border-color: var(--panel); color: var(--panel-fg); }


/* ── Results table (per phase) ─────────────────────────────────────── */

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 620px;
}
.table th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 2px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
  white-space: nowrap;
}
.table td {
  padding: 0.8rem 0.75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table tbody tr:hover { background: var(--paper-2); }
.table__num { font-family: var(--font-mono); }
.table__team { font-family: var(--font-display); font-weight: 700; color: var(--ink); }
.table--compact td, .table--compact th { padding: 0.55rem 0.6rem; }

.root-pill {
  display: inline-grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  border: 1px solid var(--line-2);
  color: var(--ink-4);
}
.root-pill--on { background: var(--panel); border-color: var(--panel); color: var(--panel-fg); }


/* ── Timeline (year-round calendar) ────────────────────────────────── */

.timeline { position: relative; padding-left: 0; list-style: none; margin: 0; }
.timeline::before {
  content: "";
  position: absolute;
  left: 7px; top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--red), var(--line) 60%);
}
.timeline__item { position: relative; padding: 0 0 var(--sp-4) 2.4rem; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: "";
  position: absolute;
  left: 0; top: 6px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--paper);
  border: 3px solid var(--line-2);
}
.timeline__item--done::before { border-color: var(--panel); background: var(--panel); }
.timeline__item--active::before { border-color: var(--red); background: var(--red); }
.timeline__when {
  font-family: var(--font-mono);
  font-size: 0.63rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--red);
  display: block;
  margin-bottom: 0.2rem;
}
.timeline__what {
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.2rem;
}
.timeline__note { color: var(--ink-3); font-size: 0.9rem; }


/* ── Schedule (event day) ──────────────────────────────────────────── */

.schedule { border-top: 1px solid var(--line); }
.schedule__row {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.schedule__time {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-3);
  white-space: nowrap;
}
.schedule__title {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  font-size: 1.02rem;
}
.schedule__detail { color: var(--ink-3); font-size: 0.88rem; margin-top: 0.15rem; }
.schedule__row--highlight { background: var(--red-wash); }
.schedule__row--highlight .schedule__time { color: var(--red-deep); }
.schedule__row--highlight { padding-inline: var(--sp-3); border-radius: var(--radius); }


/* ── People ───────────────────────────────────────────────────────── */

.person { text-align: left; }
.person__photo {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--sp-3);
  background: var(--paper-2);
}
.person__photo img { width: 100%; height: 100%; object-fit: cover; }
.person__name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.15rem;
}
.person__role {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.5rem;
}
.person__uni { font-size: 0.85rem; color: var(--ink-4); }
.person__bio { font-size: 0.9rem; color: var(--ink-3); margin-top: var(--sp-2); }
.person__list { list-style: none; padding: 0; margin: var(--sp-2) 0 0; }
.person__list li {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-3);
  padding-left: 0.9rem;
  position: relative;
  margin-bottom: 0.25rem;
}
.person__list li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--red);
}

.avatar {
  width: 40px; height: 40px;
  flex: none;
  border-radius: 50%;
  overflow: hidden;
  background: var(--panel);
  color: var(--panel-fg);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--lg { width: 64px; height: 64px; font-size: 1.2rem; }
.avatar--sm { width: 30px; height: 30px; font-size: 0.68rem; }


/* ── Sponsors ─────────────────────────────────────────────────────── */

.sponsor-tier { margin-bottom: var(--sp-6); }
.sponsor-tier__head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.sponsor-tier__label {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}
.sponsor-tier__line { flex: 1; height: 1px; background: var(--line); }
.sponsor-tier__count {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--ink-4);
  letter-spacing: 0.1em;
}

.sponsor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--sp-3);
}
.sponsor {
  display: grid;
  place-items: center;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  text-align: center;
  transition: border-color 0.2s, transform 0.2s var(--ease), box-shadow 0.2s;
}
.sponsor:hover { border-color: var(--line-2); transform: translateY(-3px); box-shadow: var(--shadow); }
.sponsor__logo { height: 46px; display: grid; place-items: center; width: 100%; }
.sponsor__logo img { max-height: 46px; width: auto; object-fit: contain; }
.sponsor__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
}
.sponsor__blurb { font-size: 0.8rem; color: var(--ink-4); }
.sponsor--gold { border-width: 2px; border-color: var(--ink); }

.tier-table th:first-child { width: 40%; }
.tier-yes { color: var(--red); font-weight: 700; }
.tier-no { color: var(--ink-4); }


/* ── Blog ─────────────────────────────────────────────────────────── */

.post-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.24s var(--ease), box-shadow 0.24s, border-color 0.24s;
}
.post-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-2);
  box-shadow: var(--shadow);
}
.post-card__media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--paper-2); }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.post-card:hover .post-card__media img { transform: scale(1.04); }
.post-card__media .ph { height: 100%; border: 0; border-radius: 0; }
.post-card__cat {
  position: absolute;
  top: var(--sp-2); left: var(--sp-2);
  background: var(--panel);
  color: var(--panel-fg);
  padding: 0.24rem 0.6rem;
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.post-card__body {
  padding: var(--sp-3);
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.55rem;
}
.post-card__title {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.24;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.post-card__excerpt {
  font-size: 0.855rem;
  color: var(--ink-3);
  line-height: 1.58;
  flex: 1;
}
.post-card__foot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.63rem;
  color: var(--ink-4);
  letter-spacing: 0.05em;
}
.post-card__foot .avatar { width: 23px; height: 23px; font-size: 0.55rem; }
.post-card__foot span:last-child { margin-left: auto; text-align: right; }

.post-feature {
  display: grid;
  gap: var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--paper);
  margin-bottom: var(--sp-5);
}
@media (min-width: 880px) { .post-feature { grid-template-columns: 1.1fr 1fr; gap: 0; } }
.post-feature__media { min-height: 240px; background: var(--paper-2); }
.post-feature__media img { width: 100%; height: 100%; object-fit: cover; }
.post-feature__media .ph { height: 100%; border: 0; border-radius: 0; }
.post-feature__body { padding: var(--sp-5) var(--sp-4); align-self: center; }
.post-feature__title { font-size: var(--step-3); margin-bottom: var(--sp-2); }

/* Article body — the rendered writeup */
.prose {
  font-size: 1.055rem;
  line-height: 1.75;
  color: var(--ink-2);
}
.prose > * + * { margin-top: 1.15em; }
.prose h2 {
  font-size: var(--step-2);
  margin-top: 2.1em;
  margin-bottom: 0.5em;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--line);
}
.prose h3 { font-size: var(--step-1); margin-top: 1.8em; margin-bottom: 0.4em; }
.prose h4 { font-size: 1.06rem; margin-top: 1.5em; margin-bottom: 0.3em; }
.prose a { color: var(--red-deep); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin-bottom: 0.4em; }
.prose li::marker { color: var(--red); }
.prose img { border-radius: var(--radius); border: 1px solid var(--line); margin-inline: auto; }
.prose figure { margin: 1.8em 0; }
.prose figcaption {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-4);
  text-align: center;
  margin-top: 0.6em;
}
.prose blockquote {
  margin: 1.8em 0;
  padding: 0.2em 0 0.2em 1.25rem;
  border-left: 3px solid var(--red);
  color: var(--ink-3);
  font-style: italic;
}
.prose code {
  font-family: var(--font-mono);
  font-size: 0.87em;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.12em 0.36em;
  color: var(--red-deep);
}
.prose pre {
  background: var(--panel);
  color: var(--panel-fg);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.65;
  border-left: 3px solid var(--red);
}
.prose pre code {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
}
/* Tables in articles. CKEditor wraps them in <figure class="table">, so both
   the wrapped and the bare form are handled. Headers echo the leaderboard:
   mono uppercase label over a heavy ink rule. */
.prose figure.table {
  margin: 1.9em 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.prose .table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.9em 0;
}
.prose table {
  display: table;
  table-layout: auto;
  min-width: 100%;
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.prose thead th,
.prose thead td,
.prose tr:first-child > th {
  background: var(--paper-2);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: left;
  white-space: nowrap;
  border-bottom: 2px solid var(--ink);
  padding: 0.7rem 0.85rem;
  vertical-align: bottom;
}
.prose tbody td,
.prose tbody th {
  padding: 0.68rem 0.85rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
/* A leading th inside the body is a row label, not a column header. */
.prose tbody th {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  background: transparent;
}
.prose tbody tr:nth-child(even) { background: var(--paper-2); }
.prose tbody tr:last-child td,
.prose tbody tr:last-child th { border-bottom: 0; }
.prose tbody tr:hover { background: var(--red-wash); }
.prose td + td, .prose th + th, .prose th + td {
  border-left: 1px solid var(--line);
}
.prose figcaption { margin-top: 0.7em; }
.prose hr { margin: 2.2em 0; }
.prose .flag {
  font-family: var(--font-mono);
  background: var(--panel);
  color: #7dff9b;
  padding: 0.15em 0.5em;
  border-radius: 3px;
}

.article-head { padding-block: var(--sp-6) var(--sp-4); }
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  padding-block: var(--sp-3);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-4);
  letter-spacing: 0.05em;
}
.article-meta__author { display: flex; align-items: center; gap: 0.6rem; }
.article-meta__author b {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--ink);
  letter-spacing: 0;
}
.article-meta__author span { display: block; font-size: 0.62rem; color: var(--ink-4); }

.writeup-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--sp-2);
  padding: var(--sp-3);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  border-radius: var(--radius);
  margin-bottom: var(--sp-4);
}
.writeup-facts dt {
  font-family: var(--font-mono);
  font-size: 0.57rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.writeup-facts dd {
  margin: 0.15rem 0 0;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  font-size: 0.98rem;
}

.sidebar { display: grid; gap: var(--sp-4); align-content: start; }
.side-block {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--sp-3);
  background: var(--paper);
}
.side-block__title {
  font-family: var(--font-mono);
  font-size: 0.63rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: var(--sp-2);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--line);
}
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list li + li { margin-top: 0.15rem; }
.side-list a {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--ink-2);
  transition: background 0.15s;
}
.side-list a:hover { background: var(--paper-2); color: var(--ink); }
.side-list a.is-active { background: var(--panel); color: var(--panel-fg); }
.side-list em {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 0.68rem;
  color: var(--ink-4);
}
.side-list a.is-active em { color: var(--panel-muted); }

.search {
  display: flex;
  gap: 0.4rem;
}
.search input {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: var(--paper);
  color: var(--ink);
}
.search input:focus { outline: 2px solid var(--red); outline-offset: 1px; }


/* ── Pagination ───────────────────────────────────────────────────── */

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: var(--sp-6);
}
.pagination a, .pagination span {
  min-width: 40px;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-align: center;
  color: var(--ink-2);
}
.pagination a:hover { border-color: var(--ink); color: var(--ink); }
.pagination .is-current { background: var(--panel); border-color: var(--panel); color: var(--panel-fg); }
.pagination .is-disabled { color: var(--ink-4); border-color: var(--line); }


/* ── Forms ────────────────────────────────────────────────────────── */

.field { margin-bottom: var(--sp-3); }
.field__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.63rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.4rem;
}
.field__label .req { color: var(--red); }
.field__input {
  width: 100%;
  padding: 0.72rem 0.85rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.field__input:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-wash);
}
.field__input--area { resize: vertical; min-height: 110px; line-height: 1.6; }
.field__input--select { appearance: none; background-image: none; cursor: pointer; padding-right: 2rem; }
.field__file {
  width: 100%;
  padding: 0.6rem;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: var(--paper-2);
}
.field__help {
  font-size: 0.78rem;
  color: var(--ink-4);
  margin-top: 0.35rem;
}
.field__error {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--red-deep);
  margin-top: 0.35rem;
}
.field--check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: var(--sp-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
}
.field__check { width: 17px; height: 17px; accent-color: var(--red); margin-top: 2px; flex: none; }
.field--check label { font-size: 0.9rem; color: var(--ink-2); cursor: pointer; }
.field-row { display: grid; gap: var(--sp-3); }
@media (min-width: 620px) { .field-row--2 { grid-template-columns: 1fr 1fr; } }


/* ── Alerts / messages ────────────────────────────────────────────── */

.alerts { display: grid; gap: 0.5rem; margin-bottom: var(--sp-4); }
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper-2);
  font-size: 0.92rem;
}
.alert--success { border-left-color: #12874f; background: #f1fbf5; }
.alert--error { border-left-color: var(--red); background: var(--red-wash); }
.alert--warning { border-left-color: #b9770e; background: #fff8ec; }
.alert--info { border-left-color: var(--ink-3); }


/* ── Callout ──────────────────────────────────────────────────────── */

.callout {
  padding: var(--sp-4);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  border-radius: var(--radius);
}
.callout__label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--red-deep);
  margin-bottom: 0.4rem;
  display: block;
}
.callout p { color: var(--ink-2); }

.quote {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.section--ink .quote { color: var(--panel-fg); }


/* ── CTA band ─────────────────────────────────────────────────────── */

.cta {
  position: relative;
  background: var(--panel);
  color: var(--panel-muted);
  overflow: hidden;
}
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 88% 50%, rgba(255, 49, 49, 0.24), transparent 70%);
}
.cta::after {
  content: "";
  position: absolute;
  right: -60px; top: -60px;
  width: 320px; height: 320px;
  border: 1px solid var(--panel-line);
  border-radius: 50%;
}
.cta__inner { position: relative; padding-block: var(--sp-7); }
.cta h2 { font-size: var(--step-4); color: var(--panel-fg); max-width: 22ch; }
.cta p { max-width: 46ch; font-size: var(--step-1); color: var(--panel-muted); }


/* ── Footer ───────────────────────────────────────────────────────── */

.site-footer { background: var(--panel); color: var(--panel-muted); padding-top: var(--sp-6); }
.site-footer a { color: var(--panel-muted); }
.site-footer a:hover { color: var(--panel-fg); }
.footer__grid {
  display: grid;
  gap: var(--sp-5);
  padding-bottom: var(--sp-5);
}
@media (min-width: 780px) { .footer__grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; } }

.footer__about { font-size: 0.9rem; margin-top: var(--sp-3); max-width: 34ch; }
.footer__title {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--panel-muted);
  margin-bottom: var(--sp-2);
}
.footer__list { list-style: none; margin: 0; padding: 0; font-size: 0.9rem; }
.footer__list li + li { margin-top: 0.5rem; }
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding-block: var(--sp-3);
  border-top: 1px solid var(--panel-line);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  color: var(--panel-muted);
}
.social-row { display: flex; gap: 0.4rem; margin-top: var(--sp-3); }
.social {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--panel-muted);
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.social:hover { background: var(--red); border-color: var(--red); color: var(--panel-fg); }


/* ── Page header (interior pages) ─────────────────────────────────── */

.page-head {
  position: relative;
  padding-block: var(--sp-6) var(--sp-5);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse 50% 70% at 92% 10%, var(--red-wash) 0%, transparent 68%),
    var(--paper);
}
.page-head h1 { font-size: var(--step-4); max-width: 22ch; }
.page-head p { color: var(--ink-3); font-size: var(--step-1); max-width: 56ch; }
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: var(--sp-3);
}
.breadcrumbs a { color: var(--ink-3); }
.breadcrumbs a:hover { color: var(--red-deep); }
.breadcrumbs span { color: var(--line-2); }

.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--sp-3);
  margin-top: var(--sp-5);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--line);
}


/* ── Empty state ──────────────────────────────────────────────────── */

.empty {
  text-align: center;
  padding: var(--sp-7) var(--sp-4);
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-lg);
  background: var(--paper-2);
}
.empty__mark {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: var(--sp-2);
}
.empty h3 { margin-bottom: var(--sp-2); }
.empty p { color: var(--ink-3); max-width: 44ch; margin-inline: auto; }


/* ── Accordion (FAQ) ──────────────────────────────────────────────── */

.faq { border-top: 1px solid var(--line); }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 600;
  color: var(--ink);
}
.faq__q:hover { color: var(--red-deep); }
.faq__sign {
  flex: none;
  width: 22px; height: 22px;
  position: relative;
}
.faq__sign::before, .faq__sign::after {
  content: "";
  position: absolute;
  background: var(--red);
  transition: transform 0.25s var(--ease);
}
.faq__sign::before { left: 0; right: 0; top: 10px; height: 2px; }
.faq__sign::after { top: 0; bottom: 0; left: 10px; width: 2px; }
.faq__q[aria-expanded="true"] .faq__sign::after { transform: rotate(90deg); }
.faq__a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s var(--ease);
}
.faq__a > div { overflow: hidden; }
.faq__item.is-open .faq__a { grid-template-rows: 1fr; }
.faq__a p { padding-bottom: var(--sp-3); color: var(--ink-3); max-width: 68ch; }


/* ── Reveal on scroll ─────────────────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.07s; }
.reveal[data-delay="2"] { transition-delay: 0.14s; }
.reveal[data-delay="3"] { transition-delay: 0.21s; }
.reveal[data-delay="4"] { transition-delay: 0.28s; }
.reveal[data-delay="5"] { transition-delay: 0.35s; }


/* ── Utilities ────────────────────────────────────────────────────── */

.mono { font-family: var(--font-mono); }
.muted { color: var(--ink-3); }
.dim { color: var(--ink-4); }
.small { font-size: 0.85rem; }
.tiny { font-size: 0.75rem; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.red { color: var(--red); }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }
.mb-0 { margin-bottom: 0; }
.mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-5 { margin-bottom: var(--sp-5); }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.items-center { align-items: center; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* ── Reduced motion ───────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .capture__fill { transition: none; }
}


/* ── Print ────────────────────────────────────────────────────────── */

@media print {
  .site-header, .site-footer, .cta, .nav-toggle, .mobile-nav { display: none; }
  body { color: #000; }
  .card, .board__row { break-inside: avoid; }
}


/* ── Competing team roster ──────────────────────────────────────────── */

.roster { display: grid; gap: var(--sp-2); }
.roster__row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  transition: border-color 0.2s, transform 0.2s var(--ease);
}
.roster__row:hover { border-color: var(--line-2); transform: translateX(3px); }
.roster__row--captain { border-left: 3px solid var(--red); }
.roster__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.roster__meta {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.05em;
  color: var(--ink-4);
  margin-top: 0.22rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}
.roster__links { margin-left: auto; display: flex; gap: 0.35rem; flex: none; }

.team-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
}
.team-hero__rank {
  display: grid;
  place-items: center;
  width: 68px; height: 68px;
  border-radius: var(--radius-lg);
  background: var(--panel);
  color: var(--panel-fg);
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  flex: none;
}
.team-hero__rank--1 { background: var(--red); }
.team-hero__rank--2 { background: var(--red-wash-2); color: var(--red-deep); border: 2px solid var(--red); }
.team-hero__rank--3 { background: var(--red-wash); color: var(--red-deep); }

a.board__stat { display: block; }
a.board__stat:hover { color: var(--red-deep); }


/* ── Definition pairs (used on public pages and in the dashboard) ───── */

.kv { display: grid; gap: var(--sp-3); margin: 0; }
@media (min-width: 480px) {
  .kv--cols { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
}
.kv > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-2);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--line);
}
.kv > div:last-child { border-bottom: 0; padding-bottom: 0; }
.kv dt {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
  flex: none;
}
.kv dd {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--ink);
  text-align: right;
}

/* ── Person links ───────────────────────────────────────────────────── */

.person__creds {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  margin-top: 0.35rem;
  line-height: 1.55;
}
.person__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: var(--sp-2);
}
.plink {
  display: inline-flex;
  align-items: center;
  gap: 0.38em;
  padding: 0.28rem 0.6rem;
  border: 1px solid var(--line-2);
  border-radius: 100px;
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  transition: background 0.16s, border-color 0.16s, color 0.16s;
}
.plink svg { flex: none; }
.plink:hover {
  background: var(--panel);
  border-color: var(--panel);
  color: var(--panel-fg);
}
.roster__links .person__links { margin-top: 0; }


/* ==========================================================================
   Dark theme
   --------------------------------------------------------------------------
   Set with data-theme="dark" on <html>. An inline script in base.html applies
   it before first paint, so there is no flash of the light theme.

   Note the panel tokens invert their logic here: in the light theme a "panel"
   is darker than the page, in the dark theme it is lighter. Everything that
   was a deliberately dark surface becomes a raised one.
   ========================================================================== */

[data-theme="dark"] {
  color-scheme: dark;

  --ink:        #f3f3f6;
  --ink-2:      #d5d5de;
  --ink-3:      #a2a2b0;
  --ink-4:      #8a8a97;   /* lifted from #71717f to clear 4.5:1 on the page background */

  --paper:      #0f0f13;
  --paper-2:    #17171d;
  --paper-3:    #21212a;

  --red:        #ff4d4d;
  --red-deep:   #ff7a7a;
  --red-wash:   #2a1418;
  --red-wash-2: #3d1b20;

  --line:       #26262f;
  --line-2:     #35353f;

  --panel:      #1b1b23;
  --panel-2:    #24242e;
  --panel-fg:   #f3f3f6;
  --panel-muted:#9b9baa;
  --panel-line: rgba(255, 255, 255, 0.12);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow:    0 8px 26px -14px rgba(0, 0, 0, 0.8);
  --shadow-lg: 0 26px 60px -28px rgba(0, 0, 0, 0.9);
}

[data-theme="dark"] .site-header {
  background: rgba(15, 15, 19, 0.9);
}

/* The hero's red glow is far too strong on a dark page. */
[data-theme="dark"] .hero {
  background:
    radial-gradient(ellipse 70% 55% at 88% 0%, rgba(255, 77, 77, 0.09) 0%, transparent 70%),
    var(--paper);
}
[data-theme="dark"] .page-head {
  background:
    radial-gradient(ellipse 50% 70% at 92% 10%, rgba(255, 77, 77, 0.08) 0%, transparent 68%),
    var(--paper);
}
[data-theme="dark"] .cta::before {
  background: radial-gradient(ellipse 60% 80% at 88% 50%, rgba(255, 77, 77, 0.16), transparent 70%);
}
[data-theme="dark"] .login {
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(255, 77, 77, 0.08), transparent 70%),
    var(--paper-2);
}
[data-theme="dark"] .shield-panel__frame::before {
  background: linear-gradient(135deg, rgba(255, 77, 77, 0.07) 0%, rgba(255, 77, 77, 0.14) 100%);
}

/* Podium ranks: tinted fills need more presence against a dark row. */
[data-theme="dark"] .rank--1 { background: var(--red); color: #16060a; }
[data-theme="dark"] .rank--2 { background: var(--red-wash-2); color: #ffb3b3; border-color: var(--red); }
[data-theme="dark"] .rank--3 { background: var(--red-wash); color: #ff9c9c; }
[data-theme="dark"] .form-guide__cell--1 { color: #16060a; }
[data-theme="dark"] .form-guide__cell--2,
[data-theme="dark"] .form-guide__cell--3 { color: #ffb3b3; }
[data-theme="dark"] .chip--wash { color: #ff9c9c; }

/* Placeholders should read as empty slots, not as bright blocks. */
[data-theme="dark"] .ph {
  background: repeating-linear-gradient(
    -45deg, var(--paper-2) 0 9px, var(--paper-3) 9px 18px);
}

[data-theme="dark"] .alert--success { background: #0f2418; border-left-color: #37a06a; }
[data-theme="dark"] .alert--error { background: #2a1418; }
[data-theme="dark"] .alert--warning { background: #2a2011; border-left-color: #c99433; }

[data-theme="dark"] .prose code { background: var(--paper-3); color: #ff9c9c; }
[data-theme="dark"] .prose pre { background: #08080b; }
[data-theme="dark"] .prose img { border-color: var(--line-2); }
[data-theme="dark"] .terminal { background: #08080b; }

[data-theme="dark"] .tier-yes { color: var(--red); }
[data-theme="dark"] .sponsor--gold { border-color: var(--red); }


/* ── Theme toggle ───────────────────────────────────────────────────── */

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 42px; height: 42px;
  padding: 0;
  background: none;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}
.theme-toggle:hover { border-color: var(--ink); color: var(--ink); }
.theme-toggle svg { display: block; }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* Logo: the supplied lockup on light, the light-ink version on dark. */
.brand__logo--auto-dark { display: none; }
[data-theme="dark"] .brand__logo--auto-light { display: none; }
[data-theme="dark"] .brand__logo--auto-dark { display: block; }

/* Generic swap for any asset that ships in a light and a dark cut. */
.dark-only { display: none; }
[data-theme="dark"] .light-only { display: none; }
[data-theme="dark"] .dark-only { display: block; }
