/* ============================================================
   BroadTrack marketing site — design system (spec §5)
   Light only. System font stack. One accent colour.
   ============================================================ */

:root {
  color-scheme: light;

  /* Ground */
  --bg:            #ffffff;
  --bg-subtle:     #f7f9fb;
  --bg-inset:      #eef2f6;

  /* Ink */
  --text:          #16202c;
  --text-muted:    #57646f;
  --text-faint:    #7c8892;

  /* Brand */
  --brand:         #0b5fb0;
  --brand-deep:    #084684;
  --brand-tint:    #eaf2fb;

  /* Signals */
  --ok:            #1f7a45;
  --warn:          #9a6200;
  --alert:         #b3261e;

  /* Lines */
  --line:          #dde4ea;
  --line-strong:   #c2ccd6;

  --radius:        10px;
  --radius-lg:     16px;
  --shadow-sm:     0 1px 2px rgb(16 32 44 / .06), 0 1px 3px rgb(16 32 44 / .08);
  --shadow-md:     0 4px 12px rgb(16 32 44 / .08), 0 12px 32px rgb(16 32 44 / .06);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --t-hero:  clamp(2.25rem, 5vw, 3.75rem);
  --t-h2:    clamp(1.75rem, 3vw, 2.5rem);
  --t-h3:    1.25rem;
  --t-lead:  clamp(1.0625rem, 1.5vw, 1.25rem);
  --t-body:  1rem;
  --t-small: 0.875rem;

  --gutter:  24px;
  --maxw:    1120px;
  --section: clamp(64px, 8vw, 128px);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-deep); text-decoration: underline; }

h1, h2, h3 { color: var(--text); margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: var(--t-hero); line-height: 1.05; letter-spacing: -0.02em; }
h2 { font-size: var(--t-h2);  line-height: 1.15; letter-spacing: -0.01em; }
h3 { font-size: var(--t-h3);  line-height: 1.3; }

p { margin: 0 0 1rem; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap-narrow { max-width: 720px; }

.band { padding-block: var(--section); }
.band-subtle { background: var(--bg-subtle); }
.band-brand { background: var(--brand-tint); }

section > .wrap > h2 { max-width: 20ch; }
.section-intro { max-width: 65ch; color: var(--text-muted); margin-bottom: 2.5rem; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  background: var(--brand);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius);
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; text-decoration: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: var(--t-body);
  line-height: 1.2;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-deep); color: #fff; }
.btn-secondary {
  background: transparent;
  color: var(--brand);
  border-color: var(--line-strong);
}
.btn-secondary:hover { background: var(--brand-tint); color: var(--brand-deep); }
.btn-block { width: 100%; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgb(255 255 255 / .9);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 92px;
  gap: 16px;
}
.brand { display: inline-flex; align-items: center; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 76px; width: auto; }

.primary-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.primary-nav a { color: var(--text-muted); font-weight: 500; }
.primary-nav a:hover { color: var(--brand); text-decoration: none; }
.primary-nav .nav-cta { color: #fff; }
.primary-nav .nav-cta:hover { color: #fff; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  margin-inline: auto;
  background: var(--text);
  transition: transform .2s ease, opacity .2s ease;
}

/* ---------- Hero ---------- */
.hero { padding-block: clamp(48px, 7vw, 104px); }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: var(--t-small);
  font-weight: 600;
  color: var(--brand);
  margin-bottom: .75rem;
}
.hero .lead { max-width: 60ch; }
.lead { font-size: var(--t-lead); color: var(--text-muted); line-height: 1.55; }
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 1.75rem 0 1rem;
}
.reassurance { font-size: var(--t-small); color: var(--text-faint); margin: 0; }
.hero-visual .shot { width: 100%; }

/* ---------- Screenshots ---------- */
.shot {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  background: var(--bg);
}

/* ---------- Cards ---------- */
.cards { display: grid; gap: 24px; }
.cards-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.cards-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.cards-cap { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card p { color: var(--text-muted); margin-bottom: 0; }
.card h3 { margin-bottom: .5rem; }

.cap-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--brand-tint);
  color: var(--brand);
  margin-bottom: 14px;
}
.cap-icon svg { width: 24px; height: 24px; }

/* Give the 7th capability card room at the widest breakpoint. */
@media (min-width: 1000px) {
  .cards-cap { grid-template-columns: repeat(3, 1fr); }
  .cap-wide { grid-column: span 2; }
}

/* ---------- Product visuals ---------- */
.shots { display: grid; gap: clamp(32px, 5vw, 56px); margin-top: 2.5rem; }
.shot-fig { margin: 0; }
.shot-fig figcaption {
  margin-top: 14px;
  font-size: var(--t-lead);
  font-weight: 600;
  color: var(--text);
  max-width: 60ch;
}
@media (min-width: 860px) {
  .shots { grid-template-columns: 1fr 1fr; align-items: start; }
  .shot-fig:first-child { grid-column: 1 / -1; }
}

/* ---------- How it works ---------- */
.steps {
  list-style: none;
  padding: 0;
  margin: 2.5rem 0 0;
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  counter-reset: step;
}
.step {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 14px;
}
.step p { color: var(--text-muted); }
.footnote {
  margin-top: 14px;
  font-size: var(--t-small);
  color: var(--text-faint);
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

/* ---------- FAQ ---------- */
.faq { margin-top: 2rem; }
.faq details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  margin-bottom: 12px;
  overflow: hidden;
}
.faq summary {
  cursor: pointer;
  padding: 18px 20px;
  font-weight: 600;
  font-size: 1.0625rem;
  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.4rem;
  color: var(--brand);
  line-height: 1;
  flex: none;
}
.faq details[open] summary::after { content: "–"; }
.faq-body { padding: 0 20px 18px; }
.faq-body p { color: var(--text-muted); margin: 0; }

/* ---------- Demo form ---------- */
.demo-form {
  margin-top: 2rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 4vw, 36px);
  box-shadow: var(--shadow-sm);
}
.field { margin-bottom: 18px; }
.field > label { display: block; font-weight: 600; margin-bottom: 6px; }
.optional { font-weight: 400; color: var(--text-faint); }

.demo-form input[type="text"],
.demo-form input[type="email"],
.demo-form select,
.demo-form textarea {
  width: 100%;
  font: inherit;
  font-size: 16px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
}
.demo-form textarea { resize: vertical; min-height: 96px; }
.demo-form input:focus, .demo-form select:focus, .demo-form textarea:focus {
  border-color: var(--brand);
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}
.demo-form [aria-invalid="true"] { border-color: var(--alert); }

.field-check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 12px;
  align-items: start;
}
.field-check input { width: 20px; height: 20px; margin-top: 3px; }
.field-check label { font-weight: 400; color: var(--text-muted); }
.field-check .field-error { grid-column: 1 / -1; }

.field-error {
  color: var(--alert);
  font-size: var(--t-small);
  margin: 6px 0 0;
  min-height: 0;
}
.field-error:empty { margin: 0; }

.turnstile-slot { margin: 6px 0 18px; min-height: 0; }

.form-status { margin: 16px 0 0; font-weight: 600; }
.form-status.is-ok { color: var(--ok); }
.form-status.is-error { color: var(--alert); }

/* Honeypot — visually and semantically hidden but present in the DOM. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--text);
  color: #cdd6df;
  padding-block: clamp(48px, 6vw, 80px);
}
.site-footer a { color: #fff; }
.footer-inner { display: grid; gap: 24px; }
.footer-logo {
  height: 92px;
  width: auto;
}
.footer-brand p { color: #9aa7b2; max-width: 46ch; margin: 18px 0 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-meta p { margin: 0 0 4px; font-size: var(--t-small); color: #9aa7b2; }
.footer-meta a { color: #e6ecf1; }
.footer-powered { font-weight: 600; }
.disclaimer {
  font-size: var(--t-body);
  color: #9aa7b2;
  border-top: 1px solid #2a3744;
  padding-top: 20px;
  margin: 8px 0 0;
}
.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.copyright { font-size: var(--t-small); color: #7c8892; margin: 0; }

@media (min-width: 760px) {
  .footer-inner {
    grid-template-columns: 1.5fr 1fr 1fr;
    align-items: start;
  }
  .footer-brand { grid-column: 1; grid-row: 1; }
  .footer-links { grid-column: 2; grid-row: 1; flex-direction: column; gap: 12px; }
  .footer-meta  { grid-column: 3; grid-row: 1; text-align: right; }
  .disclaimer   { grid-column: 1 / -1; }
  .footer-bottom {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

/* ---------- Legal pages ---------- */
.legal { padding-block: clamp(48px, 6vw, 96px); }
.legal h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
.legal h2 { font-size: 1.4rem; margin-top: 2rem; }
.legal p, .legal li { color: var(--text-muted); max-width: 70ch; }
.legal ul { padding-left: 1.25rem; }
.legal .updated { color: var(--text-faint); font-size: var(--t-small); }
.legal a { text-decoration: underline; }
.back-link { display: inline-block; margin-bottom: 1.5rem; font-weight: 600; }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding-block: clamp(80px, 12vw, 160px); }
.notfound .code { font-size: 4rem; font-weight: 700; color: var(--brand); margin: 0; }

/* ---------- Motion (spec §5.5) ---------- */
.reveal {
  opacity: 1;
  transform: none;
}
.js .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .3s cubic-bezier(.2,.6,.2,1), transform .3s cubic-bezier(.2,.6,.2,1);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }

  .nav-toggle { display: flex; }
  .primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    padding: 8px 0;
    display: none;
  }
  .primary-nav.is-open { display: flex; }
  .primary-nav a {
    padding: 14px var(--gutter);
    border-top: 1px solid var(--line);
  }
  .primary-nav a:first-child { border-top: none; }
  .primary-nav .nav-cta {
    margin: 10px var(--gutter);
    border-radius: var(--radius);
    justify-content: center;
    display: inline-flex;
  }
}
