/* ==========================================================================
   ExciIQ — marketing site stylesheet
   Brand tokens sourced from packages/ui/src/styles/globals.css (light + dark).
   Static site: no framework, no build step.
   ========================================================================== */

/* ---- Self-hosted Atkinson Hyperlegible (400 / 700, latin) ---- */
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
}

/* ---- Brand tokens — light ---- */
:root {
  --background: #F6F2F9;
  --foreground: #2E1A3D;
  --card: #FFFFFF;
  --card-foreground: #2E1A3D;
  --primary: #6A2C91;
  --primary-foreground: #FFFFFF;
  --primary-text: #6A2C91;        /* amethyst — text-safe on light */
  --secondary: #10B5BE;
  --secondary-foreground: #FFFFFF;
  --secondary-text: #0B8B92;      /* turquoise-deep — text-safe on light */
  --muted: #EFE9F4;
  --muted-foreground: #6B5A76;
  --accent: #F0EAF6;
  --accent-foreground: #35165A;
  --warning: #E0922A;
  --warning-foreground: #2E1A3D;
  --info: #2C7DA0;
  --success: #2E9E6B;
  --border: #E5DCEC;
  --ring: #6A2C91;
  --lilac: #C79BE6;

  --radius-sm: 0.375rem;   /*  6px — inputs, chips  */
  --radius:    0.625rem;   /* 10px — base           */
  --radius-lg: 0.875rem;   /* 14px — cards          */
  --radius-xl: 1.125rem;   /* 18px — hero panels    */

  --shadow-sm: 0 1px 3px rgba(46,26,61,.08), 0 1px 2px rgba(46,26,61,.05);
  --shadow-md: 0 4px 12px rgba(46,26,61,.10), 0 2px 4px rgba(46,26,61,.06);
  --shadow-lg: 0 12px 28px rgba(46,26,61,.14), 0 4px 10px rgba(46,26,61,.08);
}

/* ---- Brand tokens — dark ---- */
@media (prefers-color-scheme: dark) {
  :root {
    --background: #160B22;
    --foreground: #ECE6F2;
    --card: #1F1430;
    --card-foreground: #ECE6F2;
    --primary: #9B6BC2;
    --primary-foreground: #1A0F26;
    --primary-text: #B18AD1;      /* amethyst-light — text-safe on dark tinted/card surfaces (≥4.5:1 on #2A1A3D and #1F1430) */
    --secondary: #2BC4BE;
    --secondary-foreground: #06302F;
    --secondary-text: #2BC4BE;    /* turquoise-bright — text-safe on dark */
    --muted: #251A35;
    --muted-foreground: #A593B5;
    --accent: #2A1A3D;
    --accent-foreground: #ECE6F2;
    --warning: #F2A93C;
    --warning-foreground: #2E1A3D;
    --info: #89CFF0;
    --success: #3FB985;
    --border: #33264A;
    --ring: #9B6BC2;

    --shadow-sm: 0 1px 3px rgba(0,0,0,.45), 0 1px 2px rgba(0,0,0,.35);
    --shadow-md: 0 4px 12px rgba(0,0,0,.50), 0 2px 4px rgba(0,0,0,.35);
    --shadow-lg: 0 12px 28px rgba(0,0,0,.55), 0 4px 10px rgba(0,0,0,.40);
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family: "Atkinson Hyperlegible", system-ui, -apple-system, sans-serif;
  font-size: 1rem;            /* 16 / 24 */
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a {
  color: var(--primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { text-decoration-thickness: 2px; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---- Type scale (Atkinson 400/700 only) ---- */
h1, h2, h3, strong, b, th, dt { font-weight: 700; }

.display { font-size: clamp(1.9375rem, 3.5vw + 1rem, 2.4375rem); line-height: 1.15; } /* → 39/44 */
h1 { font-size: 1.9375rem; line-height: 1.226; }  /* 31/38 */
h2 { font-size: 1.5625rem; line-height: 1.28;  }  /* 25/32 */
h3 { font-size: 1.25rem;   line-height: 1.4;   }  /* 20/28 */
.lead  { font-size: 1.125rem; line-height: 1.556; } /* 18/28 */
.small { font-size: 0.875rem; line-height: 1.43;  } /* 14/20 */

/* ---- Layout ---- */
.container {
  width: 100%;
  max-width: 68.75rem; /* 1100px */
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.band { padding-block: 4rem; }
.band-tinted { background: var(--accent); }
.band + .band { border-top: 1px solid transparent; }

main { flex: 1; }

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus-visible { left: 0; }

/* ---- Header / nav ---- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--background);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1rem;
}
.brand img { height: 2.25rem; width: auto; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.site-nav a {
  color: var(--foreground);
  text-decoration: none;
}
.site-nav a:hover:not(.btn) { color: var(--primary-text); text-decoration: underline; }
.site-nav a[aria-current="page"]:not(.btn) {
  color: var(--primary-text);
  font-weight: 700;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--foreground);
  padding: 0.5rem;
  cursor: pointer;
}

@media (max-width: 45rem) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none;
    position: absolute;
    inset-inline: 0;
    top: 100%;
    z-index: 50;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: 0.75rem 1.5rem 1.25rem;
  }
  .site-nav a { padding-block: 0.75rem; }
  .site-nav .btn { margin-top: 0.5rem; text-align: center; }
  body.nav-open .site-nav { display: flex; }
  .site-header { position: relative; }
}

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  border-radius: var(--radius);
  padding: 0.75rem 1.5rem;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}
.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover { background: var(--accent); }
.btn-quiet {
  background: var(--muted);
  color: var(--primary-text);
  border-color: var(--primary);
}
.btn-quiet:hover { background: var(--accent); }

/* ---- Eyebrow kicker ---- */
.eyebrow {
  font-size: 0.875rem;
  line-height: 1.43;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary-text);
  margin-bottom: 0.625rem;
}

/* ---- Verdict chips (three honest verdicts — typographic, semantic colors) ---- */
.verdict-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.875rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  line-height: 1;
  font-weight: 700;
  padding: 0.375rem 0.625rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--foreground);
  background: var(--muted);
}
.chip::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
}
.chip-safe      { border-color: color-mix(in srgb, var(--success) 45%, var(--border)); background: color-mix(in srgb, var(--success) 12%, var(--card)); }
.chip-safe::before      { background: var(--success); }
.chip-avoided   { border-color: color-mix(in srgb, var(--warning) 50%, var(--border)); background: color-mix(in srgb, var(--warning) 14%, var(--card)); }
.chip-avoided::before   { background: var(--warning); }
.chip-uncertain { border-style: dashed; color: var(--muted-foreground); background: var(--card); }
.chip-uncertain::before { background: var(--muted-foreground); }

/* ---- Standing note (exact professional-use string, sitewide) ---- */
.standing-note {
  font-size: 0.875rem;
  line-height: 1.43;
  color: var(--muted-foreground);
}

/* ---- Hero ---- */
.hero { padding-block: 4.5rem 4rem; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 3rem;
  align-items: center;
}
@media (max-width: 56rem) {
  .hero-grid { grid-template-columns: 1fr; }
}
.hero h1 { margin-bottom: 1rem; }
.hero .lead { margin-bottom: 1.75rem; max-width: 38rem; }
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.hero-visual svg { width: 100%; height: auto; }

/* ---- Section headers ---- */
.band > .container > h2,
.band > h2 { margin-bottom: 1rem; }
.band-intro { max-width: 44rem; }

/* ---- Value-prop grid ---- */
.value-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin-block: 2rem 1.5rem;
}
@media (max-width: 56rem) { .value-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 38rem) { .value-grid { grid-template-columns: 1fr; } }

.value-card {
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.value-card h3 { margin-block: 0.75rem 0.5rem; }
.value-card p { color: var(--card-foreground); }

.icon-tile {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--primary);
  display: grid;
  place-items: center;
}

/* ---- Evidence stats (external peer-reviewed literature, cited) ---- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin-block: 2rem 1.5rem;
}
@media (max-width: 56rem) { .stat-grid { grid-template-columns: 1fr; } }
.stat-card {
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}
.stat-card-flag { border-left: 3px solid var(--warning); }
.stat-figure {
  font-size: 2.4375rem;  /* display 39px */
  line-height: 1.15;
  font-weight: 700;
  color: var(--primary-text);
  margin-bottom: 0.5rem;
}
.stat-card > p:not(.stat-figure):not(.stat-cite) { flex: 1; }
.stat-cite {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.43;
  color: var(--muted-foreground);
}
.stat-coda { max-width: 44rem; }

/* ---- Narrative asides (business-value notes, how-it-helps) ---- */
.narrative-aside {
  background: var(--accent);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  max-width: 46rem;
  margin-top: 1.25rem;
}
.narrative-aside h3 {
  font-size: 1rem;
  line-height: 1.5;
  color: var(--primary-text);
  margin-bottom: 0.375rem;
}
.narrative-aside p { color: var(--accent-foreground); }

/* ---- Coverage strip ---- */
.coverage-strip { text-align: center; padding-block: 3rem; }
.coverage-strip h2 { margin-bottom: 0.75rem; letter-spacing: -0.1px; }
.coverage-strip .lead { max-width: 42rem; margin-inline: auto; color: var(--muted-foreground); }
.coverage-strip .eyebrow { margin-bottom: 0.5rem; }

/* ---- Trust band ---- */
.trust-band p { max-width: 46rem; }
.trust-link { display: inline-block; margin-top: 1rem; font-weight: 700; color: var(--primary-text); }

/* ---- CTA ladder ---- */
.ladder-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
@media (max-width: 56rem) { .ladder-grid { grid-template-columns: 1fr; } }
.ladder-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.ladder-card h3 { margin: 0; }
.ladder-card p { flex: 1; }

/* ---- Narratives (how-it-helps) ---- */
.narrative { margin-block: 3rem; }
.narrative h2 { margin-bottom: 1rem; }
.narrative blockquote {
  border-left: 3px solid var(--secondary);
  padding: 0.25rem 0 0.25rem 1.25rem;
  max-width: 46rem;
}
.narrative blockquote p { font-size: 1.125rem; line-height: 1.556; }
.narrative .standing-note { margin-top: 1rem; }

/* ---- Glossary ---- */
.glossary {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
  margin-block: 2rem;
}
.glossary dt { margin-top: 1rem; }
.glossary dt:first-child { margin-top: 0; }
.glossary dd { margin-left: 0; color: var(--muted-foreground); }
.glossary dd { margin-top: 0.25rem; }

/* ---- Prose blocks (security page) ---- */
.prose-block { margin-block: 2.5rem; max-width: 46rem; }
.prose-block h2 { margin-bottom: 0.5rem; font-size: 1.25rem; line-height: 1.4; }

/* ---- Page-end CTA ---- */
.page-cta {
  text-align: center;
  padding-block: 3.5rem;
}
.page-cta p { max-width: 36rem; margin: 0 auto 1.5rem; }
.page-cta .cta-row { justify-content: center; }

/* ---- Forms ---- */
.form-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-block: 2rem;
  scroll-margin-top: 2rem;
}
.form-section h2 { margin-bottom: 0.5rem; }
.form-section > p { max-width: 42rem; }
.form-section > p + p { margin-top: 1rem; }
.form-section form { margin-top: 1rem; }

.field { margin-block: 1.25rem; max-width: 26rem; }
.field label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.375rem;
}
.field .hint {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-top: 0.375rem;
}
.field input[type="text"],
.field input[type="email"],
.field select {
  width: 100%;
  font: inherit;
  color: var(--foreground);
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.625rem 0.75rem;
}
.field input:focus-visible,
.field select:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 1px;
}
.field-check {
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
  max-width: 32rem;
}
.field-check input {
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.2rem;
  accent-color: var(--primary);
}
.field-check label { font-weight: 400; }

/* Honeypot — visually removed, still in the accessibility-hidden DOM for bots. */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.btn[disabled] { opacity: 0.6; cursor: default; }

.form-confirm {
  border: 1px solid var(--border);
  border-left: 3px solid var(--success);
  border-radius: var(--radius);
  background: var(--background);
  padding: 1rem 1.25rem;
  margin-top: 1.5rem;
}
.form-confirm > * + * { margin-top: 0.75rem; }
.form-confirm-copy {
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.43;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  user-select: all;
}

/* ---- Stylized visuals (pure CSS/SVG vignettes — never screenshots) ---- */
.vignette { margin-block: 1.5rem; }
.vignette svg { width: 100%; max-width: 32rem; height: auto; }

.sort-vignette {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-width: 32rem;
  margin-block: 1.5rem;
}
.sort-col {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  padding: 0.875rem;
}
.sort-col-head {
  height: 0.625rem;
  border-radius: 999px;
  margin-bottom: 0.875rem;
}
.sort-col:first-child .sort-col-head { background: var(--secondary); opacity: 0.75; }
.sort-col:last-child  .sort-col-head { background: var(--warning); opacity: 0.85; }
.sort-chip {
  height: 2rem;
  border-radius: var(--radius-sm);
  background: var(--muted);
  border: 1px solid var(--border);
  margin-top: 0.625rem;
}
.sort-col:last-child .sort-chip { border-left: 3px solid var(--warning); }

/* ---- Inline-SVG vignette parts (theme-aware via CSS variables) ---- */
.sv-wash          { fill: var(--accent); }
.sv-card          { fill: var(--card); stroke: var(--border); }
.sv-bar           { fill: var(--muted); }
.sv-chip-turq     { fill: var(--secondary); opacity: 0.85; }
.sv-chip-marigold { fill: var(--warning); opacity: 0.9; }
.sv-chip-amethyst { fill: var(--primary); opacity: 0.85; }
.sv-stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sv-stroke-thin { stroke-width: 1.5; }
.sv-stroke-turq     { stroke: var(--secondary-text); }
.sv-stroke-marigold { stroke: var(--warning); }
.sv-stroke-muted    { stroke: var(--muted-foreground); }
.sv-dashed          { stroke-dasharray: 4 5; }
.sv-fill-turq       { fill: var(--secondary); }
.sv-fill-marigold   { fill: var(--warning); }
.sv-fill-lilac      { fill: var(--lilac); }
.sv-fill-none       { fill: none; }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--card);
  padding-block: 3rem;
  margin-top: 4rem;
}
.site-footer .container > * + * { margin-top: 1rem; }
.footer-brand img { height: 1.75rem; width: auto; }
.site-footer p { color: var(--muted-foreground); font-size: 0.875rem; max-width: 46rem; }
.site-footer .standing-note strong { color: var(--foreground); }
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: 0.875rem;
}
.footer-nav a { color: var(--muted-foreground); }
.footer-nav a:hover { color: var(--primary-text); }

/* ---- Mobile quick-nav tab bar (R12) ---- */
.tab-bar { display: none; }
@media (max-width: 45rem) {
  .tab-bar {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 60;
    display: flex;
    background: var(--card);
    border-top: 1px solid var(--border);
    padding: 0.375rem 0 calc(0.375rem + env(safe-area-inset-bottom, 0px));
  }
  .tab-bar a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
    padding: 0.25rem 0;
    font-size: 0.6875rem;
    line-height: 1.2;
    color: var(--muted-foreground);
    text-decoration: none;
  }
  .tab-bar svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .tab-bar a[aria-current="page"] { color: var(--primary-text); font-weight: 700; }
  .tab-bar .tab-join { color: var(--primary-text); }
  /* Keep the fixed bar clear of page content and the footer. */
  body { padding-bottom: 3.75rem; }
}

/* ---- 404 ---- */
.notfound {
  text-align: center;
  padding-block: 6rem;
}
.notfound h1 { margin-bottom: 1rem; }
.notfound p { margin-bottom: 2rem; }
