:root {
  --text: #334155;
  --text-h: #1e293b;
  --text-dim: #64748b;
  --bg: #f7f9fc;
  --surface: #ffffff;
  --border: #d9e2ef;
  --accent: #046bd2;
  --accent-dark: #1e40af;
  --accent-bg: rgba(4, 107, 210, 0.08);
  --accent-border: rgba(4, 107, 210, 0.35);
  --shadow: rgba(30, 41, 59, 0.08) 0 10px 30px -8px, rgba(30, 41, 59, 0.06) 0 2px 8px -2px;

  --sans: system-ui, "Segoe UI", Roboto, sans-serif;
  --heading: "Poppins", system-ui, "Segoe UI", Roboto, sans-serif;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #cbd5e1;
    --text-h: #f1f5f9;
    --text-dim: #94a3b8;
    --bg: #0f1720;
    --surface: #16212e;
    --border: #29394d;
    --accent: #4da3ff;
    --accent-dark: #7db8ff;
    --accent-bg: rgba(77, 163, 255, 0.12);
    --accent-border: rgba(77, 163, 255, 0.35);
    --shadow: rgba(0, 0, 0, 0.4) 0 10px 30px -8px, rgba(0, 0, 0, 0.3) 0 2px 8px -2px;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font: 17px/1.6 var(--sans);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  font-family: var(--heading);
  color: var(--text-h);
  line-height: 1.2;
  text-wrap: balance;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(2.1rem, 4.5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.2rem;
  font-weight: 600;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--accent);
}

.container {
  width: min(1120px, 100% - 48px);
  margin-inline: auto;
}

/* Header / nav */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-block: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--heading);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-h);
  text-decoration: none;
  margin-right: auto;
}

.brand svg {
  flex: 0 0 auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-nav a:not(.btn) {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}

.site-nav a:not(.btn):hover {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-h);
  cursor: pointer;
  padding: 4px;
}

@media (max-width: 760px) {
  .nav-toggle {
    display: inline-flex;
  }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px 20px;
  }
  .site-nav.open {
    display: flex;
  }
  .site-nav a:not(.btn) {
    padding: 10px 0;
    width: 100%;
  }
  .site-nav .btn {
    margin-top: 8px;
  }
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

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

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--accent) 60%, transparent);
}

.btn-primary:hover {
  box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--accent) 70%, transparent);
}

.btn-ghost {
  background: transparent;
  color: var(--text-h);
  border-color: var(--border);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-lg {
  padding: 11px 24px;
  font-size: 0.98rem;
}

/* Hero */

.hero {
  padding-block: clamp(56px, 9vw, 110px) clamp(48px, 7vw, 90px);
  background:
    radial-gradient(1200px 480px at 15% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg));
}

.hero .container {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}

.hero-text {
  display: grid;
  gap: 20px;
  max-width: 620px;
}

.hero-visual img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: block;
}

.hero-trust {
  font-size: 0.92rem;
  color: var(--text-dim);
  font-style: italic;
}

@media (max-width: 900px) {
  .hero .container {
    grid-template-columns: 1fr;
  }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.hero-lede {
  font-size: 1.15rem;
  color: var(--text-dim);
  max-width: 60ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 8px;
}

.hero-note {
  font-size: 0.88rem;
  color: var(--text-dim);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.hero-stat b {
  display: block;
  font-family: var(--heading);
  font-size: 1.5rem;
  color: var(--text-h);
}

.hero-stat span {
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* Phones: most ad traffic. Keep the headline short and the signup button
   on the first screen, and pin a signup bar to the bottom while scrolling. */

.mobile-cta {
  display: none;
}

@media (max-width: 760px) {
  .hero {
    padding-block: 28px 40px;
  }

  .hero h1 {
    font-size: 2rem;
    margin-bottom: 0;
  }

  .hero .h1-more {
    display: none;
  }

  .hero .eyebrow {
    font-size: 0.75rem;
    padding: 4px 12px;
  }

  /* Signup button straight after the headline, before the longer text. */
  .hero .hero-text {
    gap: 16px;
  }

  .hero .hero-actions {
    order: 3;
    margin-top: 0;
  }

  .hero .hero-actions .btn {
    width: 100%;
  }

  .hero .hero-note {
    order: 4;
  }

  .hero .hero-lede {
    order: 5;
    font-size: 1.05rem;
  }

  .hero .hero-trust,
  .hero .hero-stats {
    order: 6;
  }

  .mobile-cta:not([hidden]) {
    display: flex;
  }

  .mobile-cta {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -6px 20px -8px rgba(30, 41, 59, 0.25);
    text-align: center;
  }

  .mobile-cta span {
    font-size: 0.78rem;
    color: var(--text-dim);
  }

  /* Room so the pinned bar never covers the footer's last line - only on
     pages that have the bar. */
  body:has(.mobile-cta) {
    padding-bottom: 96px;
  }
}

/* Sections */

section {
  padding-block: clamp(48px, 6vw, 84px);
}

.section-head {
  max-width: 640px;
  margin-bottom: 40px;
}

.section-head p {
  color: var(--text-dim);
  font-size: 1.05rem;
}

.section-alt {
  background: var(--surface);
  border-block: 1px solid var(--border);
}

/* Feature grid */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px;
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent-bg);
  color: var(--accent);
  margin-bottom: 16px;
}

.feature-card p {
  color: var(--text-dim);
  margin: 0;
  font-size: 0.96rem;
}

/* Workflow */

.workflow {
  counter-reset: step;
  display: grid;
  gap: 18px;
}

.workflow-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 26px;
}

.workflow-step .step-num {
  counter-increment: step;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--heading);
  font-weight: 700;
  flex: 0 0 auto;
}

.workflow-step .step-num::before {
  content: counter(step);
}

.workflow-arrow {
  display: flex;
  justify-content: center;
  color: var(--text-dim);
}

/* Testimonial */

.testimonial {
  max-width: 720px;
  margin-inline: auto;
  text-align: center;
}

.testimonial-quote {
  font-family: var(--heading);
  font-size: clamp(1.2rem, 2.2vw, 1.5rem);
  font-weight: 500;
  color: var(--text-h);
  line-height: 1.5;
  margin-bottom: 18px;
}

.testimonial-person {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.testimonial-photo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.testimonial-attribution {
  color: var(--text-dim);
  font-size: 0.92rem;
  font-weight: 600;
  margin: 0;
}

/* Pricing */

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  align-items: stretch;
}

.price-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px;
}

.price-card.featured {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  position: relative;
}

.price-card.featured::before {
  content: "Most Popular";
  position: absolute;
  top: -13px;
  left: 30px;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 999px;
}

.price-amount {
  font-family: var(--heading);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--text-h);
}

.price-amount span {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-dim);
}

.price-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  font-size: 0.92rem;
  flex: 1;
}

.price-card li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.price-card li svg {
  flex: 0 0 auto;
  color: var(--accent);
  margin-top: 3px;
}

.pricing-note {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: 28px;
}

/* FAQ */

.faq {
  display: grid;
  gap: 10px;
  max-width: 760px;
}

.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px 20px;
}

.faq summary {
  cursor: pointer;
  padding: 16px 0;
  font-weight: 600;
  color: var(--text-h);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  font-size: 1.3rem;
  color: var(--accent);
  flex: 0 0 auto;
}

.faq details[open] summary::after {
  content: "\2212";
}

.faq p {
  color: var(--text-dim);
  padding-bottom: 18px;
  margin: 0;
}

/* CTA band */

.cta-band {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  color: #fff;
  border-radius: 20px;
  padding: clamp(36px, 6vw, 60px);
  text-align: center;
}

.cta-band h2,
.cta-band p {
  color: #fff;
}

.cta-band p {
  color: rgba(255, 255, 255, 0.85);
  max-width: 50ch;
  margin-inline: auto;
}

.cta-band .btn-primary {
  background: #fff;
  color: var(--accent-dark);
}

.cta-band .btn-ghost {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

.cta-band .btn-ghost:hover {
  border-color: #fff;
  color: #fff;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 40px;
  background: var(--surface);
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
}

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

.footer-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
}

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

.footer-meta {
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* Help page specific */

.help-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
  align-items: start;
}

.help-toc {
  position: sticky;
  top: 90px;
  display: grid;
  gap: 4px;
  font-size: 0.9rem;
}

.help-toc a {
  color: var(--text-dim);
  text-decoration: none;
  padding: 6px 0;
}

.help-toc a:hover {
  color: var(--accent);
}

.help-article {
  max-width: 760px;
}

.help-article h2 {
  scroll-margin-top: 90px;
  margin-top: 2.2em;
}

.help-article h2:first-child {
  margin-top: 0;
}

.help-article h3 {
  scroll-margin-top: 90px;
  margin-top: 1.6em;
}

.callout {
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  border-radius: 10px;
  padding: 16px 20px;
  font-size: 0.94rem;
  margin: 1.4em 0;
}

/* Comparison ("TracFlock vs X") pages */

.compare-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  margin: 1.4em 0;
  background: var(--surface);
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 520px;
}

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

.compare-table thead th {
  background: var(--accent-bg);
  color: var(--text-h);
  font-family: var(--heading);
  font-weight: 600;
}

.compare-table tbody th {
  font-weight: 600;
  color: var(--text-h);
  white-space: nowrap;
}

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

.compare-table .win {
  color: var(--accent-dark);
  font-weight: 700;
}

.compare-verdict {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin: 1.4em 0;
}

.compare-verdict > div {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.compare-verdict h3 {
  margin-top: 0;
}

.compare-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin: 1.4em 0 2em;
}

.compare-hub-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.compare-hub-card:hover {
  transform: translateY(-2px);
  box-shadow: rgba(30, 41, 59, 0.14) 0 14px 30px -10px;
}

.compare-hub-card h3 {
  margin: 0 0 6px;
  color: var(--accent-dark);
}

.compare-hub-card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.92rem;
}

.compare-disclaimer {
  font-size: 0.82rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 2.5em;
}

.video-showcase {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.video-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.video-card video {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  display: block;
  background: #000;
}

.video-card h3 {
  margin: 14px 0 6px;
}

.video-card p {
  color: var(--text-dim);
  font-size: 0.92rem;
  margin: 0;
}

@media (max-width: 800px) {
  .video-showcase {
    grid-template-columns: 1fr;
  }
}

.help-video {
  width: 100%;
  max-width: 640px;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  display: block;
  margin: 1.2em 0;
  box-shadow: var(--shadow);
  background: #000;
}

.callout strong {
  color: var(--accent-dark);
}

@media (max-width: 900px) {
  .help-layout {
    grid-template-columns: 1fr;
  }
  .help-toc {
    position: static;
    display: none;
  }
}
