/* Brightline Growth — site styles. Tokens from the Brightline Growth design system. */
:root {
  /* Brand */
  --navy: #071d3e;
  --lime: #86cd03;
  --navy-700: #1c3a66;
  --navy-100: #e3e9f2;
  --lime-700: #4a7300;
  --lime-100: #eef8d9;
  --gray-50: #f5f7fa;
  --gray-200: #dde3ea;
  --gray-500: #5b6676;
  --white: #ffffff;

  /* Semantic (Light) */
  --surface: var(--white);
  --surface-raised: var(--gray-50);
  --surface-inverse: var(--navy);
  --ink: var(--navy);
  --ink-muted: var(--gray-500);
  --ink-inverse: var(--white);
  --border: var(--gray-200);
  --border-strong: #7a8698;
  --primary: var(--navy);
  --on-primary: var(--white);
  --primary-hover: var(--navy-700);
  --accent: var(--lime);
  --on-accent: var(--navy);
  --accent-ink: var(--lime-700);
  --focus: var(--lime-700);
  --positive: var(--lime-700);
  --negative: #b8431c;
  --inverse-action: var(--lime);
  --on-inverse-action: var(--navy);
  --chart-bar: var(--navy);
  --btn-sweep: var(--lime);
  --on-inverse-muted: #c9d3e1;

  /* Type */
  --font-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-sans: Barlow, system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Space */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-6: 24px; --space-8: 32px; --space-12: 48px; --space-16: 64px;

  --radius-sm: 2px;
  --max: 1120px;
  --gutter: 16px;
  color-scheme: light;
}

/* Dark theme: follows the system unless the visitor picks one with the toggle (data-theme on <html>). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --surface: #081a33;
    --surface-raised: #0e2442;
    --surface-inverse: #030d1f;
    --ink: #eef2f7;
    --ink-muted: #a6b2c3;
    --border: #1d3557;
    --border-strong: #5a6d8a;
    --primary: var(--lime);
    --on-primary: var(--navy);
    --primary-hover: #9fe11f;
    --accent-ink: var(--lime);
    --focus: var(--lime);
    --positive: var(--lime);
    --negative: #ff9b73;
    --chart-bar: #2b4a77;
    --btn-sweep: var(--navy);
}
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface: #081a33;
  --surface-raised: #0e2442;
  --surface-inverse: #030d1f;
  --ink: #eef2f7;
  --ink-muted: #a6b2c3;
  --border: #1d3557;
  --border-strong: #5a6d8a;
  --primary: var(--lime);
  --on-primary: var(--navy);
  --primary-hover: #9fe11f;
  --accent-ink: var(--lime);
  --focus: var(--lime);
  --positive: var(--lime);
  --negative: #ff9b73;
  --chart-bar: #2b4a77;
  --btn-sweep: var(--navy);
}

* { box-sizing: border-box; }
/* overflow-x: clip (not hidden) stops sideways scrolling without breaking the sticky header. */
html { -webkit-text-size-adjust: 100%; overflow-x: clip; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 24px;
  overflow-x: clip;
  touch-action: pan-x pan-y; /* no double-tap or pinch zoom */
}
img { max-width: 100%; display: block; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--space-4); top: var(--space-4); background: var(--surface); padding: var(--space-2) var(--space-4); z-index: 10; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 720px) { :root { --gutter: 32px; } }

/* Type styles */
.display-xl, .display-lg, .eyebrow { font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.01em; font-weight: 800; margin: 0; }
.display-xl { font-size: 44px; line-height: 44px; }
.display-lg { font-size: 34px; line-height: 36px; }
@media (min-width: 720px) {
  .display-xl { font-size: 64px; line-height: 60px; }
  .display-lg { font-size: 44px; line-height: 44px; }
}
.eyebrow { font-size: 14px; line-height: 16px; font-weight: 700; letter-spacing: 0.12em; color: var(--accent-ink); margin-bottom: var(--space-4); display: block; }
h1, h2, h3 { margin: 0; font-weight: 700; }
h1 { font-size: 36px; line-height: 42px; }
h2 { font-size: 26px; line-height: 32px; }
h3 { font-size: 20px; line-height: 26px; }
.body-lg { font-size: 18px; line-height: 28px; }
.caption { font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.muted { color: var(--ink-muted); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 100; border-bottom: 1px solid var(--border); background: var(--surface); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 72px; }
.logo { display: inline-flex; padding: var(--space-2) 0; }
.logo img { width: 150px; height: auto; }
.nav { display: flex; align-items: center; gap: var(--space-6); }
.nav a { font-size: 14px; line-height: 20px; font-weight: 500; text-decoration: none; }
.nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); }
.nav .nav-hide { display: none; }
@media (min-width: 560px) { .nav .nav-hide { display: inline; } .logo img { width: 170px; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  font-family: var(--font-sans); font-size: 14px; line-height: 20px; font-weight: 500;
  padding: var(--space-3) var(--space-6); border: 0; border-radius: 0;
  background: var(--primary); color: var(--on-primary); text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn-inverse { background: var(--inverse-action); color: var(--on-inverse-action); }
.btn-inverse:hover { background: var(--white); color: var(--navy); }
.btn-sm { padding: var(--space-2) var(--space-4); }
.btn[disabled] { opacity: 0.6; cursor: wait; }

/* Hero */
.hero { position: relative; overflow: hidden; padding: var(--space-16) 0; }
.hero .wrap { position: relative; z-index: 1; }
.hero .display-xl { max-width: 14ch; }
.hero p { max-width: 560px; margin: var(--space-6) 0 var(--space-8); }
.hero-geo { position: absolute; right: -40px; bottom: 0; width: 360px; height: 100%; pointer-events: none; display: none; }
@media (min-width: 900px) { .hero { padding: 96px 0; } .hero-geo { display: block; right: max(0px, calc((100vw - var(--max)) / 2)); } }

/* Sections */
.section { padding: var(--space-16) 0; }
.section-raised { background: var(--surface-raised); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 640px; margin-bottom: var(--space-12); }
.section-head p { margin: var(--space-4) 0 0; }

.cards { display: grid; gap: var(--space-6); grid-template-columns: 1fr; }
@media (min-width: 800px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--border); padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); }
.card p { margin: 0; }
.card ul { margin: 0; padding-left: 18px; color: var(--ink-muted); }
.card li + li { margin-top: var(--space-1); }
.card-num { font-family: var(--font-display); text-transform: uppercase; font-weight: 800; font-size: 14px; letter-spacing: 0.12em; color: var(--accent-ink); }
.card-bar { height: 4px; width: 48px; background: var(--accent); }

/* Proof / principles */
.rules { display: grid; gap: 0; grid-template-columns: 1fr; border-top: 1px solid var(--border); }
@media (min-width: 800px) { .rules { grid-template-columns: repeat(2, 1fr); column-gap: var(--space-12); } }
.rule { display: grid; grid-template-columns: 56px 1fr; gap: var(--space-4); padding: var(--space-6) 0; border-bottom: 1px solid var(--border); }
.rule-n { font-family: var(--font-display); font-weight: 800; font-size: 32px; line-height: 32px; color: var(--ink); }
.rule h3 { margin-bottom: var(--space-2); }
.rule p { margin: 0; color: var(--ink-muted); }

.bars { display: flex; align-items: flex-end; gap: 6px; height: 48px; margin-bottom: var(--space-4); }
.bars span { width: 12px; background: var(--chart-bar); }
.bars span:last-child { background: var(--accent); }

/* CTA band */
.cta { background: var(--surface-inverse); color: var(--ink-inverse); padding: var(--space-16) 0; position: relative; overflow: hidden; }
.cta .wrap { display: flex; flex-direction: column; gap: var(--space-6); align-items: flex-start; position: relative; z-index: 1; }
.cta p { margin: 0; max-width: 520px; color: var(--on-inverse-muted); }
.cta-wedge { position: absolute; right: 0; bottom: 0; width: 280px; height: 100%; display: none; }
@media (min-width: 800px) { .cta .wrap { flex-direction: row; align-items: center; justify-content: space-between; } .cta-wedge { display: block; } .cta .btn { margin-right: 120px; } }

/* Footer */
.site-footer { background: var(--surface-inverse); color: var(--ink-inverse); border-top: 1px solid var(--navy-700); padding: var(--space-12) 0 var(--space-8); }
.site-footer .wrap { display: grid; gap: var(--space-8); }
.site-footer .logo img { width: 160px; }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--space-6); }
.footer-links a { color: var(--ink-inverse); font-size: 14px; text-decoration: none; }
.footer-links a:hover { color: var(--lime); }
.footer-meta { font-size: 12px; line-height: 16px; color: #a3afc0; border-top: 1px solid var(--navy-700); padding-top: var(--space-6); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-4); }
@media (min-width: 720px) { .site-footer .top { display: flex; justify-content: space-between; align-items: center; } }

/* Page header (inner pages) */
.page-head { background: var(--surface-inverse); color: var(--ink-inverse); padding: var(--space-12) 0; position: relative; overflow: hidden; }
.page-head .eyebrow { color: var(--lime); }
.page-head p { color: var(--on-inverse-muted); margin: var(--space-4) 0 0; max-width: 560px; }

/* Contact */
.contact-grid { display: grid; gap: var(--space-12); grid-template-columns: 1fr; }
@media (min-width: 880px) { .contact-grid { grid-template-columns: 3fr 2fr; } }
.form { display: grid; gap: var(--space-6); }
.form-row { display: grid; gap: var(--space-6); grid-template-columns: 1fr; }
@media (min-width: 600px) { .form-row { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: var(--space-2); }
.field label { font-size: 14px; line-height: 20px; font-weight: 500; }
.field .opt { color: var(--ink-muted); font-weight: 400; }
.field input, .field select, .field textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: var(--space-3); width: 100%; min-height: 48px;
}
.field textarea { min-height: 140px; resize: vertical; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.field [aria-invalid="true"] { border-color: var(--negative); }
.error { color: var(--negative); font-size: 14px; line-height: 20px; margin: 0; }
.error:empty { display: none; }
.hp { position: absolute; left: -9999px; }
.form-note { font-size: 12px; line-height: 16px; color: var(--ink-muted); margin: 0; }
.status { padding: var(--space-4) var(--space-6); border: 1px solid var(--border); margin: 0; }
.status.ok { background: var(--lime-100); border-color: var(--lime-700); color: var(--navy); }
.status.bad { border-color: var(--negative); color: var(--negative); }
.aside { background: var(--surface-raised); border: 1px solid var(--border); padding: var(--space-6); display: grid; gap: var(--space-6); align-content: start; }
.aside h3 { margin-bottom: var(--space-2); }
.aside p, .aside ol { margin: 0; }
.aside ol { padding-left: 20px; }
.aside li + li { margin-top: var(--space-2); }

/* Legal */
.legal { max-width: 720px; padding: var(--space-12) 0 var(--space-16); }
.legal h2 { margin: var(--space-12) 0 var(--space-4); }
.legal h3 { margin: var(--space-6) 0 var(--space-2); }
.legal p, .legal ul { margin: 0 0 var(--space-4); }
.legal ul { padding-left: 20px; }
.legal li + li { margin-top: var(--space-2); }
.legal .updated { color: var(--ink-muted); font-size: 14px; }
.toc { background: var(--surface-raised); border: 1px solid var(--border); padding: var(--space-6); margin: var(--space-8) 0 0; }
.toc ol { margin: var(--space-2) 0 0; padding-left: 20px; columns: 1; }
@media (min-width: 600px) { .toc ol { columns: 2; column-gap: var(--space-8); } }

@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* ==========================================================================
   Motion
   One orchestrated moment (the hero chart plots itself on load), the same
   growth motif repeated where bars already exist, and feedback on hover/scroll.
   Everything is visible without JS; reduced-motion users get a static page.
   ========================================================================== */
:root {
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* Header compacts once the page scrolls */
.site-header .wrap { transition: min-height 0.35s var(--ease-out); }
.site-header .logo img { transition: width 0.35s var(--ease-out); }
.site-header.is-scrolled .wrap { min-height: 60px; }
.site-header.is-scrolled .logo img { width: 132px; }
@media (min-width: 560px) { .site-header.is-scrolled .logo img { width: 150px; } }

/* Nav underline slides in from the left */
.nav a:not(.btn) { position: relative; }
.nav a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform 0.3s var(--ease-out);
}
.nav a:not(.btn):hover::after { transform: scaleX(1); }

/* Buttons: a lime bar sweeps along the bottom; inverse buttons fill from the left */
.btn { position: relative; overflow: hidden; isolation: isolate; transition: background-color 0.25s, color 0.25s; }
.btn::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: var(--btn-sweep); transform: scaleX(0); transform-origin: left;
  transition: transform 0.35s var(--ease-out);
}
.btn:hover::after, .btn:focus-visible::after { transform: scaleX(1); }
.btn-inverse:hover { background: var(--inverse-action); }
.btn-inverse::after { top: 0; height: auto; background: var(--white); z-index: -1; }

/* Cards: the lime bar extends across the card on hover */
.card { transition: border-color 0.3s; }
.card:hover { border-color: var(--border-strong); }
.card-bar { transform-origin: left; transition: width 0.5s var(--ease-out); }
.card:hover .card-bar { width: 100%; }

@media (prefers-reduced-motion: no-preference) {
  /* Hero load sequence: words rise, then the chart plots bar by bar */
  .hero .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; margin-bottom: -0.08em; }
  .hero .w > span { display: inline-block; animation: rise 0.9s var(--ease-out) both; }
  .hero .w:nth-child(2) > span { animation-delay: 0.08s; }
  .hero .w:nth-child(3) > span { animation-delay: 0.16s; }
  .hero .w:nth-child(4) > span { animation-delay: 0.24s; }
  .hero .eyebrow { animation: fade 0.6s ease both; }
  .hero p, .hero .btn { animation: fade-up 0.8s var(--ease-out) 0.45s both; }
  .hero .btn { animation-delay: 0.55s; }

  .hero-geo rect, .hero-geo polygon { transform-box: fill-box; transform-origin: bottom; animation: grow 1s var(--ease-out) both; }
  .hero-geo rect:nth-of-type(1) { animation-delay: 0.35s; }
  .hero-geo rect:nth-of-type(2) { animation-delay: 0.45s; }
  .hero-geo rect:nth-of-type(3) { animation-delay: 0.55s; }
  .hero-geo rect:nth-of-type(4) { animation-delay: 0.65s; }
  .hero-geo polygon { animation: grow 1.3s var(--ease-out) 0.8s both; }

  /* Repeated motif: bars grow when they scroll into view (JS adds .in) */
  .js .bars span { transform: scaleY(0); transform-origin: bottom; transition: transform 0.8s var(--ease-out); }
  .js .bars span:nth-child(2) { transition-delay: 0.08s; }
  .js .bars span:nth-child(3) { transition-delay: 0.16s; }
  .js .bars span:nth-child(4) { transition-delay: 0.24s; }
  .js .bars.in span { transform: none; }

  .js .card .card-bar { transform: scaleX(0); transition: transform 0.7s var(--ease-out), width 0.5s var(--ease-out); }
  .js .card:nth-child(2) .card-bar { transition-delay: 0.1s, 0s; }
  .js .card:nth-child(3) .card-bar { transition-delay: 0.2s, 0s; }
  .js .cards.in .card-bar { transform: none; }

  .js .cta-wedge polygon { transform-box: fill-box; transform-origin: bottom; transform: scaleY(0); transition: transform 1.1s var(--ease-out) 0.15s; }
  .js .cta.in .cta-wedge polygon { transform: none; }
}

@keyframes rise { from { transform: translateY(105%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleY(0); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* Design review fixes */
.skip:focus { z-index: 200; } /* stay above the sticky header */
.site-footer :focus-visible, .cta :focus-visible, .page-head :focus-visible { outline-color: var(--lime); } /* 3:1 on navy */
.card > * { max-width: 62ch; } /* readable line length when cards stack on tablets */
@media (min-width: 800px) { .cta-wedge { right: max(0px, calc((100vw - var(--max)) / 2)); } } /* keep wedge near content on wide screens */
.toc li a { display: inline-block; padding: 3px 0; } /* 24px minimum tap height */

/* ==========================================================================
   Theme toggle
   ========================================================================== */
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: block; }
}

.theme-toggle {
  display: none; /* shown once JS can run it */
  width: 40px; height: 40px; padding: 0; border: 1px solid var(--border); border-radius: 0;
  background: transparent; color: var(--ink); cursor: pointer;
  align-items: center; justify-content: center; position: relative; overflow: hidden;
  transition: border-color 0.25s;
}
.js .theme-toggle { display: inline-flex; }
.theme-toggle:hover { border-color: var(--border-strong); }
.theme-toggle svg {
  position: absolute; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round;
  transition: transform 0.5s var(--ease-out), opacity 0.3s;
}
.theme-toggle .icon-moon path { fill: currentColor; stroke: none; }
/* Light theme shows the moon (switch to dark); dark theme shows the sun. */
.theme-toggle .icon-sun { transform: rotate(-90deg) scale(0.4); opacity: 0; }
:root[data-theme="dark"] .theme-toggle .icon-moon { transform: rotate(90deg) scale(0.4); opacity: 0; }
:root[data-theme="dark"] .theme-toggle .icon-sun { transform: none; opacity: 1; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { transform: rotate(90deg) scale(0.4); opacity: 0; }
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { transform: none; opacity: 1; }
}

/* Charts take their bar color from the theme */
.hero-geo rect { fill: var(--chart-bar); }

/* The theme switch wipes outward from the toggle (JS drives the clip-path) */
html.theme-switching::view-transition-old(root),
html.theme-switching::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ==========================================================================
   Motion, round two
   ========================================================================== */
/* Compact hero chart on phones and tablets (it was desktop-only) */
@media (max-width: 899px) {
  .hero { padding-bottom: 72px; }
  .hero-geo { display: block; width: 132px; height: 154px; right: var(--gutter); bottom: 0; }
}
@media (max-width: 359px) { .hero { padding-bottom: 168px; } } /* too narrow to sit beside the button */

@media (prefers-reduced-motion: no-preference) {
  /* Pages crossfade when navigating between them */
  @view-transition { navigation: auto; }

  /* Hero button: the lime bar sweeps across once after the chart lands */
  .hero .btn::after { animation: sweep 1.1s var(--ease-in-out) 1.6s backwards; }

  /* Headlines rise out of a mask: on load for page titles, on scroll for sections */
  .rise { animation: rise-mask 0.9s var(--ease-out) 0.1s both; }
  .js .section-head h2, .js .cta h2 {
    clip-path: inset(100% 0 0 0); transform: translateY(0.35em);
    transition: clip-path 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  }
  .js .section-head.in h2, .js .cta.in h2 { clip-path: inset(0 0 -0.2em 0); transform: none; }

  /* Card bars grow one card at a time as each scrolls in */
  .js .card.in .card-bar { transform: none; }

  /* How we work: each divider draws left to right, the number rises in */
  .js .rule { position: relative; border-bottom-color: transparent; }
  .js .rule::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--border);
    transform: scaleX(0); transform-origin: left; transition: transform 1s var(--ease-out);
  }
  .js .rule .rule-n { opacity: 0; transform: translateY(0.5em); transition: opacity 0.6s, transform 0.7s var(--ease-out); }
  .js .rule.in::after { transform: none; }
  .js .rule.in .rule-n { opacity: 1; transform: none; }
  .js .rule:nth-child(2)::after, .js .rule:nth-child(2) .rule-n { transition-delay: 0.1s; }
  .js .rule:nth-child(3)::after, .js .rule:nth-child(3) .rule-n { transition-delay: 0.2s; }
  .js .rule:nth-child(4)::after, .js .rule:nth-child(4) .rule-n { transition-delay: 0.3s; }
}

@keyframes sweep {
  0% { transform: scaleX(0); transform-origin: left; }
  50% { transform: scaleX(1); transform-origin: left; }
  50.01% { transform: scaleX(1); transform-origin: right; }
  100% { transform: scaleX(0); transform-origin: right; }
}
@keyframes rise-mask {
  from { clip-path: inset(100% 0 0 0); transform: translateY(0.35em); }
  to { clip-path: inset(0 0 -0.2em 0); transform: none; }
}

/* ==========================================================================
   Service pages
   ========================================================================== */
/* Card link to each service page, aligned to the bottom of every card */
.card-link { margin-top: auto; font-weight: 500; text-underline-offset: 4px; }

/* Service pages: scannable sections instead of long prose */
.svc-section { padding: var(--space-12) 0; border-top: 1px solid var(--border); }
.page-head + .svc-section { border-top: 0; }
@media (min-width: 720px) { .svc-section { padding: var(--space-16) 0; } }
.svc-intro { max-width: 640px; margin-bottom: var(--space-8); }
.svc-intro p { margin: var(--space-3) 0 0; }
.svc-answer { margin: var(--space-8) 0 0; max-width: 640px; font-size: 20px; line-height: 28px; font-weight: 700; }
.svc-note { margin: var(--space-6) 0 0; max-width: 640px; }
.svc-section h3 { font-size: 18px; line-height: 24px; }

/* Page head: tags plus a small chart that plots on load */
.svc-head .wrap { position: relative; z-index: 1; }
.svc-head .chips { margin-top: var(--space-6); }
.head-geo { display: block; width: 120px; height: 70px; margin: var(--space-6) var(--gutter) calc(-1 * var(--space-12)) auto; position: relative; } /* sits on the section edge like a chart baseline */
.head-geo rect { fill: var(--navy-700); }
.head-geo polygon { fill: var(--lime); }
@media (min-width: 900px) {
  .svc-head { padding: var(--space-16) 0; }
  .svc-head .wrap > * { max-width: 620px; }
  .head-geo { position: absolute; margin: 0; width: 240px; height: 140px; bottom: 0; right: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter))); }
}

/* Tags for platforms, tools, and metrics */
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.chips li { border: 1px solid var(--border-strong); padding: var(--space-1) var(--space-3); font-size: 14px; line-height: 20px; font-weight: 500; }
.chips-inverse li { border-color: #3d5a85; color: var(--ink-inverse); }
.chips-accent li { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.split .chips { margin-top: var(--space-4); }

/* Problems we find */
.flags { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-6); grid-template-columns: 1fr; }
@media (min-width: 720px) { .flags { grid-template-columns: repeat(3, 1fr); } .flags-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .flags-4 { grid-template-columns: repeat(4, 1fr); } }
.flags li { border-top: 3px solid var(--negative); padding-top: var(--space-4); font-size: 18px; line-height: 26px; font-weight: 700; }

/* What's included: a ruled two-column spec sheet */
.spec { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--border); }
@media (min-width: 720px) { .spec { grid-template-columns: 1fr 1fr; column-gap: var(--space-12); } }
.spec li { padding: var(--space-6) 0; border-bottom: 1px solid var(--border); }
.spec h3 { display: flex; align-items: center; gap: var(--space-3); }
.spec h3::before { content: ""; flex: none; width: 10px; height: 10px; background: var(--accent); }
.spec p { margin: var(--space-1) 0 0 22px; color: var(--ink-muted); }

/* Who it's for */
.fit { display: grid; gap: var(--space-8); align-items: start; }
@media (min-width: 880px) { .fit { grid-template-columns: 1fr 1fr; gap: var(--space-12); } }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.checks li { position: relative; padding-left: 32px; font-size: 18px; line-height: 26px; }
.checks li::before { content: ""; position: absolute; left: 4px; top: 4px; width: 7px; height: 13px; border: solid var(--accent-ink); border-width: 0 3px 3px 0; transform: rotate(45deg); }
.callout { margin: 0; background: var(--surface-raised); border-left: 4px solid var(--accent); padding: var(--space-6); }
.section-raised .callout { background: var(--surface); }
.callout strong { display: block; font-size: 20px; line-height: 26px; margin-bottom: var(--space-2); }

/* How an engagement works: numbered steps on a rail (vertical on phones, horizontal on desktop) */
.steps { list-style: none; margin: 0; padding: 0; display: grid; }
.steps li { position: relative; display: grid; grid-template-columns: 40px 1fr; column-gap: var(--space-4); padding-bottom: var(--space-6); }
.steps li:last-child { padding-bottom: 0; }
.step-n { grid-row: span 2; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: var(--primary); color: var(--on-primary); font: 800 22px/1 var(--font-display); position: relative; z-index: 1; }
.steps h3 { margin-top: 8px; }
.steps p { margin: var(--space-1) 0 0; color: var(--ink-muted); }
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 19px; top: 40px; bottom: 0; width: 2px; background: var(--border); transform-origin: top; }
@media (min-width: 960px) {
  .steps { grid-template-columns: repeat(5, 1fr); column-gap: var(--space-6); }
  .steps li { display: block; padding-bottom: 0; }
  .step-n { margin-bottom: var(--space-4); }
  .steps h3 { margin-top: 0; }
  .steps li:not(:last-child)::after { left: 40px; right: calc(-1 * var(--space-6)); top: 19px; bottom: auto; width: auto; height: 2px; transform-origin: left; }
}

/* Attribution: platforms over-count compared with actual sales */
.overcount { margin: 0; max-width: 760px; }
.oc-row + .oc-row { margin-top: var(--space-6); }
.oc-label { display: block; font-size: 14px; line-height: 20px; font-weight: 500; margin-bottom: var(--space-2); }
.oc-track { position: relative; height: 40px; }
.oc-bar { display: flex; gap: 2px; height: 100%; transform-origin: left; }
.oc-bar span { display: flex; align-items: center; min-width: 0; padding: 0 var(--space-2); background: var(--chart-bar); color: var(--white); font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; }
.oc-actual { width: 71%; }
.oc-actual span { flex: 1; background: var(--accent); color: var(--on-accent); }
.oc-track-line::after { content: ""; position: absolute; left: 71%; top: -6px; bottom: -6px; border-left: 2px dashed var(--ink); }
.overcount figcaption { margin-top: var(--space-4); font-size: 14px; line-height: 20px; color: var(--ink-muted); }

/* Attribution models: two columns */
.split { display: grid; gap: var(--space-8); }
@media (min-width: 880px) { .split { grid-template-columns: 1fr 1fr; gap: var(--space-12); } }
.split p { margin: var(--space-2) 0 0; }

/* Pricing facts */
.facts { display: grid; grid-template-columns: 1fr 1fr; margin: 0; border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
@media (min-width: 880px) { .facts { grid-template-columns: repeat(4, 1fr); } }
.facts > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: var(--space-2); padding: var(--space-6) var(--space-4); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.facts dd { margin: 0; font: 800 34px/36px var(--font-display); }
@media (min-width: 720px) { .facts dd { font-size: 44px; line-height: 44px; } .facts > div { padding: var(--space-6); } }
.facts dt { font-size: 14px; line-height: 20px; color: var(--ink-muted); }

/* Related services */
.related { display: grid; gap: var(--space-4); }
@media (min-width: 720px) { .related { grid-template-columns: 1fr 1fr; gap: var(--space-6); } }
.related a { display: block; border: 1px solid var(--border); padding: var(--space-6); text-decoration: none; transition: border-color 0.3s; }
.related a::before { content: ""; display: block; width: 48px; height: 4px; background: var(--accent); margin-bottom: var(--space-4); transition: width 0.5s var(--ease-out); }
.related a:hover { border-color: var(--border-strong); color: inherit; }
.related a:hover::before { width: 100%; }
.related-title { display: block; font-size: 20px; line-height: 26px; font-weight: 700; color: var(--ink); }
.related .muted { display: block; margin-top: var(--space-1); }

@media (prefers-reduced-motion: no-preference) {
  /* The page-head chart plots itself on load, like the home hero */
  .head-geo rect, .head-geo polygon { transform-box: fill-box; transform-origin: bottom; animation: grow 1s var(--ease-out) both; }
  .head-geo rect:nth-of-type(1) { animation-delay: 0.3s; }
  .head-geo rect:nth-of-type(2) { animation-delay: 0.4s; }
  .head-geo rect:nth-of-type(3) { animation-delay: 0.5s; }
  .head-geo rect:nth-of-type(4) { animation-delay: 0.6s; }
  .head-geo polygon { animation-duration: 1.3s; animation-delay: 0.75s; }

  /* The step rail draws in as it scrolls into view */
  .js .steps li::after { transform: scaleY(0); transition: transform 0.6s var(--ease-out); }
  .js .steps.in li::after { transform: none; }
  .js .steps li:nth-child(2)::after { transition-delay: 0.15s; }
  .js .steps li:nth-child(3)::after { transition-delay: 0.3s; }
  .js .steps li:nth-child(4)::after { transition-delay: 0.45s; }
  @media (min-width: 960px) { .js .steps li::after { transform: scaleX(0); } }

  /* Over-count bars fill when they scroll into view */
  .js .overcount .oc-bar { transform: scaleX(0); transition: transform 0.9s var(--ease-out); }
  .js .overcount .oc-row + .oc-row .oc-bar { transition-delay: 0.25s; }
  .js .overcount.in .oc-bar { transform: none; }
}

/* Services menu in the header. Without JS it's a plain link to the home page section. */
.nav-menu { display: flex; align-items: center; }
.nav-menu-btn, .nav-menu-list { display: none; }
.js .nav-menu-link { display: none; }
.js .nav-menu-btn {
  display: inline-flex; align-items: center; gap: 6px; position: relative;
  font: 500 14px/20px var(--font-sans); color: var(--ink); background: none; border: 0; padding: 10px 0; cursor: pointer;
}
.nav-menu-btn:hover { color: var(--accent-ink); }
.nav-menu-btn svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.3s var(--ease-out); }
.nav-menu-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.nav-menu-btn::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 4px; height: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease-out);
}
.nav-menu-btn:hover::after, .nav-menu-btn[aria-expanded="true"]::after { transform: scaleX(1); }
/* Phones: the menu drops full width under the header (the sticky header is its containing block) */
.nav-menu-list {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 110;
  margin: 0; padding: var(--space-2) 0; list-style: none;
  background: var(--surface); border-bottom: 1px solid var(--border); border-top: 3px solid var(--accent);
}
.js .nav-menu.open .nav-menu-list { display: block; }
.nav .nav-menu-list a { display: block; padding: var(--space-3) var(--gutter); font-size: 16px; line-height: 24px; color: var(--ink); }
.nav .nav-menu-list a::after { display: none; }
.nav .nav-menu-list a:hover, .nav .nav-menu-list a[aria-current="page"] { background: var(--surface-raised); box-shadow: inset 3px 0 0 var(--accent); }
@media (min-width: 560px) {
  .nav-menu { position: relative; }
  .nav-menu-list { top: calc(100% + 6px); left: -16px; right: auto; min-width: 240px; border: 1px solid var(--border); border-top: 3px solid var(--accent); }
  .nav .nav-menu-list a { padding: 10px var(--space-4); font-size: 15px; }
}
@media (prefers-reduced-motion: no-preference) {
  .js .nav-menu.open .nav-menu-list { animation: fade-up 0.25s var(--ease-out); }
}
/* Narrow phones: tighten the header so Services, the toggle, and Contact fit on one row */
@media (max-width: 559px) {
  .nav { gap: var(--space-3); }
  .site-header .wrap { gap: var(--space-3); }
}
@media (max-width: 399px) {
  .logo img, .site-header.is-scrolled .logo img { width: 120px; }
  .nav .btn-sm { padding-left: var(--space-3); padding-right: var(--space-3); }
}
