/* The Majlis of AI: white sheet, black linework, one redline. */
:root {
  --surface-100: #ffffff;
  --surface-200: #f5f5f5;
  --surface-300: #e6e6e6;
  --ink: #111111;
  --ink-muted: #5c5c5c;
  --ink-muted-inverse: #bdbdbd;
  --hairline: #d9d9d9;
  --border: #767676;
  --redline: #cc3a1c;
  --on-redline: #ffffff;
  --on-ink: #ffffff;
  --font: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-cond: "IBM Plex Sans Condensed", "IBM Plex Sans", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --margin: 64px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface-100: #121212;
    --surface-200: #1e1e1e;
    --surface-300: #2a2a2a;
    --ink: #ffffff;
    --ink-muted: #b3b3b3;
    --ink-muted-inverse: #4d4d4d;
    --hairline: #333333;
    --border: #8a8a8a;
    --redline: #ff7a5c;
    --on-redline: #121212;
    --on-ink: #121212;
  }
}
@media (max-width: 640px) { :root { --margin: 16px; } }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--surface-100);
  color: var(--ink);
  font: 16px/26px var(--font);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
h1, h2, p { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--ink); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* type */
.kicker, .label, .btn, .stamp, .tag {
  font-family: var(--font-cond);
  font-weight: 600;
  text-transform: uppercase;
}
.kicker { font-size: 13px; line-height: 16px; letter-spacing: 0.1em; color: var(--ink-muted); }
.kicker.focal { color: var(--redline); display: inline-flex; align-items: center; gap: 8px; }
.kicker.focal::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--redline); }
.display-l { font-weight: 300; font-size: 48px; line-height: 56px; letter-spacing: -0.02em; }
.display-m { font-weight: 400; font-size: 32px; line-height: 40px; }
.heading { font-weight: 500; font-size: 20px; line-height: 28px; }
.numeral { font-weight: 300; font-size: 64px; line-height: 64px; font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-muted); }
.caption { font-size: 12px; line-height: 16px; color: var(--ink-muted); }
@media (max-width: 640px) {
  .display-l { font-size: 32px; line-height: 40px; }
  .numeral { font-size: 48px; line-height: 48px; }
}

/* sheet */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 var(--margin) 96px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 24px 0; margin-bottom: 48px; border-bottom: 1px solid var(--hairline);
}
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; }
.brand img { display: block; height: 40px; width: auto; }
.tag { font-size: 13px; line-height: 16px; letter-spacing: 0.06em; border: 1px solid var(--ink); padding: 4px 8px; }
.chip { display: flex; align-items: center; gap: 12px; font-family: var(--font-mono); font-size: 12px; line-height: 16px; }
@media (max-width: 640px) { .brand img { height: 32px; } .chip a { display: none; } }

.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; align-items: start; }
.span-8 { grid-column: span 8; }
.span-4 { grid-column: span 4; }
.span-12 { grid-column: span 12; }
@media (max-width: 1023px) { .grid { grid-template-columns: repeat(8, 1fr); } .span-8, .span-4 { grid-column: span 8; } }

.card { background: var(--surface-100); border: 1px solid var(--hairline); padding: 24px; }
.card.poche { background: var(--surface-200); border-color: var(--surface-200); }
.card > .kicker { display: block; margin-bottom: 8px; }

/* controls */
.btn {
  font-size: 15px; line-height: 20px; letter-spacing: 0.06em;
  border: 1px solid var(--border); background: var(--surface-100); color: var(--ink);
  border-radius: 2px; padding: 12px 24px; cursor: pointer;
  transition: background 160ms ease-out, color 160ms ease-out;
}
.btn:hover { background: var(--surface-200); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.btn.primary:hover { background: var(--ink-muted); border-color: var(--ink-muted); }
.btn.small { padding: 4px 12px; font-size: 13px; line-height: 16px; }
.btn.text { border-color: transparent; background: none; padding-left: 8px; padding-right: 8px; }
.btn.text:hover { text-decoration: underline; text-underline-offset: 3px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 48px; }

.label { display: block; font-size: 13px; line-height: 16px; letter-spacing: 0.1em; color: var(--ink-muted); margin-bottom: 8px; }
input[type=text], textarea {
  width: 100%; background: var(--surface-100); border: 1px solid var(--border); border-radius: 2px; padding: 12px 16px;
}
input[type=text]::placeholder, textarea::placeholder { color: var(--ink-muted); }
textarea { resize: vertical; min-height: 96px; font-size: 20px; line-height: 28px; font-weight: 300; }
.err { color: var(--ink); font-size: 14px; line-height: 22px; min-height: 22px; margin-top: 8px; }
.err:not(:empty)::before { content: "! "; color: var(--redline); font-weight: 600; }

/* landing */
.hero { padding: 48px 0; }
.hero .display-l { margin: 16px 0 24px; max-width: 16ch; }
.hero .lede { max-width: 56ch; color: var(--ink-muted); font-size: 20px; line-height: 28px; font-weight: 300; margin-bottom: 48px; }
.steps { display: flex; gap: 0; list-style: none; padding: 0; margin: 96px 0 0; border-top: 1px solid var(--ink); }
.steps li { flex: 1; padding: 24px 24px 0 0; position: relative; }
.steps .num {
  position: absolute; top: -17px; left: 0; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface-100); border: 1px solid var(--ink);
  font-family: var(--font-cond); font-weight: 600; font-size: 14px;
}
.steps li.active .num { border-color: var(--redline); background: var(--redline); color: var(--on-redline); }
.steps .label { color: var(--ink); margin: 16px 0 4px; }
.steps p { font-size: 14px; line-height: 22px; color: var(--ink-muted); max-width: 30ch; }
@media (max-width: 640px) { .steps { flex-direction: column; border-top: 0; border-left: 1px solid var(--ink); margin-left: 16px; } .steps li { padding: 0 0 32px 32px; } .steps .num { left: -17px; top: 0; } .steps .label { margin-top: 4px; } }

/* setup */
.opt-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.opt-row .idx { width: 24px; text-align: center; color: var(--ink-muted); font-family: var(--font-cond); font-weight: 600; }
.opt-row .x { border: 0; background: none; color: var(--ink-muted); font-size: 22px; cursor: pointer; padding: 0 8px; }
.opt-row .x:hover { color: var(--ink); }
.qr { text-align: center; }
.qr .code { background: #fff; padding: 12px; display: inline-block; border: 1px solid var(--hairline); }
.qr img { display: block; width: 224px; height: 224px; }
.qr .url { word-break: break-all; font-family: var(--font-mono); font-size: 12px; line-height: 16px; margin: 16px 0 8px; }

/* results */
.q-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.stamp { font-size: 13px; line-height: 16px; letter-spacing: 0.1em; color: var(--redline); border: 1.5px solid var(--redline); padding: 4px 8px; }
.stamp.closed { color: var(--ink-muted); border-color: var(--ink-muted); }
.q-title { margin-bottom: 48px; max-width: 24ch; }
.result { margin-bottom: 24px; }
.result .row { display: flex; justify-content: space-between; gap: 16px; font-size: 20px; line-height: 28px; font-weight: 500; margin-bottom: 8px; }
.result .row .n { font-variant-numeric: tabular-nums; color: var(--ink-muted); font-weight: 400; white-space: nowrap; }
.track { background: var(--surface-200); height: 32px; }
.fill { height: 100%; background: var(--ink); transition: width 240ms ease-out; }
.result.lead .fill { background: var(--redline); }
.result.lead .row span:first-child { color: var(--redline); }
.stat .numeral { margin: 16px 0 8px; }
.live { display: inline-flex; align-items: center; gap: 8px; }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }

.overlay { position: fixed; inset: 0; background: rgba(17, 17, 17, 0.72); display: grid; place-items: center; z-index: 10; padding: 16px; }
.overlay[hidden] { display: none; }
.overlay .card { text-align: center; max-width: 480px; width: 100%; }
.overlay img { width: min(70vw, 384px); height: auto; background: #fff; padding: 16px; }
.overlay .url { font-family: var(--font-mono); font-size: 14px; margin: 16px 0 24px; word-break: break-all; }

/* audience */
.join { max-width: 560px; margin: 0 auto; padding: 0 16px 48px; }
.join .topbar { margin-bottom: 32px; padding: 16px 0; }
.join .brand img { height: 32px; }
.join h1 { margin: 8px 0 32px; font-weight: 300; font-size: 32px; line-height: 40px; }
.choice {
  display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; margin-bottom: 12px; padding: 16px 20px;
  background: var(--surface-100); border: 1px solid var(--border); border-radius: 2px; font-size: 18px; line-height: 26px; cursor: pointer;
}
.choice::before { content: ""; flex: none; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--border); }
.choice.sel { border: 3px solid var(--redline); padding: 14px 18px; font-weight: 500; }
.choice.sel::before { background: var(--redline); border-color: var(--redline); }
.note { font-size: 14px; line-height: 22px; color: var(--ink-muted); margin-top: 16px; }
.center { text-align: center; padding: 64px 0; }
.center .display-m { margin: 16px 0 8px; }
