/* Colors match the CarrierZoom app (src/constants/theme.ts) */
:root {
  --ink: #171119;
  --text-2: #6B7280;
  --muted: #9CA3AF;
  --border: #E5E7EB;
  --surface: #FFFFFF;
  --bg: #F9FAFB;
  --chip: #F3F4F6;
  --green: #27794A;   --green-tint: #E8F3EC;
  --amber: #B7791F;   --amber-tint: #FDF3E1;
  --blue: #3A4FC4;    --blue-tint: #EAEEFD;
  --purple: #6B3FC4;  --purple-tint: #F0EAFD;
  --orange: #B9471A;  --orange-tint: #FDEEE5;
  --red: #D92D20;

  /* Explore-tile gradients from the app home screen */
  --tile-blue: linear-gradient(135deg, #6E9CF7, #3A56D4);
  --tile-orange: linear-gradient(135deg, #F7A35C, #DD5A22);
  --tile-purple: linear-gradient(135deg, #A487F5, #6A44D8);
  --tile-green: linear-gradient(135deg, #4CC79D, #1C8A62);

  --radius: 16px;
  --radius-sm: 12px;
  --gutter: 16px;
  --max: 1120px;
  --shadow: 0 1px 2px rgb(23 17 25 / .04), 0 8px 24px rgb(23 17 25 / .06);
  --font: system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #F3F4F6;
    --text-2: #9CA3AF;
    --muted: #6B7280;
    --border: #2C2F36;
    --surface: #17181C;
    --bg: #0B0C0E;
    --chip: #24262C;
    --green: #4CB37A;   --green-tint: #15301F;
    --amber: #E3A743;   --amber-tint: #33270F;
    --blue: #8C9CF5;    --blue-tint: #1A1F3A;
    --purple: #B394F2;  --purple-tint: #251A3A;
    --orange: #F08A5D;  --orange-tint: #3A1F14;
    --red: #F2554A;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .3);
  }
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}

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

h1, h2, h3 { line-height: 1.12; margin: 0 0 .5em; letter-spacing: -.02em; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 6vw + .5rem, 4rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 3vw + .75rem, 2.6rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; }
p, li { text-wrap: pretty; }
p { margin: 0 0 1em; }

a { color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }

.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.container.narrow { max-width: 760px; }

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

.skip-link {
  position: absolute; left: 8px; top: -100px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 999px; font-weight: 700;
}
.skip-link:focus { top: 8px; }

/* Section label, like "NEAR YOU" / "FIND A CARRIER" in the app */
.eyebrow {
  display: block; margin-bottom: 16px;
  color: var(--text-2); font-weight: 700; text-transform: uppercase; letter-spacing: .12em; font-size: .85rem;
}

/* Buttons: black pills like "View Full Profile" */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px; border-radius: 999px;
  font-weight: 700; text-decoration: none; white-space: nowrap;
}
.btn-small { min-height: 40px; padding: 0 18px; font-size: .95rem; }
.btn-ink { background: var(--ink); color: var(--bg); }

.store-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 12px; }
.store-buttons.center { justify-content: center; }
.store-btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 56px; padding: 8px 22px 8px 18px;
  background: var(--ink); color: var(--bg); border-radius: 999px;
  text-decoration: none; font-weight: 700; font-size: 1.15rem; line-height: 1.1;
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; text-decoration: none; }
.nav-links { display: none; list-style: none; margin: 0; padding: 0; gap: 28px; }
.nav-links a { text-decoration: none; color: var(--text-2); font-weight: 600; }
.nav-links a:hover { color: var(--ink); }
@media (min-width: 760px) { .nav-links { display: flex; } }

/* Sections */
.section { padding-block: clamp(56px, 8vw, 96px); }
.section.alt { background: var(--surface); border-block: 1px solid var(--border); }
.section-lead { font-size: 1.15rem; color: var(--text-2); max-width: 60ch; margin-bottom: 40px; }
.lead { font-size: clamp(1.1rem, 1vw + .9rem, 1.3rem); color: var(--text-2); max-width: 36em; }

/* Hero */
.hero {
  padding-block: clamp(40px, 7vw, 88px);
  background:
    radial-gradient(700px 420px at 90% 10%, color-mix(in srgb, #6E9CF7 22%, transparent), transparent 70%),
    radial-gradient(600px 380px at 70% 95%, color-mix(in srgb, #4CC79D 16%, transparent), transparent 70%),
    var(--bg);
  overflow: hidden;
}
.hero-grid { display: grid; gap: 48px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.15fr .85fr; } }
.hero-note { color: var(--text-2); font-size: .95rem; }

/* Phone mockup, styled like the app's Compare / carrier screens */
.phone {
  justify-self: center;
  width: min(330px, 100%);
  padding: 10px;
  background: #111;
  border-radius: 46px;
  box-shadow: 0 30px 70px rgb(23 17 25 / .22), 0 0 0 1px rgb(0 0 0 / .1);
}
.phone-img { width: 100%; height: auto; border-radius: 37px; }
.hero .phone { width: min(300px, 100%); }

/* Problem cards */
.grid-3 { display: grid; gap: 16px; margin-top: 32px; }
@media (min-width: 760px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.card p { color: var(--text-2); margin: 0; }
.card-num {
  display: inline-grid; place-items: center; width: 40px; height: 40px; margin-bottom: 14px;
  border-radius: 12px; font-weight: 800; font-size: .95rem;
}
.grid-3 > :nth-child(1) .card-num { background: var(--orange-tint); color: var(--orange); }
.grid-3 > :nth-child(2) .card-num { background: var(--purple-tint); color: var(--purple); }
.grid-3 > :nth-child(3) .card-num { background: var(--blue-tint); color: var(--blue); }

/* Steps */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 32px 0 0; display: grid; gap: 16px; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { counter-increment: step; background: var(--bg); border-radius: var(--radius); padding: 24px; border: 1px solid var(--border); }
.steps li::before {
  content: counter(step);
  display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 14px;
  background: var(--ink); color: var(--bg); border-radius: 50%; font-weight: 800; font-size: 1.05rem;
}
.steps p { color: var(--text-2); margin: 0; }

/* Features: intro + carrier card mockup side by side */
.features-intro { display: grid; gap: 40px; align-items: center; margin-bottom: 48px; }
@media (min-width: 900px) { .features-intro { grid-template-columns: 1.1fr .9fr; } }
@media (min-width: 900px) { .features-intro.flip { grid-template-columns: .9fr 1.1fr; } .features-intro.flip .phone { order: -1; } }
.features-intro .extras { margin-top: 0; grid-template-columns: 1fr; }

/* Features */
.features { display: grid; gap: 16px; }
@media (min-width: 640px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .features { grid-template-columns: repeat(3, 1fr); } }
.feature { padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.feature p { color: var(--text-2); margin: 0; }
.icon {
  width: 48px; height: 48px; padding: 11px; margin-bottom: 16px;
  color: #fff; border-radius: 14px;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.icon.i-blue { background: var(--blue-tint); color: var(--blue); }
.icon.i-orange { background: var(--orange-tint); color: var(--orange); }
.icon.i-green { background: var(--green-tint); color: var(--green); }
.icon.i-purple { background: var(--purple-tint); color: var(--purple); }
.grid-h { font-size: clamp(1.4rem, 2vw + .75rem, 1.9rem); margin: 8px 0 24px; }
.extras { margin: 32px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
@media (min-width: 760px) { .extras { grid-template-columns: repeat(2, 1fr); } }
.extras li { padding-left: 22px; position: relative; color: var(--text-2); }
.extras li::before { content: ""; position: absolute; left: 0; top: .6em; width: 8px; height: 8px; background: var(--muted); border-radius: 50%; }
.extras b { color: var(--ink); }

/* Numbers: two big plain numbers */
.numbers { padding-block: 24px 8px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin: 0; }
.stats div { display: flex; flex-direction: column-reverse; justify-content: flex-start; border-top: 1px solid var(--border); padding-top: 20px; }
.stats dd { margin: 0; font-size: clamp(2.6rem, 6vw + 1rem, 5rem); font-weight: 800; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.stats dt { color: var(--text-2); font-weight: 600; font-size: 1.1rem; margin-top: 8px; }

/* Who */
.who { display: grid; gap: 16px; margin-top: 32px; }
@media (min-width: 640px) { .who { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .who { grid-template-columns: repeat(5, 1fr); } }
.who article { border-top: 1px solid var(--border); padding-top: 16px; }
.who p { color: var(--text-2); margin: 0; }

/* FAQ */
.faq { margin-top: 24px; }
.faq details { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; }
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 56px 18px 20px; font-weight: 700; font-size: 1.1rem; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 16px; top: 50%; translate: 0 -50%;
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--chip); font-size: 1.25rem; font-weight: 500; line-height: 1;
}
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 20px 18px; margin: 0; color: var(--text-2); }

/* CTA: ink panel */
.cta .container {
  max-width: calc(var(--max) - 2 * var(--gutter));
  background: var(--ink); color: var(--bg);
  border-radius: 28px; padding: clamp(40px, 6vw, 72px) 24px;
  text-align: center;
}
.cta .lead { margin-inline: auto; color: color-mix(in srgb, var(--bg) 75%, transparent); }
.cta .store-btn { background: var(--bg); color: var(--ink); }
.signup { max-width: 520px; margin: 40px auto 0; padding-top: 32px; border-top: 1px solid color-mix(in srgb, var(--bg) 22%, transparent); text-align: left; }
.signup h3 { text-align: center; margin-bottom: 16px; }
.signup-fields { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .signup-fields { grid-template-columns: 1fr; } }
.signup input[type="text"], .signup input[type="email"] {
  width: 100%; min-height: 48px; padding: 0 16px; border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 5%, var(--ink)); color: var(--bg);
  border: 1px solid color-mix(in srgb, var(--bg) 26%, transparent); font: inherit;
}
.signup input::placeholder { color: color-mix(in srgb, var(--bg) 62%, transparent); opacity: 1; }
.signup :focus-visible { outline: 2px solid var(--bg); outline-offset: 2px; }
.signup .consent { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0; color: color-mix(in srgb, var(--bg) 75%, transparent); font-size: .9rem; cursor: pointer; }
.signup .consent a { color: var(--bg); text-decoration: underline; }
.signup .consent input {
  appearance: none; -webkit-appearance: none; display: grid; place-items: center;
  width: 20px; height: 20px; margin: 1px 0 0; flex: none; cursor: pointer; border-radius: 6px;
  background: color-mix(in srgb, var(--bg) 5%, var(--ink));
  border: 1px solid color-mix(in srgb, var(--bg) 40%, transparent);
}
.signup .consent input:checked { background: var(--bg); border-color: var(--bg); }
.signup .consent input:checked::after { content: ""; width: 5px; height: 10px; margin-top: -2px; border: solid var(--ink); border-width: 0 2px 2px 0; rotate: 45deg; }
.signup .btn { width: 100%; border: 0; cursor: pointer; font: inherit; font-weight: 700; background: var(--bg); color: var(--ink); }
.signup .btn:disabled { opacity: .6; cursor: default; }
.signup .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.signup-msg { min-height: 1.5em; margin: 12px 0 0; text-align: center; font-size: .95rem; font-weight: 600; color: var(--bg); }
@media (max-width: 1151px) { .cta .container { width: calc(100% - 2 * var(--gutter)); } }

/* Footer */
.site-footer { background: var(--surface); color: var(--text-2); padding-block: 40px 24px; border-top: 1px solid var(--border); }
.footer-inner { display: grid; gap: 24px; }
@media (min-width: 760px) { .footer-inner { grid-template-columns: 1fr auto; align-items: start; } }
.site-footer .logo { color: var(--ink); margin-bottom: 12px; }
.data-note { font-size: .9rem; max-width: 60ch; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer-links a { color: var(--ink); font-weight: 600; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.copyright { font-size: .85rem; margin-top: 24px; }

/* Legal pages */
.legal { padding-block: 56px 80px; }
.legal h1 { font-size: clamp(2rem, 4vw + .5rem, 2.75rem); }
.legal h2 { font-size: 1.5rem; margin-top: 2em; }
.legal ul { padding-left: 1.25em; margin: 0 0 1em; }
.legal li { margin-bottom: .4em; }
.legal .updated { color: var(--text-2); }
.legal .table-wrap { overflow-x: auto; margin: 20px 0 1.25em; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.legal table { width: 100%; border-collapse: collapse; font-size: .95rem; line-height: 1.5; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.legal th { background: var(--chip); color: var(--text-2); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.legal th:first-child { width: 26%; }
.legal th:first-child:nth-last-child(2) { width: 42%; }
.legal th:nth-child(3) { width: 29%; }
.legal td { color: var(--text-2); }
.legal td:first-child { color: var(--ink); font-weight: 600; }
.legal tbody tr:last-child td { border-bottom: 0; }
@media (max-width: 640px) {
  .legal thead { display: none; }
  .legal table, .legal tbody, .legal tr, .legal td { display: block; }
  .legal tr { padding: 16px 18px; border-bottom: 1px solid var(--border); }
  .legal tbody tr:last-child { border-bottom: 0; }
  .legal td { padding: 0; border-bottom: 0; }
  .legal td:first-child { margin-bottom: 4px; }
  .legal td:nth-child(3) { margin-top: 8px; font-size: .85rem; }
  .legal td:nth-child(3)::before { content: "Source: "; color: var(--ink); font-weight: 600; }
}
.legal .notice { background: var(--amber-tint); color: var(--ink); border: 1px solid var(--amber); border-radius: var(--radius-sm); padding: 16px 20px; }

/* ---------- Motion ---------- */
:root {
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --dur-hover: 180ms;
  --dur-reveal: 600ms;
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes rise { from { opacity: 0; translate: 0 16px; } }
  @keyframes rise-phone { from { opacity: 0; translate: 0 48px; scale: .96; } }

  /* Hero entrance: copy, then phone */
  .hero-copy > * { animation: rise 600ms var(--ease-out) both; }
  .hero-copy > :nth-child(2) { animation-delay: 70ms; }
  .hero-copy > :nth-child(3) { animation-delay: 140ms; }
  .hero-copy > :nth-child(4) { animation-delay: 210ms; }
  .hero-copy > :nth-child(5) { animation-delay: 280ms; }
  .hero .phone { animation: rise-phone 900ms var(--ease-out) 200ms both; }

  /* Scroll reveal (classes added by main.js) */
  [data-reveal].reveal-ready > * {
    opacity: 0;
    translate: 0 20px;
    transition:
      opacity var(--dur-reveal) var(--ease-out) calc(var(--i, 0) * 70ms),
      translate var(--dur-reveal) var(--ease-out) calc(var(--i, 0) * 70ms),
      transform var(--dur-hover) var(--ease-out),
      box-shadow var(--dur-hover) var(--ease-out),
      border-color var(--dur-hover) var(--ease-out);
  }
  [data-reveal].reveal-ready.in > * { opacity: 1; translate: none; }

  /* FAQ answer fade */
  .faq details[open] p { animation: rise 350ms var(--ease-out); }
}

/* Hover lift: mouse only, motion allowed */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .btn, .store-btn, .card, .steps li, .feature {
    transition: transform var(--dur-hover) var(--ease-out), box-shadow var(--dur-hover) var(--ease-out),
      border-color var(--dur-hover) var(--ease-out), background-color var(--dur-hover) var(--ease-out);
  }
  .btn:hover, .store-btn:hover { transform: translateY(-2px); }
  a.btn:not([href]):hover, a.store-btn:not([href]):hover { transform: none; }
  .card:hover, .steps li:hover, .feature:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
  }
}

/* Crisp border + soft bottom shadow on cards (borrowed from the coss ui look) */
.card, .feature, .steps li, .faq details {
  box-shadow: 0 1px 0 rgb(23 17 25 / .03), 0 1px 3px rgb(23 17 25 / .05);
}
@media (prefers-color-scheme: dark) {
  .logo img { border-radius: 9px; box-shadow: 0 0 0 1px var(--border); }
}

/* Driver guides (/drivers/) */
.guide { padding-block: 40px 80px; }
.guide h1 { font-size: clamp(2rem, 4vw + .5rem, 2.75rem); }
.guide article h2 { font-size: 1.5rem; margin-top: 1.8em; }
.guide article ul, .guide article ol { padding-left: 1.25em; margin: 0 0 1em; }
.guide article li { margin-bottom: .4em; }
.guide .updated { color: var(--text-2); }
.breadcrumb { font-size: .9rem; color: var(--text-2); margin-bottom: 20px; }
.breadcrumb a { color: var(--text-2); }
.answer { background: var(--blue-tint); border-left: 4px solid var(--blue); border-radius: var(--radius-sm); padding: 18px 22px; margin: 24px 0 8px; font-size: 1.1rem; }
.answer p:last-child { margin: 0; }
.answer-label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--blue); margin-bottom: 6px; }
.guide-cta { background: var(--ink); color: var(--bg); border-radius: 24px; padding: 36px 24px; text-align: center; margin: 48px 0; }
.guide-cta h2 { margin-top: 0; }
.guide-cta p { color: color-mix(in srgb, var(--bg) 75%, transparent); }
.guide-cta .store-btn { background: var(--bg); color: var(--ink); }
.related ul { padding-left: 1.25em; }
.related li { margin-bottom: .5em; }
.guide-list { display: grid; gap: 16px; margin-top: 32px; }
@media (min-width: 760px) { .guide-list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .guide-list { grid-template-columns: repeat(3, 1fr); } }
.guide-card { display: block; text-decoration: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.guide-card h2 { font-size: 1.2rem; }
.guide-card p { color: var(--text-2); margin: 0; font-size: .97rem; }
.guide-card:hover { border-color: var(--ink); }
.guide-list + p { margin-top: 24px; font-weight: 700; }
.guide-card h3 { margin-bottom: .4em; }
.guide .table-wrap { overflow-x: auto; margin: 20px 0 1.25em; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.guide table { width: 100%; border-collapse: collapse; font-size: .95rem; line-height: 1.5; }
.guide th, .guide td { text-align: left; vertical-align: top; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.guide th { background: var(--chip); color: var(--text-2); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.guide td { color: var(--text-2); }
.guide td:first-child { color: var(--ink); font-weight: 600; }
.guide tbody tr:last-child td { border-bottom: 0; }
.guide-jump { list-style: none; padding: 0; margin: 28px 0 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.guide-jump a { display: inline-block; padding: 8px 16px; border-radius: 999px; background: var(--chip); text-decoration: none; font-weight: 600; font-size: .95rem; }
.guide-jump a:hover { background: var(--border); }
.guide-group { margin-top: 48px; scroll-margin-top: 80px; }
.guide-group h2 { font-size: clamp(1.4rem, 2vw + .75rem, 1.9rem); margin-bottom: .25em; }
.guide-group-lead { color: var(--text-2); margin: 0; }
.guide-group .guide-list { margin-top: 20px; }
