/*
 * uVote public site — the only stylesheet.
 *
 * THE WHITE THEME (2026-10-28): always light, on a pure white page. The site
 * no longer follows the system's dark mode; `color-scheme: light` is set in
 * layout.html and below.
 *
 * COLOURS ARE COPIED FROM artifacts/uVote/theme/tokens.ts, never invented.
 * Every colour below is a custom property declared on :root, and each carries
 * a comment naming the token it copies. The white page is the app's card
 * colour; the app's own off-white background tints the bands.
 * `pnpm --filter @workspace/scripts check:site` fails when a value drifts from
 * tokens.ts, when a colour lacks its token comment, or when a hex appears
 * anywhere outside these declarations. Change tokens.ts first, then here.
 * Shades (shadows, the band edges) are mixed from these tokens with
 * color-mix(), never written as a new colour.
 */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/inter-latin-700-normal.woff2") format("woff2"); }

:root {
  --page: #FFFFFF; /* palettes.light.card */
  --soft: #FAFAF7; /* palettes.light.bg */
  --text: #2C2C2A; /* palettes.light.text */
  --muted: #6E6D67; /* palettes.light.textMuted */
  --line: #E8E6DF; /* palettes.light.line */
  --outline: #8B8A82; /* palettes.light.controlOutline */
  --primary: #534AB7; /* palettes.light.primary */
  --on-primary: #FFFFFF; /* palettes.light.onPrimary */
  --attention: #9A5B00; /* palettes.light.accentText */
  --approve: #15785A; /* palettes.light.voteApprove */
  --bar-1: #D85A30; /* markBars.0 */
  --bar-2: #EF9F27; /* markBars.1 */
  --bar-3: #1D9E75; /* markBars.2 */
  --bar-4: #378ADD; /* markBars.3 */
  --bar-5: #7F77DD; /* markBars.4 */

  --radius-card: 12px;
  --radius-control: 8px;
  --measure: 44rem;
  --shadow: 0 24px 48px -24px color-mix(in srgb, var(--text) 30%, transparent);
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

.wrap { max-width: 64rem; margin: 0 auto; padding: 0 1rem; }

a { color: var(--primary); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

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

.skip {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--page); color: var(--text);
  padding: 0.5rem 0.75rem; border: 1px solid var(--outline); border-radius: var(--radius-control);
  z-index: 20;
}
.skip:focus { top: 1rem; }

/* ── header ─────────────────────────────────────────────────────────────── */
/* Sticky, solid white, with the logo's five colours as a strip underneath. */
.site-header { position: sticky; top: 0; z-index: 10; background: var(--page); }
.header-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem 1rem; min-height: 4.25rem; flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  color: var(--text); text-decoration: none;
  font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em;
}
.top-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.top-nav a { color: var(--text); text-decoration: none; font-weight: 500; font-size: 0.95rem; padding: 0.25rem 0; }
.top-nav a[aria-current="page"] { color: var(--primary); box-shadow: inset 0 -2px 0 var(--primary); }
.top-nav a.pill {
  color: var(--primary); font-weight: 600;
  border: 1px solid var(--line); border-radius: 999px; padding: 0.35rem 0.9rem;
}
.top-nav a.pill:hover { border-color: var(--primary); }
.spectrum { display: grid; grid-template-columns: repeat(5, 1fr); height: 4px; }
.spectrum span:nth-child(1) { background: var(--bar-1); }
.spectrum span:nth-child(2) { background: var(--bar-2); }
.spectrum span:nth-child(3) { background: var(--bar-3); }
.spectrum span:nth-child(4) { background: var(--bar-4); }
.spectrum span:nth-child(5) { background: var(--bar-5); }

/* ── type ───────────────────────────────────────────────────────────────── */
main.wrap { padding-top: 3rem; padding-bottom: 4.5rem; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 5.5vw, 2.75rem); font-weight: 700; letter-spacing: -0.03em; margin: 0 0 1rem; }
h2 { font-size: clamp(1.4rem, 3.5vw, 1.85rem); font-weight: 700; margin: 3.5rem 0 1rem; }
h3 { font-size: 1.1rem; font-weight: 600; margin: 1.75rem 0 0.5rem; }
p, li { margin: 0.5rem 0; }
ul, ol { padding-left: 1.4rem; }
strong { font-weight: 600; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: var(--measure); }
.muted { color: var(--muted); }
.prose { max-width: var(--measure); }
.small { font-size: 0.9rem; }
.eyebrow {
  margin: 0 0 0.9rem; font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}

/* A label the user sees in the app, quoted exactly. */
.ui {
  font-weight: 600;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.05rem 0.4rem;
  /* Long labels wrap at 360px; each line keeps its own chip edges. */
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* ── shared blocks ──────────────────────────────────────────────────────── */
/* `hidden` must win over a class's display (.button is inline-flex). */
[hidden] { display: none !important; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; margin-top: 1.5rem; }
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: 0.6rem 1.3rem;
  background: var(--primary); color: var(--on-primary);
  border: 1px solid var(--primary); border-radius: 999px;
  font-weight: 600; text-decoration: none;
  font-family: inherit; font-size: inherit; cursor: pointer;
}
.button:hover { text-decoration: underline; }
.button.ghost { background: var(--page); color: var(--text); border-color: var(--line); }
.button.ghost:hover { border-color: var(--outline); }

.card {
  background: var(--page); border: 1px solid var(--line);
  border-radius: var(--radius-card); padding: 1.25rem;
}
.card h3 { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
/* An invite code shown to be kept (/convite/ on iPhone). */
.code-big {
  font-size: 2rem; font-weight: 700; letter-spacing: 0.15em;
  margin: 0.25rem 0 0.75rem; user-select: all; -webkit-user-select: all;
}

.callout {
  border: 1px solid var(--line); border-left: 4px solid var(--primary);
  background: var(--soft); border-radius: var(--radius-card);
  padding: 1.1rem 1.25rem; max-width: var(--measure);
}
.callout.attention { border-left-color: var(--attention); }
.callout > :first-child { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }

.badge {
  display: inline-block; font-size: 0.75rem; font-weight: 600; white-space: nowrap;
  border: 1px solid var(--line); border-radius: 999px; padding: 0.1rem 0.55rem;
  color: var(--muted); vertical-align: middle;
}
.badge.ok { border-color: var(--approve); color: var(--approve); }

/* Top-level sections of a page sit 4rem apart; a band keeps the same rhythm. */
main.wrap > section + section { margin-top: 4rem; }

/* A full-width tinted band inside main.wrap: the background reaches the
   screen edges without making the page scroll sideways. */
.band {
  background: var(--soft);
  box-shadow: 0 0 0 100vmax var(--soft);
  clip-path: inset(0 -100vmax);
  padding: 3.5rem 0;
  margin: 4rem 0;
}
main.wrap > .band:last-child { margin-bottom: -4.5rem; }
.band > :first-child { margin-top: 0; }
.band > :last-child { margin-bottom: 0; }

/* ── landing ────────────────────────────────────────────────────────────── */
.hero { display: grid; gap: 2.5rem; align-items: center; padding: 0.5rem 0 1rem; }
.hero h1 { font-size: clamp(2.25rem, 6.2vw, 3.6rem); letter-spacing: -0.035em; line-height: 1.08; margin: 0; }
.hero h1 em { font-style: normal; color: var(--primary); }
.hero .lead { margin-top: 1.1rem; max-width: 34rem; }
@media (min-width: 52rem) {
  .hero { grid-template-columns: 1.25fr 1fr; padding: 1.5rem 0 1rem; }
}

/* The demo recording in a phone-sized frame, on a soft backdrop. */
.demo { position: relative; justify-self: center; margin: 0; width: min(17rem, 78vw); }
.demo::before {
  content: ""; position: absolute; inset: 8% -14% 14% -14%;
  border-radius: 40px; background: var(--soft); z-index: -1;
}
.demo video {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--line); border-radius: 28px;
  background: var(--soft); box-shadow: var(--shadow);
}
.demo figcaption { margin-top: 0.75rem; text-align: center; }
.hero > :first-child { min-width: 0; }

.section-head { max-width: 40rem; margin-bottom: 2rem; }
.section-head h2 { margin: 0 0 0.6rem; }
.section-head p { margin: 0; color: var(--muted); }

.audiences { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.audiences li {
  margin: 0; padding: 0.45rem 0.95rem; font-weight: 500;
  background: var(--page); border: 1px solid var(--line); border-radius: 999px;
}

/* A real sequence, so numbered; one logo colour per step. */
.steps {
  list-style: none; padding: 0; counter-reset: step;
  display: grid; gap: 2rem 1.75rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}
.steps > li { counter-increment: step; margin: 0; display: grid; gap: 0.5rem; align-content: start; }
.steps > li::before {
  content: counter(step);
  display: grid; place-items: center; width: 2.25rem; height: 2.25rem;
  border-radius: 999px; font-weight: 700;
  background: var(--bar-1); color: var(--on-primary);
}
.steps > li:nth-child(2)::before { background: var(--bar-2); color: var(--text); }
.steps > li:nth-child(3)::before { background: var(--bar-3); }
.steps > li:nth-child(4)::before { background: var(--bar-4); }
.steps > li:nth-child(5)::before { background: var(--bar-5); }
.steps h3 { margin: 0.25rem 0 0; font-weight: 700; }
.steps p { margin: 0; color: var(--muted); font-size: 0.98rem; }

.money { display: grid; gap: 1.5rem 3rem; }
.money .copy { display: grid; gap: 0.9rem; max-width: 36rem; }
.money .copy h2, .money .copy p { margin: 0; }
.money .copy p:first-of-type { font-weight: 600; }
@media (min-width: 52rem) { .money { grid-template-columns: 1.2fr 1fr; } }
.ledger {
  margin: 0; display: grid; overflow: hidden; font-size: 0.95rem;
  background: var(--page); border: 1px solid var(--line); border-radius: var(--radius-card);
}
.ledger div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--line); }
.ledger div:last-child { border-bottom: 0; font-weight: 700; }
.ledger dt { color: var(--muted); }
.ledger div:last-child dt { color: var(--text); }
.ledger dd { margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger .in { color: var(--approve); }
.money .ledger-cap { margin: 0.5rem 0 0; font-size: 0.8rem; color: var(--muted); }

.plans { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr)); }
.plan { position: relative; display: grid; gap: 0.75rem; align-content: start; padding: 1.4rem 1.25rem 1.25rem; }
.plan::before {
  content: ""; position: absolute; left: 1.25rem; right: 1.25rem; top: 0;
  height: 3px; border-radius: 0 0 3px 3px; background: var(--line);
}
.plan.current { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.plan.current::before { background: var(--primary); }
.plan-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.plan h3 { margin: 0; font-size: 1.15rem; font-weight: 700; }
.plan .size { margin: 0; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.plan .size small { font-size: 0.9rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.45rem; font-size: 0.95rem; }
.plan li { margin: 0; padding-left: 1.3rem; position: relative; }
.plan li::before {
  content: ""; position: absolute; left: 0; top: 0.62em;
  width: 0.5rem; height: 0.5rem; border-radius: 2px; background: var(--line);
}
.plan.current li::before { background: var(--primary); }
.plans-note { margin-top: 1.25rem; max-width: var(--measure); }

.download { display: grid; gap: 1.5rem; align-items: center; }
.download h2 { margin: 0 0 0.5rem; }
.download p { margin: 0; }
.download-mark { width: 5.5rem; height: auto; }
@media (min-width: 52rem) { .download { grid-template-columns: 1fr auto; } }

/* ── tutorial ───────────────────────────────────────────────────────────── */
.toc {
  columns: 2 14rem; padding: 1rem 1.25rem 1rem 2.6rem; margin: 1.5rem 0 0;
  background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius-card);
}
.tutorial section { max-width: var(--measure); }
.tutorial h2 { scroll-margin-top: 6rem; }
.tutorial ol > li { margin: 0.6rem 0; }

/* ── FAQ ────────────────────────────────────────────────────────────────── */
.faq { max-width: var(--measure); }
.faq details {
  background: var(--page); border: 1px solid var(--line);
  border-radius: var(--radius-card); margin: 0.75rem 0;
}
.faq details[open] { border-color: var(--outline); }
.faq summary {
  cursor: pointer; padding: 1rem 1.2rem; font-weight: 600; list-style-position: inside;
  border-radius: var(--radius-card);
}
.faq details[open] summary { border-bottom: 1px solid var(--line); }
.faq details > :not(summary) { margin: 0.75rem 1.2rem; }
.faq details > :last-child { margin-bottom: 1rem; }

/* ── release notes ──────────────────────────────────────────────────────── */
.releases > section { max-width: var(--measure); border-top: 1px solid var(--line); padding-top: 0.5rem; }
.releases > section h2 { margin-top: 2rem; font-size: 1.4rem; scroll-margin-top: 6rem; }

/* ── legal ──────────────────────────────────────────────────────────────── */
.legal { max-width: var(--measure); }
.legal h2 { font-size: 1.25rem; margin-top: 2.25rem; scroll-margin-top: 6rem; }
.legal .meta { color: var(--muted); font-size: 0.95rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-card); }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; vertical-align: top; padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
th { font-weight: 600; background: var(--soft); }

/* ── footer ─────────────────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); padding: 2rem 0 2.5rem; color: var(--muted); font-size: 0.92rem; }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; }
.footer-nav a { color: var(--text); text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; }
.footer-nav a[aria-current="page"] { color: var(--primary); font-weight: 600; }
.site-footer p { margin: 0.15rem 0; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
