/* === Design tokens from CirclTheme === */
:root {
  --bg-primary: #0D1321;
  --bg-secondary: #151E2C;
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-bg-hover: rgba(255, 255, 255, 0.07);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-highlight: rgba(140, 180, 210, 0.15);
  --text-primary: #E8EAED;
  --text-secondary: rgba(232, 234, 237, 0.65);
  --text-tertiary: rgba(232, 234, 237, 0.40);
  --text-accent: #7EB8D8;
  --action-primary: #6BA3C7;
  --action-secondary: #8A6DBD;
  --radius-md: 14px;
  --radius-lg: 22px;
  --font-serif: 'Instrument Serif', serif;
}

/* === Reset === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-primary);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-primary);
  background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-primary) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}

/* iOS Safari doesn't support background-attachment: fixed */
@supports (-webkit-touch-callout: none) {
  body {
    background-attachment: scroll;
    background-color: var(--bg-primary);
  }
}

a {
  color: var(--text-accent);
  text-decoration: none;
}

/* === Nav === */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}

.nav-scrolled {
  background: rgba(13, 19, 33, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom-color: var(--glass-border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.nav-logo-text {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -1px;
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-hamburger.open span:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* === Hero === */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 28px 80px;
}

.hero-content {
  text-align: center;
  max-width: 600px;
}

.hero-logo {
  margin-bottom: 32px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 52px;
  font-weight: 400;
  line-height: 1.15;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.hero-subtitle {
  font-size: 18px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 28px;
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta {
  display: inline-block;
  padding: 14px 40px;
  background: var(--action-primary);
  color: var(--bg-primary);
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: background 0.2s, transform 0.2s;
}

.hero-cta:hover {
  background: var(--text-accent);
  color: var(--bg-primary);
  transform: translateY(-1px);
}

.hero-divider {
  width: 40px;
  height: 1px;
  background: var(--glass-border-highlight);
  margin: 48px auto 32px;
}

.hero-callout {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: 0.3px;
}

/* Hero entrance animations */
.animate-in {
  opacity: 0;
  transform: translateY(24px);
  animation: fadeSlideUp 0.6s ease forwards;
  animation-delay: var(--delay, 0s);
}

@keyframes fadeSlideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === Sections === */
.section-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 28px;
}

/* === Features === */
.features {
  padding: 100px 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 28px 24px;
  transition: background 0.2s, border-color 0.2s;
}

.feature-card:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-highlight);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(107, 163, 199, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.feature-title {
  font-size: 17px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.feature-description {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* === Demo === */
.demo {
  padding: 80px 0 100px;
}

.demo-container {
  max-width: 460px;
  margin: 0 auto;
}

.demo-question {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border-highlight);
  border-radius: 16px;
  padding: 22px 24px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.demo-question-text {
  font-family: var(--font-serif);
  font-size: 20px;
  color: var(--text-primary);
}

.demo-question-badge {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-accent);
  background: rgba(107, 163, 199, 0.12);
  padding: 5px 12px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}

.demo-poll {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.demo-option {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 14px 18px;
  transition: background 0.2s, border-color 0.2s;
}

.demo-option:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-highlight);
}

.demo-option-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.demo-option-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.demo-option-count {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-accent);
}

.demo-option-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.demo-option-fill {
  height: 100%;
  width: var(--fill);
  background: var(--action-primary);
  border-radius: 3px;
  transition: width 0.8s ease;
}

.demo-option-fill--muted {
  background: var(--text-tertiary);
}

.demo-option-voters {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* === Demo 2: Groups + Image === */
.demo-divider {
  width: 40px;
  height: 1px;
  background: var(--glass-border-highlight);
  margin: 48px auto;
}

.demo-question-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 16px;
}

.demo-question-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.demo-groups-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.demo-group-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-accent);
  background: rgba(107, 163, 199, 0.12);
  border: 1px solid rgba(107, 163, 199, 0.2);
  padding: 6px 14px;
  border-radius: 20px;
  letter-spacing: 0.2px;
}

.demo-group-chip svg {
  opacity: 0.7;
  flex-shrink: 0;
}

.demo-groups-reach {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: 0.2px;
}

/* Demo groups cascade animation */
.demo-groups-animate {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.demo-groups-animate.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Demo cascade animation */
.demo-animate {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.demo-animate.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* === How It Works === */
.how-it-works {
  padding: 80px 0 100px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 38px;
  font-weight: 400;
  text-align: center;
  margin-bottom: 14px;
  color: var(--text-primary);
}

.section-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 48px;
  line-height: 1.6;
}

.steps {
  max-width: 460px;
  margin: 0 auto 40px;
}

.step {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  position: relative;
}

.step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(107, 163, 199, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 16px;
}

.step-number {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-accent);
}

.step-text {
  font-size: 17px;
  color: var(--text-primary);
  font-weight: 400;
}

.step-connector {
  position: absolute;
  left: 17px;
  top: 40px;
  width: 2px;
  height: 24px;
  background: rgba(107, 163, 199, 0.15);
}

.callout {
  background: rgba(107, 163, 199, 0.1);
  border: 1px solid rgba(107, 163, 199, 0.15);
  border-radius: var(--radius-md);
  padding: 16px 24px;
  text-align: center;
  font-size: 16px;
  font-weight: 500;
  color: rgba(232, 234, 237, 0.7);
  letter-spacing: 0.2px;
  max-width: 460px;
  margin: 0 auto;
}

/* === CTA === */
.cta {
  padding: 80px 0 100px;
}

.cta-title {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 400;
  text-align: center;
  margin-bottom: 14px;
  color: var(--text-primary);
  line-height: 1.2;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.cta-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 32px;
}

.cta-form {
  display: flex;
  gap: 12px;
  max-width: 420px;
  margin: 0 auto 16px;
}

.cta-input {
  flex: 1;
  padding: 14px 18px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.cta-input::placeholder {
  color: var(--text-tertiary);
}

.cta-input:focus {
  border-color: var(--glass-border-highlight);
}

.cta-button {
  padding: 14px 28px;
  background: var(--action-primary);
  color: var(--bg-primary);
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  white-space: nowrap;
}

.cta-button:hover {
  background: var(--text-accent);
  transform: translateY(-1px);
}

.cta-note {
  font-size: 13px;
  color: var(--text-tertiary);
  text-align: center;
}

/* === Footer === */
.footer {
  border-top: 1px solid var(--glass-border);
  padding: 40px 28px;
}

.footer-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

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

.footer-links a {
  color: var(--text-tertiary);
  font-size: 14px;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--text-secondary);
}

.footer-copy {
  font-size: 13px;
  color: var(--text-tertiary);
}

/* === Scroll animations === */
.scroll-animate {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.scroll-animate.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger feature cards */
.feature-card:nth-child(2) {
  transition-delay: 0.1s;
}

.feature-card:nth-child(3) {
  transition-delay: 0.2s;
}

/* Stagger steps */
.step:nth-child(2) {
  transition-delay: 0.1s;
}

.step:nth-child(3) {
  transition-delay: 0.2s;
}

/* === Legal pages === */
.legal {
  padding: 120px 28px 80px;
  min-height: 100vh;
}

.legal-inner {
  max-width: 720px;
  margin: 0 auto;
}

.legal-title {
  font-family: var(--font-serif);
  font-size: 42px;
  font-weight: 400;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.legal-updated {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-bottom: 40px;
}

.legal h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 36px;
  margin-bottom: 12px;
}

.legal h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 24px;
  margin-bottom: 8px;
}

.legal p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 12px;
}

.legal ul {
  list-style: none;
  padding: 0;
  margin-bottom: 12px;
}

.legal ul li {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  padding-left: 20px;
  position: relative;
  margin-bottom: 4px;
}

.legal ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-accent);
  opacity: 0.5;
}

.legal a {
  color: var(--text-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal a:hover {
  color: var(--text-primary);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 20px;
  font-size: 14px;
}

.legal-table th,
.legal-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--glass-border);
  color: var(--text-secondary);
}

.legal-table th {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.legal-table tr:last-child td {
  border-bottom: none;
}

/* === Tablet === */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(13, 19, 33, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 8px 0;
  }

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

  .nav-links a {
    padding: 14px 28px;
    font-size: 16px;
  }

  .nav-hamburger {
    display: flex;
  }

  .hero {
    padding: 0 24px;
    min-height: 100dvh;
  }

  .hero-logo svg {
    width: 60px;
    height: 60px;
  }

  .hero-logo {
    margin-bottom: 24px;
  }

  .hero-title {
    font-size: 38px;
    margin-bottom: 16px;
  }

  .hero-subtitle {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 24px;
    max-width: 380px;
  }

  .hero-cta {
    padding: 12px 36px;
    font-size: 15px;
  }

  .hero-divider {
    margin: 32px auto 20px;
  }

  .hero-callout {
    font-size: 13px;
  }

  .features {
    padding: 60px 0;
  }

  .section-inner {
    padding: 0 20px;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .feature-card {
    padding: 18px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
  }

  .feature-icon {
    width: 44px;
    height: 44px;
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .feature-title {
    font-size: 16px;
  }

  .feature-description {
    font-size: 14px;
  }

  .demo {
    padding: 50px 0 60px;
  }

  .demo-question {
    padding: 18px 18px;
  }

  .demo-question-text {
    font-size: 18px;
  }

  .demo-option {
    padding: 12px 14px;
  }

  .demo-option-label {
    font-size: 15px;
  }

  .demo-option-voters {
    font-size: 12px;
  }

  .demo-question-image {
    height: 160px;
  }

  .demo-divider {
    margin: 36px auto;
  }

  .how-it-works {
    padding: 50px 0 60px;
  }

  .section-title {
    font-size: 30px;
    padding: 0 8px;
  }

  .section-subtitle {
    font-size: 15px;
    margin-bottom: 36px;
    padding: 0 8px;
  }

  .steps {
    margin: 0 auto 32px;
  }

  .step-text {
    font-size: 15px;
  }

  .callout {
    font-size: 15px;
    padding: 14px 20px;
  }

  .cta {
    padding: 50px 0 60px;
  }

  .cta-title {
    font-size: 28px;
    padding: 0 8px;
  }

  .cta-subtitle {
    font-size: 16px;
  }

  .cta-form {
    flex-direction: column;
    padding: 0 8px;
  }

  .cta-input {
    padding: 14px 16px;
    font-size: 16px; /* prevents iOS zoom on focus */
  }

  .cta-button {
    padding: 14px 24px;
    font-size: 16px;
  }

  .footer {
    padding: 32px 20px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  /* Legal pages */
  .legal {
    padding: 100px 20px 60px;
  }

  .legal-title {
    font-size: 32px;
  }

  .legal h2 {
    font-size: 18px;
  }

  .legal-table {
    font-size: 13px;
  }

  .legal-table th,
  .legal-table td {
    padding: 8px 10px;
  }
}

/* === Small phones === */
@media (max-width: 390px) {
  .hero-title {
    font-size: 32px;
  }

  .hero-subtitle {
    font-size: 15px;
    max-width: 300px;
  }

  .demo-question-text {
    font-size: 16px;
  }

  .section-title {
    font-size: 26px;
  }

  .cta-title {
    font-size: 24px;
  }

  .step-text {
    font-size: 14px;
  }

  .feature-title {
    font-size: 15px;
  }

  .feature-description {
    font-size: 13px;
  }
}
