/* Design tokens — matched to remotebrowser.ai (Figtree, indigo, light/dark by system) */
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --surface: #ffffff;
  --panel: #f5f6fa;
  --line: #e3e4e8;
  --line-soft: #eef0f3;
  --line-strong: #c4c7d0;
  --ink: #1f1f22;
  --muted: #5c5f66;
  --faint: #8a8d94;
  --placeholder: #a6a9b0;
  --blue: #4051b5;
  --accent: #526cfe;
  --blue-pale: #eef0fb;
  --ring: rgba(82, 108, 254, .2);
  --cta: #4051b5;
  --cta-hover: #303fa1;
  --on-accent: #ffffff;
  --ghost-bar: #eceef2;
  --dark: #16171a;
  --danger: #e5384f;
  --alert-bg: #fff1f3; --alert-ink: #b0173a; --alert-line: #ffd0d8;
  --grad: linear-gradient(100deg, #303fa1 0%, #4051b5 40%, #526cfe 100%);
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, Menlo, monospace; /* remotebrowser.ai: system mono, code only */
  --pad-x: max(clamp(20px, 5.5vw, 80px), calc((100% - 1280px) / 2));
  --radius: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16171a;
    --surface: #1d1e22;
    --panel: #212226;
    --line: #2e3036;
    --line-soft: #26272c;
    --line-strong: #474a52;
    --ink: #f2f2f4;
    --muted: #a3a6ad;
    --faint: #7c7f87;
    --placeholder: #5f626a;
    --blue: #7b8cff;
    --accent: #7b8cff;
    --blue-pale: #232842;
    --ring: rgba(123, 140, 255, .25);
    --cta: #526cfe;
    --cta-hover: #6a80ff;
    --ghost-bar: #2a2c31;
    --dark: #0b0c0f;
    --danger: #ff6b7f;
    --alert-bg: #3a1a20; --alert-ink: #ffb3bf; --alert-line: #5c2731;
    --grad: linear-gradient(100deg, #7b8cff 0%, #6a80ff 45%, #5488e8 100%);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, dl, dd, ol, ul { margin: 0; }
h1, h2, h3, dt, .caption, .win { text-wrap: balance; }
p, dd { text-wrap: pretty; }
ol, ul { list-style: none; padding: 0; }
a { color: inherit; }
img { display: block; }
button, input { font: inherit; color: inherit; }
.mono { font-family: var(--mono); }
.u { text-decoration: underline; text-underline-offset: 3px; }
.icon { width: 1em; height: 1em; flex: none; }
.short { display: none; }

.label, .kicker, .eyebrow, .tag, .when, .list-head, .plabel {
  font: 600 12px/1.4 var(--sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ── Buttons ── */
.btn-primary, .btn-secondary, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border-radius: 100px; font-weight: 700; font-size: 16px; text-decoration: none;
  padding: 16px 28px; cursor: pointer; border: 1px solid transparent; line-height: 1.2;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.btn-primary { background: var(--cta); color: var(--on-accent); }
.btn-primary:hover { background: var(--cta-hover); }
.btn-secondary, .btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-secondary:hover, .btn-ghost:hover { border-color: var(--line-strong); }
.btn-primary:active, .btn-secondary:active { transform: scale(.98); }
.btn-sm { padding: 8px 14px; font-size: 14px; font-weight: 500; gap: 8px; }
.block { display: flex; width: 100%; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
/* Inline links to remotebrowser.ai / the repo inside copy */
a.ref { color: var(--blue); text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
a.ref:hover { text-decoration-color: currentColor; }
.footer a.ref { color: #fff; }

/* ── Nav ── */
.nav {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px var(--pad-x); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-home { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.mark { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); flex: none; }
.wordmark { font-weight: 700; font-size: 17px; letter-spacing: -0.02em; }
.by { color: var(--muted); font-size: 13px; white-space: nowrap; }
.nav-right { display: flex; align-items: center; gap: 24px; }
.nav-right form { margin: 0; }
.nav-link { color: var(--muted); text-decoration: none; font-size: 14px; }
.nav-link:hover { color: var(--ink); }
.nav .avatar { width: 18px; height: 18px; border-radius: 50%; }
.lang {
  display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line);
  border-radius: 100px; background: var(--surface);
}
.lang a {
  font: 700 12px/1 var(--sans); padding: 6px 9px; border-radius: 100px;
  color: var(--muted); text-decoration: none;
}
.lang a.on { background: var(--cta); color: var(--on-accent); }
.tag { border: 1px solid var(--line); border-radius: 100px; padding: 6px 12px; background: var(--surface); font-size: 11px; }

/* ── Hero ── */
.hero { padding: 88px var(--pad-x) 88px; display: flex; flex-direction: column; gap: 40px; }
.hero-top { display: flex; flex-direction: column; gap: 18px; }
.eyebrow { display: flex; align-items: center; gap: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); flex: none; }
.win { font-size: clamp(26px, 3.1vw, 44px); font-weight: 500; letter-spacing: -0.03em; line-height: 1.1; }
.big-number {
  font-size: clamp(36px, 12.4vw, 184px); font-weight: 700; letter-spacing: -0.045em;
  line-height: .95; font-variant-numeric: tabular-nums;
  margin-left: -0.065em; /* optical alignment of the leading "1" */
}
.caption { font-size: clamp(24px, 3vw, 44px); font-weight: 500; letter-spacing: -0.03em; line-height: 1.2; }
.winner-row { display: flex; align-items: center; gap: clamp(14px, 2.2vw, 32px); min-width: 0; }
.winner-avatar { width: clamp(56px, 9.7vw, 140px); height: clamp(56px, 9.7vw, 140px); border-radius: 50%; border: 3px solid var(--blue); background: var(--surface); }
.big-handle {
  font-size: clamp(36px, 10.4vw, 150px); font-weight: 700; letter-spacing: -0.045em; line-height: 1;
  overflow-wrap: anywhere; min-width: 0;
}
.hero-bottom { display: flex; align-items: flex-start; justify-content: space-between; gap: 64px; }
.pitch { display: flex; flex-direction: column; gap: 28px; max-width: 620px; padding-top: 4px; }
.lede { font-size: 18px; line-height: 1.6; color: var(--muted); }
.ctas { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.needs, .aside-link { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; font-size: 14px; }
.need { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.need .icon { color: var(--blue); }
.aside-link { text-decoration: none; gap: 6px 12px; }
.stats {
  display: flex; flex-direction: column; width: 380px; flex: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.stat { display: flex; flex-direction: column; gap: 8px; padding: 24px; }
.stat + .stat { border-top: 1px solid var(--line); }
.stat-value { font: 700 34px/1.15 var(--sans); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-value.accent { color: var(--blue); }
.stat-note { font-size: 13px; color: var(--muted); }

/* ── Sections ── */
.section { padding: 96px var(--pad-x); }
.section h2 { font-size: clamp(32px, 3.9vw, 56px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.08; }
.section-head { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; margin-bottom: 48px; }
.how { border-top: 1px solid var(--line); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.steps li { border-top: 2px solid var(--line); padding-top: 28px; display: flex; flex-direction: column; gap: 14px; }
.steps li.first { border-color: var(--blue); }
.step-row { display: flex; justify-content: space-between; align-items: center; color: var(--muted); }
.step-row .num { font: 600 14px var(--sans); font-variant-numeric: tabular-nums; }
.steps li.first .num { color: var(--blue); }
.step-row .icon { width: 20px; height: 20px; }
.steps h3 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.steps p, .timeline p, .qa dd, .draw-copy p { color: var(--muted); }

.draw { background: var(--panel); }
.draw-top { display: grid; grid-template-columns: minmax(0, 460px) minmax(0, 1fr); gap: 80px; margin-bottom: 56px; }
.draw-copy { display: flex; flex-direction: column; gap: 16px; }
.draw-copy p { margin-top: 6px; }
.list-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; align-self: start; }
.list-head { display: flex; justify-content: space-between; padding: 14px 24px; border-bottom: 1px solid var(--line); font-size: 11px; }
.entrants li { display: flex; align-items: center; gap: 24px; padding: 13px 24px; font: 500 15px var(--sans); font-variant-numeric: tabular-nums; }
.entrants li + li { border-top: 1px solid var(--line-soft); }
.entrants .num { color: var(--muted); min-width: 3.5em; }
.entrants .empty-text { font-family: var(--sans); font-size: 15px; color: var(--ink); }
.entrants li.mine .num { color: var(--blue); }
.entrants li.ghost .bar { height: 10px; border-radius: 5px; background: var(--ghost-bar); width: 52%; }
.entrants li.ghost:nth-child(2) .bar { width: 62%; }
.entrants li.ghost:nth-child(3) .bar { width: 44%; }
.entrants li.ghost:nth-child(4) .bar { width: 70%; }
.entrants li.win { background: var(--cta); color: var(--on-accent); font-weight: 700; }
.entrants li.win .num { color: var(--on-accent); }
.entrants li.mine { background: var(--blue-pale); }
.tag-win { margin-left: auto; font: 700 11px var(--sans); letter-spacing: .08em; }
.list-more { display: block; padding: 14px 24px; border-top: 1px solid var(--line); font-size: 14px; font-weight: 500; color: var(--blue); text-decoration: none; }
.timeline { display: grid; grid-template-columns: repeat(4, 1fr); }
.timeline li { border-top: 1px solid var(--line); padding: 24px 24px 0; display: flex; flex-direction: column; gap: 8px; }
.timeline li:first-child { padding-left: 0; }
.timeline li + li { border-left: 1px solid var(--line); }
.timeline li.now .when { color: var(--blue); }
.timeline h3 { font-size: 20px; font-weight: 700; letter-spacing: -0.015em; }
.timeline p { font-size: 14px; }

.faq { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 80px; }
.faq-head { display: flex; flex-direction: column; gap: 16px; }
.faq h2 { font-size: clamp(30px, 2.8vw, 40px); }
.qa > div { border-top: 1px solid var(--line); padding: 24px 0; display: flex; flex-direction: column; gap: 10px; }
.qa dt { font-size: 20px; font-weight: 700; letter-spacing: -0.015em; }

.footer {
  background: var(--dark); color: rgba(255, 255, 255, .6);
  padding: 40px var(--pad-x); font-size: 14px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand links" "sponsor links";
  column-gap: 32px; row-gap: 6px; align-items: center;
}
.footer-brand { grid-area: brand; display: flex; align-items: center; gap: 10px; color: #fff; }
.footer-brand .wordmark { font-size: 16px; }
.footer-sponsor { grid-area: sponsor; }
.footer-links { grid-area: links; display: flex; gap: 8px 28px; flex-wrap: wrap; justify-content: flex-end; }
.footer-links a {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  font: 500 14px var(--sans); color: rgba(255, 255, 255, .75);
}
.footer-links a:hover { color: #fff; }
.footer-links .icon { width: 14px; height: 14px; opacity: .8; }

/* ── Flow (join) ── */
.flow-page { min-height: 100vh; display: flex; flex-direction: column; }
.flow-page .footer { margin-top: auto; }
.flow { width: 100%; max-width: 480px; margin: 0 auto; padding: 32px 20px 56px; display: flex; flex-direction: column; gap: 28px; }
@media (min-width: 721px) { .flow { padding: 64px 20px 96px; gap: 32px; } }
.progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.progress li { display: flex; flex-direction: column; gap: 8px; }
.progress .bar { height: 3px; border-radius: 2px; background: var(--line); }
.progress .plabel { display: flex; align-items: center; gap: 4px; font-size: 11px; letter-spacing: .02em; text-transform: none; }
.progress .now .bar { background: var(--blue); }
.progress .now .plabel { font-weight: 700; }
.progress .now .plabel { color: var(--ink); }
.progress .done .bar { background: var(--blue); }
.progress .done .plabel { color: var(--ink); }
.progress .done .icon { color: var(--blue); }
.user-card {
  display: flex; align-items: center; gap: 12px; padding: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.user-card .avatar { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); }
.who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.who .handle { font: 700 15px var(--sans); overflow-wrap: anywhere; }
.who .status { font-size: 13px; color: var(--muted); }
.who .status.ok, .state-icon.ok { color: var(--blue); }
.state-icon { color: var(--muted); }
.state-icon .icon { width: 20px; height: 20px; }
.flow-head { display: flex; flex-direction: column; gap: 12px; }
.flow-head h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; overflow-wrap: anywhere; }
.flow-head p { color: var(--muted); font-size: 15px; }
.repo-card {
  display: flex; flex-direction: column; gap: 6px; padding: 16px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.repo-card .repo { font: 700 15px var(--sans); }
.repo-card .desc { color: var(--muted); font-size: 13px; }
.actions, .form { display: flex; flex-direction: column; gap: 10px; }
.actions form { margin: 0; }
.form { gap: 20px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field input {
  width: 100%; padding: 15px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); font-size: 16px; outline: none;
}
.field input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--ring); }
.field input.invalid { border-color: var(--danger); }
.code-input { font: 500 20px var(--mono) !important; letter-spacing: .08em; text-transform: uppercase; }
.code-input::placeholder { font: 400 15px var(--sans); letter-spacing: 0; text-transform: none; }

/* Ticket upload (needs JS; without it only the text field shows) */
.js-only { display: none; }
.js .js-only { display: flex; }
.scan { flex-direction: column; gap: 10px; }
.scan-btn {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 20px 16px; border: 1.5px dashed var(--line-strong); border-radius: 12px; background: var(--surface);
  font-weight: 700; font-size: 15px; cursor: pointer; text-align: center;
  transition: border-color .12s ease, background .12s ease;
}
.scan-btn:hover { border-color: var(--blue); background: var(--blue-pale); }
.scan-btn:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.scan-btn .icon { width: 20px; height: 20px; color: var(--blue); }
.scan-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.scan-status { font-size: 13px; color: var(--muted); }
.scan-status.ok { color: var(--blue); font-weight: 500; }
.scan-status.error { color: var(--danger); }
.scan-or { display: flex; align-items: center; gap: 12px; margin-top: 6px; font: 600 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.scan-or::before, .scan-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.code-input::placeholder, .field input::placeholder { color: var(--placeholder); }
.hint { font-size: 13px; color: var(--muted); }
.hint.error { color: var(--danger); }
.alert {
  padding: 12px 16px; border-radius: 12px; font-size: 14px;
  background: var(--alert-bg); color: var(--alert-ink); border: 1px solid var(--alert-line);
}
.big-check { width: 56px; height: 56px; border-radius: 50%; background: var(--cta); color: var(--on-accent); display: grid; place-items: center; }
.big-check .icon { width: 28px; height: 28px; }
.share { display: flex; flex-direction: column; gap: 12px; padding-top: 8px; }
.share-head { display: flex; flex-direction: column; gap: 4px; }
.share-hint { font-size: 13px; color: var(--muted); }
.share-card { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.share-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.share-row .btn-secondary { padding: 14px 12px; font-size: 15px; }
.facts > div { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

/* ── Entrants page ── */
.narrow { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }
.page-title { font-size: clamp(32px, 4vw, 48px); font-weight: 700; letter-spacing: -0.035em; }

/* ── Admin ── */
.admin { max-width: 1100px; margin: 0 auto; padding: 40px 20px 80px; display: flex; flex-direction: column; gap: 20px; }
.admin-head h1 { font-size: 28px; font-weight: 700; }
.admin-head p { color: var(--muted); font-size: 13px; }
.admin-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.admin-card h2 { font-size: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-card p { color: var(--muted); font-size: 14px; }
.admin .row { display: flex; flex-wrap: wrap; gap: 8px; }
.inline { display: inline-flex; gap: 6px; margin: 0; }
.inline input { padding: 7px 10px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; font-size: 13px; width: 170px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
th { font: 600 11px var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.muted-row td { color: var(--faint); }
.history li { font-size: 13px; padding: 6px 0; border-top: 1px solid var(--line); }

/* ── Responsive ── */
@media (max-width: 1080px) {
  .hero-bottom { flex-direction: column; align-items: stretch; gap: 32px; }
  .stats { width: 100%; flex-direction: row; }
  .stat { flex: 1; min-width: 0; }
  .stat + .stat { border-top: 0; border-left: 1px solid var(--line); }
  .draw-top, .faq { grid-template-columns: 1fr; gap: 32px; }
  .timeline { grid-template-columns: 1fr 1fr; row-gap: 24px; }
  .timeline li:nth-child(3) { border-left: 0; padding-left: 0; }
}

@media (max-width: 720px) {
  .long { display: none; }
  .short { display: inline; }
  .nav { padding: 14px 20px; }
  .by, .nav-link, .hide-sm { display: none; }
  .nav-right { gap: 10px; }
  .hero { padding: 40px 20px; gap: 28px; }
  .hero-top { gap: 12px; }
  .eyebrow { font-size: 11px; gap: 10px; }
  .dot { width: 6px; height: 6px; }
  .caption .grad { display: block; }
  .lede { font-size: 16px; }
  .ctas { align-items: stretch; }
  .ctas .btn-primary { width: 100%; }
  .needs { flex-direction: column; align-items: flex-start; }
  .stat { padding: 16px; gap: 6px; }
  .stat-value { font-size: 24px; }
  .stat-note { font-size: 12px; }
  .section { padding: 48px 20px; }
  .section-head { gap: 10px; margin-bottom: 28px; }
  .steps { grid-template-columns: 1fr; gap: 24px; }
  .steps li { display: grid; grid-template-columns: auto 1fr; column-gap: 16px; row-gap: 6px; padding-top: 20px; }
  .step-row { grid-row: span 2; align-items: flex-start; }
  .step-row .icon { display: none; }
  .steps h3 { font-size: 20px; }
  .steps p { font-size: 15px; }
  .draw-top { margin-bottom: 28px; }
  .list-head, .entrants li, .list-more { padding-left: 16px; padding-right: 16px; }
  .entrants li { font-size: 14px; gap: 16px; padding-top: 12px; padding-bottom: 12px; }
  .timeline { grid-template-columns: 1fr; row-gap: 0; }
  .timeline li, .timeline li:first-child, .timeline li + li { display: flex; flex-direction: column; gap: 4px; padding: 18px 0; border-left: 0; }
  .timeline li .when { font-size: 11px; margin-bottom: 2px; }
  .timeline h3 { font-size: 16px; }
  .faq { gap: 20px; }
  .qa > div { padding: 18px 0; }
  .qa dt { font-size: 17px; }
  .qa dd { font-size: 15px; }
  .footer { grid-template-columns: 1fr; grid-template-areas: "brand" "sponsor" "links"; padding: 32px 20px 40px; row-gap: 8px; }
  .footer-links { flex-direction: column; gap: 0; margin-top: 16px; }
  .footer-links li { border-top: 1px solid rgba(255, 255, 255, .12); }
  .footer-links a { display: flex; padding: 14px 0; font-size: 14px; overflow-wrap: anywhere; }
}
