/* ==========================================================================
   Backseat Driver — landing page
   Mobile-first. Desktop breakpoints added upward at 640px and 900px.
   ========================================================================== */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('assets/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Surfaces */
  --bg:            #F7F3EA;
  --bg-alt:        #EDE7D9;
  --surface:       #FFFFFF;
  --line:          #E4DED2;
  --line-soft:     #EDE7D9;

  /* Ink — all verified at 4.5:1+ on --bg */
  --ink:           #1C2531;
  --ink-2:         #4A5265;
  --ink-3:         #5B6472;
  --muted:         #6F6759;

  /* Accents */
  --teal:          #356861;
  --teal-hover:    #2A544E;
  --sage:          #7BA88F;
  --sage-line:     #699680;
  --amber:         #E2A63B;

  /* Dark section */
  --dark:          #1C2531;
  --dark-surface:  #2A3543;
  --dark-line:     #3A4552;
  --on-dark:       #F7F3EA;
  --on-dark-2:     #B9C4CC;
  --on-dark-3:     #96A3AF;

  /* Notices */
  --ok-bg:         #EDF2EE;
  --ok-line:       #CFE0D6;
  --ok-ink:        #2E5C55;
  --note-bg:       #FBF3E2;
  --note-line:     #E8D6AC;

  --radius:        16px;
  --radius-lg:     24px;
  --maxw:          1160px;
}

/* --------------------------------------------------------------- Reset -- */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.01em; margin: 0; }
p { margin: 0; }
img, svg { max-width: 100%; }
svg { display: block; }

a {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:hover { color: var(--teal-hover); }

/* ------------------------------------------------------------- Utility -- */

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Honeypot — hidden from people, reachable by bots */
.hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

.skip-link {
  position: absolute;
  top: 0; left: 0;
  z-index: 100;
  transform: translateY(-120%);
  background: var(--ink);
  color: var(--on-dark);
  padding: 12px 20px;
  border-radius: 0 0 10px 0;
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus { transform: translateY(0); color: var(--on-dark); }

/* ---------------------------------------------------------------- Focus -- */

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
  border-radius: 4px;
}
.section--dark :focus-visible,
.skip-link:focus-visible {
  outline-color: var(--on-dark);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247, 243, 234, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  padding-top: 14px;
  padding-bottom: 14px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
.wordmark:hover { color: var(--ink); }
.wordmark svg { width: 26px; height: 26px; flex: none; }

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

.hero { padding: 40px 0 36px; }

.hero__grid { display: grid; gap: 36px; }

.hero h1 {
  font-size: clamp(31px, 8vw, 52px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.hero__sub {
  font-size: clamp(16px, 4.4vw, 19px);
  color: var(--ink-2);
  margin-bottom: 24px;
  max-width: 30em;
}

.hero__figure { margin: 0; max-width: 420px; }
.hero__card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: 0 24px 60px -20px rgba(28, 37, 49, 0.18);
}
.hero__figure figcaption {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  margin-top: 12px;
}

/* ----------------------------------------------------------------- Form -- */

.signup { max-width: 460px; }

.signup__row { display: grid; gap: 10px; }

.field {
  width: 100%;
  padding: 14px 16px;
  font: inherit;
  font-size: 16px; /* 16px stops iOS zooming on focus */
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid #8C8375;
  border-radius: 10px;
}
.field::placeholder { color: var(--muted); opacity: 1; }
.field[aria-invalid='true'] { border-color: var(--ink); border-width: 2px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 14px 22px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.btn:disabled { opacity: 0.75; cursor: default; }

.btn--primary { background: var(--teal); color: var(--on-dark); }
.btn--primary:hover:not(:disabled) { background: var(--teal-hover); }

.btn--sage { background: var(--sage); color: var(--ink); }
.btn--sage:hover:not(:disabled) { background: #6D9B82; }

.btn--outline {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid #8C8375;
}
.btn--outline:hover:not(:disabled) { background: var(--bg-alt); }

.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
}
.consent input {
  flex: none;
  width: 20px; height: 20px;
  margin: 2px 0 0;
  accent-color: var(--teal);
}

.form-note {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 12px;
}

.form-msg { margin-top: 14px; }
.form-msg:empty { margin-top: 0; }

/* Success: the fields go, the live region stays so it can announce */
.signup.is-done .signup__row,
.signup.is-done .consent,
.signup.is-done .form-note { display: none; }
.signup.is-done .form-msg { margin-top: 0; }

.msg {
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.5;
}
.msg--error {
  background: var(--note-bg);
  border: 1px solid var(--note-line);
  color: var(--ink);
}
.msg--ok {
  background: var(--ok-bg);
  border: 1px solid var(--ok-line);
  color: var(--ok-ink);
  font-weight: 600;
}

/* --------------------------------------------------------- Stat strip -- */

.stat {
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
}
.stat p {
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
  font-size: clamp(15px, 4vw, 17px);
  font-weight: 500;
  color: #5B5347;
}

/* -------------------------------------------------------------- Section -- */

.section { padding: 56px 0; }
.section__title {
  font-size: clamp(23px, 6vw, 32px);
  font-weight: 800;
  text-align: center;
}
.section__lede {
  text-align: center;
  color: var(--ink-3);
  font-size: 16px;
  margin-top: 8px;
}
.section__title + .grid,
.section__lede + .grid,
.section__title + .steps,
.section__lede + .steps,
.section__lede + .plans { margin-top: 32px; }

.grid { display: grid; gap: 16px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 22px 20px;
}
.card__quote {
  font-size: 17px;
  line-height: 1.55;
  font-style: italic;
}

/* ------------------------------------------------------- How it works -- */

.steps {
  display: grid;
  gap: 32px;
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: step;
}
.step { counter-increment: step; }
.step__label {
  font-size: 13px;
  font-weight: 700;
  color: var(--teal);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.step h3 {
  font-size: 19px;
  font-weight: 700;
  margin: 8px 0 14px;
}
.step__art {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 18px;
}
.step__art--dark { background: var(--dark); border-color: var(--dark); }
.step__note {
  font-size: 14px;
  color: var(--muted);
  margin-top: 12px;
}

/* -------------------------------------------------------------- Pricing -- */

.plans {
  display: grid;
  gap: 20px;
  justify-content: center;
}

.plan {
  position: relative;
  background: var(--surface);
  border: 2px solid var(--line-soft);
  border-radius: 18px;
  padding: 28px 24px;
}
.plan__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.plan__price {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.plan__price span {
  font-size: 16px;
  font-weight: 500;
  color: var(--muted);
}
.plan__meta {
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 20px;
}
.plan__meta:empty { margin-bottom: 12px; }
.plan .btn { width: 100%; }

.plan--featured {
  background: var(--dark);
  border-color: var(--dark);
  box-shadow: 0 24px 56px -20px rgba(28, 37, 49, 0.35);
}
.plan--featured .plan__name { color: var(--on-dark-2); }
.plan--featured .plan__price { color: var(--on-dark); }
.plan--featured .plan__price span,
.plan--featured .plan__meta { color: var(--on-dark-3); }
.plan--featured :focus-visible { outline-color: var(--on-dark); }

.plan__badge {
  position: absolute;
  top: -13px;
  right: 24px;
  background: var(--amber);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 5px 12px;
  border-radius: 20px;
}

.plans__note {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  margin-top: 24px;
}

/* ------------------------------------------------------------ Final CTA -- */

.section--dark {
  background: var(--dark);
  color: var(--on-dark);
  padding: 60px 0;
}
.section--dark .section__title { color: var(--on-dark); }
.cta__inner { max-width: 520px; margin: 0 auto; text-align: center; }
.cta__line {
  font-size: 16px;
  font-style: italic;
  color: var(--on-dark-2);
  margin-top: 14px;
}
.section--dark .signup { margin: 26px auto 0; }
.section--dark .field {
  background: var(--dark-surface);
  border-color: #78869D;
  color: var(--on-dark);
}
.section--dark .field::placeholder { color: var(--on-dark-3); }
.section--dark .field[aria-invalid='true'] { border-color: var(--on-dark); }
.section--dark .consent { color: var(--on-dark-2); text-align: left; }
.section--dark .form-note { color: var(--on-dark-3); }
.section--dark a { color: var(--on-dark-2); }
.section--dark a:hover { color: var(--on-dark); }
.section--dark .msg--ok {
  background: var(--dark-surface);
  border-color: var(--dark-line);
  color: var(--sage);
}
.section--dark .msg--error {
  background: var(--dark-surface);
  border-color: var(--amber);
  color: var(--on-dark);
}

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

.site-footer {
  border-top: 1px solid var(--line);
  padding: 26px 0;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.site-footer p { font-size: 13.5px; color: var(--muted); }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--ink); }

/* ------------------------------------------------------- Privacy page -- */

.prose { max-width: 68ch; padding: 40px 0 64px; }
.prose h1 { font-size: clamp(28px, 7vw, 38px); font-weight: 800; }
.prose h2 {
  font-size: clamp(19px, 5vw, 22px);
  font-weight: 700;
  margin-top: 34px;
}
.prose p, .prose ul { margin-top: 14px; color: var(--ink-2); }
.prose ul { padding-left: 22px; }
.prose li { margin-top: 7px; }
.prose .updated { font-size: 14px; color: var(--muted); margin-top: 10px; }

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

.notfound { text-align: center; padding: 40px 0 64px; }

.notfound__figure { margin: 0 auto 30px; max-width: 300px; }

.notfound__label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
.notfound h1 {
  font-size: clamp(28px, 7vw, 40px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: 10px;
}
.notfound__body {
  color: var(--ink-2);
  font-size: clamp(16px, 4.2vw, 18px);
  max-width: 36em;
  margin: 16px auto 0;
}

.notfound__actions { margin-top: 28px; }
/* The button is an anchor here, so the global link colour and underline
   both need overriding — including on hover. */
.notfound__actions .btn,
.notfound__actions .btn:hover {
  text-decoration: none;
  color: var(--on-dark);
}

/* ---------------------------------------------------------- Breakpoints -- */

@media (min-width: 560px) {
  .signup__row { grid-template-columns: 1fr auto; }
  .btn--submit { width: auto; }
}

@media (min-width: 640px) {
  .wrap { padding: 0 24px; }
  .hero { padding: 52px 0 44px; }
  .section { padding: 68px 0; }
  .grid { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }
  .card { padding: 26px 24px; }
  .plans { grid-template-columns: repeat(2, minmax(0, 280px)); }
  /* side by side, so the price rows need to line up */
  .plan__meta, .plan__meta:empty { min-height: 20px; margin-bottom: 20px; }
}

@media (min-width: 900px) {
  body { font-size: 17px; }
  .hero { padding: 64px 0 52px; }
  .hero__grid {
    grid-template-columns: 1fr minmax(320px, 420px);
    align-items: center;
    gap: 56px;
  }
  .hero__figure { margin: 0 0 0 auto; }
  .steps { grid-template-columns: repeat(3, 1fr); gap: 28px; }
  .section--dark { padding: 76px 0; }
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
