/* ==========================================================================
   The AI-First Contractor — by TCC AI · Shared design system
   Brand (LOCKED per brief.md):
     Fonts:  Lato 300/400/700/900 (body + headings) · Architects Daughter (sparing accents)
     Colors: Accent Orange #E57824 (CTAs/action ONLY) · Primary Blue #1F5489
             Deep Navy #17375E (dark sections) · Ink #272727 · Light #F6F6F6 · White
   Mobile-first. Generous whitespace. Professional, not flashy.
   Used by: index.html, assessment.html, proof.html, about.html, start-small.html
   (audit.html survives only as a redirect stub and loads no CSS)
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --orange: #E57824;
  --orange-dark: #C9641A;
  --blue: #1F5489;
  --navy: #17375E;
  --ink: #272727;
  --light: #F6F6F6;
  --white: #FFFFFF;
  --line: #E3E3E3;
  --ink-soft: #4C4C4C;
  --navy-text-soft: #C8D4E4;   /* body text on navy sections */

  --font-body: 'Lato', 'Helvetica Neue', Arial, sans-serif;
  --font-hand: 'Architects Daughter', cursive;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 2px 12px rgba(23, 55, 94, 0.08);
  --shadow-lift: 0 6px 24px rgba(23, 55, 94, 0.12);

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;

  --container: 72rem;      /* 1152px */
  --container-narrow: 46rem; /* 736px — reading width */
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.0625rem;      /* 17px */
  line-height: 1.65;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--navy); }

h1, h2, h3, h4 {
  font-family: var(--font-body);
  font-weight: 900;
  line-height: 1.15;
  color: var(--navy);
  margin: 0 0 var(--space-2);
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.25rem, 6vw, 3.75rem); }
h2 { font-size: clamp(1.65rem, 4vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 3vw, 1.5rem); }
p { margin: 0 0 var(--space-2); }
strong { font-weight: 700; }

/* ---------- Utilities ---------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--space-3); }
.container--narrow { max-width: var(--container-narrow); }
.center { text-align: center; }

/* Handwritten accent — use SPARINGLY (one or two per page) */
.hand {
  font-family: var(--font-hand);
  font-weight: 400;
  letter-spacing: 0;
}
.hand--orange { color: var(--orange); }

/* Inline orange highlight — normal font, for emphasising a key term in body copy */
.text-orange { color: var(--orange); }

/* Eyebrow label above headings */
.eyebrow {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--blue);
  margin-bottom: var(--space-2);
}
.section--navy .eyebrow { color: var(--orange); }

/* Inline stat attribution — every stat carries its source */
.source {
  font-size: 0.85em;
  color: var(--ink-soft);
}
.section--navy .source { color: var(--navy-text-soft); }

/* ---------- Buttons (orange = action, ONLY) ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  border-radius: var(--radius);
  padding: 0.95rem 1.9rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--orange);
  color: var(--white);
  border-color: var(--orange);
}
.btn--primary:hover { background: var(--orange-dark); border-color: var(--orange-dark); color: var(--white); }

.btn--ghost {
  background: transparent;
  color: var(--blue);
  border-color: var(--blue);
}
.btn--ghost:hover { background: var(--blue); color: var(--white); }
.section--navy .btn--ghost { color: var(--white); border-color: var(--white); }
.section--navy .btn--ghost:hover { background: var(--white); color: var(--navy); }

.btn--lg { font-size: 1.15rem; padding: 1.1rem 2.4rem; }

/* Small line under a CTA (appetizer downsell, capacity note) */
.cta-under {
  margin-top: var(--space-2);
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.section--navy .cta-under { color: var(--navy-text-soft); }

/* ---------- Section rhythm ---------- */
.section { padding: var(--space-5) 0; }
.section--light { background: var(--light); }
.section--navy { background: var(--navy); color: var(--navy-text-soft); }
.section--navy h1, .section--navy h2, .section--navy h3 { color: var(--white); }
.section--navy a { color: var(--white); }
.section-head { max-width: var(--container-narrow); margin: 0 auto var(--space-4); text-align: center; }
.section-head p { font-size: 1.125rem; }

@media (min-width: 48rem) {
  .section { padding: var(--space-6) 0; }
}

/* ---------- Hero ---------- */
.hero { padding: var(--space-5) 0; background: var(--white); }
.hero .container { max-width: 56rem; text-align: center; }
.hero h1 { margin-bottom: var(--space-3); }
.hero .subhead {
  font-size: 1.125rem;
  color: var(--ink-soft);
  margin: 0 auto var(--space-4);
  max-width: 44rem;
  text-align: left;
}
@media (min-width: 48rem) {
  .hero { padding: var(--space-6) 0; }
  .hero .subhead { font-size: 1.1875rem; text-align: center; }
}

/* Hero eyebrow — larger, more heading-like (home hero only) */
.hero .eyebrow {
  font-size: 1.0625rem;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-3);
}
@media (min-width: 48rem) {
  .hero .eyebrow { font-size: 1.1875rem; }
}

/* Hero epigraph — the Sun Tzu line under the eyebrow */
.hero-epigraph {
  max-width: 40rem;
  margin: 0 auto var(--space-4);
  font-style: italic;
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--navy);
}
.hero-epigraph cite {
  display: block;
  font-style: normal;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  margin-top: 0.4rem;
}

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-3);
  box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; }
.section--navy .card { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.15); box-shadow: none; }
.section--navy .card h3 { color: var(--white); }

.grid { display: grid; gap: var(--space-3); }
@media (min-width: 48rem) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
}

/* Dollar tag on pain cards */
.dollar-tag {
  display: inline-block;
  font-weight: 900;
  font-size: 1.35rem;
  color: var(--orange);
  margin-bottom: var(--space-1);
}

/* ---------- Industry-voice quotes (NEVER testimonials) ---------- */
.quote {
  border-left: 4px solid var(--orange);
  background: var(--light);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: var(--space-2) var(--space-3);
  margin: 0 0 var(--space-2);
  font-style: italic;
  color: var(--ink);
}
.quote cite {
  display: block;
  margin-top: var(--space-1);
  font-style: normal;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.section--light .quote { background: var(--white); }
.section--navy .quote { background: rgba(255, 255, 255, 0.06); color: var(--white); }
.section--navy .quote cite { color: var(--navy-text-soft); }

/* ---------- Three-level narrative (Toy → Coding Tool → Business Brain) ---------- */
.levels { counter-reset: level; }
.level {
  position: relative;
  padding-left: 4rem;
  margin-bottom: var(--space-4);
}
.level::before {
  counter-increment: level;
  content: counter(level);
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.25rem;
  background: var(--light);
  color: var(--blue);
  border: 2px solid var(--line);
}
.level--highlight::before { background: var(--orange); color: var(--white); border-color: var(--orange); }
.section--navy .level::before { background: rgba(255,255,255,0.08); color: var(--white); border-color: rgba(255,255,255,0.25); }
.section--navy .level--highlight::before { background: var(--orange); border-color: var(--orange); }
.level h3 { margin-bottom: 0.4rem; }
.level:last-child { margin-bottom: 0; }

/* ---------- Ladder (the four steps, stated plainly) ---------- */
.ladder { list-style: none; margin: 0 0 var(--space-3); padding: 0; counter-reset: rung; }
.ladder li {
  counter-increment: rung;
  position: relative;
  padding: var(--space-2) 0 var(--space-2) 3.5rem;
  border-bottom: 1px solid var(--line);
}
.ladder li:last-child { border-bottom: none; }
.ladder li::before {
  content: counter(rung);
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  background: var(--blue);
  color: var(--white);
}
.section--navy .ladder li { border-color: rgba(255,255,255,0.15); }
.section--navy .ladder li::before { background: var(--orange); }

/* ---------- FAQ accordion (CSS-only via <details>) ---------- */
.faq { max-width: var(--container-narrow); margin: 0 auto; }
.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  margin-bottom: var(--space-2);
  box-shadow: var(--shadow);
}
.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: var(--space-2) var(--space-3);
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--navy);
  position: relative;
  padding-right: 3rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--orange);
  transition: transform 0.15s ease;
}
.faq-item[open] summary::after { content: "–"; }
.faq-item .faq-body { padding: 0 var(--space-3) var(--space-3); }
.faq-item .faq-body p:last-child { margin-bottom: 0; }

/* ---------- Header / responsive nav (CSS-only checkbox toggle) ---------- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}
.brand {
  text-decoration: none;
  line-height: 1.15;
}
.brand .brand-name {
  display: block;
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--navy);
}
.brand .brand-by {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.nav-toggle { display: none; }
.nav-toggle-label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2rem;
  height: 2rem;
  cursor: pointer;
}
.nav-toggle-label span {
  display: block;
  height: 3px;
  width: 100%;
  border-radius: 2px;
  background: var(--navy);
}

.site-nav {
  display: none;
  width: 100%;
  padding-top: var(--space-2);
}
.nav-toggle:checked ~ .site-nav { display: block; }
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.site-nav a {
  display: block;
  padding: 0.6rem 0;
  text-decoration: none;
  font-weight: 700;
  color: var(--navy);
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--orange); }
.site-nav .nav-cta .btn { width: 100%; margin-top: var(--space-1); }

@media (min-width: 54rem) {
  .nav-toggle-label { display: none; }
  .site-nav { display: block; width: auto; padding-top: 0; }
  .site-nav ul { flex-direction: row; align-items: center; gap: var(--space-3); }
  .site-nav a { padding: 0.25rem 0; }
  .site-nav .nav-cta .btn { width: auto; margin: 0; padding: 0.6rem 1.25rem; font-size: 0.95rem; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy);
  color: var(--navy-text-soft);
  padding: var(--space-5) 0 var(--space-4);
  font-size: 0.95rem;
}
.site-footer a { color: var(--white); }
.footer-grid { display: grid; gap: var(--space-4); margin-bottom: var(--space-4); }
@media (min-width: 48rem) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer h4 { color: var(--white); font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.1em; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.5rem; }
.footer-legal {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: var(--space-3);
  font-size: 0.85rem;
}

/* ---------- Misc ---------- */
.divider-note {
  font-family: var(--font-hand);
  font-size: 1.2rem;
  color: var(--orange);
  text-align: center;
  margin: var(--space-3) auto;
  max-width: 34rem;
}
.checklist { list-style: none; margin: 0 0 var(--space-2); padding: 0; }
.checklist li { position: relative; padding-left: 1.9rem; margin-bottom: 0.6rem; }
.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.42em;
  width: 0.6rem;
  height: 0.95rem;
  border-right: 3px solid var(--orange);
  border-bottom: 3px solid var(--orange);
  transform: rotate(40deg);
}

/* Tables (used by inner pages) scroll inside their own container */
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line); }
th { color: var(--navy); font-weight: 700; }


/* ===== Red-team fixes (2026-07-10 adjudication) ===== */

/* Screen-reader-only utility — replaces display:none on the nav checkbox so the
   mobile menu is keyboard/screen-reader operable (bounce-test a11y fix) */
.sr-only,
.nav-toggle {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
  display: block; /* override any display:none above */
}
.nav-toggle:focus-visible + .nav-toggle-label {
  outline: 3px solid var(--accent-orange, #E57824);
  outline-offset: 3px;
}
a:focus-visible, .btn:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent-orange, #E57824);
  outline-offset: 2px;
}

/* Hero strip: the qualification/valuation math moved below the CTA so the
   mobile hero passes the 5-second test (subhead cut to one sentence) */
.founder-creds {
  list-style: none;
  margin: 0 0 var(--space-2);
  padding: 0;
  max-width: 44rem;
}
.founder-creds li {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: 0.6rem;
  font-size: 1.02rem;
  color: var(--ink);
  line-height: 1.5;
}
.founder-creds li::before {
  content: "\00BB"; /* » */
  position: absolute;
  left: 0;
  top: 0;
  color: var(--orange);
  font-weight: 700;
}

/* Founder bio band — photo left, name + credentials right (About page) */
.founder-bio {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  margin-bottom: var(--space-4);
  text-align: left;
}
.founder-bio__photo { flex: 0 0 auto; width: 260px; max-width: 38%; }
.founder-bio__photo img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.founder-bio__cap {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.founder-bio__text { flex: 1 1 0; min-width: 0; }
.founder-bio__name {
  font-family: 'Architects Daughter', cursive;
  color: var(--orange);
  font-size: 1.9rem;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.6rem;
}
.founder-bio__title {
  font-size: 1.1rem;
  color: var(--navy);
  line-height: 1.5;
  margin-bottom: var(--space-2);
}
@media (max-width: 640px) {
  .founder-bio { flex-direction: column; }
  .founder-bio__photo { width: 200px; max-width: 60%; }
  .founder-bio__name { font-size: 1.6rem; }
}

.hero-scoreboard {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 auto var(--space-3);
  max-width: 44rem;
  text-align: left;
}
.hero-scoreboard strong { color: var(--orange); }
@media (min-width: 54rem) {
  .hero-scoreboard { text-align: center; }
}

.hero-strip {
  margin-top: 1.75rem;
  max-width: 46rem;
  font-size: 0.95rem;
  line-height: 1.55;
  opacity: 0.92;
}

/* ---------- Hero → next-section seam ---------- */
/* The hero's padding-bottom and the next section's padding-top were stacking to
   ~192px, leaving so much white that visitors couldn't tell anything followed the
   hero. Tighten only this junction — general section rhythm is unchanged. */
.hero { padding-bottom: var(--space-4); }
.hero + .section { padding-top: var(--space-4); }

/* ---------- Brand diagrams (v1.1) ---------- */
/* Centered figure wrapper for the self-contained SVG diagrams. They ship
   width:100%+viewBox, so the img scales to the wrapper; overflow-x is a
   mobile safety net. Sits fine on light and navy sections (warm-cream panels). */
.diagram {
  max-width: 55rem;              /* 880px — a touch wider than reading width to draw the eye */
  margin: var(--space-4) auto;
  overflow-x: auto;
}
.diagram img {
  width: 100%;
  height: auto;
  display: block;
}
