/* ============================================================
   Design foundations: brand-neutral reset, layout primitives and
   section patterns. Shared vocabulary of the `taste` and
   `octomatica-design` skills (see ../patterns.md).

   Load order: foundation.css -> theme.css (a taste direction, or
   your own tokens; it overrides the defaults below) -> page.css
   (page-specific, tokens only) -> print.css with media="print".

   It reads only the token contract (../README.md). The defaults
   below are a deliberately plain scaffold: a page shipped on them
   has skipped the design step.
   ============================================================ */

:root {
  /* surfaces + text */
  --bg: #fbfbfa; --surface: #ffffff; --surface-2: #f2f2ef;
  --ink-field: #1b1c1d; --on-ink: #f3f3f0; --on-ink-muted: #c4c5c1;
  --ink: #161718; --muted-strong: #3f4143; --muted: #5d6063;
  --line: #e4e4e0; --line-strong: #cfcfca;
  /* accent: signal, primary fill, text on the fill, accent as text, wash */
  --accent: #3a5a8c; --accent-fill: #3a5a8c; --accent-on-fill: #ffffff;
  --accent-text: #34517e; --accent-soft: #e6ecf5;
  /* type */
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: var(--font-body);
  --fs-display: clamp(2.6rem, 1.4rem + 5.4vw, 6rem);
  --fs-h2: clamp(2rem, 1.3rem + 3vw, 4rem);
  --fs-h3: clamp(1.25rem, 1.1rem + 0.7vw, 1.75rem);
  --fs-lead: clamp(1.0625rem, 1rem + 0.35vw, 1.3rem);
  --fs-body: 1rem; --fs-small: 0.875rem; --fs-micro: 0.75rem;
  --tr-display: -0.03em; --tr-h2: -0.025em; --w-display: 700; --lh-display: 1;
  --case-eyebrow: uppercase; --tr-eyebrow: 0.12em;
  /* shape */
  --radius: 14px; --radius-sm: 8px; --radius-button: 999px;
  /* layout */
  --shell: min(1280px, calc(100vw - 32px));
  --section-pad: clamp(56px, 4vw + 36px, 112px);
  --header-height: 64px;
  /* motion */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1); --dur: 560ms;
  color-scheme: light dark;
}

@media (min-width: 760px) { :root { --shell: min(1280px, calc(100vw - 64px)); --header-height: 72px; } }
@media (min-width: 1100px) { :root { --shell: min(1280px, calc(100vw - 96px)); } }

/* ── Reset. body margin 0 is what keeps header and hero edge to edge. ── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: var(--fs-body); line-height: 1.6;
  overflow-x: clip; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p, figure, blockquote, dl, dd, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img, video, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
main [id] { scroll-margin-top: calc(var(--header-height) + 24px); }

/* ── Accessibility primitives ── */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.skip-link {
  position: absolute; left: 12px; top: -100px; z-index: 100;
  padding: 10px 16px; border-radius: var(--radius-sm);
  background: var(--ink); color: var(--bg); font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ── Type ── */
.display, .h2, .h3 { font-family: var(--font-display); color: inherit; text-wrap: balance; }
.display { font-size: var(--fs-display); font-weight: var(--w-display); letter-spacing: var(--tr-display); line-height: var(--lh-display); }
.h2 { font-size: var(--fs-h2); font-weight: var(--w-display); letter-spacing: var(--tr-h2); line-height: 1.04; }
.h3 { font-size: var(--fs-h3); font-weight: 650; letter-spacing: -0.01em; line-height: 1.2; }
.h4 { font-size: 1.0625rem; font-weight: 700; line-height: 1.35; }
.lead { font-size: var(--fs-lead); line-height: 1.5; color: var(--muted-strong); max-width: 60ch; text-wrap: pretty; }
.eyebrow, .label {
  font-size: var(--fs-micro); font-weight: 700; line-height: 1.3;
  text-transform: var(--case-eyebrow); letter-spacing: var(--tr-eyebrow);
}
.eyebrow { color: var(--accent-text); }
.label { color: var(--muted); }
.num { font-family: var(--font-display); font-weight: var(--w-display); font-variant-numeric: tabular-nums lining-nums; letter-spacing: -0.03em; line-height: 1; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-small); }
p + p { margin-top: 0.9em; }
.prose { max-width: 66ch; }
.print-only { display: none; }

/* ── Layout primitives ── */
.shell { width: var(--shell); margin-inline: auto; }
.section { padding-block: var(--section-pad); }
.section-tight { padding-block: calc(var(--section-pad) * 0.5); }
.section + .section:not(.band):not(.band-ink) { padding-top: calc(var(--section-pad) * 0.6); }
.band { background: var(--surface-2); }
.band-ink { background: var(--ink-field); color: var(--on-ink); }
.band-ink .lead, .band-ink .muted, .band-ink .label { color: var(--on-ink-muted); }
.band-ink .eyebrow { color: var(--on-ink-muted); }
.stack > * + * { margin-top: var(--stack, 1rem); }

.intro { display: grid; gap: 16px; max-width: 58rem; margin-bottom: clamp(32px, 4vw, 56px); }
.intro-row { display: grid; gap: 20px; margin-bottom: clamp(32px, 4vw, 56px); }
.split { display: grid; gap: clamp(28px, 4vw, 72px); }
@media (min-width: 900px) {
  .intro-row { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: end; gap: 64px; }
  .split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; }
  .split-flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .split-sticky > :first-child { position: sticky; top: calc(var(--header-height) + 32px); }
}

/* ── Header: full width, no box. Transparent at top, a solid bar after scroll. ── */
.site-header { position: sticky; top: 0; z-index: 50; background: transparent; transition: background var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out); }
.site-header.is-scrolled { background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(14px); box-shadow: 0 1px 0 var(--line); }
.header-inner { width: var(--shell); margin-inline: auto; min-height: var(--header-height); display: flex; align-items: center; gap: 24px; }
.brand { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em; text-decoration: none; margin-right: auto; }
.nav-links { display: none; gap: 28px; font-size: var(--fs-small); font-weight: 600; }
.nav-links a { text-decoration: none; color: var(--muted-strong); padding-block: 8px; }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--ink); }
@media (min-width: 900px) { .nav-links { display: flex; } }

/* ── Hero: edge to edge, never framed. Variants add structure, not boxes. ── */
.hero { position: relative; display: grid; align-content: center; min-height: min(88svh, 900px); padding-block: clamp(48px, 8vw, 120px); overflow: clip; }
.hero-compact { min-height: 0; padding-block: clamp(40px, 6vw, 88px) clamp(32px, 4vw, 64px); }
.hero-inner { width: var(--shell); margin-inline: auto; display: grid; gap: 24px; position: relative; }
.hero-split .hero-inner { gap: clamp(32px, 5vw, 80px); }
@media (min-width: 900px) { .hero-split .hero-inner { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: center; } }
.hero .lead { max-width: 44ch; }
.hero-media { border-radius: var(--radius); overflow: hidden; }
.hero-bleed { position: absolute; inset: 0; z-index: -1; }
.hero-bleed img { width: 100%; height: 100%; object-fit: cover; }

/* ── Actions ── */
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 24px; border-radius: var(--radius-button);
  border: 1.5px solid transparent; font-weight: 700; font-size: 0.9375rem; line-height: 1.2;
  text-decoration: none; cursor: pointer;
  transition: transform 200ms var(--ease-out), background 200ms var(--ease-out), border-color 200ms var(--ease-out);
}
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--accent-fill); color: var(--accent-on-fill); }
.button-quiet { border-color: var(--line-strong); color: inherit; background: transparent; }
.button-quiet:hover { border-color: currentColor; }
.band-ink .button-quiet { border-color: color-mix(in srgb, var(--on-ink) 35%, transparent); }
.text-link { font-weight: 700; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 0.25em; }
@media (max-width: 559px) { .actions-stack { flex-direction: column; align-items: stretch; } }

/* ── Lists without boxes ── */
.rule-list { display: grid; gap: 0 clamp(20px, 3vw, 40px); }
.rule-list > * { display: grid; align-content: start; gap: 10px; padding-block: 20px 28px; border-top: 2px solid var(--ink); }
.band-ink .rule-list > * { border-top-color: var(--on-ink); }
@media (min-width: 700px) { .rule-list { grid-template-columns: repeat(min(var(--cols, 3), 2), minmax(0, 1fr)); } }
@media (min-width: 1100px) { .rule-list { grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); } }

.index-list { counter-reset: idx; }
.index-list > li { counter-increment: idx; display: grid; gap: 6px 24px; padding-block: 24px; border-top: 1px solid var(--line-strong); }
.index-list > li:last-child { border-bottom: 1px solid var(--line-strong); }
.index-list > li::before { content: counter(idx, decimal-leading-zero); font-family: var(--font-display); font-weight: var(--w-display); font-size: clamp(1.75rem, 1.2rem + 1.8vw, 3rem); line-height: 1; color: var(--accent-text); font-variant-numeric: tabular-nums; }
@media (min-width: 760px) { .index-list > li { grid-template-columns: 5.5rem minmax(0, 0.9fr) minmax(0, 1.3fr); align-items: baseline; } }

.kv > div { display: grid; gap: 4px 24px; padding-block: 16px; border-top: 1px solid var(--line); }
.kv > div:last-child { border-bottom: 1px solid var(--line); }
.kv dt { color: var(--muted); font-size: var(--fs-small); font-weight: 600; }
@media (min-width: 640px) { .kv > div { grid-template-columns: minmax(9rem, 0.4fr) 1fr; } }

.facts { display: grid; gap: 24px clamp(20px, 3vw, 40px); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.facts > div { display: grid; gap: 8px; padding-top: 16px; border-top: 1px solid var(--line-strong); }
.facts strong { font-family: var(--font-display); font-weight: var(--w-display); font-size: clamp(2.25rem, 1.6rem + 2.6vw, 4.25rem); line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums lining-nums; }
@media (min-width: 900px) { .facts { grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); } }

.faq details { border-top: 1px solid var(--line-strong); }
.faq details:last-child { border-bottom: 1px solid var(--line-strong); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 24px; padding-block: 22px; font-family: var(--font-display); font-size: var(--fs-h3); font-weight: 600; line-height: 1.25; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; font-weight: 400; transition: transform 240ms var(--ease-out); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding-bottom: 24px; max-width: 64ch; color: var(--muted-strong); }

/* ── Colour fields: blocks of colour instead of bordered cards. --span out of 12. ── */
.fields { display: grid; gap: 12px; }
.field { position: relative; display: grid; align-content: space-between; gap: 32px; min-height: 200px; padding: clamp(24px, 3vw, 40px); border-radius: var(--radius); background: var(--field-bg, var(--surface-2)); color: var(--field-ink, var(--ink)); overflow: hidden; }
@media (min-width: 900px) { .fields { grid-template-columns: repeat(12, minmax(0, 1fr)); } .field { grid-column: span var(--span, 6); min-height: 280px; } }
.field-1 { --field-bg: var(--field-1, var(--surface-2)); --field-ink: var(--field-1-ink, var(--ink)); }
.field-2 { --field-bg: var(--field-2, var(--accent-soft)); --field-ink: var(--field-2-ink, var(--ink)); }
.field-3 { --field-bg: var(--field-3, var(--ink-field)); --field-ink: var(--field-3-ink, var(--on-ink)); }

/* ── The few bordered surfaces: a data board and the closing brief. ── */
.board { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.board th, .board td { padding: 14px 18px; text-align: left; border-top: 1px solid var(--line); vertical-align: top; }
.board thead th { border-top: 0; font-size: var(--fs-micro); text-transform: var(--case-eyebrow); letter-spacing: var(--tr-eyebrow); color: var(--muted); }
.board td.num-cell { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.board-wrap { overflow-x: auto; }

.callout { display: grid; gap: 8px; padding: clamp(20px, 3vw, 32px); border-radius: var(--radius); background: var(--accent-soft); color: var(--ink); }
.quote { font-family: var(--font-display); font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.5rem); line-height: 1.2; letter-spacing: -0.015em; max-width: 30ch; text-wrap: balance; }
.quote + .label, .quote + figcaption { margin-top: 20px; }
.brief { display: grid; gap: 28px; padding: clamp(28px, 5vw, 64px); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
@media (min-width: 900px) { .brief { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: end; } }

.media { border-radius: var(--radius); overflow: hidden; }
.media img { width: 100%; height: 100%; object-fit: cover; }
figcaption { margin-top: 10px; font-size: var(--fs-small); color: var(--muted); }

/* ── Footer ── */
.site-footer { padding-block: clamp(48px, 6vw, 88px) 32px; background: var(--surface-2); font-size: var(--fs-small); }
.footer-cols { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.footer-cols h2 { font-size: var(--fs-micro); text-transform: var(--case-eyebrow); letter-spacing: var(--tr-eyebrow); color: var(--muted); margin-bottom: 12px; }
.footer-cols li + li { margin-top: 6px; }
.footer-cols a { text-decoration: none; }
.footer-cols a:hover { text-decoration: underline; }

/* ── Motion: reveal once, only when scripts run; nothing hides without JS. ── */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity var(--dur) var(--ease-out) var(--delay, 0ms), transform calc(var(--dur) + 120ms) var(--ease-out) var(--delay, 0ms); }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
  .button:hover { transform: none; }
}
