/* RocketVote website styles. Design tokens are identical to the app. */

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2-variations"),
    url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --accent-3: #ec4899;
  --accent-strong: #4f46e5;
  --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 60%, #ec4899 120%);
  --r-low: #10b981;
  --r-mid: #f59e0b;
  --r-high: #ef4444;

  --bg: #f7f8fc;
  --surface: #ffffff;
  --surface-2: #f1f2f9;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e5e7f0;
  --accent-soft: rgba(99, 102, 241, 0.1);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -8px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 24px 48px -16px rgba(79, 70, 229, 0.25);
  --blob-opacity: 0.35;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --container: 1120px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0b0d17;
  --surface: #141827;
  --surface-2: #1b2033;
  --text: #e5e7f0;
  --muted: #94a3b8;
  --border: #262b40;
  --accent-strong: #a5b4fc;
  --accent-soft: rgba(129, 140, 248, 0.14);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 48px -16px rgba(99, 102, 241, 0.35);
  --blob-opacity: 0.22;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d17;
    --surface: #141827;
    --surface-2: #1b2033;
    --text: #e5e7f0;
    --muted: #94a3b8;
    --border: #262b40;
    --accent-strong: #a5b4fc;
    --accent-soft: rgba(129, 140, 248, 0.14);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -8px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 24px 48px -16px rgba(99, 102, 241, 0.35);
    --blob-opacity: 0.22;
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.6em;
}

h1 {
  font-size: clamp(2.2rem, 5vw + 1rem, 4rem);
  font-weight: 800;
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(1.6rem, 2vw + 1rem, 2.4rem);
  font-weight: 750;
}

h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

p {
  margin: 0 0 1em;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.skip-link:focus {
  top: 1rem;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 640px) {
  .container {
    padding: 0 24px;
  }
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.btn-primary {
  color: #fff;
  background: var(--gradient);
  box-shadow: var(--shadow-lg);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 28px 52px -16px rgba(99, 102, 241, 0.45);
}

.btn-ghost {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-ghost:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.92rem;
}

.btn svg {
  width: 18px;
  height: 18px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  margin-right: auto;
}

.brand svg {
  width: 32px;
  height: 32px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav a {
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-weight: 550;
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--text);
  background: var(--surface-2);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.icon-btn,
.lang-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  min-width: 38px;
  padding: 0 0.6rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.icon-btn:hover,
.lang-switch:hover {
  border-color: var(--accent);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .icon-moon {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun {
    display: none;
  }

  :root:not([data-theme="light"]) .theme-toggle .icon-moon {
    display: block;
  }
}

.nav-toggle {
  display: none;
}

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex;
  }

  .header-cta {
    display: none;
  }

  .nav {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding: 0.75rem 16px 1.25rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: none;
  }

  .nav.is-open {
    display: flex;
  }

  .nav a {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
  }

  .nav .nav-app {
    display: inline-flex;
    margin-top: 0.5rem;
    color: #fff;
  }
}

@media (min-width: 861px) {
  .nav .nav-app {
    display: none;
  }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: clamp(3.5rem, 8vw, 7rem) 0 clamp(3rem, 6vw, 5rem);
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: var(--blob-opacity);
  pointer-events: none;
  z-index: -1;
}

.blob-1 {
  width: 520px;
  height: 520px;
  background: #6366f1;
  top: -180px;
  left: -140px;
  animation: float 18s ease-in-out infinite;
}

.blob-2 {
  width: 440px;
  height: 440px;
  background: #ec4899;
  top: 40px;
  right: -160px;
  animation: float 22s ease-in-out infinite reverse;
}

.blob-3 {
  width: 360px;
  height: 360px;
  background: #8b5cf6;
  bottom: -200px;
  left: 35%;
  animation: float 26s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(40px, 30px) scale(1.08);
  }
}

.hero-grid {
  display: grid;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 960px) {
  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.hero .lead {
  font-size: clamp(1.08rem, 0.6vw + 1rem, 1.3rem);
  color: var(--muted);
  max-width: 36em;
  margin-bottom: 2rem;
}

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

.hero-note {
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Example card in the hero */
.demo-card {
  position: relative;
  padding: 1.5rem;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.demo-card h3 {
  margin-bottom: 0.25rem;
}

.demo-card .demo-sub {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.result-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 1rem;
  align-items: center;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
}

.result-row:first-of-type {
  border-top: 0;
}

.result-row .label {
  font-weight: 600;
  font-size: 0.95rem;
}

.result-row .value {
  font-weight: 700;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.bar {
  grid-column: 1 / -1;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.winner-badge {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-pill);
  background: rgba(16, 185, 129, 0.14);
  color: var(--r-low);
  font-size: 0.72rem;
  font-weight: 700;
  vertical-align: middle;
}

/* ---------- Sections ---------- */

.section {
  padding: clamp(3.5rem, 7vw, 6rem) 0;
}

.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  max-width: 44rem;
  margin: 0 auto 3rem;
  text-align: center;
}

.section-head p {
  color: var(--muted);
  font-size: 1.08rem;
}

.grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 720px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  padding: 1.6rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.section-alt .card {
  background: var(--bg);
}

.card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.card p:last-child {
  margin-bottom: 0;
}

.card p {
  color: var(--muted);
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 1rem;
  border-radius: 13px;
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 10px 20px -10px rgba(99, 102, 241, 0.7);
}

.feature-icon svg {
  width: 22px;
  height: 22px;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-bottom: 1rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 800;
}

/* ---------- Resistance scale ---------- */

.scale {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 6px;
  margin: 1.5rem 0 0.75rem;
}

.scale span {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border-radius: 10px;
  color: #fff;
  font-weight: 750;
  font-size: clamp(0.75rem, 1.5vw, 1rem);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}

.scale span:hover {
  transform: translateY(-3px) scale(1.06);
}

.scale-legend {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.scale-card {
  max-width: 760px;
  margin: 0 auto;
}

/* ---------- CTA band ---------- */

.cta-band {
  position: relative;
  overflow: hidden;
  padding: clamp(2.5rem, 6vw, 4rem);
  border-radius: 28px;
  background: var(--gradient);
  color: #fff;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.cta-band::after {
  content: "";
  position: absolute;
  inset: auto -20% -60% auto;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.cta-band h2 {
  color: #fff;
}

.cta-band p {
  max-width: 36rem;
  margin: 0 auto 1.75rem;
  opacity: 0.92;
  font-size: 1.08rem;
}

.cta-band .btn {
  position: relative;
  z-index: 1;
  background: #fff;
  color: #4338ca;
  box-shadow: 0 16px 30px -12px rgba(15, 23, 42, 0.4);
}

.cta-band .btn:hover {
  transform: translateY(-2px);
}

/* ---------- Content pages ---------- */

.page-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(3rem, 6vw, 5rem) 0 clamp(1.5rem, 3vw, 2.5rem);
}

.page-hero h1 {
  font-size: clamp(2rem, 3vw + 1rem, 3.2rem);
}

.page-hero .lead {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 40rem;
}

.prose {
  max-width: 46rem;
}

.prose h2 {
  margin-top: 2.5rem;
  font-size: clamp(1.4rem, 1vw + 1rem, 1.8rem);
}

.prose h3 {
  margin-top: 1.75rem;
}

.prose ul,
.prose ol {
  padding-left: 1.3rem;
  margin: 0 0 1em;
}

.prose li {
  margin-bottom: 0.35rem;
}

.callout {
  margin: 1.5rem 0;
  padding: 1.1rem 1.3rem;
  border-radius: var(--radius);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout-warn {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.45);
}

.formula {
  display: block;
  margin: 1rem 0 1.25rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  overflow-x: auto;
}

.table-wrap {
  margin: 1.25rem 0 1.5rem;
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
}

th,
td {
  padding: 0.75rem 1rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
}

thead th {
  background: var(--surface-2);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--muted);
}

tbody tr:last-child td {
  border-bottom: 0;
}

tr.is-winner td {
  background: rgba(16, 185, 129, 0.09);
  font-weight: 700;
}

.pill {
  display: inline-block;
  min-width: 2rem;
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-pill);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
}

.pill-low {
  background: var(--r-low);
}

.pill-mid {
  background: var(--r-mid);
  color: #1f1300;
}

.pill-high {
  background: var(--r-high);
}

.placeholder {
  padding: 0.05rem 0.4rem;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.18);
  border: 1px dashed rgba(245, 158, 11, 0.7);
  font-weight: 600;
}

/* ---------- FAQ ---------- */

.faq {
  max-width: 48rem;
  display: grid;
  gap: 0.75rem;
}

.faq details {
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.faq details[open] {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: var(--shadow);
}

.faq summary {
  position: relative;
  padding: 1.1rem 3.25rem 1.1rem 1.3rem;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  position: absolute;
  right: 1.3rem;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.2s ease;
}

.faq details[open] summary::after {
  transform: translateY(-30%) rotate(-135deg);
}

.faq .answer {
  padding: 0 1.3rem 1.2rem;
  color: var(--muted);
}

.faq .answer p:last-child {
  margin-bottom: 0;
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: clamp(3rem, 6vw, 5rem);
  padding: 3rem 0 2.5rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.92rem;
}

.footer-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 720px) {
  .footer-grid {
    grid-template-columns: 1.6fr 1fr 1fr;
  }
}

.site-footer h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.9rem;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.site-footer a {
  color: var(--text);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
}

/* ---------- 404 ---------- */

.notfound {
  min-height: 60vh;
  display: grid;
  place-items: center;
  text-align: center;
}

.notfound .big {
  font-size: clamp(5rem, 15vw, 9rem);
  font-weight: 850;
  line-height: 1;
  letter-spacing: -0.05em;
  margin-bottom: 1rem;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
