/* ============================================================
   START — styles.css
   Single stylesheet. Tokens straight from DESIGN.md.
   No hardcoded colours/fonts/shadows below the token block.
   ============================================================ */

/* ---------- 1. Tokens ---------- */
:root {
  /* Colour — DESIGN.md §2 */
  --ink:        #111514;
  --charcoal:   #2B302E;
  --grey:       #6A716D;  /* nudged darker from #6E7672 to clear WCAG AA (4.69:1) on --paper */
  --grey-light: #D9DEDB;
  --paper:      #F6F8F7;
  --white:      #FFFFFF;
  --lake:       #166B59;
  --lake-deep:  #1D4438;
  --lake-mist:  #E4EFEA;
  --fog:        #AEB6B2;  /* muted text on dark */
  --error:      #9A4A3B;

  /* Elevation — the one shadow (DESIGN.md §2/§4) */
  --shadow-float: 0 8px 24px -8px rgba(17, 21, 20, 0.18);

  /* Type families — DESIGN.md §3 */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Spacing scale — DESIGN.md §4 (8px base) */
  --sp-4: 4px;   --sp-8: 8px;   --sp-12: 12px; --sp-16: 16px;
  --sp-24: 24px; --sp-32: 32px; --sp-48: 48px; --sp-64: 64px;
  --sp-96: 96px; --sp-128: 128px; --sp-160: 160px;

  /* Radius — DESIGN.md §4 */
  --radius-sm: 8px;
  --radius-card: 16px;
  --radius-pill: 999px;

  /* Layout */
  --container: 1160px;
  --measure: 68ch;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- 2. Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--lake); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Visible keyboard focus — DESIGN.md §8 */
:focus-visible {
  outline: 2px solid var(--lake);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- 3. Typography — DESIGN.md §3 ---------- */
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 600; line-height: 1.15; }
h3 { font-family: var(--font-body); }
p { margin: 0; max-width: var(--measure); }

.display { font-family: var(--font-display); font-weight: 600; font-size: clamp(40px, 6vw, 64px); line-height: 1.05; letter-spacing: -0.01em; }
.h1 { font-size: clamp(34px, 5vw, 48px); line-height: 1.1; }
.h2 { font-size: clamp(26px, 3.5vw, 34px); line-height: 1.2; }
.h3 { font-family: var(--font-body); font-weight: 600; font-size: clamp(20px, 2.4vw, 22px); line-height: 1.3; }
.body-lg { font-size: clamp(18px, 2vw, 19px); line-height: 1.6; }
.small { font-size: 14px; line-height: 1.5; }
.mono { font-family: var(--font-mono); font-weight: 400; }

.eyebrow {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grey);
}
.eyebrow--lake { color: var(--lake); }

.muted { color: var(--grey); }
[hidden] { display: none !important; }

/* ---------- 4. Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-24);
}
@media (max-width: 640px) { .container { padding-inline: var(--sp-16); } }

.section { padding-block: clamp(var(--sp-64), 12vw, var(--sp-160)); }
.section--tight { padding-block: clamp(var(--sp-48), 8vw, var(--sp-96)); }

.grid { display: grid; gap: var(--sp-24); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* Dark surfaces */
.on-dark { background: var(--ink); color: var(--white); }
.on-lake-deep { background: var(--lake-deep); color: var(--white); }
.on-lake { background: var(--lake); color: var(--white); }
.on-mist { background: var(--lake-mist); color: var(--ink); }
.on-dark p, .on-lake-deep p { color: var(--fog); }         /* muted-on-dark */
.on-dark .lead, .on-lake-deep .lead { color: var(--lake-mist); }
.full-bleed { width: 100%; }

/* ---------- 5. The Blaze — DESIGN.md §5 ---------- */
.blaze-rule {          /* short centered vertical rule */
  width: 2px;
  height: 40px;
  background: var(--lake);
  margin: var(--sp-24) auto;
  border: 0;
}
.on-dark .blaze-rule, .on-lake-deep .blaze-rule { background: var(--white); }
.blaze-left {          /* left-border accent for quotes/callouts */
  border-left: 2px solid var(--lake);
  padding-left: var(--sp-24);
}
.on-dark .blaze-left, .on-lake-deep .blaze-left { border-left-color: var(--white); }

/* ---------- 6. Buttons — DESIGN.md §6 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px;                    /* touch target — §8 */
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body); font-weight: 600; font-size: 16px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out);
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--ink); color: var(--white); }
.btn-primary:hover { background: var(--lake-deep); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-secondary:hover { background: var(--lake-mist); }
/* On dark sections */
.on-dark .btn-primary, .on-lake-deep .btn-primary, .on-lake .btn-primary { background: var(--white); color: var(--ink); }
.on-dark .btn-secondary, .on-lake-deep .btn-secondary, .on-lake .btn-secondary { color: var(--white); border-color: var(--white); }
.on-dark .btn-secondary:hover, .on-lake-deep .btn-secondary:hover, .on-lake .btn-secondary:hover { background: rgba(255,255,255,0.08); }

/* ---------- 7. Cards — DESIGN.md §6 ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius-card);
  padding: var(--sp-32);
}
.card--mist { background: var(--lake-mist); border-color: transparent; }
a.card, .card--link { transition: border-color 160ms var(--ease-out); }
a.card:hover, .card--link:hover { border-color: var(--lake); text-decoration: none; }

/* ---------- 8. Forms — DESIGN.md §6 ---------- */
.field { display: flex; flex-direction: column; gap: var(--sp-8); margin-bottom: var(--sp-16); }
.field label { font-size: 14px; font-weight: 500; }
.field input, .field select, .field textarea {
  font-family: var(--font-body); font-size: 16px;
  background: var(--white);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--lake);
  box-shadow: 0 0 0 2px var(--lake);
}
.field .error-msg { color: var(--error); font-size: 14px; }
.field--error input { border-color: var(--error); }

/* Minimal centered card (sign-up / contact) — DESIGN.md §6 */
.centered-card {
  max-width: 480px; margin-inline: auto;
  background: var(--white);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius-card);
  padding: var(--sp-48);
  box-shadow: var(--shadow-float);
}

/* ---------- 9. Nav — DESIGN.md §6 ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--grey-light);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-24); min-height: 64px; }
.nav-logo { display: inline-flex; align-items: center; gap: var(--sp-12); font-family: var(--font-display); font-weight: 600; font-size: 20px; color: var(--ink); }
.nav-logo:hover { text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: var(--sp-24); list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--ink); font-size: 15px; }
.nav-links a:hover { text-decoration: none; color: var(--lake); }
.nav-links a[aria-current="page"]:not(.btn) { color: var(--lake); border-bottom: 2px solid var(--lake); padding-bottom: 2px; }  /* blaze underline — text links only, never the pill button */
.nav-links a.btn-primary, .nav-links a.btn-primary:hover { color: var(--white); }  /* .nav-links a's ink color must not win over the pill's white text */
@media (max-width: 780px) {
  .nav-links { gap: var(--sp-16); }
  .nav-links .nav-hide-sm { display: none; }
}

/* ---------- 10. Step list — DESIGN.md §6 ---------- */
.steps { counter-reset: step; }
.step-num {
  width: 44px; height: 44px; border-radius: var(--radius-pill);
  border: 1px solid var(--grey-light);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 16px; color: var(--lake);
  margin-bottom: var(--sp-16);
}

/* ---------- 11. Stat band ---------- */
.stat-num { font-family: var(--font-display); font-weight: 600; font-size: clamp(40px, 6vw, 64px); line-height: 1; color: var(--white); }
.stat-label { font-family: var(--font-body); font-size: 14px; color: var(--fog); margin-top: var(--sp-8); }

/* ---------- 12. Footer — DESIGN.md §6 ---------- */
.footer { background: var(--ink); color: var(--white); padding-block: var(--sp-64); }
.footer h4, .footer .footer-h { font-family: var(--font-body); font-weight: 600; font-size: 14px; color: var(--white); margin: 0 0 var(--sp-16); }
.footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-8); }
.footer a { color: var(--fog); font-size: 14px; }
.footer a:hover { color: var(--white); }
.footer-cols { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: var(--sp-32); }
@media (max-width: 900px) { .footer-cols { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 780px) { .footer-cols { grid-template-columns: repeat(2, 1fr); } }

/* ---------- 12b. Pricing table + FAQ ---------- */
.price { font-family: var(--font-display); font-weight: 600; font-size: 32px; }
.price small { font-family: var(--font-body); font-weight: 400; font-size: 14px; color: var(--grey); display: block; }
.feature-list { list-style: none; margin: var(--sp-16) 0 0; padding: 0; }
.feature-list li { padding: var(--sp-8) 0; border-top: 1px solid var(--grey-light); font-size: 15px; }

.compare { width: 100%; border-collapse: collapse; font-size: 15px; }
.compare caption { text-align: left; }
.compare th, .compare td { padding: var(--sp-12) var(--sp-16); text-align: left; border-bottom: 1px solid var(--grey-light); }
.compare thead th { font-family: var(--font-body); font-weight: 600; font-size: 14px; }
.compare td + td, .compare th + th { text-align: center; }
.compare tbody tr:nth-child(odd) { background: var(--lake-mist); }
.compare .yes { color: var(--lake); font-weight: 600; }
.compare .no { color: var(--grey); }
.table-wrap { overflow-x: auto; }

.faq { border-top: 1px solid var(--grey-light); }
.faq details { border-bottom: 1px solid var(--grey-light); }
.faq summary { cursor: pointer; padding: var(--sp-24) 0; font-family: var(--font-body); font-weight: 600; font-size: 18px; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: var(--sp-16); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-mono); color: var(--lake); font-size: 22px; }
.faq details[open] summary::after { content: "–"; }
.faq details > p { padding: 0 0 var(--sp-24); }

/* ---------- 13. Utilities ---------- */
.stack > * + * { margin-top: var(--sp-16); }
.stack-lg > * + * { margin-top: var(--sp-24); }
.text-center { text-align: center; }
.mx-auto { margin-inline: auto; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-16); }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: var(--sp-16); top: var(--sp-16); background: var(--ink); color: var(--white); padding: var(--sp-12) var(--sp-16); border-radius: var(--radius-sm); z-index: 100; }

/* ---------- 14. Motion — DESIGN.md §7 ---------- */
@media (prefers-reduced-motion: no-preference) {
  .fade-up { opacity: 0; transform: translateY(16px); animation: fadeUp 600ms var(--ease-out) forwards; }
  @keyframes fadeUp { to { opacity: 1; transform: none; } }
  .blaze-draw { animation: blazeDraw 400ms var(--ease-out) both; }
  @keyframes blazeDraw { from { height: 0; } }
}
