/* Synthetic Poll Market — landing page
 *
 * Tokens below are lifted from the Shannon Labs design system
 * (near-monochrome OKLCH neutral scale, Plus Jakarta Sans, chart hues
 * as the only chromatic color). Copied in rather than imported so the
 * site stays a dependency-free static folder.
 */

:root {
  --neutral-0: oklch(1 0 0);
  --neutral-50: oklch(0.985 0 0);
  --neutral-100: oklch(0.97 0 0);
  --neutral-200: oklch(0.922 0 0);
  --neutral-300: oklch(0.87 0 0);
  --neutral-400: oklch(0.708 0 0);
  --neutral-500: oklch(0.556 0 0);
  --neutral-600: oklch(0.44 0 0);
  --neutral-800: oklch(0.205 0 0);
  --neutral-900: oklch(0.145 0 0);

  --chart-1: oklch(0.646 0.222 41.116);
  --chart-2: oklch(0.6 0.118 184.704);
  --chart-3: oklch(0.398 0.07 227.392);
  --chart-4: oklch(0.828 0.189 84.429);

  --ink: var(--neutral-900);
  --paper: var(--neutral-0);
  --foreground: var(--neutral-900);
  --card: var(--neutral-0);
  --muted-foreground: var(--neutral-500);
  --border: var(--neutral-200);

  --font-sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --shadow-xs: 0 1px 2px 0 oklch(0 0 0 / 0.05);
  --shadow-md: 0 4px 12px -2px oklch(0 0 0 / 0.08);

  --gutter: 56px;
  --max: 1280px;
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--foreground);
  font-family: var(--font-sans);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
p,
dl,
dd,
dt,
ol {
  margin: 0;
}

ol {
  padding: 0;
  list-style: none;
}

button {
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

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

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 9999px;
  flex: none;
}

.swatch-or {
  background: var(--chart-1);
}

.swatch-bl {
  background: var(--chart-3);
}

/* ---------------------------------------------------------------- header */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 16px;
  color: var(--foreground);
  text-decoration: none;
}

.mark {
  width: 20px;
  height: 20px;
  flex: none;
  fill: var(--ink);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
  font-weight: 500;
}

.site-nav a {
  color: var(--neutral-600);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--foreground);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  background: var(--neutral-100);
}

/* ------------------------------------------------------------------- ask */

main {
  max-width: var(--max);
  margin: 0 auto;
}

.ask {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 40px 120px 0;
  text-align: center;
}

.ask-question {
  font-size: clamp(28px, 4.1vw, 52px);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.04em;
  text-wrap: balance;
  max-width: 980px;
  min-height: 110px;
}

.ask-sentence {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 960px;
}

.tokens {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: clamp(17px, 1.9vw, 24px);
  line-height: 1.3;
}

.token-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.token-pre {
  color: var(--neutral-500);
  font-weight: 500;
}

.token {
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 9999px;
  background: var(--neutral-100);
  color: var(--foreground);
  transition: background 0.15s;
}

.token.is-open {
  background: var(--ink);
  color: var(--paper);
}

.token-add {
  font-weight: 500;
  padding: 3px 13px;
  border-radius: 9999px;
  border: 1.5px dashed var(--neutral-400);
  color: var(--neutral-600);
}

.token-add:hover {
  background: var(--neutral-100);
}

.tray {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border-radius: 20px;
  background: var(--neutral-50);
}

.tray-option {
  font-size: 15px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 9999px;
  background: var(--paper);
  color: var(--foreground);
  box-shadow: var(--shadow-xs);
}

.tray-option.is-selected {
  background: var(--ink);
  color: var(--paper);
}

.ask-button {
  height: 60px;
  padding: 0 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 17px;
  font-weight: 600;
  transition: transform 0.15s;
}

.ask-button:hover {
  transform: scale(1.03);
}

.ask-button:active {
  transform: scale(0.98);
}

.ask-button.is-running {
  opacity: 0.5;
}

/* --------------------------------------------------------------- results */

.results {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 560px minmax(0, 1fr);
  gap: 48px;
  align-items: center;
  padding: 48px var(--gutter) 12px;
}

.tally {
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 1;
  transition: opacity 0.4s;
}

.tally.is-dimmed {
  opacity: 0.35;
}

.tally-start {
  align-items: flex-end;
}

.tally-end {
  align-items: flex-start;
}

.tally-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 600;
}

.tally-pct {
  font-size: clamp(48px, 8.7vw, 112px);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}

.population {
  display: flex;
  justify-content: center;
}

#poll-canvas {
  display: block;
  width: 560px;
  max-width: 100%;
  aspect-ratio: 1;
  border-radius: 24px;
  background: var(--neutral-50);
}

.status {
  text-align: center;
  font-size: 14px;
  color: var(--neutral-600);
  min-height: 20px;
  padding: 0 32px;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------- followups */

.followups {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 40px var(--gutter) 0;
}

.followups-title {
  font-size: 16px;
  font-weight: 600;
}

.followup-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.followup {
  border-radius: 16px;
  background: var(--neutral-50);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  transition: background 0.15s;
}

.followup:hover {
  background: var(--neutral-100);
}

.followup span:last-child {
  flex: none;
}

/* ----------------------------------------------------------- how it works */

.how {
  padding: 48px var(--gutter);
  margin-top: 48px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.section-title {
  font-size: clamp(24px, 4.6vw, 30px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.section-title-sm {
  font-size: 20px;
}

.section-title-lg {
  font-size: clamp(24px, 3.2vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.how-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.how-step {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.how-figure {
  border: 1px solid var(--border);
  border-radius: 12px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
}

.how-figure-agent {
  flex-direction: column;
  gap: 14px;
}

.how-figure-prices {
  gap: 10px;
}

.agent-dot {
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  background: var(--chart-3);
  box-shadow: 0 0 0 4px var(--paper), 0 0 0 6px var(--ink);
}

.agent-id {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 13px;
}

.agent-name {
  font-weight: 600;
}

.agent-meta {
  color: var(--muted-foreground);
}

.price {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
}

.price-lead {
  border-color: var(--ink);
}

.price-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
}

.price-label .swatch {
  width: 8px;
  height: 8px;
}

.price-value {
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.dot-sheet {
  display: grid;
  grid-template-columns: repeat(12, 10px);
  gap: 6px;
}

.dot-sheet span {
  width: 10px;
  height: 10px;
  border-radius: 9999px;
}

.how-caption {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 14px;
  font-weight: 600;
}

.how-num {
  font-size: 12px;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
  flex: none;
}

/* ----------------------------------------------------------- earlier runs */

.history {
  padding: 48px var(--gutter) 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.history-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.history-card {
  border-radius: 20px;
  border: 1px solid var(--border);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-q {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.history-pop {
  font-size: 13px;
  color: var(--neutral-600);
  line-height: 1.4;
}

.history-bar {
  display: flex;
  height: 10px;
  border-radius: 9999px;
  overflow: hidden;
  gap: 2px;
}

.history-bar span:first-child {
  background: var(--chart-1);
}

.history-bar span:last-child {
  flex: 1;
  background: var(--chart-3);
}

.history-legend {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------- compare */

.compare {
  margin: 80px var(--gutter) 0;
  border-radius: 24px;
  background: var(--neutral-50);
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.compare-lede {
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
  max-width: 900px;
}

.compare-rows {
  display: flex;
  flex-direction: column;
}

.compare-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--border);
}

.compare-row dt {
  font-size: 13px;
  color: var(--neutral-500);
}

.compare-row dd {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-align: right;
}

.compare-old {
  font-size: 13px;
  color: var(--neutral-400);
  text-decoration: line-through;
}

.compare-new {
  font-size: 18px;
  font-weight: 600;
}

/* --------------------------------------------------------------- gallery */

.gallery {
  padding: 80px var(--gutter) 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.gallery-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}

.gallery-note {
  font-size: 14px;
  color: var(--neutral-600);
  flex: none;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.gallery-card {
  border-radius: 24px;
  border: 1px solid var(--border);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: left;
  transition: transform 0.15s, box-shadow 0.15s;
}

.gallery-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.gallery-dots {
  display: grid;
  grid-template-columns: repeat(16, minmax(0, 1fr));
  gap: 4px;
}

.gallery-dots span {
  aspect-ratio: 1;
  border-radius: 9999px;
}

.gallery-q {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  text-wrap: pretty;
  min-height: 47px;
}

.gallery-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.gallery-pop {
  font-size: 13px;
  color: var(--neutral-600);
}

.gallery-win {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  flex: none;
}

.gallery-win .swatch {
  width: 9px;
  height: 9px;
}

/* ------------------------------------------------------------------- cta */

.cta {
  margin: 80px var(--gutter) 0;
  border-radius: 32px;
  background: var(--ink);
  color: var(--paper);
  padding: 72px 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  text-align: center;
}

.cta-title {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.04em;
  text-wrap: balance;
  max-width: 760px;
}

.cta-field {
  width: 100%;
  max-width: 720px;
  height: 64px;
  border-radius: 9999px;
  background: var(--neutral-800);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 28px;
  font-size: 17px;
  color: var(--neutral-400);
}

.cta-submit {
  height: 48px;
  padding: 0 28px;
  border-radius: 9999px;
  background: var(--paper);
  color: var(--ink);
  display: flex;
  align-items: center;
  font-size: 16px;
  font-weight: 600;
  flex: none;
}

.cta-note {
  font-size: 12px;
  color: var(--neutral-400);
}

/* ---------------------------------------------------------------- footer */

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px var(--gutter);
  font-size: 13px;
  color: var(--neutral-500);
}

.footer-brand {
  font-weight: 600;
  color: var(--foreground);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-nav a {
  color: inherit;
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--foreground);
}

/* ----------------------------------------------------------- breakpoints */

@media (max-width: 1180px) {
  .results {
    grid-template-columns: 1fr 1fr;
    gap: 20px 12px;
    padding: 24px var(--gutter) 4px;
  }

  .population {
    grid-row: 1;
    grid-column: 1 / -1;
  }

  .tally-start {
    grid-row: 2;
    grid-column: 1;
    align-items: flex-start;
  }

  .tally-end {
    grid-row: 2;
    grid-column: 2;
    align-items: flex-end;
  }

  .tally-label {
    font-size: 14px;
  }
}

@media (max-width: 1000px) {
  :root {
    --gutter: 32px;
  }

  .ask {
    padding: 32px 32px 0;
  }

  .how-steps,
  .followup-list,
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .history-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compare,
  .gallery,
  .cta {
    margin-top: 56px;
  }
}

@media (max-width: 640px) {
  :root {
    --gutter: 20px;
  }

  .site-header {
    padding: 0 20px;
  }

  .ask {
    padding: 20px 20px 0;
    gap: 18px;
  }

  .ask-question {
    min-height: 92px;
    letter-spacing: -0.03em;
  }

  .ask-button {
    height: 56px;
    width: 100%;
    font-size: 16px;
  }

  .status {
    font-size: 12px;
    padding: 0 20px;
    min-height: 16px;
  }

  #poll-canvas {
    border-radius: 20px;
  }

  .how-steps,
  .followup-list,
  .history-list,
  .gallery-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .how {
    margin-top: 24px;
    padding: 32px var(--gutter);
  }

  .compare {
    padding: 28px 20px;
  }

  .gallery-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .gallery-card {
    padding: 18px;
    border-radius: 20px;
  }

  .gallery-q {
    font-size: 15px;
    min-height: 0;
  }

  .cta {
    border-radius: 24px;
    padding: 36px 20px;
    gap: 18px;
  }

  .cta-field {
    height: 52px;
    padding: 0 6px 0 18px;
    font-size: 15px;
  }

  .cta-submit {
    height: 40px;
    padding: 0 18px;
    font-size: 14px;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .footer-nav {
    gap: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  .ask-button:hover,
  .gallery-card:hover {
    transform: none;
  }
}
