/* ==========================================================================
   Garrison Sterling — site.css (v2)
   Editorial: paper pages, ink bands, serif display. Plain CSS, no build step.
   ========================================================================== */

/* --- Fonts (self-hosted, OFL) ------------------------------------------- */
@font-face {
  font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/IBMPlexSans-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../fonts/IBMPlexSans-Medium.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('../fonts/IBMPlexSans-SemiBold.woff2') format('woff2');
}
/* Source Serif 4: display headlines and lead lines. */
@font-face {
  font-family: 'Source Serif 4'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/SourceSerif4-Regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Source Serif 4'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('../fonts/SourceSerif4-Semibold.woff2') format('woff2');
}

/* --- Tokens --------------------------------------------------------------- */
:root {
  /* Company colours: aubergine and silver, from the logo pack and the client platform. */
  --paper: #F3F0EB;          /* page background */
  --paper-2: #E9E4E0;        /* tinted bands */
  --ink: #2E1A31;            /* text, buttons, heavy rules (logo's deep aubergine) */
  --aubergine: #3D2340;      /* footer background (logo aubergine) */
  --plum: #5C4370;           /* button hover */
  --mauve: #6B5276;          /* the one accent on paper: labels, underlines (AA) */
  --slate: #5E5564;          /* secondary text on paper (AA) */
  --silver: #C3BEC7;         /* accent and secondary text on aubergine */

  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;

  --max: 1200px;
  --gutter: 20px;
  --nav-h: 76px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
@media (min-width: 768px) { :root { --gutter: 40px; --nav-h: 88px; } }

/* Surfaces. Paper is the page; ink bands opt in. Components read these. */
body {
  --bg: var(--paper); --fg: var(--ink); --fg-2: var(--slate);
  --rule: rgba(46, 26, 49, 0.16); --accent: var(--mauve);
}
.tint { --bg: var(--paper-2); background: var(--bg); }
.footer {
  --bg: var(--aubergine); --fg: var(--paper); --fg-2: var(--silver);
  --rule: rgba(243, 240, 235, 0.18); --accent: var(--silver);
  background: var(--bg); color: var(--fg);
}

/* --- Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--paper); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
main { flex: 1 0 auto; }
@media (min-width: 768px) { body { font-size: 1.125rem; } }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
p { margin: 0 0 1em; max-width: 60ch; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
canvas, svg, img { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
::selection { background: var(--ink); color: var(--paper); }

.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;
}
.skip-link {
  position: absolute; left: var(--gutter); top: -100px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 8px 14px; font-weight: 500;
}
.skip-link:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.muted { color: var(--fg-2); }
.eyebrow {
  display: flex; align-items: center; gap: 14px;
  font-size: 0.8125rem; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent);
  max-width: none;
}
.eyebrow::before { content: ''; width: 28px; height: 1px; background: currentColor; flex: none; }

/* --- Logo: one swappable component --------------------------------------- */
.logo { display: inline-flex; align-items: center; flex-shrink: 0; }
.logo__img { height: 40px; width: auto; }
@media (min-width: 768px) { .logo__img { height: 44px; } }
.logo__wordmark { height: 18px; width: auto; }

/* --- Buttons and links --------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 14px 30px;
  border: 1px solid var(--fg); border-radius: 2px;
  font-weight: 500; font-size: 1rem; line-height: 1.2; white-space: nowrap;
  color: var(--bg); background: var(--fg);
  transition: background-color 200ms var(--ease), color 200ms var(--ease), border-color 200ms var(--ease);
}
.btn:hover { background: var(--plum); border-color: var(--plum); color: var(--paper); }
.btn--sm, .btn--line {
  background: transparent; color: var(--fg); border-color: var(--accent);
}
.btn--sm:hover, .btn--line:hover { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.btn--sm { min-height: 40px; padding: 8px 18px; font-size: 0.875rem; }
.link {
  color: var(--fg); font-weight: 500;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
  transition: color 200ms var(--ease);
}
.link:hover { color: var(--accent); }
.link--arrow::after { content: '\2192'; margin-left: 0.45em; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 32px; }

/* --- Nav ----------------------------------------------------------------- */
.nav {
  position: absolute; top: 0; left: 0; right: 0; z-index: 30;
  min-height: var(--nav-h);
  display: flex; align-items: center;
  color: var(--fg);
}
.nav--static { position: relative; }
.nav__bar { display: flex; align-items: center; justify-content: space-between; gap: 32px; min-height: var(--nav-h); }
.nav__links { display: flex; align-items: center; gap: 36px; }
.nav__link {
  font-size: 0.9375rem; font-weight: 500; color: var(--fg-2);
  padding: 6px 0; border-bottom: 1px solid transparent;
  transition: color 200ms var(--ease), border-color 200ms var(--ease);
}
.nav__link:hover { color: var(--fg); }
.nav__link[aria-current="page"] { color: var(--fg); border-bottom-color: var(--accent); }
.nav__cta { margin-left: 8px; }

.nav__toggle {
  display: none; align-items: center; gap: 10px;
  min-height: 44px; padding: 0 4px; z-index: 41; position: relative;
  font-size: 0.875rem; font-weight: 500; color: var(--fg);
}
.nav__toggle-icon { position: relative; width: 20px; height: 12px; }
.nav__toggle-icon::before, .nav__toggle-icon::after {
  content: ''; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor;
  transition: transform 200ms var(--ease), top 200ms var(--ease), bottom 200ms var(--ease);
}
.nav__toggle-icon::before { top: 0; }
.nav__toggle-icon::after { bottom: 0; }
.nav__toggle[aria-expanded="true"] .nav__toggle-icon::before { top: 5px; transform: rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__toggle-icon::after { bottom: 5px; transform: rotate(-45deg); }

@media (max-width: 899px) {
  .nav__toggle { display: inline-flex; }
  .nav__links {
    display: none;
    position: fixed; inset: 0; z-index: 40;
    flex-direction: column; align-items: flex-start; justify-content: center;
    gap: 4px;
    padding: var(--nav-h) var(--gutter) 40px;
    background: var(--bg);
  }
  .nav__links.is-open { display: flex; }
  .nav .logo { position: relative; z-index: 41; }
  .nav__link {
    font-family: var(--serif); font-size: 2.25rem; font-weight: 400; letter-spacing: -0.02em;
    color: var(--fg); padding: 6px 0;
  }
  .nav__cta { margin: 32px 0 0; }
  body.nav-open { overflow: hidden; }
}

/* --- Display type -------------------------------------------------------- */
.hero__title, .page-title, .pullquote, .statement__text, .row__title, .lead,
.step__title, .trait__title, .empty__title, .research__title, .person__name {
  font-family: var(--serif); font-weight: 400;
}

/* --- Hero (Home) --------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex; align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
  border-bottom: 1px solid var(--fg);
}
.hero__canvas { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; }
.hero__shade {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    linear-gradient(to top, rgba(243, 240, 235, 0.94) 0%, rgba(243, 240, 235, 0.5) 45%, rgba(243, 240, 235, 0) 78%),
    linear-gradient(to right, rgba(243, 240, 235, 0.7) 0%, rgba(243, 240, 235, 0) 62%);
}
.hero__inner {
  position: relative; z-index: 1;
  padding-top: calc(var(--nav-h) + 48px);
  padding-bottom: 64px;
}
@media (min-width: 768px) { .hero__inner { padding-bottom: 104px; } }
.hero__promise { margin-bottom: 28px; }
.hero__title {
  font-size: clamp(3rem, 8.4vw, 7.25rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  max-width: 11ch;
  text-wrap: balance;
}
.hero__actions { margin-top: 44px; }
@media (min-width: 768px) { .hero__actions { margin-top: 56px; } }

/* --- Page heads (inner pages) -------------------------------------------- */
.page-head {
  position: relative;
  padding-top: calc(var(--nav-h) + 64px);
  padding-bottom: 56px;
  border-bottom: 1px solid var(--fg);
}
@media (min-width: 768px) { .page-head { padding-top: calc(var(--nav-h) + 120px); padding-bottom: 96px; } }
.page-head--tall { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding-bottom: 96px; border-bottom: 0; }
.page-head .eyebrow { margin-bottom: 28px; }
.page-title {
  font-size: clamp(2.5rem, 6.4vw, 5.25rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  max-width: 16ch;
  text-wrap: balance;
}
.conviction {
  margin-top: 32px;
  font-size: 1.1875rem; line-height: 1.5;
  color: var(--fg-2);
  max-width: 46ch;
}
@media (min-width: 768px) { .conviction { margin-top: 40px; font-size: 1.375rem; } }
.contact__line { margin-top: 44px; }

/* --- Blocks -------------------------------------------------------------- */
.block { padding: 64px 0; }
@media (min-width: 768px) { .block { padding: 112px 0; } }
.block + .block { border-top: 1px solid var(--rule); }
.page-head + .block, .hero + .block { border-top: 0; }
.block__grid { display: grid; gap: 24px; }
@media (min-width: 900px) {
  .block__grid { grid-template-columns: minmax(0, 3fr) minmax(0, 8fr); column-gap: 64px; align-items: start; }
}
.block__title {
  font-family: var(--sans); font-size: 0.8125rem; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase; line-height: 1.6;
  color: var(--accent);
  padding-top: 0.6em;
}
.block__body { font-size: 1.125rem; line-height: 1.65; }
.block__body p { max-width: 54ch; color: var(--fg-2); }
.block__body > p:first-child, .lead {
  font-family: var(--serif);
  font-size: clamp(1.375rem, 2.3vw, 1.9375rem); line-height: 1.3; letter-spacing: -0.012em;
  color: var(--fg); max-width: 36ch; margin-bottom: 1em;
}
.block__body > p:first-child:last-child { margin-bottom: 0; }
.block__body--equal > p {
  font-family: var(--serif);
  font-size: clamp(1.375rem, 2.3vw, 1.9375rem); line-height: 1.3; letter-spacing: -0.012em;
  color: var(--fg); max-width: 36ch; margin: 0; padding: 20px 0; border-top: 1px solid var(--rule);
}
.block__body--equal > p:first-child { margin: 0; padding-top: 0; border-top: 0; }
.block__body--equal > p:last-child { padding-bottom: 0; }
.block__body .actions { margin-top: 36px; }

/* --- Home: statement, rows ----------------------------------------------- */
.statement__text {
  font-size: clamp(1.75rem, 4vw, 3.25rem); line-height: 1.16; letter-spacing: -0.02em;
  max-width: 30ch; margin-bottom: 0;
}
.rows { margin-top: 32px; border-top: 1px solid var(--fg); }
.row { display: grid; gap: 10px; padding: 32px 0; border-bottom: 1px solid var(--rule); }
@media (min-width: 900px) {
  .row { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); column-gap: 64px; align-items: baseline; padding: 44px 0; }
}
.row__title { font-size: clamp(1.75rem, 3.4vw, 2.75rem); letter-spacing: -0.02em; line-height: 1.05; }
.row p { color: var(--fg-2); font-size: 1.125rem; line-height: 1.55; max-width: 44ch; }
.row .link { display: inline-block; margin-top: 14px; }

/* --- Method diagram (inline SVG) ----------------------------------------- */
.method .block__title, .method .eyebrow { margin-bottom: 24px; padding-top: 0; }
.method__svg { width: 100%; max-width: 980px; height: auto; margin: 8px 0; overflow: visible; }
.method__field { fill: none; stroke: var(--rule); stroke-width: 1; }
.method__spine { stroke: var(--accent); stroke-width: 1; }
.method__node circle, .method__node rect, .method__node line { fill: var(--bg); stroke: var(--fg); stroke-width: 1.2; }
.method__node line { stroke-opacity: 0.4; }
.method__node .method__core { fill: var(--accent); stroke: none; }
.method__tick path { fill: none; stroke: var(--accent); stroke-width: 1.2; }
.method__label text { fill: var(--fg); font-family: var(--serif); font-size: 24px; text-anchor: middle; }
@media (max-width: 599px) { .method__label text { font-size: 38px; } .method__svg { margin: 0 -6px; width: calc(100% + 12px); } }
.method__steps { display: grid; gap: 16px; margin-top: 16px; }
@media (min-width: 768px) { .method__steps { grid-template-columns: repeat(3, 1fr); gap: 48px; } }
.method__steps li { padding-top: 16px; border-top: 1px solid var(--rule); }
.method__steps p { color: var(--fg-2); font-size: 1.0625rem; line-height: 1.5; max-width: 30ch; }

/* numbered 1-2-3 (Company) */
.steps { display: grid; gap: 28px; margin-top: 24px; }
@media (min-width: 768px) { .steps--row { grid-template-columns: repeat(3, 1fr); gap: 48px; } }
.step { display: grid; gap: 10px; padding-top: 20px; border-top: 1px solid var(--rule); align-content: start; }
.step__n { font-weight: 500; color: var(--accent); font-size: 0.875rem; letter-spacing: 0.1em; }
.step__title { font-size: 1.75rem; letter-spacing: -0.015em; margin-bottom: 8px; }
.step p { font-size: 1.0625rem; color: var(--fg-2); max-width: 32ch; line-height: 1.55; }

/* --- Traits --------------------------------------------------------------- */
.traits { display: grid; gap: 0; }
.traits li { padding: 26px 0; border-top: 1px solid var(--rule); display: grid; gap: 6px; }
.traits li:first-child { border-top-color: var(--fg); }
@media (min-width: 700px) { .traits li { grid-template-columns: 11rem 1fr; column-gap: 32px; align-items: baseline; } }
.trait__title { font-size: 1.625rem; letter-spacing: -0.015em; }
.traits p, .block__body.traits p { color: var(--fg-2); font-family: var(--sans); font-size: 1.0625rem; line-height: 1.55; letter-spacing: 0; max-width: 46ch; margin: 0; }

/* --- Pull-quote and closing ------------------------------------------------ */
.pullquote {
  font-size: clamp(2rem, 4.6vw, 3.75rem); line-height: 1.1; letter-spacing: -0.025em;
  max-width: 26ch; text-wrap: balance;
}
.closing { text-align: left; }
.closing__cta { margin-top: 44px; }

/* --- Founders (hidden by flag) --------------------------------------------- */
.people { display: grid; gap: 24px; }
.person__name { font-size: 1.5rem; }
.block__body.people p { font-family: var(--sans); font-size: 1.0625rem; color: var(--fg-2); letter-spacing: 0; }

/* --- Research list + empty state ------------------------------------------- */
.research { display: grid; border-top: 1px solid var(--fg); }
.research__item { padding: 32px 0; border-bottom: 1px solid var(--rule); display: grid; gap: 8px; }
.research__date { font-size: 0.8125rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.research__title { font-size: clamp(1.5rem, 2.6vw, 2.125rem); letter-spacing: -0.015em; line-height: 1.15; }
a.research__title:hover { color: var(--accent); }
.research__summary { color: var(--fg-2); }
.empty__title { font-size: clamp(2rem, 4.6vw, 3.75rem); letter-spacing: -0.025em; line-height: 1.1; margin-bottom: 24px; }
.empty p + p { margin-top: 8px; }

.link--lg { font-family: var(--serif); font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 400; letter-spacing: -0.015em; }

/* --- Footer ---------------------------------------------------------------- */
.footer { padding: 56px 0 36px; border-top: 1px solid var(--rule); }
.footer__row {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 24px 40px;
  font-size: 0.875rem; color: var(--fg-2);
}
.footer__links { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 28px; }
.footer__links a { transition: color 200ms var(--ease); }
.footer__links a:hover { color: var(--fg); }
.footer__icon { display: inline-flex; width: 18px; height: 18px; }
.footer__tag { margin-top: 14px; font-size: 0.8125rem; color: var(--fg-2); }

/* --- Legal pages: paper, plain prose --------------------------------------- */
.prose { padding: 40px 0 80px; }
@media (min-width: 768px) { .prose { padding: 64px 0 112px; } }
.prose .wrap { max-width: calc(68ch + 2 * var(--gutter)); margin-left: 0; }
@media (min-width: 1000px) { .prose .wrap { margin-left: max(var(--gutter), calc((100% - var(--max) - 2 * var(--gutter)) / 2 + var(--gutter))); padding-left: 0; } }
.prose .eyebrow { margin-bottom: 20px; }
.prose .page-title { font-size: clamp(2.25rem, 5vw, 3.5rem); margin-bottom: 12px; }
.prose h2 { font-size: 1.25rem; margin: 40px 0 10px; letter-spacing: -0.01em; }
.prose p { max-width: 68ch; }

/* --- Reveal on scroll (300ms fade only) ------------------------------------ */
.reveal { opacity: 0; transition: opacity 300ms var(--ease); }
.reveal.is-visible { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transition: none; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
