:root {
  --bg: #0a0a0f;
  --bg-elevated: rgba(13, 14, 23, 0.88);
  --bg-panel: rgba(18, 20, 34, 0.82);
  --border: rgba(167, 139, 250, 0.2);
  --text: #f5f7ff;
  --muted: #a2acc9;
  --accent: #6366f1;
  --accent-soft: #a78bfa;
  --success: #38b26c;
  --warning: #d8af36;
  --orange: #ef8d32;
  --danger: #d95a5a;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --max-width: 1160px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(99, 102, 241, 0.18), transparent 34%),
    radial-gradient(circle at 80% 20%, rgba(167, 139, 250, 0.12), transparent 24%),
    linear-gradient(180deg, #090910 0%, #0a0a0f 48%, #0f1020 100%);
  color: var(--text);
  font-family: "Inter", sans-serif;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.site-shell {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.stars,
.stars::before,
.stars::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
}

.stars {
  background-image:
    radial-gradient(2px 2px at 12% 18%, rgba(255, 255, 255, 0.9) 20%, transparent 60%),
    radial-gradient(1.5px 1.5px at 24% 64%, rgba(167, 139, 250, 0.8) 20%, transparent 60%),
    radial-gradient(1.75px 1.75px at 81% 28%, rgba(255, 255, 255, 0.72) 20%, transparent 60%),
    radial-gradient(2px 2px at 72% 72%, rgba(99, 102, 241, 0.72) 20%, transparent 60%),
    radial-gradient(1px 1px at 40% 30%, rgba(255, 255, 255, 0.6) 20%, transparent 60%);
  opacity: 0.7;
  animation: drift 24s linear infinite;
}

.stars::before {
  background-image:
    radial-gradient(1.5px 1.5px at 16% 80%, rgba(255, 255, 255, 0.78) 20%, transparent 60%),
    radial-gradient(2px 2px at 52% 14%, rgba(167, 139, 250, 0.7) 20%, transparent 60%),
    radial-gradient(1px 1px at 88% 58%, rgba(255, 255, 255, 0.72) 20%, transparent 60%);
  animation: pulse 8s ease-in-out infinite;
}

.stars::after {
  background:
    radial-gradient(circle at center, rgba(99, 102, 241, 0.08), transparent 55%);
  filter: blur(24px);
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

.site-header,
.site-footer,
.hero,
.poll-card,
.results-panel {
  width: min(calc(100% - 2rem), var(--max-width));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.25rem 0 0.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
}

.brand-mark {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, #ffffff 0, rgba(255, 255, 255, 0.6) 12%, transparent 24%),
    linear-gradient(135deg, var(--accent-soft), var(--accent));
  box-shadow: 0 0 28px rgba(99, 102, 241, 0.45);
}

.brand-text {
  display: grid;
  gap: 0.15rem;
}

.brand-text strong,
.site-nav a,
h1,
h2,
h3 {
  font-family: "Space Grotesk", sans-serif;
}

.brand-text strong {
  font-size: 0.98rem;
}

.brand-text span {
  color: var(--muted);
  font-size: 0.88rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-nav a {
  color: var(--muted);
  font-size: 0.95rem;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.essay-link:hover,
.essay-link:focus-visible {
  color: var(--text);
}

.hero {
  display: grid;
  gap: 1.5rem;
  padding: 3.75rem 0 2rem;
}

.eyebrow,
.section-kicker,
.stat-label,
.chip-label {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-soft);
  font-size: 0.75rem;
  font-weight: 700;
}

h1 {
  margin: 0.45rem 0 1rem;
  max-width: 12ch;
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  line-height: 0.94;
}

.hero-text,
.hero-note {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.hero-note {
  margin-top: 1rem;
}

.hero-panel,
.poll-card,
.results-panel,
.timeline-panel,
.context-panel,
.hero-stat,
.result-chip {
  backdrop-filter: blur(18px);
}

.hero-panel {
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(16, 18, 31, 0.9), rgba(11, 12, 20, 0.74));
  box-shadow: var(--shadow);
}

.hero-stat {
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
}

.hero-stat strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.05rem;
  line-height: 1.4;
}

.poll-card,
.results-panel {
  margin-top: 1.5rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(13, 14, 24, 0.92), rgba(10, 10, 15, 0.82));
  box-shadow: var(--shadow);
}

.section-heading h2 {
  margin: 0.2rem 0 0;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.assistive-copy,
.status-message,
.timeline-header p,
.context-copy li,
.site-footer p {
  color: var(--muted);
}

.poll-form {
  margin-top: 1.5rem;
}

.timeline-grid {
  display: grid;
  gap: 1rem;
}

.choice-card {
  position: relative;
  display: grid;
  gap: 0.65rem;
  width: 100%;
  padding: 1.15rem 1.15rem 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.choice-card:hover,
.choice-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(167, 139, 250, 0.46);
  box-shadow: 0 16px 30px rgba(99, 102, 241, 0.18);
}

.choice-card.is-selected {
  border-color: rgba(167, 139, 250, 0.84);
  background:
    linear-gradient(180deg, rgba(99, 102, 241, 0.18), rgba(167, 139, 250, 0.06)),
    rgba(255, 255, 255, 0.02);
  box-shadow: 0 18px 36px rgba(99, 102, 241, 0.24);
}

.choice-card.is-locked {
  cursor: default;
}

.choice-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.choice-emoji {
  font-size: 1.35rem;
  line-height: 1;
}

.choice-title {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.15rem;
}

.choice-description {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.choice-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #edf0ff;
  font-size: 0.84rem;
  font-weight: 600;
}

.poll-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.submit-button,
.share-button {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
  color: #fff;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.submit-button {
  padding: 0.95rem 1.35rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(99, 102, 241, 0.3);
}

.submit-button.is-confirmed {
  animation: submit-pop 380ms ease;
}

.submit-button:hover,
.submit-button:focus-visible,
.share-button:hover,
.share-button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(99, 102, 241, 0.34);
}

.submit-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.status-message {
  min-height: 1.5rem;
  margin: 0;
}

.results-panel {
  display: grid;
  gap: 1.5rem;
}

.results-topline {
  display: grid;
  gap: 1rem;
}

.result-chip {
  padding: 1rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
}

.result-chip strong {
  display: block;
  margin-top: 0.25rem;
  font-size: clamp(1.35rem, 4vw, 1.8rem);
}

.result-chip.emphasis {
  border-color: rgba(167, 139, 250, 0.34);
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.14), rgba(167, 139, 250, 0.06));
}

.results-bars {
  display: grid;
  gap: 0.95rem;
}

.result-row {
  display: grid;
  gap: 0.55rem;
}

.result-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.result-label {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
}

.result-track {
  overflow: hidden;
  height: 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.result-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  transition: width 900ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.result-bar.is-animated {
  width: var(--bar-width);
}

.timeline-panel,
.context-panel {
  padding: 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.025);
}

.timeline-graphic {
  position: relative;
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1.3rem;
}

.timeline-graphic::before {
  position: absolute;
  top: 0.35rem;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.2), rgba(167, 139, 250, 0.8), rgba(99, 102, 241, 0.12));
  content: "";
}

.timeline-item {
  position: relative;
  padding-left: 1.25rem;
}

.timeline-item::before {
  position: absolute;
  top: 0.1rem;
  left: 0;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--marker-color);
  box-shadow: 0 0 18px var(--marker-color);
  content: "";
}

.timeline-item strong {
  display: block;
  font-family: "Space Grotesk", sans-serif;
}

.timeline-item span {
  color: var(--muted);
  font-size: 0.95rem;
}

.context-panel {
  display: grid;
  gap: 1.25rem;
}

.context-copy ul {
  margin: 0.9rem 0 0;
  padding-left: 1.2rem;
}

.context-copy li + li {
  margin-top: 0.65rem;
}

.essay-link {
  display: inline-block;
  margin-top: 1.1rem;
  color: var(--accent-soft);
  font-weight: 600;
  text-decoration: none;
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 8rem;
  padding: 0.8rem 1rem;
  cursor: pointer;
}

.site-footer {
  padding: 2.5rem 0 3rem;
}

.site-footer p {
  margin: 0.25rem 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid rgba(167, 139, 250, 0.9);
  outline-offset: 3px;
}

@media (min-width: 700px) {
  .hero {
    grid-template-columns: minmax(0, 1.35fr) minmax(20rem, 0.85fr);
    align-items: end;
  }

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

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

  .context-panel {
    grid-template-columns: minmax(0, 1.4fr) minmax(18rem, 0.9fr);
  }
}

@media (min-width: 980px) {
  .timeline-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .poll-card,
  .results-panel {
    padding: 1.75rem;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@keyframes drift {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(10px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 0.9;
  }
}

@keyframes submit-pop {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(0.96);
  }
  100% {
    transform: scale(1);
  }
}
