/* ==========================================================================
   Company31 — shared stylesheet
   Palette derives from the Company31 logo: deep to bright blue plus warm
   neutrals. No other hues. Every text/background pairing below is checked
   for WCAG AA contrast.
   Typefaces: Bricolage Grotesque (headings, weights 500/600 only) over
   Newsreader (body, 400 + italic). Spline Sans Mono for small labels.
   ========================================================================== */

/* ----- Design tokens ----------------------------------------------------- */
:root {
  /* Brand blues */
  --ink-navy: #0A1633;
  --deep-royal: #12339E;
  --current-blue: #1C4FD8;
  --azure: #3B8AF7;
  --ice: #EAF1FD;
  --paper: #FAFBFF;
  --white: #FFFFFF;

  /* Text roles (all AA on their intended surfaces) */
  --text: #0A1633;          /* primary text on light           ~18:1 on paper */
  --text-muted: #48546E;    /* secondary text on light          ~7.4:1 on paper */
  --text-on-dark: #EAF1FD;  /* primary text on navy            ~15.7:1 on navy  */
  --text-on-dark-muted: #C4D4F2; /* secondary text on navy       AA on navy      */

  /* Fonts */
  --font-head: "Bricolage Grotesque", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Newsreader", Georgia, "Times New Roman", serif;
  --font-mono: "Spline Sans Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Layout */
  --container: 1120px;
  --pad-x: clamp(20px, 5vw, 40px);
  --radius: 12px;
  --radius-lg: 18px;
  --gap: clamp(24px, 4vw, 40px);

  --shadow-sm: 0 1px 2px rgba(10, 22, 51, .06), 0 6px 20px rgba(10, 22, 51, .06);
  --shadow-md: 0 10px 30px rgba(10, 22, 51, .10);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.075rem;
  line-height: 1.7;
  font-weight: 400;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  color: var(--text);
  text-wrap: balance;
}
h1 { font-size: clamp(2.1rem, 5.2vw, 3.35rem); font-weight: 600; }
h2 { font-size: clamp(1.65rem, 3.4vw, 2.35rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.4rem); font-weight: 600; }
p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--current-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  transition: color .15s ease;
}
a:hover { color: var(--deep-royal); }

strong { font-weight: 600; }

/* ----- Accessibility helpers -------------------------------------------- */
:focus-visible {
  outline: 3px solid var(--azure);
  outline-offset: 2px;
  border-radius: 3px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 1000;
  background: var(--ink-navy);
  color: var(--ice);
  padding: 10px 16px;
  border-radius: 8px;
  font-family: var(--font-head);
  font-weight: 500;
  text-decoration: none;
  transition: top .18s ease;
}
.skip-link:focus { top: 12px; color: var(--ice); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ----- Layout ------------------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

.section { padding-block: clamp(52px, 8vw, 92px); }
.section--ice { background: var(--ice); }
.section--paper { background: var(--paper); }

.section-head { max-width: 44rem; margin-bottom: clamp(28px, 4vw, 44px); }
.section-head p { color: var(--text-muted); font-size: 1.15rem; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--current-blue);
  margin: 0 0 0.9em;
  display: block;
}

.lead { font-size: clamp(1.15rem, 2vw, 1.35rem); color: var(--text-muted); line-height: 1.6; }

/* ----- Header / navigation ---------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 251, 255, 0.86);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid rgba(18, 51, 158, 0.10);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink-navy);
}
.brand:hover { color: var(--ink-navy); }
.brand-logo { width: 46px; height: 46px; object-fit: contain; display: block; }
.brand-logo.logo-missing { display: none; }
/* The logo mark replaces the wordmark in the header. The text below is kept as
   an accessible fallback and only appears if the logo image fails to load. */
.wordmark {
  display: none;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--ink-navy);
}
.brand-logo.logo-missing + .wordmark { display: inline; }
.nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.5vw, 28px);
}
.nav-links {
  display: flex;
  gap: clamp(14px, 2.5vw, 26px);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 1rem;
  color: var(--ink-navy);
  text-decoration: none;
  padding: 4px 2px;
}
.nav-links a:hover { color: var(--current-blue); }
.nav-links a[aria-current="page"] {
  color: var(--current-blue);
  box-shadow: inset 0 -2px 0 var(--azure);
}

/* Compact header on small screens: keep wordmark + primary action */
@media (max-width: 620px) {
  .nav-links { display: none; }
}

/* ----- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.1;
  padding: 0.85em 1.6em;
  border-radius: 999px;
  border: 1.5px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
}
.btn-primary {
  background: var(--current-blue);   /* white on #1C4FD8 ≈ 6.6:1, passes AA */
  color: var(--white);
}
.btn-primary:hover {
  /* permitted logo sweep, kept within AA range (deep royal to current blue) */
  background: linear-gradient(135deg, var(--deep-royal), var(--current-blue));
  color: var(--white);
  box-shadow: 0 8px 24px rgba(28, 79, 216, .32);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--current-blue);
  border-color: rgba(28, 79, 216, .4);
}
.btn-ghost:hover {
  background: var(--ice);
  color: var(--deep-royal);
  border-color: var(--current-blue);
}
.btn-sm { padding: 0.6em 1.15em; font-size: 0.95rem; }

/* Secondary text link, used on the dark hero */
.textlink {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 1.02rem;
  color: var(--ice);
  text-decoration: underline;
  text-decoration-color: var(--azure);
  text-underline-offset: 4px;
  text-decoration-thickness: 1.5px;
}
.textlink:hover { color: var(--azure); }
.textlink .arrow { transition: transform .15s ease; display: inline-block; }
.textlink:hover .arrow { transform: translateX(3px); }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 24px;
  margin-top: clamp(24px, 3vw, 34px);
}

/* ----- Hero -------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  color: var(--text-on-dark);
  background:
    radial-gradient(1100px 620px at 88% -12%, rgba(59, 138, 247, .38), transparent 62%),
    linear-gradient(158deg, var(--ink-navy) 8%, var(--deep-royal) 96%);
}
.hero .container {
  position: relative;
  z-index: 2;
  display: grid;
  gap: clamp(32px, 5vw, 56px);
  align-items: center;
  padding-block: clamp(56px, 9vw, 104px);
}
.hero h1 { color: var(--white); max-width: 15ch; }
.hero .hero-sub {
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  color: var(--text-on-dark-muted);
  line-height: 1.6;
  max-width: 42ch;
  margin-top: 0.4em;
}
.hero .eyebrow { color: var(--azure); }

.hero-tagline {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: clamp(1rem, 1.7vw, 1.15rem);
  letter-spacing: 0.01em;
  color: var(--azure);
  margin-bottom: 1.1em;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
}
.hero-tagline span { color: var(--ice); }
.hero-tagline b { color: var(--azure); font-weight: 600; }

@media (min-width: 900px) {
  .hero .container { grid-template-columns: 1.15fr 0.85fr; }
}

.hero-media {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(5, 12, 32, .45);
}

/* Decorative flowing-line motif inside the hero */
.hero-motif {
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  z-index: 1;
  opacity: 0.9;
  pointer-events: none;
}

/* ----- Image brand treatment -------------------------------------------- */
/* Every photo gets a cool grade so the set reads as one family; hero and
   banner images additionally get a ~30% Ink navy overlay. */
.media {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
}
.media img {
  width: 100%;
  height: auto;
  display: block;
  filter: saturate(0.9) contrast(1.03) brightness(0.99);
}
.media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(160deg, rgba(18, 51, 158, .18), rgba(10, 22, 51, .12));
}
.media--hero::after {
  background: linear-gradient(160deg, rgba(18, 51, 158, .30), rgba(10, 22, 51, .34));
}
.media--tall img { aspect-ratio: 3 / 4; object-fit: cover; }

.figure figcaption {
  margin-top: 12px;
  font-size: 0.92rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ----- Generic grids & cards -------------------------------------------- */
.grid { display: grid; gap: var(--gap); }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

.card {
  background: var(--white);
  border: 1px solid rgba(18, 51, 158, .12);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 3vw, 32px);
  box-shadow: var(--shadow-sm);
  height: 100%;
}
.section--ice .card { background: var(--white); }
.section--paper .card { background: var(--ice); border-color: rgba(18, 51, 158, .10); }
.card h3 { margin-top: 0.1em; }
.card p { color: var(--text-muted); margin-bottom: 0; }

.card-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--current-blue);
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.8em;
}

/* Numbered step list (how it works) */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px 20px;
  align-items: start;
  background: var(--white);
  border: 1px solid rgba(18, 51, 158, .12);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 2.6vw, 28px);
  box-shadow: var(--shadow-sm);
}
.section--paper .step { background: var(--ice); }
.step-index {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--white);
  background: var(--current-blue);
  width: 2.4rem; height: 2.4rem;
  display: grid; place-items: center;
  border-radius: 50%;
  flex: none;
}
.step h3 { margin: 0 0 0.35em; }
.step p { margin: 0; color: var(--text-muted); }

/* ----- Two-column media + text feature ---------------------------------- */
.feature {
  display: grid;
  gap: clamp(28px, 4vw, 52px);
  align-items: center;
}
@media (min-width: 860px) {
  .feature { grid-template-columns: 1fr 1fr; }
  .feature--reverse .feature-media { order: 2; }
}
.feature-body p { color: var(--text-muted); }
.feature-body .lead { color: var(--text); }

/* Bio detail lines */
.factlist { list-style: none; margin: 1.4em 0 0; padding: 0; display: grid; gap: 10px; }
.factlist li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: baseline;
  color: var(--text-muted);
}
.factlist .dot { color: var(--azure); font-size: 1.1em; line-height: 1; }

/* ----- Problem blocks (plain, no cards) --------------------------------- */
.problem { display: grid; gap: clamp(22px, 3vw, 34px); }
@media (min-width: 760px) { .problem { grid-template-columns: repeat(3, 1fr); } }
.problem h3 { display: flex; align-items: baseline; gap: 0.5em; }
.problem p { color: var(--text-muted); margin-bottom: 0; }
.problem .num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--current-blue);
  font-weight: 500;
}

/* ----- Advisory strip ---------------------------------------------------- */
.advisory {
  background:
    radial-gradient(700px 400px at 100% 0%, rgba(59, 138, 247, .12), transparent 60%),
    var(--ice);
  border: 1px solid rgba(18, 51, 158, .12);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 4vw, 44px);
}
.advisory .eyebrow { color: var(--current-blue); }
.advisory p { color: var(--text-muted); }

/* ----- Founding client banner ------------------------------------------- */
.banner {
  position: relative;
  overflow: hidden;
  color: var(--text-on-dark);
  background:
    radial-gradient(680px 380px at 92% 10%, rgba(59, 138, 247, .34), transparent 60%),
    linear-gradient(150deg, var(--ink-navy), var(--deep-royal));
  border-radius: var(--radius-lg);
  padding: clamp(30px, 4.4vw, 52px);
}
.banner .eyebrow { color: var(--azure); }
.banner h2 { color: var(--white); }
.banner p { color: var(--text-on-dark-muted); }
.banner .banner-rate {
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--ice);
  font-size: clamp(1.05rem, 1.8vw, 1.2rem);
  margin-top: 0.6em;
}

/* ----- Final call to action --------------------------------------------- */
.cta-final {
  position: relative;
  overflow: hidden;
  color: var(--text-on-dark);
  background:
    radial-gradient(900px 500px at 15% 0%, rgba(59, 138, 247, .30), transparent 60%),
    linear-gradient(158deg, var(--ink-navy), var(--deep-royal));
}
.cta-final .container { position: relative; z-index: 2; text-align: center; max-width: 46rem; }
.cta-final h2 { color: var(--white); }
.cta-final p { color: var(--text-on-dark-muted); font-size: 1.2rem; }
.cta-final .cta-row { justify-content: center; }
.cta-final .btn-primary { background: var(--azure); color: var(--ink-navy); }
.cta-final .btn-primary:hover {
  background: var(--white);
  color: var(--ink-navy);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
}

/* ----- Motif (flowing water lines into nodes) --------------------------- */
.motif { width: 100%; height: auto; display: block; }
.motif-lines path {
  fill: none;
  stroke: var(--current-blue);
  stroke-width: 1.5;
  stroke-linecap: round;
  opacity: 0.4;
}
.motif-nodes circle { fill: var(--azure); opacity: 0.75; }
.hero-motif .motif-lines path { stroke: var(--azure); opacity: 0.38; }
.hero-motif .motif-nodes circle { fill: var(--ice); opacity: 0.85; }

.divider { padding-block: 8px; }
.divider .container { padding-inline: var(--pad-x); }

/* ----- Footer ------------------------------------------------------------ */
.site-footer {
  background: var(--ink-navy);
  color: var(--text-on-dark-muted);
  padding-block: clamp(40px, 6vw, 64px);
}
.site-footer a { color: var(--ice); text-decoration: none; }
.site-footer a:hover { color: var(--azure); text-decoration: underline; text-underline-offset: 3px; }
.footer-top {
  display: grid;
  gap: 28px;
  align-items: start;
}
@media (min-width: 720px) {
  .footer-top { grid-template-columns: 1.4fr 1fr; }
}
.footer-word {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--ice);
  letter-spacing: -0.02em;
}
.footer-tag {
  font-family: var(--font-head);
  font-weight: 500;
  color: var(--azure);
  margin-top: 0.5em;
}
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px 24px; }
.footer-links li { font-family: var(--font-head); font-weight: 500; }
.footer-base {
  margin-top: clamp(28px, 4vw, 40px);
  padding-top: 20px;
  border-top: 1px solid rgba(234, 241, 253, .16);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
  font-size: 0.92rem;
  color: var(--text-on-dark-muted);
}

/* ----- Reveal on scroll (progressive enhancement) ----------------------- */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .6s ease, transform .6s ease;
  will-change: opacity, transform;
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ----- Reduced motion ---------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .btn-primary:hover { transform: none; }
}
