/* ==========================================================================
   BuilderIQ — public site
   Design tokens up top; tweak these first when iterating on the look.
   ========================================================================== */

:root {
  /* Palette — warm neutrals + one accent */
  --bg: #faf9f5;
  --bg-alt: #f0eee6;
  --surface: #ffffff;
  --ink: #141413;
  --ink-soft: #3d3d3a;
  --muted: #6b6a63;
  --line: #e3e0d6;
  --accent: #c8623d;        /* brick / terracotta */
  --accent-ink: #ffffff;
  --accent-soft: #f4e3da;
  --dark: #1f1e1b;
  --dark-ink: #f0eee6;
  --dark-muted: #a3a097;

  /* Type */
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Layout */
  --max: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 14px;
  --radius-sm: 8px;
}

*, *::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: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.12;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.9rem, 4vw, 3rem); }
h3 { font-size: 1.45rem; }

p { margin: 0 0 1em; }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

.lede {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: var(--ink-soft);
  max-width: 40rem;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  cursor: pointer;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: #33322e; }
.btn-secondary { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-secondary:hover { background: var(--ink); color: var(--bg); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { filter: brightness(0.93); }

.link-arrow {
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}
.link-arrow::after { content: " \2192"; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled { border-bottom-color: var(--line); }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  text-decoration: none;
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a[aria-current="page"] { font-weight: 500; }
.nav-links .btn-primary, .nav-links .btn-primary:hover { color: var(--bg); }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 8px;
  cursor: pointer;
  color: var(--ink);
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.5rem var(--gutter) 1.5rem;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 0.8rem 0; font-size: 1.05rem; }
  .nav-links .btn { margin-top: 0.75rem; }
}

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

section { padding: clamp(64px, 10vw, 120px) 0; }
.section-alt { background: var(--bg-alt); }
.section-tight { padding: clamp(48px, 7vw, 80px) 0; }

.section-head { max-width: 46rem; margin-bottom: clamp(2rem, 5vw, 3.5rem); }

.hero { padding-top: clamp(56px, 10vw, 128px); }
.hero h1 { max-width: 18ch; }
.hero .lede { margin-top: 1.5rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.25rem; }

/* ---------- Cards / grids ---------- */

.grid {
  display: grid;
  gap: 1.25rem;
}
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2.25rem);
}
.card p { color: var(--ink-soft); }
.card p:last-child { margin-bottom: 0; }

.product-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.product-card:hover { border-color: var(--ink); transform: translateY(-2px); }
.product-card h3 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-top: 1.25rem; }
.product-card ul { margin: 0.5rem 0 1.75rem; }
.product-card .link-arrow { margin-top: auto; align-self: flex-start; }

.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}
.tag-neutral { background: var(--bg-alt); color: var(--muted); }

.icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  margin-bottom: 1.25rem;
}
.icon svg { width: 22px; height: 22px; }

.check-list { list-style: none; padding: 0; }
.check-list li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.6rem;
  color: var(--ink-soft);
}
.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.85;
}

/* ---------- Split / feature rows ---------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.feature-list { display: grid; gap: 0; }
.feature {
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
}
.feature:last-child { border-bottom: 1px solid var(--line); }
.feature h3 { font-family: var(--font-sans); font-size: 1.1rem; font-weight: 600; letter-spacing: 0; margin-bottom: 0.35rem; }
.feature p { color: var(--ink-soft); margin: 0; }

/* ---------- Steps ---------- */

.steps { counter-reset: step; }
.step { position: relative; padding-top: 3.25rem; }
.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute;
  top: 0;
  left: 0;
  font-family: var(--font-serif);
  font-size: 1.9rem;
  color: var(--accent);
}
.step h3 { font-size: 1.3rem; }
.step p { color: var(--ink-soft); }

/* ---------- Pull quote / statement ---------- */

.statement {
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 3.6vw, 2.6rem);
  line-height: 1.25;
  max-width: 28ch;
  margin: 0;
}

/* ---------- Product UI mock ---------- */

.mock {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02), 0 20px 40px -24px rgba(20,20,19,0.18);
  font-size: 0.85rem;
}
.mock-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.mock-bar span { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.mock-bar b { margin-left: 0.75rem; font-weight: 500; color: var(--muted); font-size: 0.8rem; }
.mock-body { padding: 1.25rem; }
.mock-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; margin-bottom: 1.25rem; }
.mock-stat { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.75rem; }
.mock-stat small { display: block; color: var(--muted); font-size: 0.72rem; }
.mock-stat strong { font-family: var(--font-serif); font-weight: 400; font-size: 1.35rem; }
.mock table { width: 100%; border-collapse: collapse; }
.mock th, .mock td { text-align: left; padding: 0.55rem 0.4rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.mock th { color: var(--muted); font-weight: 500; font-size: 0.75rem; }
.mock td:last-child, .mock th:last-child { text-align: right; }
.mock .pill { font-size: 0.7rem; padding: 0.15rem 0.5rem; border-radius: 999px; background: var(--bg-alt); color: var(--ink-soft); }
.mock .pill.ok { background: #e3efe3; color: #2f6b3a; }
.mock .pill.warn { background: var(--accent-soft); color: var(--accent); }
.mock-scroll { overflow-x: auto; }
@media (max-width: 480px) { .mock-stats { grid-template-columns: 1fr 1fr; } .mock-stat:last-child { display: none; } }

/* ---------- CTA band ---------- */

.cta-band {
  background: var(--dark);
  color: var(--dark-ink);
  border-radius: var(--radius);
  padding: clamp(2.5rem, 6vw, 4.5rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
  align-items: end;
}
.cta-band h2 { margin: 0; max-width: 18ch; }
.cta-band p { color: var(--dark-muted); margin: 1rem 0 0; max-width: 34rem; }
.cta-band .btn-primary { background: var(--dark-ink); color: var(--dark); }
.cta-band .btn-primary:hover { background: #fff; }
@media (max-width: 760px) { .cta-band { grid-template-columns: 1fr; align-items: start; } }

/* ---------- Forms ---------- */

.form { display: grid; gap: 1rem; }
.form label { display: grid; gap: 0.35rem; font-size: 0.9rem; font-weight: 500; }
.form input, .form select, .form textarea {
  font: inherit;
  font-weight: 400;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  width: 100%;
}
.form input:focus, .form select:focus, .form textarea:focus {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
  border-color: transparent;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.form fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.form legend { font-size: 0.9rem; font-weight: 500; margin-bottom: 0.35rem; }
.checkbox { display: flex !important; align-items: center; gap: 0.6rem !important; font-weight: 400 !important; }
.checkbox input { width: auto; }

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

.site-footer {
  background: var(--dark);
  color: var(--dark-muted);
  padding: 4.5rem 0 2.5rem;
  font-size: 0.92rem;
}
.site-footer a { text-decoration: none; color: var(--dark-muted); }
.site-footer a:hover { color: var(--dark-ink); }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 2rem;
}
.footer-grid h4 {
  color: var(--dark-ink);
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 1rem;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.site-footer .brand { color: var(--dark-ink); margin-bottom: 1rem; }
.footer-bottom {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #34332f;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

/* ---------- Utilities ---------- */

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.muted { color: var(--muted); }
.center { text-align: center; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Fixes / refinements ---------- */

.product-card .tag { align-self: flex-start; }

.hero .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
.hero .split h1 { font-size: clamp(2.4rem, 4.6vw, 3.75rem); }
@media (max-width: 860px) { .hero .split { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .nav-links a.btn { display: inline-flex; padding: 0.75rem 1.25rem; } }

/* ---------- Logo ---------- */
/* Source PNG is light gray on transparent: darken it for the light header, keep it as-is on the dark footer. */
.brand img { height: 46px; width: auto; }
.site-header .brand img { filter: brightness(0); }
.site-footer .brand { display: inline-block; }
.site-footer .brand img { height: 60px; }

/* ---------- Form states ---------- */
[hidden] { display: none !important; }
.form [aria-invalid="true"] { border-color: #b3261e; outline-color: #b3261e; }
.form-status { margin: 0; font-size: 0.92rem; color: var(--muted); min-height: 1.4em; }
.form-status.error { color: #b3261e; }
.form button:disabled { opacity: 0.6; cursor: progress; }
.form-success h3 { margin-top: 0; }
.form-success:focus { outline: none; }

/* ---------- Product card links / PDF downloads ---------- */
.product-card { position: relative; }
.card-links { margin-top: auto; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 1.5rem; }
.product-card .card-links .link-arrow { margin-top: 0; }
/* Whole card stays clickable via the main link; the PDF link sits above it */
.card-main-link::before { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.link-pdf { position: relative; z-index: 1; font-size: 0.9rem; color: var(--muted); text-decoration: none; }
.link-pdf:hover { color: var(--ink); text-decoration: underline; }
.link-pdf::before { content: "\2193  "; }
.footer-sub { margin-top: -0.35rem; font-size: 0.85rem; }
.footer-sub a::before { content: "\2193  "; }

/* ---------- Privacy policy ---------- */
.policy { padding-top: 0; }
.policy .container > * { max-width: 46rem; }
.policy h2 { font-size: clamp(1.35rem, 2.4vw, 1.7rem); margin: 2.25rem 0 0.75rem; }
.policy h2:first-child { margin-top: 0; }
.policy p, .policy li { color: var(--ink-soft); }
.policy a { color: var(--ink); }
.form-note { margin: 0; font-size: 0.85rem; color: var(--muted); }
.form-note a { color: inherit; }

/* ---------- Home page overview video ---------- */
.hero-video { margin-top: clamp(2.5rem, 6vw, 4rem); }
.video-frame {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-alt);
  cursor: pointer;
  aspect-ratio: 16 / 9;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02), 0 24px 48px -28px rgba(20,20,19,0.25);
}
.video-frame video { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.video-frame:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.video-chip {
  position: absolute;
  left: clamp(12px, 2vw, 20px);
  bottom: clamp(12px, 2vw, 20px);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font: 500 0.88rem/1 var(--font-sans);
  transition: transform 0.15s, background 0.15s;
}
.video-frame:hover .video-chip { transform: scale(1.04); background: #33322e; }

.video-dialog {
  width: min(92vw, 1280px);
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
.video-dialog::backdrop { background: rgba(20, 20, 19, 0.88); }
.video-dialog video { display: block; width: 100%; border-radius: var(--radius-sm); background: #000; }
.video-close {
  position: absolute;
  top: -48px;
  right: 0;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: #fff;
  cursor: pointer;
}
.video-close:hover { background: rgba(255,255,255,0.24); }
.video-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
html.video-open { overflow: hidden; }

/* ---------- Home hero: text left, overview video right (stacks below 960px) ---------- */
.hero.hero-home { padding-top: clamp(32px, 4vw, 56px); }
.hero-home h1 { text-wrap: balance; }
.hero-home .lede { margin-top: 1.1rem; }
.hero-home .hero-actions { margin-top: 1.75rem; }
.hero-home .hero-video { margin-top: clamp(2rem, 4vw, 2.75rem); }

@media (min-width: 960px) {
  .hero.hero-home { padding-top: clamp(48px, 5vw, 80px); }
  .hero-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: clamp(2.5rem, 4.5vw, 4rem);
    align-items: center;
  }
  .hero-home h1 { font-size: clamp(2.5rem, 4vw, 3.4rem); max-width: none; }
  .hero-home .lede { font-size: 1.12rem; }
  .hero-home .hero-video { margin-top: 0; }
  .hero-home .video-chip { padding: 0.45rem 0.8rem; font-size: 0.8rem; }
}

/* ---------- Spotlight page ---------- */
.spot { scroll-margin-top: 80px; }
.spot-grid { display: grid; gap: clamp(2rem, 4vw, 3.5rem); align-items: center; }
@media (min-width: 960px) {
  .spot-grid { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.3fr); }
  .spot-flip { grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.85fr); }
  .spot-flip .spot-copy { order: 2; }
}
.spot-copy h2 { margin-top: 0.25rem; }
.spot-copy > p { color: var(--ink-soft); }
.spot-video video {
  display: block; width: 100%; aspect-ratio: 16 / 9; background: #000;
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(0,0,0,0.02), 0 24px 48px -28px rgba(20,20,19,0.25);
}
.chapters { list-style: none; padding: 0; margin: 1.5rem 0 1.75rem; border-top: 1px solid var(--line); }
.chapters li { border-bottom: 1px solid var(--line); }
.chapters button {
  all: unset; box-sizing: border-box; width: 100%; display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.6rem 0.25rem; cursor: pointer; font: 500 0.95rem/1.4 var(--font-sans); color: var(--ink);
}
.chapters button:hover { color: var(--accent); }
.chapters button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
.chapters .ct { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 400; }
@media (min-width: 600px) {
  .chapters-two-col { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1.5rem; }
}
