@font-face {
  font-family: 'Geist Pixel';
  src: url('/fonts/geist-pixel/GeistPixel-Square.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Geist Pixel Grid';
  src: url('/fonts/geist-pixel/GeistPixel-Grid.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Geist Sans';
  src: url('/fonts/geist-sans/Geist-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Geist Mono';
  src: url('/fonts/geist-mono/GeistMono-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #050507;
  --surface: #0c0d11;
  --surface-hover: #13151c;
  --surface-elevated: #171a22;
  --fg: #f5f6f8;
  --fg-secondary: #c5c9d4;
  --muted: #848a98;
  --border: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(255, 255, 255, 0.28);
  --border-selected: rgba(255, 255, 255, 0.85);
  --bar: rgba(255, 255, 255, 0.085);
  --bar-selected: rgba(255, 255, 255, 0.16);
  --radius: 14px;
  --font-pixel: 'Geist Pixel', 'Geist Mono', monospace;
  --font-pixel-grid: 'Geist Pixel Grid', 'Geist Pixel', monospace;
  --font-sans: 'Geist Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

html {
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  position: relative;
  overflow-x: hidden;
}

/* Architectural pixel-dot field behind the hero */
.hero-grid-bg {
  position: absolute;
  inset: 0 0 auto 0;
  height: 440px;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 20px 20px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0) 100%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0) 100%);
}

/* Sticky minimal topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(5, 5, 7, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.topbar-inner {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 13px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-mark {
  font-family: var(--font-pixel);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--fg);
  text-decoration: none;
}

.brand-dot {
  color: var(--muted);
}

.progress-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.progress-segments {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.progress-seg {
  width: 14px;
  height: 6px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.12);
  transition: background-color 220ms ease, transform 220ms ease;
}

.progress-seg.is-done {
  background: var(--fg);
}

.progress-text {
  font-family: var(--font-pixel);
  font-size: 0.85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 28px;
  text-align: right;
}

/* Main column */
.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 56px 20px 96px;
}

/* Hero */
.hero {
  margin-bottom: 64px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 24px;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--fg-secondary);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 1px;
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
}

.voter-counter {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
}

.voter-number {
  font-family: var(--font-pixel);
  font-size: 1.15rem;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

.hero-title {
  margin: 0 0 18px;
  font-family: var(--font-pixel);
  font-size: clamp(2.15rem, 6.4vw, 3.25rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--fg);
}

.hero-subtitle {
  margin: 0 0 32px;
  font-family: var(--font-sans);
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 54ch;
}

/* AI Ecosystem Logo Strip */
.ecosystem-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.eco-tile {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.025);
  color: var(--fg-secondary);
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.eco-tile:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
  color: var(--fg);
}

.eco-tile .logo-svg {
  width: 15px;
  height: 15px;
}

/* Shared SVG wrapper */
.logo-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  flex-shrink: 0;
}

.logo-svg svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Questions */
.questions {
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.loading-state {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--muted);
  padding: 24px 0;
}

.question {
  display: flex;
  flex-direction: column;
}

.question-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 22px;
}

.question-index {
  flex-shrink: 0;
  min-width: 38px;
  height: 34px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: var(--font-pixel);
  font-size: 0.95rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.question.is-answered .question-index {
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--fg);
  background: var(--surface-elevated);
}

.question-title {
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(1.2rem, 3.3vw, 1.44rem);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.025em;
  color: var(--fg);
}

/* Options */
.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-row {
  --row-accent: rgba(255, 255, 255, 0.35);
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 17px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  font: inherit;
  text-align: left;
  overflow: hidden;
  transition: border-color 160ms ease, background-color 160ms ease;
}

button.option-row {
  cursor: pointer;
}

button.option-row:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--row-accent) 45%, rgba(255, 255, 255, 0.22));
  background: var(--surface-hover);
}

button.option-row:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

button.option-row:disabled {
  cursor: wait;
  opacity: 0.72;
}

.option-row.is-selected {
  border-color: var(--border-selected);
  background: var(--surface-hover);
}

/* Animated result bar with subtle pixel-grid texture */
.option-bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background-color: var(--bar);
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 6px 6px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
  z-index: 0;
  transition: width 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.option-row.is-selected .option-bar {
  background-color: var(--bar-selected);
  border-right-color: rgba(255, 255, 255, 0.24);
}

.option-row.is-leader:not(.is-selected) .option-bar {
  background-color: rgba(255, 255, 255, 0.115);
}

.option-left {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

/* Primary logo container(s) */
.logo-well {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.035);
  color: var(--fg);
  flex-shrink: 0;
  transition: border-color 160ms ease, background-color 160ms ease;
}

button.option-row:hover:not(:disabled) .logo-well {
  border-color: color-mix(in srgb, var(--row-accent) 50%, rgba(255, 255, 255, 0.2));
  background: rgba(255, 255, 255, 0.06);
}

.option-row.is-selected .logo-well {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.08);
}

.logo-well .logo-svg {
  width: 22px;
  height: 22px;
}

/* Multi-logo cluster for options with several companies/editors */
.logo-cluster {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  width: 42px;
  height: 42px;
  padding: 5px;
  align-items: center;
  justify-items: center;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.035);
  flex-shrink: 0;
}

.logo-cluster.is-pair {
  grid-template-columns: repeat(2, 1fr);
  padding: 4px 3px;
  gap: 2px;
}

.logo-cluster .logo-svg {
  width: 14px;
  height: 14px;
}

.logo-cluster.is-pair .logo-svg {
  width: 16px;
  height: 16px;
}

.option-copy {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.option-label-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.option-label {
  font-family: var(--font-sans);
  font-size: 0.99rem;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.option-subtitle {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.3;
}

/* Inline agent / model chips with mini SVG logos */
.agent-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.agent-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px 2px 5px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--fg-secondary);
  line-height: 1.3;
}

.agent-chip .logo-svg {
  width: 12px;
  height: 12px;
}

.option-right {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.your-vote-pill {
  padding: 4px 9px;
  border-radius: 6px;
  background-color: var(--fg);
  color: var(--bg);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.option-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 66px;
}

.option-percent {
  font-family: var(--font-pixel);
  font-size: 1.5rem;
  line-height: 1.05;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

.option-row.is-leader .option-percent {
  color: #ffffff;
}

.option-votes {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.question-footer {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Completion banner */
.completion-banner {
  margin-top: 56px;
  padding: 22px 22px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: var(--surface);
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.completion-banner[hidden] {
  display: none;
}

.completion-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--fg);
  color: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-pixel);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.completion-title {
  margin: 0 0 4px;
  font-family: var(--font-pixel);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--fg);
}

.completion-text {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Footer */
.site-footer {
  margin-top: 76px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--muted);
}

.footer-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.footer-brand {
  font-family: var(--font-pixel);
  font-size: 0.9rem;
  color: var(--fg);
}

.footer-sep {
  opacity: 0.35;
}

.footer-stack {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.stack-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg-secondary);
  font-size: 0.74rem;
}

.stack-pill .logo-svg {
  width: 14px;
  height: 14px;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: min(460px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: #12141a;
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  line-height: 1.4;
  z-index: 50;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

@media (max-width: 520px) {
  .container {
    padding: 36px 16px 72px;
  }

  .hero {
    margin-bottom: 48px;
    padding-bottom: 32px;
  }

  .question-header {
    gap: 11px;
  }

  .option-row {
    padding: 13px 13px;
    gap: 10px;
  }

  .logo-well,
  .logo-cluster {
    width: 38px;
    height: 38px;
  }

  .option-right {
    gap: 8px;
  }

  .your-vote-pill {
    padding: 3px 7px;
    font-size: 0.68rem;
  }

  .option-percent {
    font-size: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .option-bar,
  .option-row,
  .eco-tile,
  .progress-seg,
  .logo-well {
    transition: none;
  }
}
