/* ============================================================
   Trim Match — Landing Page (sell overhaul)
   Design: web/docs/LANDING-OVERHAUL-DESIGN.md
   Brand tokens: web/app/assets/brand-palette.md
   ============================================================ */

:root {
  /* Brand colors */
  --mazda-red: #910a2a;
  --mazda-red-hover: #b0123a;
  --mazda-red-light: #f9e6ea;
  --mazda-navy: #1a2332;
  --mazda-navy-hover: #2a3448;
  --mazda-navy-light: #e8eaed;

  /* Neutral palette (light theme — no large pure white) */
  --bg-page: #f4f5f7;
  --bg-card: #fafbfc;
  --bg-card-elevated: #f7f8fa;
  --bg-chip: #e8eaed;
  --bg-chip-on-navy: rgba(255, 255, 255, 0.12);
  --border: #e0e2e6;
  --border-light: #f0f1f3;
  --border-strong: #c8cbd0;
  --text-primary: #1a1a2e;
  --text-secondary: #3d4048; /* outdoor ≥7:1 on page/card — D21 */
  --text-dim: #5a5d65; /* micro only; not body secondary */
  --text-white: #ffffff;
  --text-on-dark: #ffffff;
  --text-on-dark-secondary: rgba(255, 255, 255, 0.88);
  --text-on-dark-muted: rgba(255, 255, 255, 0.72);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);

  /* Type scale (marketing outdoor — D11) */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --text-body: 18px;
  --text-body-lg: 20px;
  --text-button: 18px;
  --text-h1-mobile: 36px;
  --text-h1-desktop: 48px;
  --text-h2-mobile: 28px;
  --text-h2-desktop: 34px;
  --text-h3: 20px;
  --leading-body: 1.6;

  /* Outcome motifs */
  --motif-added-bg: #e8f5e9;
  --motif-added-text: #1b5e20;
  --motif-quote: #910a2a;
  --motif-share: #1a2332;

  /* Radii */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Spacing */
  --gap-sm: 8px;
  --gap-md: 16px;
  --section-x: 20px;
  --section-y-mobile: 56px;
  --section-y-desktop: 80px;

  /* Layout */
  --max-width: 1120px;
  --tap-target: 48px;
}

/* ---------- Reset & base ---------- */

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

a:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--mazda-red);
  outline-offset: 2px;
}

h1,
h2,
h3 {
  margin: 0 0 var(--gap-md);
  font-weight: 700;
  line-height: 1.2;
}

p {
  margin: 0 0 var(--gap-md);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-sm);
  min-height: var(--tap-target);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: var(--text-button);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
  border: none;
}

.btn-primary {
  background: var(--mazda-red);
  color: var(--text-white);
}

.btn-primary:hover {
  background: var(--mazda-red-hover);
  color: var(--text-white);
}

.btn-primary:active {
  transform: translateY(1px);
}

/* ---------- Sticky nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--mazda-navy);
  box-shadow: var(--shadow-md);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--section-x);
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-md);
}

.nav-logo {
  display: flex;
  align-items: center;
  min-height: var(--tap-target);
}

.nav-logo img {
  height: 32px;
  width: auto;
}

.nav .btn {
  min-height: var(--tap-target);
  padding: 10px 20px;
  font-size: var(--text-button);
}

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

.hero {
  background: var(--mazda-navy);
  color: var(--text-on-dark);
  padding: 40px var(--section-x) 48px;
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  gap: 28px;
  align-items: center;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--mazda-red-light);
  margin-bottom: var(--gap-sm);
}

.hero h1 {
  font-size: var(--text-h1-mobile);
  margin-bottom: var(--gap-md);
  letter-spacing: -0.02em;
}

.hero-sub {
  font-size: 19px;
  font-weight: 500;
  color: var(--text-on-dark-secondary);
  max-width: 40ch;
  margin-bottom: 16px;
}

.hero-sub strong {
  color: var(--text-on-dark);
  font-weight: 700;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.proof-chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  background: var(--bg-chip-on-navy);
  color: var(--text-on-dark);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.proof-chip--light {
  background: var(--bg-chip);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--gap-md);
}

.hero-microcopy {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-on-dark-muted);
}

.hero-img {
  display: flex;
  justify-content: center;
}

.hero-img img {
  max-width: 320px;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

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

.section {
  padding: var(--section-y-mobile) var(--section-x);
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--mazda-red);
  margin: 0 0 var(--gap-sm);
}

.section h2 {
  font-size: var(--text-h2-mobile);
}

.section-lead {
  color: var(--text-secondary);
  max-width: 60ch;
  margin-bottom: 32px;
  font-size: 19px;
}

/* ---------- Proof strip ---------- */

.proof-strip {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 20px var(--section-x);
}

.proof-strip .section-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.proof-strip-line {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Hide non-duplicate chips on mobile — hero already has Free/No account/Offline */
.proof-strip-chips {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Problem + Thumb-Stop ---------- */

.problem {
  background: var(--bg-page);
}

.problem-body,
.problem-stakes {
  color: var(--text-secondary);
  max-width: 68ch;
  font-size: var(--text-body);
}

.problem-stakes {
  margin-bottom: 32px;
}

.problem-stakes strong {
  color: var(--text-primary);
}

.thumb-stop-split {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}

.thumb-stop-fog,
.thumb-stop-answer {
  margin: 0;
  text-align: center;
}

.fog-stack {
  position: relative;
  height: 200px;
  width: 100%;
  max-width: 280px;
  margin: 0 auto 12px;
}

.fog-page {
  position: absolute;
  inset: 0;
  border: 2px solid var(--border-strong);
  background: var(--mazda-navy-light);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.fog-page--1 {
  transform: rotate(-6deg);
  opacity: 0.55;
  top: 8px;
  left: 0;
}

.fog-page--2 {
  transform: rotate(-2deg);
  opacity: 0.7;
  top: 4px;
  left: 8px;
}

.fog-page--3 {
  transform: rotate(3deg);
  opacity: 0.85;
  top: 0;
  left: 16px;
}

.fog-page--4 {
  transform: rotate(1deg);
  opacity: 1;
  top: 12px;
  left: 10px;
  background:
    repeating-linear-gradient(
      180deg,
      #e8eaed 0,
      #e8eaed 10px,
      #d5d8dd 10px,
      #d5d8dd 12px
    );
}

.thumb-stop-answer img {
  max-width: 300px;
  width: 100%;
  margin: 0 auto 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.thumb-stop-caption {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0;
}

.thumb-stop-rule {
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--mazda-navy);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.thumb-stop-rule span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: var(--bg-card);
}

/* ---------- Outcomes ---------- */

.features {
  background: var(--bg-page);
}

.features-grid {
  display: grid;
  gap: var(--gap-md);
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-sm);
}

.feature-motif {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  margin-bottom: var(--gap-md);
}

.motif-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.motif-added {
  background: var(--motif-added-bg);
  color: var(--motif-added-text);
}

.motif-upgraded {
  background: var(--mazda-navy-light);
  color: var(--mazda-navy);
}

.motif-quote {
  font-size: 48px;
  line-height: 0.8;
  color: var(--motif-quote);
  font-weight: 700;
  font-family: Georgia, 'Times New Roman', serif;
  min-height: 48px;
  align-items: flex-start;
}

.motif-share-well {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  background: var(--mazda-navy-light);
  color: var(--motif-share);
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-card h3 {
  font-size: var(--text-h3);
  margin-bottom: var(--gap-sm);
}

.feature-card p {
  color: var(--text-secondary);
  font-size: var(--text-body);
  margin-bottom: 0;
}

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

.how {
  background: var(--bg-card);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.steps-grid {
  display: grid;
  gap: 32px;
}

.step {
  text-align: center;
}

.step-number {
  display: inline-block;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--mazda-navy);
  margin-bottom: var(--gap-md);
}

.step--emphasis .step-number {
  color: var(--mazda-red);
}

.step img {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  margin: 0 auto var(--gap-md);
  max-width: 320px;
}

.step h3 {
  font-size: 18px;
  margin-bottom: var(--gap-sm);
}

.step p {
  color: var(--text-secondary);
  font-size: var(--text-body);
  max-width: 34ch;
  margin: 0 auto;
}

/* ---------- Compare + For / Not for ---------- */

.compare {
  background: var(--bg-page);
}

.compare-table-wrap {
  overflow-x: auto;
  margin: 28px 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-body);
  min-width: 560px;
}

.compare-table th,
.compare-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}

.compare-table th {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  background: var(--bg-card-elevated);
}

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

.compare-table .compare-win {
  background: rgba(26, 35, 50, 0.04);
  font-weight: 600;
  color: var(--text-primary);
}

.compare-table th.compare-win {
  color: var(--mazda-navy);
  background: var(--mazda-navy-light);
}

.compare-footer {
  color: var(--text-secondary);
  max-width: 60ch;
  margin-bottom: 32px;
}

.for-grid {
  display: grid;
  gap: var(--gap-md);
  margin-bottom: 20px;
}

.for-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.for-card h3 {
  font-size: 18px;
  margin-bottom: 12px;
  color: var(--motif-added-text);
}

.for-card--not h3 {
  color: var(--mazda-red);
}

.for-card ul {
  margin: 0;
  padding-left: 1.2em;
  color: var(--text-secondary);
}

.for-card li {
  margin-bottom: 8px;
}

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

.honesty-line {
  margin: 0;
  font-size: 16px;
  color: var(--text-secondary);
  font-style: italic;
  max-width: 60ch;
}

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

.final-cta {
  background: var(--mazda-navy);
  color: var(--text-on-dark);
  text-align: center;
}

.final-cta h2 {
  font-size: var(--text-h2-mobile);
}

.final-cta p {
  color: var(--text-on-dark-secondary);
  max-width: 48ch;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 24px;
  font-size: 19px;
}

.final-cta .hero-microcopy {
  margin-top: var(--gap-md);
}

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

.footer {
  background: var(--mazda-navy);
  border-top: 1px solid var(--mazda-navy-hover);
  color: var(--text-on-dark-muted);
  padding: 28px var(--section-x);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--gap-md);
  font-size: 15px;
}

.footer-meta {
  max-width: 56ch;
}

.footer-legal {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.55);
}

.footer a {
  color: rgba(255, 255, 255, 0.9);
  min-height: var(--tap-target);
  display: inline-flex;
  align-items: center;
  font-weight: 600;
}

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

.footer a:focus-visible {
  outline-color: #fff;
}

.footer-links {
  display: flex;
  gap: var(--gap-md);
}

/* ---------- Responsive ---------- */

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

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

  .for-grid {
    grid-template-columns: 1fr 1fr;
  }

  .proof-strip-chips {
    display: flex;
  }
}

@media (min-width: 900px) {
  .hero {
    padding: 64px var(--section-x) 72px;
  }

  .hero-inner {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 40px;
  }

  .hero h1 {
    font-size: var(--text-h1-desktop);
  }

  .hero-img {
    justify-content: flex-end;
  }

  .section {
    padding: var(--section-y-desktop) var(--section-x);
  }

  .section h2,
  .final-cta h2 {
    font-size: var(--text-h2-desktop);
  }

  .fog-stack {
    height: 240px;
  }

  .thumb-stop-split {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 24px;
    align-items: center;
  }

  .thumb-stop-rule {
    display: flex;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn,
  .btn-primary:active {
    transition: none;
    transform: none;
  }
}
