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

:root {
  --red:        #DC2626;
  --red-dark:   #B91C1C;
  --bg:         #FFFFFF;
  --text:       #0F172A;
  --muted-bg:   #F8FAFC;
  --border:     #E2E8F0;
  --text-muted: #64748B;
  --radius:     0.5rem;
  --shadow-sm:  0 1px 2px rgba(0,0,0,.06);
  --shadow:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:  0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.75rem; /* offset for sticky navbar */
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   Utilities
   ============================================================ */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.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;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.btn--primary {
  background: var(--red);
  color: #fff;
}

.btn--primary:hover { background: var(--red-dark); }

.btn--primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(220,38,38,.35);
}

.btn--lg {
  padding: 0.8125rem 1.875rem;
  font-size: 1rem;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.section-sub {
  text-align: center;
  color: var(--text-muted);
  margin-top: 0.625rem;
  font-size: 1.0625rem;
}

/* ============================================================
   Navbar
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.2s;
}

.nav.scrolled {
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.nav__logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}

.nav__logo-icon { flex-shrink: 0; }

/* Mobile: menu hidden by default */
.nav__menu {
  display: none;
}

.nav__links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.nav__links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.15s;
}

.nav__links a:hover,
.nav__links a:focus-visible { color: var(--text); }

@media (min-width: 1024px) {
  .nav__links a.active { color: var(--red); font-weight: 600; }
}

/* Hamburger button */
.nav__toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.375rem;
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-radius: 4px;
}

.nav__toggle:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

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

/* Mobile open state */
@media (max-width: 1023px) {
  .nav.open .nav__menu {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    position: absolute;
    top: 4rem;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem;
    box-shadow: var(--shadow-md);
    z-index: 99;
  }

  .nav.open .nav__cta {
    display: flex;
    width: 100%;
    margin-top: 0.5rem;
  }

  .nav.open .nav__toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav.open .nav__toggle span:nth-child(2) {
    opacity: 0;
  }
  .nav.open .nav__toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

/* Desktop nav */
@media (min-width: 1024px) {
  .nav__menu {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2rem;
    flex: 1;
    padding-left: 2.5rem;
  }

  .nav__links {
    flex-direction: row;
    gap: 1.75rem;
    align-items: center;
  }

  .nav__cta {
    margin-left: auto;
  }

  .nav__toggle {
    display: none;
  }
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--bg);
  padding: 5rem 0 4.5rem;
  text-align: center;
}

.hero__pattern {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><line x1='100' y1='22' x2='44' y2='98' stroke='%23DC2626' stroke-opacity='.07' stroke-width='1.5'/><line x1='100' y1='22' x2='156' y2='98' stroke='%23DC2626' stroke-opacity='.07' stroke-width='1.5'/><line x1='44' y1='98' x2='72' y2='170' stroke='%23DC2626' stroke-opacity='.07' stroke-width='1.5'/><line x1='44' y1='98' x2='128' y2='170' stroke='%23DC2626' stroke-opacity='.07' stroke-width='1.5'/><line x1='156' y1='98' x2='128' y2='170' stroke='%23DC2626' stroke-opacity='.07' stroke-width='1.5'/><circle cx='100' cy='22' r='4' fill='%23DC2626' fill-opacity='.12'/><circle cx='44' cy='98' r='4' fill='%23DC2626' fill-opacity='.12'/><circle cx='156' cy='98' r='4' fill='%23DC2626' fill-opacity='.12'/><circle cx='72' cy='170' r='4' fill='%23DC2626' fill-opacity='.12'/><circle cx='128' cy='170' r='4' fill='%23DC2626' fill-opacity='.12'/></svg>");
  background-repeat: repeat;
  background-size: 200px 200px;
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 780px;
}

.hero__headline {
  font-size: clamp(2rem, 5.5vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.hero__sub {
  margin-top: 1.375rem;
  font-size: clamp(1rem, 2vw, 1.1875rem);
  color: var(--text-muted);
  max-width: 620px;
  margin-inline: auto;
  line-height: 1.7;
}

.hero__actions {
  margin-top: 2.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: center;
}

.hero__link {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.hero__link:hover { color: var(--text); }

/* ============================================================
   Features
   ============================================================ */
.features {
  padding: 5rem 0;
}

.features__grid {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 3rem;
}

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

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

.feature-card {
  background: var(--muted-bg);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.75rem;
  transition: box-shadow 0.15s, transform 0.15s;
}

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

.feature-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(220,38,38,.09);
  border-radius: 0.5rem;
  color: var(--red);
}

.feature-card__icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.feature-card h3 {
  margin-top: 1rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.feature-card p {
  margin-top: 0.375rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ============================================================
   How it works
   ============================================================ */
.how-it-works {
  background: var(--muted-bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 5rem 0;
}

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 3rem;
}

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

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

.step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.step__number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--red);
  opacity: 0.2;
  flex-shrink: 0;
  line-height: 1;
  letter-spacing: -0.05em;
  min-width: 2.5rem;
}

.step h3 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.step p {
  margin-top: 0.3125rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ============================================================
   Waitlist
   ============================================================ */
.waitlist {
  padding: 5rem 0;
  background: var(--bg);
}

.waitlist__inner {
  max-width: 560px;
  text-align: center;
}

.waitlist h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.waitlist > .waitlist__inner > p {
  margin-top: 0.625rem;
  color: var(--text-muted);
  font-size: 1rem;
}

.waitlist__form {
  margin-top: 2rem;
}

.waitlist__field {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .waitlist__field {
    flex-direction: row;
  }
  .waitlist__field input[type="email"] {
    flex: 1;
  }
  .waitlist__field .btn {
    flex-shrink: 0;
  }
}

.waitlist__field input[type="email"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--muted-bg);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  outline: none;
}

.waitlist__field input[type="email"]::placeholder { color: var(--text-muted); }

.waitlist__field input[type="email"]:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(220,38,38,.15);
  background: var(--bg);
}

.waitlist__field input[type="email"].is-invalid {
  border-color: var(--red);
}

.waitlist__feedback {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  min-height: 1.25em;
  text-align: left;
}

.waitlist__feedback.is-error   { color: var(--red); }
.waitlist__feedback.is-success { color: #15803d; }

.waitlist__success {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  color: #15803d;
  font-weight: 600;
  font-size: 0.9375rem;
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  background: var(--muted-bg);
  border-top: 1px solid var(--border);
  padding: 3rem 0 1.5rem;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: flex-start;
}

@media (min-width: 640px) {
  .footer__inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}

.footer__logo {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
}

.footer__brand p {
  margin-top: 0.3125rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer__links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem 1.25rem;
  align-items: center;
}

.footer__links a {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

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

.footer__copy {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ============================================================
   Back to top
   ============================================================ */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--text);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(0.75rem);
  transition: opacity 0.2s, transform 0.2s, background 0.15s;
  pointer-events: none;
  z-index: 90;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover { background: var(--red); }

.back-to-top:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(220,38,38,.35);
}
