/* ==========================================================================
   Clarion Growth Intelligence — Brand CSS
   Source of truth: ops/assets/brand/clarion-visual-direction.md
   "Coastal intelligence: calm, crisp, technical, trustworthy."
   No build step — plain CSS custom properties + Google Fonts.
   ========================================================================== */

/* --- Fonts --------------------------------------------------------------- */
/* Space Grotesk (headings) + Inter (body) loaded via <link> in each page */

/* --- Design tokens ------------------------------------------------------- */
:root {
  /* Neutrals */
  --ink: #0B1220;          /* Clarion Ink — text, dark sections, logo */
  --navy: #132238;         /* Deep Navy — headers, footer, premium panels */
  --surface: #F8FAFC;      /* Warm White — page background */
  --card: #FFFFFF;         /* White — cards, reports */
  --border: #CBD5E1;       /* Soft Slate — dividers */
  --border-soft: #E7ECF3;  /* lighter divider on white */
  --body: #334155;         /* Graphite — paragraphs */
  --muted: #64748B;        /* muted UI text */

  /* Signal colors */
  --blue: #2563EB;         /* Signal Blue — links, action, data emphasis */
  --blue-ink: #1D4ED8;     /* darker blue for hovers */
  --teal: #14B8A6;         /* Reef Teal — positive signals, growth (graphics/chips only) */
  --teal-ink: #0F766E;     /* AA-contrast teal for small text on light backgrounds */
  --coral: #F97316;        /* Sun Coral — graphics/accents only (fails AA under white text) */
  --coral-ink: #EA6407;
  --coral-btn: #C2410C;    /* AA-contrast coral for button fills + small coral text */
  --coral-btn-ink: #9A3412;
  --seafoam: #CCFBF1;      /* soft teal bg, tags */
  --dawn: #FFEDD5;         /* soft warm callouts */

  /* On-dark */
  --on-navy: #E8EEF6;
  --on-navy-muted: #9FB0C6;

  /* Typography */
  --font-head: 'Space Grotesk', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  /* Layout */
  --container: 1120px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(11, 18, 32, 0.04), 0 1px 3px rgba(11, 18, 32, 0.06);
  --shadow: 0 10px 30px -12px rgba(11, 18, 32, 0.12);
  --shadow-lg: 0 24px 48px -20px rgba(11, 18, 32, 0.22);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
/* Anchor targets clear the 68px sticky header */
[id] { scroll-margin-top: 92px; }
/* Branded keyboard focus ring everywhere */
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.section-dark :focus-visible, .site-footer :focus-visible, .cta-band :focus-visible { outline-color: var(--teal); }
body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--body);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Short pages (404, thank-you): pin the footer to the viewport bottom */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.site-footer { margin-top: auto; }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-ink); }

/* --- Typography ---------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--ink);
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.4rem, 5vw, 3.5rem); font-weight: 700; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); }
h1, h2 { text-wrap: balance; }
h3 { font-size: 1.28rem; }
h4 { font-size: 1.05rem; }
p { color: var(--body); }
.lead { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--muted); line-height: 1.6; }
.eyebrow {
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--blue);
}
.text-teal { color: var(--teal); }
.text-blue { color: var(--blue); }

/* --- Skip link (keyboard users) ------------------------------------------ */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 0 0 10px 0; font-family: var(--font-head); font-weight: 600; }
.skip-link:focus { left: 0; }

/* --- Layout -------------------------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section-tight { padding: clamp(40px, 6vw, 72px) 0; }
.section-hero-slim { padding-bottom: clamp(8px, 2vw, 24px); }
.section-follow { padding-top: clamp(24px, 4vw, 48px); }
.section-dark { background: var(--navy); color: var(--on-navy); }
.section-dark h1, .section-dark h2, .section-dark h3, .section-dark h4 { color: #fff; }
.section-dark p { color: var(--on-navy-muted); }
.section-alt { background: linear-gradient(180deg, #fff 0%, var(--surface) 100%); }
.center { text-align: center; }
.section-head { max-width: 680px; margin: 0 auto clamp(36px, 5vw, 56px); }
.section-head.left { margin-left: 0; }
.section-head p { margin-top: 14px; }

/* --- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-head); font-weight: 600; font-size: 0.98rem;
  padding: 13px 24px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: all 0.2s var(--ease); white-space: nowrap;
}
.btn-primary { background: var(--coral-btn); color: #fff; box-shadow: 0 6px 16px -6px rgba(194,65,12,0.5); }
.btn-primary:hover { background: var(--coral-btn-ink); color: #fff; transform: translateY(-1px); }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: var(--blue-ink); color: #fff; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); background: #fff; }
.section-dark .btn-ghost { color: #fff; border-color: rgba(255,255,255,0.28); }
.section-dark .btn-ghost:hover { border-color: #fff; background: rgba(255,255,255,0.06); color: #fff; }
.btn-lg { padding: 15px 30px; font-size: 1.05rem; }

/* --- Header / Nav -------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(248, 250, 252, 0.85);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.site-header.scrolled { border-bottom-color: var(--border-soft); background: rgba(248,250,252,0.95); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; flex: 0 0 auto; }
.brand-name {
  font-family: var(--font-head); font-weight: 700; font-size: 1.22rem;
  color: var(--ink); letter-spacing: -0.02em;
}
.brand-name .dot { color: var(--coral); }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a.navlink {
  font-family: var(--font-head); font-weight: 500; font-size: 0.96rem; color: var(--body);
}
.nav-links a.navlink:hover, .nav-links a.navlink[aria-current="page"] { color: var(--ink); }
.nav-links a.navlink[aria-current="page"] { color: var(--blue); }
.nav-cta { display: flex; align-items: center; gap: 14px; }
.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer; padding: 8px; margin: -8px;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: 0.25s var(--ease); }
.nav-toggle span + span { margin-top: 5px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- Hero ---------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; padding: clamp(64px, 9vw, 116px) 0 clamp(56px, 8vw, 96px); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
.hero h1 { margin-bottom: 20px; }
.hero .lead { margin-bottom: 30px; max-width: 34ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-note { margin-top: 18px; font-size: 0.9rem; color: var(--muted); }
.tag {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 22px;
  background: var(--seafoam); color: #0F766E; border: 1px solid #99F6E4;
  font-family: var(--font-head); font-weight: 600; font-size: 0.8rem;
  padding: 6px 14px; border-radius: 999px;
}
.tag .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 0 rgba(20,184,166,0.6); animation: pulse 2.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(20,184,166,0.5); } 70% { box-shadow: 0 0 0 8px rgba(20,184,166,0); } 100% { box-shadow: 0 0 0 0 rgba(20,184,166,0); } }
.hero-glow { position: absolute; inset: auto auto 0 -10%; width: 55%; height: 120%; background: radial-gradient(closest-side, rgba(37,99,235,0.09), transparent); pointer-events: none; }

/* --- Dashboard mock (hero visual) --------------------------------------- */
.mock {
  background: var(--card); border: 1px solid var(--border-soft); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.mock-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--border-soft); background: #fff; }
.mock-bar .dotb { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.mock-bar .mock-title { margin-left: 8px; font-family: var(--font-head); font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.mock-bar .mock-badge {
  margin-left: auto; font-family: var(--font-head); font-size: 0.68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px;
}
.mock-body { padding: 18px; display: grid; gap: 14px; }
.mock-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 14px; }
.stat .k { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.stat .v { font-family: var(--font-head); font-size: 1.5rem; font-weight: 700; color: var(--ink); margin-top: 4px; }
.stat .d { font-size: 0.78rem; font-weight: 600; margin-top: 2px; }
.stat .d.up { color: var(--teal-ink); }
.stat .d.warn { color: var(--coral-btn); }
.mock-chart { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 16px; }
.mock-chart .clab { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; margin-bottom: 12px; }
.spark { display: flex; align-items: flex-end; gap: 6px; height: 76px; }
.spark span { flex: 1; background: linear-gradient(180deg, var(--blue), #93C5FD); border-radius: 4px 4px 0 0; opacity: 0.9; }
.spark span:last-child { background: linear-gradient(180deg, var(--teal), #5EEAD4); }

/* --- Cards / grids ------------------------------------------------------- */
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
/* Zig-zag rows: DOM keeps heading-first reading order; flip is visual only */
.grid-2.flip > :first-child { order: 2; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--card); border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow-sm); transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #DDE5EF; }
.card h3 { margin-bottom: 8px; }
.card p { font-size: 0.98rem; }
.card .icon {
  width: 46px; height: 46px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(37,99,235,0.1), rgba(20,184,166,0.12));
  color: var(--blue); margin-bottom: 16px;
}
.card .icon svg { width: 22px; height: 22px; }
.module { display: inline-block; margin-top: 14px; font-family: var(--font-head); font-size: 0.74rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--teal-ink); }
.card ul { margin: 14px 0 0; padding-left: 0; list-style: none; }
.card ul li { position: relative; padding-left: 22px; margin-bottom: 7px; font-size: 0.94rem; color: var(--body); }
.card ul li::before { content: ""; position: absolute; left: 0; top: 9px; width: 8px; height: 8px; border-radius: 2px; background: var(--teal); }

/* --- Steps (how it works) ------------------------------------------------ */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; counter-reset: step; }
.step { background: var(--card); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 26px; position: relative; }
.step .num { font-family: var(--font-head); font-weight: 700; font-size: 0.85rem; color: #fff; background: var(--blue); width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; margin-bottom: 14px; }
.step:nth-child(2) .num { background: #0E7490; }
.step:nth-child(3) .num { background: var(--teal-ink); }
.step:nth-child(4) .num { background: var(--coral-btn); }
.step h3, .step h4 { margin-bottom: 6px; font-size: 1.05rem; }
.step p { font-size: 0.94rem; }
/* White step cards sit inside .section-dark — restore light-theme text colors */
.section-dark .step h3, .section-dark .step h4 { color: var(--ink); }
.section-dark .step p { color: var(--body); }

/* --- Feature split ------------------------------------------------------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
.stack > * + * { margin-top: 16px; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { position: relative; padding-left: 30px; margin-bottom: 12px; color: var(--body); }
.checklist li::before { content: ""; position: absolute; left: 0; top: 3px; width: 20px; height: 20px; border-radius: 6px; background: var(--seafoam); }
.checklist li::after { content: ""; position: absolute; left: 7px; top: 8px; width: 6px; height: 10px; border: 2px solid #0F766E; border-top: 0; border-left: 0; transform: rotate(45deg); }

/* --- CTA band ------------------------------------------------------------ */
.cta-band { background: linear-gradient(135deg, var(--navy), var(--ink)); color: #fff; border-radius: 20px; padding: clamp(40px, 6vw, 64px); text-align: center; position: relative; overflow: hidden; }
.cta-band h2 { color: #fff; margin-bottom: 12px; }
.cta-band p { color: var(--on-navy-muted); max-width: 52ch; margin: 0 auto 26px; }
.cta-band .glow { position: absolute; top: -40%; right: -10%; width: 50%; height: 160%; background: radial-gradient(closest-side, rgba(20,184,166,0.25), transparent); }

/* --- Stat strip ---------------------------------------------------------- */
.statstrip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center; }
.statstrip .n { font-family: var(--font-head); font-weight: 700; font-size: clamp(1.8rem, 3vw, 2.4rem); color: #fff; }
.statstrip .l { color: var(--on-navy-muted); font-size: 0.92rem; margin-top: 4px; }

/* --- Footer -------------------------------------------------------------- */
.site-footer { background: var(--ink); color: var(--on-navy-muted); padding: 64px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.site-footer .brand-name { color: #fff; }
.site-footer p { color: var(--on-navy-muted); font-size: 0.94rem; margin-top: 14px; max-width: 34ch; }
.footer-col h5, .footer-col .footer-h { font-family: var(--font-head); color: #fff; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 14px; font-weight: 600; }
.footer-col a { display: block; color: var(--on-navy-muted); font-size: 0.94rem; margin-bottom: 9px; }
.footer-col a:hover { color: #fff; }
.footer-tag { font-family: var(--font-head); font-weight: 600; color: var(--on-navy); }
.footer-tag .dot { color: var(--coral); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); margin-top: 44px; padding-top: 24px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 0.86rem; }
.footer-bottom a { color: var(--on-navy); display: inline-block; padding: 4px 2px; }
.footer-bottom a:hover { color: #fff; }

/* --- Reveal animation ---------------------------------------------------- */
/* Hidden state is gated behind html.js so content stays visible if JS fails. */
.reveal { transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
html.js .reveal { opacity: 0; transform: translateY(16px); }
html.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  .tag .pulse { animation: none; }
  html { scroll-behavior: auto; }
}

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 900px) {
  .hero-grid, .split { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .statstrip { grid-template-columns: repeat(2, 1fr); gap: 30px; }
  /* Nav collapses here too — the desktop header needs ~720px of intrinsic width */
  .nav-links {
    position: fixed; inset: 68px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--border-soft);
    padding: 8px 24px 20px; transform: translateY(-120%); transition: transform 0.28s var(--ease); box-shadow: var(--shadow);
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a.navlink { padding: 13px 0; border-bottom: 1px solid var(--border-soft); }
  .nav-links .btn { margin-top: 12px; }
  .nav-toggle { display: block; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .grid-2, .grid-3, .steps { grid-template-columns: 1fr; }
  .grid-2.flip > :first-child { order: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-col.footer-brand { grid-column: 1 / -1; }
  .hero-actions .btn { flex: 1; }
}

/* --- Legal pages (privacy/terms) ----------------------------------------- */
.legal { padding: clamp(40px, 6vw, 72px) 0 clamp(56px, 8vw, 88px); }
.legal .wrap { max-width: 760px; margin: 0 auto; padding: 0 24px; }
.legal h1 { font-size: clamp(2rem, 4vw, 2.6rem); margin-bottom: 8px; }
.legal h2 { font-size: 1.35rem; margin: 44px 0 12px; }
.legal h3 { font-size: 1.08rem; margin: 26px 0 8px; }
.legal p { margin: 0 0 16px; }
.legal ul { padding-left: 22px; margin: 0 0 16px; }
.legal li { margin-bottom: 8px; }
.legal .meta { color: var(--muted); font-size: 0.9rem; margin: 0 0 32px; }
.legal .meta span + span::before { content: " · "; margin: 0 4px; }
.legal a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.legal a:hover { text-decoration-thickness: 2px; }
.legal hr { border: 0; border-top: 1px solid var(--border-soft); margin: 44px 0 24px; }
.legal .legal-note { font-size: 0.85rem; color: var(--muted); font-style: italic; }
.legal code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; background: #F1F5F9; padding: 2px 6px; border-radius: 4px; }

/* Contact form controls */
.contact-form { display: grid; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
}
.form-group label span { color: var(--coral-btn); margin-left: 2px; }
.form-group input,
.form-group select,
.form-group textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  width: 100%;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
  appearance: none;
  -webkit-appearance: none;
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--muted); }
.form-group select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748B' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; cursor: pointer; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
}
.form-group textarea { resize: vertical; min-height: 120px; }
.form-note { font-size: 0.88rem; color: var(--muted); margin-top: 4px; }
