/* SUPERGENE Challenge Site — design tokens + components.
   Loaded via <link rel="stylesheet" href="/static/styles.css"> from
   src/views/layout.js. No inline styles anywhere, so the CSP can omit
   'unsafe-inline' from style-src. Requires:
     style-src 'self' https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/;
     font-src  https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/;
   (the @import below pulls Pretendard's CSS and woff2 files from jsdelivr).
*/

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');

:root {
  /* Dark theme, matching supergene.co in dark mode */
  color-scheme: dark;
  --bg: #1B1C1F;
  --surface: #232429;
  --ink: #ECE9E4;
  --body: #C4C1CC;
  --muted: #8E8AA3;
  --line: #2F2D45;
  --accent: #7C5CFF;
  --accent-soft: #2B2550;
  --accent-tint: #24222F;
  --mint: #18C8A8;
  --dark: #121216;
  --on-dark: #B9B3DE;

  --radius: 24px;
  --radius-sm: 12px;
  --container: 1360px;
  --header-h: 76px;

  --font-sans: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: 'Lucida Console', Menlo, Monaco, 'Courier New', monospace;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--body);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
}
h1, h2, h3, h4, p, ul, ol, dl { margin: 0 0 0.75em; }
h1, h2, h3, h4 {
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
h1 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.75rem); }
h2 { font-size: clamp(1.375rem, 1.1rem + 1vw, 1.875rem); }
h3 { font-size: 1.25rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Layout shell ---------- */
.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--header-h);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(12px);
  display: flex;
  align-items: center;
}
.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}
.wordmark {
  font-weight: 800;
  font-size: 1.125rem;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.wordmark--on-dark { color: #fff; }
.site-nav { display: flex; align-items: center; gap: 12px; }
.site-nav form { margin: 0; }

.site-main { flex: 1 0 auto; padding: 40px 0 64px; }
@media (max-width: 640px) {
  .site-main { padding: 28px 0 48px; }
}

.site-footer {
  background: var(--dark);
  color: var(--on-dark);
  margin-top: auto;
  padding: 36px 0;
}
.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.footer-brand { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-link { color: var(--on-dark); }
.footer-link:hover { color: #fff; }
.footer-disclaimer {
  flex-basis: 100%;
  font-size: 0.8125rem;
  color: var(--on-dark);
  border-top: 1px solid rgba(185, 179, 222, 0.25);
  padding-top: 16px;
  margin-top: 8px;
}

/* ---------- Eyebrows & sections ---------- */
.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.section { margin-bottom: 40px; }
.section-title { margin-bottom: 8px; }
.section-body { color: var(--body); }
.section + .section { padding-top: 32px; border-top: 1px solid var(--line); }

/* ---------- Cards ---------- */
.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
}
@media (max-width: 640px) {
  .card { padding: 20px; }
}
.card--tint { background: var(--accent-tint); border-color: var(--accent-tint); }

/* Dark CTA band (e.g. "Are you up for the challenge?") */
.cta-band {
  background: var(--dark);
  color: var(--on-dark);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
}
.cta-band h2, .cta-band h3 { color: #fff; }
.cta-band p { color: var(--on-dark); }

/* ---------- Prerequisite / hand-in checklist ---------- */
.checklist { list-style: none; padding: 0; margin: 0 0 1em; }
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.checklist-item:last-child { border-bottom: none; }
.checklist-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--accent);
}
/* Decorative (read-only) checklist mark, for recaps that aren't a real form control */
.checklist-mark {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  margin-top: 1px;
}
.checklist-label { color: var(--body); }

/* ---------- Countdown ---------- */
.countdown {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px 16px;
  flex-wrap: wrap;
  background: var(--accent-tint);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin: 24px 0;
}
.countdown-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--mint);
  flex-shrink: 0;
}
.countdown.is-urgent .countdown-dot { background: var(--accent); }
.countdown-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(1.25rem, 1rem + 1.5vw, 1.75rem);
  color: var(--ink);
  letter-spacing: 0.01em;
}
.countdown-caption {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.countdown-refresh-link {
  font-size: 0.875rem;
  font-weight: 600;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn--accent { background: var(--accent); color: #fff; }
.btn--accent:hover { box-shadow: 0 10px 28px rgba(108, 76, 241, 0.35); }
.btn--black { background: var(--ink); color: #fff; }
.btn--black:hover { box-shadow: 0 10px 28px rgba(15, 15, 25, 0.25); }
.btn--outline { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn--outline:hover { border-color: var(--accent); color: var(--accent); }
.btn--sm { padding: 8px 18px; font-size: 0.875rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- Forms ---------- */
.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="url"],
.field select,
.field textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { min-height: 140px; resize: vertical; }
.field-error {
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: 6px;
}
.field--inline { display: flex; align-items: center; gap: 8px; margin-bottom: 0; }
.field--inline label { margin-bottom: 0; }
.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 24px; }

/* ---------- Notices ---------- */
.notice {
  display: flex;
  gap: 12px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 20px 24px;
  margin: 0 0 24px;
}
.notice-body p:last-child { margin-bottom: 0; }
.notice--success { background: color-mix(in srgb, var(--mint) 14%, var(--bg)); border-color: color-mix(in srgb, var(--mint) 35%, var(--bg)); color: var(--ink); }
.notice--sorry,
.notice--warning { background: var(--accent-soft); color: var(--ink); }
.notice--info { background: var(--accent-tint); color: var(--body); }

/* ---------- Filter bar ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.filter-bar select {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  background: var(--bg);
  color: var(--ink);
}

/* ---------- Admin table ---------- */
.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
}
.admin-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
.admin-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg);
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  white-space: nowrap;
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table .mono { font-family: var(--font-mono); font-size: 0.875rem; color: var(--body); }

.pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--line);
  color: var(--body);
}
.pill--accepting, .pill--running { background: var(--accent-tint); color: var(--accent); }
.pill--submitted, .pill--invited { background: color-mix(in srgb, var(--mint) 18%, var(--bg)); color: #0c7d68; }
.pill--expired, .pill--invitation_expired, .pill--rejected { background: var(--accent-soft); color: var(--accent); }
.pill--never_logged_in, .pill--none, .pill--withdrawn, .pill--declined { background: var(--line); color: var(--muted); }

.outcome-form { display: inline-flex; align-items: center; gap: 8px; }
.outcome-form select { font-family: var(--font-sans); font-size: 0.875rem; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 10px; }
.outcome-at { display: block; font-size: 0.75rem; color: var(--muted); margin-top: 2px; }

/* ---------- Prose (marked-rendered markdown from content.md) ---------- */
.prose h1, .prose h2, .prose h3, .prose h4 { margin-top: 1.4em; }
.prose h1:first-child, .prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose p { margin: 0 0 1em; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.4em; }
.prose a { font-weight: 600; }
.prose code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--accent-tint);
  color: var(--ink);
  padding: 2px 6px;
  border-radius: 6px;
}
.prose pre {
  background: var(--ink);
  color: var(--on-dark);
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
}
.prose pre code { background: none; color: inherit; padding: 0; }
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1em;
  font-size: 0.9375rem;
}
.prose th, .prose td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
.prose blockquote {
  margin: 0 0 1em;
  padding: 2px 20px;
  border-left: 3px solid var(--accent-soft);
  color: var(--muted);
}

/* ---------- Utilities ---------- */
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.text-center { text-align: center; }

/* ---------- Small screens (down to 375px, no horizontal page scroll) ---------- */
@media (max-width: 480px) {
  .site-header-inner { flex-wrap: wrap; }
  .cta-band { padding: 28px 20px; }
  .countdown { padding: 18px 20px; gap: 12px; }
  .btn { width: 100%; }
  .form-actions { flex-direction: column; align-items: stretch; }
  .form-actions .btn { width: 100%; }
  /* The admin table is the one component allowed to scroll, inside .table-wrap */
}

/* ---------- Parallax hero (accepting view, modelled on supergene.co) ---------- */
.hero-space {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(120% 90% at 70% 0%, #2a1f6b 0%, #14112e 45%, var(--dark) 100%);
  color: #fff;
  min-height: min(88vh, 820px);
  display: flex;
  align-items: center;
  padding: clamp(64px, 12vh, 140px) 0 clamp(56px, 10vh, 120px);
}
.hero-inner { position: relative; z-index: 1; width: 100%; will-change: transform; }
.eyebrow--on-dark { color: var(--on-dark); }
.mega {
  font-size: clamp(2.5rem, 1.2rem + 6vw, 6rem);
  line-height: 0.98;
  font-weight: 900;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: #fff;
  margin: 16px 0 0;
  max-width: 14ch;
}
.mega .ol {
  display: block;
  color: transparent;
  -webkit-text-stroke: 1.5px #fff;
}
.hero-space .lead {
  color: #c9c4e8;
  font-size: clamp(1rem, 0.9rem + 0.5vw, 1.25rem);
  max-width: 46ch;
  margin-top: 28px;
}
.hero-space .countdown {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.14);
  backdrop-filter: blur(6px);
  max-width: 620px;
}
.hero-space .countdown-value { color: #fff; }
.hero-space .countdown-caption { color: var(--on-dark); }
.hero-actions { margin-top: 8px; }

/* Sections fade up as they scroll in. Only hidden when JS is running (html.js),
   so content stays visible without JavaScript. */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.45s ease, transform 0.45s ease; }
.js .reveal.on { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .hero-inner { transform: none !important; }
}

/* ---------- Modal (replaces browser confirm/alert) ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 15, 25, 0.55);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.18s ease;
}
.modal-backdrop.is-open { opacity: 1; }
.modal {
  width: min(100%, 440px);
  background: #fff;
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 24px 64px rgba(15, 15, 25, 0.35);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.18s ease;
}
.modal-backdrop.is-open .modal { transform: none; }
.modal-title { margin: 0 0 8px; font-size: 1.25rem; color: var(--ink); }
.modal-message { margin: 0 0 24px; color: var(--body); }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }
body.modal-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
  .modal-backdrop, .modal { transition: none; }
}

/* Admin row actions (Reset + Remove side by side) */
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; }
.row-actions form { margin: 0; }

/* ---------- Logo (supergene.co wordmark: SUPERGENE + accent dot) ---------- */
.logo { font-weight: 900; font-size: 1.25rem; letter-spacing: 0.02em; text-transform: uppercase; }
.logo-dot { color: var(--accent); }

/* ---------- Pinned countdown in the sticky header ---------- */
.header-timer { margin-left: auto; min-width: 0; }
.pinned-timer {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  white-space: nowrap;
}
.pinned-timer .countdown-dot { width: 8px; height: 8px; }
.pinned-timer-caption {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-dark);
}
.pinned-timer time, .pinned-timer .countdown-value { font-family: var(--font-mono); font-weight: 700; font-size: 0.9375rem; color: #fff; }
.pinned-timer.is-urgent .countdown-dot { background: var(--accent); }
@media (max-width: 520px) {
  .site-header-inner { flex-wrap: nowrap; gap: 8px; }
  .pinned-timer { padding: 6px 10px; gap: 6px; }
  .pinned-timer-caption { display: none; }
  .pinned-timer time, .pinned-timer .countdown-value { font-size: 0.8125rem; }
  .site-header .btn--sm { padding: 6px 10px; font-size: 0.8125rem; white-space: nowrap; }
  .logo { font-size: 1rem; }
}
@media (max-width: 360px) {
  .pinned-timer .countdown-dot { display: none; }
  .pinned-timer time, .pinned-timer .countdown-value { font-size: 0.75rem; }
  .pinned-timer { padding: 5px 8px; }
  .site-header .btn--sm { padding: 5px 8px; font-size: 0.75rem; }
  .logo { font-size: 0.9375rem; }
}

/* Compact hero for inner candidate and admin pages */
.hero-space--compact {
  min-height: 0;
  padding: clamp(48px, 8vh, 96px) 0 clamp(40px, 7vh, 80px);
}
.hero-space--compact .mega {
  font-size: clamp(2rem, 1rem + 4vw, 4rem);
  max-width: 22ch;
  overflow-wrap: anywhere;
}
.hero-space--compact .lead { margin-top: 20px; }

/* Logo link never shows an underline */
.wordmark, .wordmark:hover { text-decoration: none; }

/* ---------- Dark theme fixes for rules written for a light page ---------- */
.site-header { background: rgba(27, 28, 31, 0.82); }
.card { background: var(--surface); }
.field input, .field select, .field textarea, .filter-bar select, .outcome-form select { background: var(--surface); color: var(--ink); }
.admin-table thead th { background: var(--surface); }
.btn--black { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn--outline:hover { border-color: var(--accent); color: #fff; }
.cta-band { border: 1px solid var(--line); background: linear-gradient(135deg, #1a1630 0%, var(--dark) 70%); }
.pinned-timer { background: var(--dark); border: 1px solid var(--line); }
.modal { background: var(--surface); border: 1px solid var(--line); }
.modal-backdrop { background: rgba(0, 0, 0, 0.6); }
.prose pre { background: var(--dark); border: 1px solid var(--line); }
.pill--submitted, .pill--invited { color: #3EE0C0; }
.site-footer { border-top: 1px solid var(--line); }
.hero-space { background: radial-gradient(120% 90% at 70% 0%, #2a1f6b 0%, #14112e 45%, var(--bg) 100%); }

/* Plain title block on inner pages */
.page-head { padding-top: clamp(40px, 7vh, 80px); }
.page-title {
  font-size: clamp(2rem, 1rem + 4vw, 4rem);
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 12px 0 0;
  overflow-wrap: anywhere;
}
.page-title .ol { color: transparent; -webkit-text-stroke: 1.5px var(--ink); }
.page-head .lead { color: var(--body); margin-top: 16px; max-width: 60ch; }

/* ---------- Colored blocks: the hero's purple gradient on key surfaces ---------- */
:root { --hero-gradient: radial-gradient(120% 140% at 85% 0%, #3a2a8f 0%, #1f1850 45%, #14112e 100%); }
.card {
  background: var(--hero-gradient);
  border-color: rgba(185, 179, 222, 0.18);
}
.cta-band {
  background: var(--hero-gradient);
  border: 1px solid rgba(185, 179, 222, 0.18);
}
.pinned-timer {
  background: linear-gradient(135deg, #3a2a8f 0%, #1f1850 60%, #14112e 100%);
  border: 1px solid rgba(185, 179, 222, 0.22);
}
.card .field input, .card .field select, .card .field textarea { background: rgba(10, 8, 24, 0.55); border-color: rgba(185, 179, 222, 0.2); }
.notice--success { background: linear-gradient(135deg, rgba(24, 200, 168, 0.22), rgba(31, 24, 80, 0.6)); border-color: rgba(24, 200, 168, 0.4); }
.modal { background: var(--hero-gradient); border-color: rgba(185, 179, 222, 0.22); }

/* ======================================================================
   supergene.co layout: narrow centred column, black hero with a purple
   headline line, purple ticker band, numbered rows, big-wordmark footer.
   ====================================================================== */
:root { --container: 1040px; --title: #E7E4DF; }

/* Hero */
.hero-space { background: #07060F; }
.mega { color: var(--title); }
.mega .ol, .page-title .ol { color: var(--accent); -webkit-text-stroke: 0; }
.page-title { color: var(--title); }

/* Numbered rows */
.section.row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 24px;
  margin: 0;
  padding: 48px 0;
  border-top: 1px solid var(--line);
}
.section.row + .section.row { padding-top: 48px; }
.row-num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--accent);
  padding-top: 26px;
}
.row .section-title {
  font-size: clamp(1.5rem, 1rem + 2vw, 2.25rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--title);
  margin: 6px 0 16px;
}
.row .section-body { max-width: 68ch; }
.site-main .row:last-of-type { border-bottom: 1px solid var(--line); }
.site-main .cta-band { margin-top: 56px; }
@media (max-width: 640px) {
  .section.row { grid-template-columns: 1fr; gap: 4px; padding: 36px 0; }
  .row-num { padding-top: 0; }
}

/* Footer */
.site-footer { background: #0B0B10; border-top: 1px solid var(--line); padding: 72px 0 32px; }
.footer-mega {
  font-weight: 900;
  font-size: clamp(3.5rem, 1rem + 13vw, 11rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--title);
  margin-bottom: 56px;
  white-space: nowrap;
}
.footer-offices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  margin-bottom: 48px;
}
.footer-office {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 12px;
}
.footer-offices p { color: var(--on-dark); margin: 0; }
.footer-bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--on-dark);
}
.footer-bar .footer-link { color: var(--on-dark); }
@media (max-width: 720px) { .footer-offices { grid-template-columns: 1fr; gap: 24px; } }

/* ---------- supergene.co hero (WebGL earth from public/globe.js) ---------- */
.hero--space {
  position: relative;
  overflow: hidden;
  min-height: min(92vh, 960px);
  display: flex;
  align-items: center;
  padding: clamp(64px, 10vh, 120px) 0;
  background: linear-gradient(180deg, #03040a 0%, #0b0a1e 100%);
}
.hero--space .hero__earth { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.hero--space .hero__globe {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.94);
  transform-origin: 50% 50%;
  transition: opacity 0.8s cubic-bezier(0.22, 0.61, 0.36, 1), transform 1s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.hero--space .hero__globe.is-on { opacity: 1; transform: none; }
.hero--space::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(2, 3, 8, 0.8) 0%, rgba(2, 3, 8, 0.38) 48%, transparent 76%);
  pointer-events: none;
}
@media (max-width: 879px) {
  .hero--space::before {
    background: linear-gradient(180deg, rgba(2, 3, 8, 0.78) 0%, rgba(2, 3, 8, 0.52) 54%, rgba(2, 3, 8, 0.1) 80%, transparent 100%);
  }
}
.hero--space .hero-inner { position: relative; z-index: 2; }
.hero__meta { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; }
.mono { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase; }
.mono--accent { color: var(--accent); }
.mono--muted { color: rgba(255, 255, 255, 0.6); }
.hero--space .hero__meta .mono {
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
  background: rgba(2, 3, 10, 0.42);
  padding: 5px 12px;
  border-radius: 999px;
  backdrop-filter: blur(5px);
}
.hero--space .mega {
  font-size: clamp(44px, 7.4vw, 104px);
  font-weight: 900;
  text-transform: uppercase;
  line-height: 0.98;
  letter-spacing: -0.02em;
  color: #fff;
  max-width: none;
  margin: 0;
}
.hero--space .mega .hl { color: var(--accent); }
@media (max-width: 640px) { .hero--space .mega { font-size: clamp(30px, 9.6vw, 46px); } }
.hero--space .lead { color: #c9c4e8; font-size: clamp(16px, 1.8vw, 19px); max-width: 720px; margin-top: 32px; }
.hero--space .hero-actions { margin-top: 36px; }
.hero--space .btn {
  padding: 16px 32px;
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Withdraw: deliberately low-key, bottom of the brief */
.withdraw-form { margin: 40px 0 0; text-align: center; }
.link-quiet {
  background: none;
  border: 0;
  padding: 4px;
  font: inherit;
  font-size: 0.8125rem;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-quiet:hover, .link-quiet:focus-visible { color: #ff8a8a; }
.btn--danger { background: #d9485f; color: #fff; }
.btn--danger:hover { box-shadow: 0 10px 28px rgba(217, 72, 95, 0.35); }
.modal--danger { border-color: rgba(217, 72, 95, 0.5); }
.modal--danger .modal-title { color: #ff8a8a; }

/* Footer wordmark scales with the column so it never wraps */
.site-footer .container { container-type: inline-size; }
.footer-mega { font-size: 16.8cqi; }

/* ---------- Big pill button ---------- */
.btn--xl {
  padding: 18px 34px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.btn--xl span { transition: transform 0.15s; }
.btn--xl:hover span { transform: translateX(3px); }

/* ---------- CTA panel (invitation + brief) ---------- */
.cta-panel {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 32px;
  margin-top: 64px;
  padding: clamp(32px, 5vw, 56px);
  border-radius: var(--radius);
  border: 1px solid rgba(185, 179, 222, 0.18);
  background:
    radial-gradient(420px 260px at 100% 0%, rgba(124, 92, 255, 0.45), transparent 70%),
    radial-gradient(360px 240px at 0% 100%, rgba(24, 200, 168, 0.12), transparent 70%),
    #121025;
}
.cta-panel-title {
  font-size: clamp(1.75rem, 1rem + 2.6vw, 2.75rem);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--title);
  margin: 8px 0 12px;
}
.cta-panel-body, .cta-panel-body p { color: var(--on-dark); margin: 0; }
@media (max-width: 720px) {
  .cta-panel { grid-template-columns: 1fr; }
  .cta-panel .btn--xl { justify-content: center; }
}

/* ---------- Accept panel with a custom checkbox ---------- */
.accept-panel {
  margin-top: 32px;
  padding: clamp(24px, 4vw, 40px);
  border-radius: var(--radius);
  border: 1px solid rgba(185, 179, 222, 0.18);
  background: radial-gradient(420px 260px at 100% 0%, rgba(124, 92, 255, 0.35), transparent 70%), #121025;
}
.confirm-check {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.confirm-check:hover { border-color: rgba(124, 92, 255, 0.6); }
.confirm-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.confirm-check-box {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  margin-top: 1px;
  border-radius: 8px;
  border: 2px solid var(--muted);
  display: grid;
  place-items: center;
  transition: background 0.15s, border-color 0.15s;
}
.confirm-check-box::after {
  content: '';
  width: 7px;
  height: 13px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg) scale(0);
  margin-top: -3px;
  transition: transform 0.15s;
}
.confirm-check input:checked + .confirm-check-box { background: var(--accent); border-color: var(--accent); }
.confirm-check input:checked + .confirm-check-box::after { transform: rotate(45deg) scale(1); }
.confirm-check input:focus-visible + .confirm-check-box { outline: 2px solid var(--accent); outline-offset: 3px; }
.confirm-check:has(input:checked) { border-color: var(--accent); background: rgba(124, 92, 255, 0.08); }
.confirm-check-text { display: flex; flex-direction: column; gap: 4px; }
.confirm-check-text strong { color: var(--title); font-size: 1.0625rem; }
.confirm-check-text span { color: var(--muted); font-size: 0.875rem; }
.accept-actions { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin-top: 24px; }
.accept-panel:has(#ready:not(:checked)) .btn--accent { opacity: 0.45; box-shadow: none; transform: none; }

/* ---------- Modal refresh ---------- */
.modal-backdrop { background: rgba(3, 4, 10, 0.72); }
.modal {
  width: min(100%, 460px);
  padding: 32px;
  text-align: center;
  background: radial-gradient(360px 220px at 50% 0%, rgba(124, 92, 255, 0.35), transparent 70%), #121025;
  border: 1px solid rgba(185, 179, 222, 0.22);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.modal-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(124, 92, 255, 0.25);
  border: 1px solid rgba(124, 92, 255, 0.5);
}
.modal-title { font-size: 1.5rem; font-weight: 900; letter-spacing: -0.01em; color: var(--title); margin-bottom: 10px; }
.modal-message { color: var(--on-dark); margin-bottom: 28px; }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-actions .btn { justify-content: center; text-transform: uppercase; font-weight: 800; letter-spacing: 0.04em; font-size: 14px; white-space: nowrap; padding-left: 16px; padding-right: 16px; }
.modal--danger { background: radial-gradient(360px 220px at 50% 0%, rgba(217, 72, 95, 0.3), transparent 70%), #121025; }
.modal--danger .modal-icon { background: rgba(217, 72, 95, 0.2); border-color: rgba(217, 72, 95, 0.55); color: #ff8a8a; }

/* Brief rows use the full column; lists stay tight */
.row .section-body { max-width: none; }
.row .prose li { margin-bottom: 6px; }
.row .prose li > p { margin: 0; }
.row .prose h4 { margin-top: 28px; }
.row .prose code { white-space: nowrap; }

/* Modal surfaces: a soft tint fading down from the top over a neutral dark base */
.modal {
  background:
    linear-gradient(180deg, rgba(124, 92, 255, 0.20) 0%, rgba(124, 92, 255, 0.06) 38%, rgba(124, 92, 255, 0) 70%),
    #15141c;
}
.modal--danger {
  background:
    linear-gradient(180deg, rgba(217, 72, 95, 0.09) 0%, rgba(217, 72, 95, 0.025) 38%, rgba(217, 72, 95, 0) 70%),
    #15141c;
  border-color: rgba(217, 72, 95, 0.22);
}

.page-head-actions { margin: 20px 0 0; }

/* ---------- Admin: flat, dense, wide ---------- */
.container--wide { max-width: 1400px; }
.admin .card,
.admin .table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  backdrop-filter: none;
}
.admin .card .field input,
.admin .card .field textarea { background: var(--bg); border-color: var(--line); }
.admin .filter-bar { align-items: center; gap: 12px 20px; margin-bottom: 16px; }
.admin .filter-bar select { background: var(--surface); padding: 8px 12px; }
.admin .field--inline label { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.admin .table-wrap { margin-bottom: 32px; }
.admin .admin-table { font-size: 0.875rem; }
.admin .admin-table thead th { background: var(--surface); padding: 12px 14px; font-size: 0.6875rem; }
.admin .admin-table td { padding: 12px 14px; }
.admin .admin-table td.mono, .admin .admin-table .mono { font-size: 0.75rem; color: var(--muted); letter-spacing: 0; }
.admin .admin-table tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }
.admin .row-actions .btn--sm, .admin .outcome-form .btn--sm { padding: 6px 12px; font-size: 0.75rem; }
.admin .outcome-form { display: flex; align-items: center; gap: 8px; }
.admin .outcome-form select { background: var(--bg); padding: 5px 8px; font-size: 0.8125rem; }
.admin-add { padding: 24px 28px; max-width: 760px; }
.admin-subtitle {
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--title);
  margin: 0 0 12px;
}
.admin-add .form-actions { margin-top: 12px; }
.admin .admin-table .mono, .admin .admin-table time { text-transform: none; }
.admin-add .stack { gap: 0; }
.admin-add .field { margin-bottom: 0; }
/* Admin table sits directly on the page: no box around it */
.admin .table-wrap { background: none; border: 0; border-radius: 0; }
.admin .admin-table thead th { background: var(--bg); border-bottom: 1px solid var(--line); }
.admin .admin-table td:first-child, .admin .admin-table th:first-child { padding-left: 0; }

/* Admin table: horizontal scrollbar always visible (macOS hides overlay scrollbars) */
.admin .table-wrap { overflow-x: scroll; padding-bottom: 6px; }
/* Chromium ignores ::-webkit-scrollbar when the standard properties are set, and macOS
   then hides the overlay bar, so only browsers without the WebKit pseudo-element
   (Firefox) get scrollbar-color. */
@supports not selector(::-webkit-scrollbar) {
  .admin .table-wrap { scrollbar-width: auto; scrollbar-color: rgba(185, 179, 222, 0.45) rgba(255, 255, 255, 0.04); }
}
.admin .table-wrap::-webkit-scrollbar { height: 10px; }
.admin .table-wrap::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.04); border-radius: 999px; }
.admin .table-wrap::-webkit-scrollbar-thumb { background: rgba(185, 179, 222, 0.45); border-radius: 999px; }
.admin .table-wrap::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.admin .row-actions .btn:disabled { opacity: 0.35; cursor: default; box-shadow: none; transform: none; }
.admin .outcome-form { flex-direction: column; align-items: flex-start; gap: 4px; }
.admin .outcome-form .outcome-at { font-size: 0.6875rem; color: var(--muted); padding-left: 2px; }

/* Softer danger modal (Withdraw and Reset share it): neutral title, muted rose accents */
.modal--danger .modal-title { color: var(--title); }
.modal--danger .modal-icon {
  background: rgba(217, 72, 95, 0.12);
  border-color: rgba(217, 72, 95, 0.3);
  color: #f0a3ae;
}
.modal--danger { border-color: rgba(217, 72, 95, 0.18); }
.btn--danger { background: #b4505f; color: #fff; }
.btn--danger:hover { background: #c25a6a; box-shadow: 0 8px 22px rgba(180, 80, 95, 0.28); }
.pill--invitation_expired, .pill--challenge_timeout, .pill--expired { background: rgba(240, 180, 90, 0.12); color: #f0b45a; }
/* Admin rows: top-align every cell so the dropdown, pills and buttons share one line
   even when the outcome date sits under the dropdown. */
.admin .admin-table td { vertical-align: top; }
.admin .admin-table td > span, .admin .admin-table td > time { display: inline-block; line-height: 30px; }
.admin .admin-table td .pill { line-height: normal; margin-top: 4px; }
.admin .outcome-form select { width: 172px; height: 30px; }
.admin .row-actions { align-items: flex-start; }
.admin .row-actions .btn--sm { height: 30px; display: inline-flex; align-items: center; }
/* Outcome date starts exactly under the dropdown's text: select padding (10px) + border (1px). */
.admin .outcome-form select { padding-left: 10px; padding-right: 10px; }
.admin .outcome-form .outcome-at { padding-left: 11px; }

/* Admin filter bar: labels, dropdowns and Apply share one height and centre line */
.admin .filter-bar { align-items: center; }
.admin .filter-bar .field--inline { align-items: center; }
.admin .filter-bar select { height: 40px; padding-top: 0; padding-bottom: 0; }
.admin .filter-bar .btn { height: 40px; display: inline-flex; align-items: center; padding-top: 0; padding-bottom: 0; }
.admin .field--inline label { line-height: 40px; }

/* Admin banner in the house purple gradient */
.admin .notice--success {
  color: var(--title);
  border: 1px solid rgba(185, 179, 222, 0.22);
  background:
    radial-gradient(420px 200px at 100% 0%, rgba(124, 92, 255, 0.4), transparent 70%),
    radial-gradient(320px 180px at 0% 100%, rgba(24, 200, 168, 0.1), transparent 70%),
    #121025;
}
[data-autohide] { transition: opacity 0.4s ease, transform 0.4s ease; }
[data-autohide].is-hiding { opacity: 0; transform: translateY(-6px); }

html:not(.js) .js-only, .js .js-hide, .js .admin .row-actions .js-hide { display: none; }

.add-rows { display: flex; flex-direction: column; gap: 12px; }
.add-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }
.add-row-remove {
  width: 36px; height: 40px; border: 1px solid var(--line); border-radius: 8px;
  background: none; color: var(--muted); font-size: 1.25rem; line-height: 1; cursor: pointer;
}
.add-row-remove:hover, .add-row-remove:focus-visible { color: #ff8a8a; border-color: currentColor; }
.add-row-more {
  align-self: flex-start; margin-top: 12px; padding: 0; border: 0; background: none;
  color: var(--accent); font: inherit; font-weight: 700; cursor: pointer;
}
.add-row-more:hover, .add-row-more:focus-visible { text-decoration: underline; }
.add-row-more:disabled { color: var(--muted); cursor: default; text-decoration: none; }
.admin .card.admin-add .field input[type="file"] { width: 100%; padding: 7px 0; border: 0; background: none; color: var(--muted); font-size: 0.8125rem; }
/* Visually hidden, not removed, so screen readers still get each row's labels */
.add-row + .add-row label {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.admin-add input[type="file"]::file-selector-button {
  margin-right: 10px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: none; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer;
}
.admin-add input[type="file"]::file-selector-button:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 640px) {
  .add-row { grid-template-columns: 1fr auto; }
  .add-row .field:first-child { grid-column: 1 / -1; }
}

.resume-link {
  display: block; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 0; border: 0; background: none; font: inherit; color: var(--accent); cursor: pointer; text-align: left;
}
.resume-link:hover, .resume-link:focus-visible { text-decoration: underline; }
.resume-form { display: flex; align-items: center; gap: 6px; margin: 0; }
.file-btn { position: relative; overflow: hidden; cursor: pointer; padding: 6px 12px; font-size: 0.75rem; }
.file-btn input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
html:not(.js) .file-btn input[type="file"] { position: static; opacity: 1; width: 180px; }

/* Only hidden with JS, since only JS can show them again */
.js .admin-table:not(.dates-shown) .col-date { display: none; }
.admin .filter-bar .toggle-dates { margin-left: auto; }

.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;
}
.admin .row-actions .btn--icon { width: 30px; padding: 0; justify-content: center; }
.admin .row-actions .btn--icon svg { display: block; }
.admin .row-actions .btn--icon-danger:hover, .admin .row-actions .btn--icon-danger:focus-visible { color: #ff8a8a; border-color: currentColor; }

.page--minimal .site-main { display: flex; align-items: center; padding: 48px 0; }
.page--minimal .site-main > .container { width: 100%; }
.signin { max-width: 420px; margin: 0 auto; }
.signin .card { margin: 0; }
.signin .form-actions .btn { width: 100%; justify-content: center; }

.challenge-switch {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: 20px; border: 1px solid var(--line); border-radius: 12px;
}
.challenge-switch p { margin: 0; display: flex; align-items: center; gap: 10px; color: var(--muted); }
.challenge-switch form { margin: 0; }
.challenge-switch--ended { border-color: rgba(240, 180, 90, 0.45); }
.btn--danger-quiet:hover, .btn--danger-quiet:focus-visible { color: #ff8a8a; border-color: currentColor; }
.ended .prose { max-width: 640px; }

.not-selected .prose { max-width: 640px; }

.status-page .prose { max-width: 640px; }

/* Sits in the content area's bottom padding, apart from the message, without making the page taller */
.site-main:has(.hint) { position: relative; }
.prose .hint { position: absolute; bottom: 24px; margin: 0; font-size: 0.875rem; color: var(--muted); }
