/* Self-hosted fonts (SIL Open Font License) — no third-party requests, works with CSP default-src 'self' */
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 200 900; font-display: swap; src: url(../fonts/source-sans-3.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/ibm-plex-mono-400.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/ibm-plex-mono-500.woff2) format("woff2"); }

:root {
  --ink: #0d2b33;          /* deep petrol */
  --teal: #0f6b70;
  --accent: #2fd1b5;       /* quantum mint */
  --paper: #ffffff;
  --mist: #f1f5f5;
  --line: #d9e3e3;
  --text: #1b2a2e;
  --muted: #5a6b70;
  --bad: #d4553f;
  --ok: #e0a53a;
  --good: #1fa88f;
  --sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --wrap: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; font: 18px/1.6 var(--sans); color: var(--text); background: var(--paper); }
a { color: var(--teal); }
h1, h2, h3 { line-height: 1.2; color: var(--ink); margin: 0 0 .5em; }
h2 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); }
h3 { font-size: 1.2rem; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: #fff; padding: 8px; z-index: 99; }
.mono { font-family: var(--mono); font-size: .9em; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--paper); border-bottom: 1px solid var(--line); }
.utility { display: flex; justify-content: space-between; align-items: center; font-size: .82rem; color: var(--muted); padding-top: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--mist); }
.utility-links { display: flex; gap: 18px; align-items: center; }
.utility-links a { color: var(--muted); text-decoration: none; }
.utility-links a:hover { color: var(--ink); }
.lang { font-weight: 700; color: var(--ink); }
.mainbar { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 14px; }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo-mark { flex: none; display: block; }
.logo-text { font-size: 1.6rem; font-weight: 700; color: #000; letter-spacing: -.015em; line-height: 1; display: flex; flex-direction: column; }
.logo-sub { font: 600 .74rem/1 var(--sans); color: #44565b; letter-spacing: .14em; text-transform: uppercase; margin-top: 6px; }
.primary-nav { display: flex; gap: 6px; align-items: center; }
.primary-nav a { color: var(--ink); text-decoration: none; font-weight: 600; padding: 8px 12px; position: relative; }
.primary-nav a:not(.nav-cta)::after { content: ""; position: absolute; left: 12px; bottom: 2px; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid var(--accent); opacity: 0; transition: opacity .15s; }
.primary-nav a:hover::after { opacity: 1; }
.nav-cta { background: var(--ink); color: #fff !important; border-radius: 2px; margin-left: 8px; }
.nav-cta:hover { background: var(--teal); }
.menu-toggle { display: none; background: none; border: 1px solid var(--line); padding: 8px 14px; font: 600 1rem var(--sans); color: var(--ink); cursor: pointer; }

/* ---------- Featured ---------- */
.featured { background: var(--ink); color: #e4eeee; }
.featured-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; padding-top: 72px; padding-bottom: 72px; }
.eyebrow { font: 500 .78rem var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--accent); margin: 0 0 18px; }
.eyebrow::before { content: "▶ "; font-size: .7em; }
.featured h1 { color: #fff; font-size: clamp(2rem, 4vw, 3.1rem); letter-spacing: -.015em; }
.featured p { font-size: 1.15rem; max-width: 36em; }
.slides { display: grid; }
.slide { grid-area: 1 / 1; opacity: 0; visibility: hidden; transition: opacity .4s; }
.slide.is-active { opacity: 1; visibility: visible; }
.read-more { display: inline-block; font-weight: 700; color: var(--accent); text-decoration: none; margin-top: 6px; }
.read-more::after { content: " →"; transition: margin .15s; }
a:hover .read-more::after, .read-more:hover::after { margin-left: 4px; }
.carousel-controls { display: flex; align-items: center; gap: 14px; margin-top: 32px; }
.ctrl { width: 40px; height: 40px; border: 1px solid rgba(255,255,255,.35); background: transparent; color: #fff; cursor: pointer; font-size: .8rem; }
.ctrl:hover { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.ctrl-count { font: .85rem var(--mono); color: #9fb6b8; }
.featured-visual { color: #9fb6b8; }
.lattice { width: 100%; height: auto; display: block; }
.svg-label { fill: var(--accent); font: 700 22px var(--mono); }
.visual-caption { font-size: .9rem !important; color: #9fb6b8; border-left: 2px solid var(--accent); padding-left: 12px; }

/* ---------- Intro ---------- */
.intro { padding-top: 72px; padding-bottom: 56px; }
.intro-lead { font-size: clamp(1.25rem, 2vw, 1.55rem); line-height: 1.5; max-width: 52em; color: var(--ink); margin: 0 0 40px; }
.intro-lead a { color: var(--teal); text-decoration-color: var(--accent); text-underline-offset: 3px; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 0; border-top: 1px solid var(--line); }
.facts div { padding: 22px 20px 0 0; }
.facts dt { font: 600 1.7rem var(--mono); color: var(--ink); }
.facts dd { margin: 4px 0 0; color: var(--muted); font-size: .95rem; }

/* ---------- Sections ---------- */
section[id] { scroll-margin-top: 90px; }
.band { background: var(--mist); padding: 72px 0; }
#approach, #insights { padding-top: 72px; padding-bottom: 72px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; margin-bottom: 28px; }
.section-head h2 { margin: 0; }
.all-link { font-weight: 700; text-decoration: none; white-space: nowrap; }
.all-link::after { content: " →"; }
.section-lead { font-size: 1.15rem; color: var(--muted); max-width: 40em; margin: -12px 0 36px; }

/* Themes */
.themes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.theme { background: #fff; padding: 28px 24px; border-top: 4px solid var(--accent); display: flex; flex-direction: column; }
.theme-tag { font: 500 .8rem var(--mono); color: var(--muted); margin-bottom: 14px; }
.theme p { font-size: .98rem; margin: 0 0 16px; }
.theme details { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; }
.theme summary { cursor: pointer; font-weight: 700; color: var(--teal); font-size: .95rem; list-style: none; }
.theme summary::before { content: "+ "; font-family: var(--mono); }
.theme details[open] summary::before { content: "– "; }
.theme details p { margin: 10px 0 0; color: var(--muted); font-size: .95rem; }

/* Steps */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); counter-reset: s; position: relative; }
.steps::before { content: ""; position: absolute; top: 22px; left: 22px; right: 22px; height: 2px; background: var(--line); }
.steps li { position: relative; padding-right: 20px; }
.step-n { display: grid; place-items: center; width: 44px; height: 44px; background: var(--ink); color: var(--accent); font: 600 1rem var(--mono); position: relative; margin-bottom: 18px; }
.steps p { font-size: .98rem; color: var(--muted); margin: 0; }

/* Explained */
.band-dark { background: var(--ink); color: #d5e2e3; }
.band-dark h2 { color: #fff; }
.eyebrow-light { color: var(--accent); }
.explained-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.compare { background: #12363f; border: 1px solid #1f4c56; }
.compare-row { display: grid; grid-template-columns: 1.2fr 1fr 1.1fr; gap: 12px; padding: 16px 20px; border-bottom: 1px solid #1f4c56; font-size: 1rem; }
.compare-head { font: 500 .75rem var(--mono); text-transform: uppercase; letter-spacing: .1em; color: #9fb6b8; }
.bad { color: #ff8a73; } .ok { color: #f2c463; } .good { color: var(--accent); }
.compare-note { padding: 14px 20px; margin: 0; font-size: .82rem; color: #9fb6b8; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: -8px; }
.dot.bad { background: #ff8a73; } .dot.ok { background: #f2c463; } .dot.good { background: var(--accent); }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.card { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; }
.card-img { aspect-ratio: 1 / 1; display: grid; place-items: center; margin-bottom: 16px; overflow: hidden; transition: transform .25s; }
.card-img svg { width: 46%; }
.card:hover .card-img { transform: translateY(-4px); }
.card:hover h3 { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; }
.card-img-1 { background: var(--ink); color: var(--accent); }
.card-img-2 { background: var(--accent); color: var(--ink); }
.card-img-3 { background: var(--teal); color: #fff; }
.card-img-4 { background: #dcebea; color: var(--ink); }
.card h3 { font-size: 1.12rem; margin-bottom: 8px; }
.card .read-more { color: var(--teal); font-size: .95rem; margin-top: auto; }

/* Timeline */
.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 56px; }
.events { list-style: none; padding: 0; margin: 0; }
.events li { display: grid; grid-template-columns: 120px 1fr; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.events li:first-child { border-top: 1px solid var(--line); }
.events time { font: 600 .95rem var(--mono); color: var(--teal); }
.quick { background: #fff; padding: 28px; align-self: start; }
.quick h2 { font-size: 1.3rem; }
.quick ul { list-style: none; padding: 0; margin: 0; }
.quick li { border-bottom: 1px solid var(--line); }
.quick a { display: block; padding: 10px 0; text-decoration: none; font-weight: 600; }
.quick a::before { content: "▸ "; color: var(--accent); }

/* CTA */
.cta { display: flex; justify-content: space-between; align-items: center; gap: 40px; padding-top: 72px; padding-bottom: 72px; }
.cta p { color: var(--muted); max-width: 38em; margin: 0; }
.button { background: var(--accent); color: var(--ink); font-weight: 700; padding: 16px 26px; text-decoration: none; white-space: nowrap; }
.button:hover { background: var(--ink); color: #fff; }

/* Footer */
.site-footer { background: var(--ink); color: #b7c9cb; padding-top: 56px; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding-bottom: 40px; }
.footer-logo { font-size: 1.5rem; font-weight: 700; color: #fff; margin: 0 0 10px; }
.site-footer h3 { color: #fff; font-size: 1rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: #b7c9cb; text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.legal { display: flex; justify-content: space-between; border-top: 1px solid #1f4c56; padding-top: 18px; padding-bottom: 24px; font-size: .85rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .themes, .cards { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; gap: 22px; }
  .steps::before { top: 22px; bottom: 22px; left: 21px; right: auto; width: 2px; height: auto; }
  .steps li { display: grid; grid-template-columns: 44px 1fr; column-gap: 18px; }
  .steps li .step-n { grid-row: span 2; margin: 0; }
  .steps h3 { margin: 0; align-self: end; }
  .menu-toggle { display: block; }
  .primary-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; flex-direction: column; align-items: stretch; padding: 8px 24px 20px; border-bottom: 1px solid var(--line); }
  .primary-nav.open { display: flex; }
  .primary-nav a { padding: 12px 0; border-bottom: 1px solid var(--mist); }
  .nav-cta { margin: 12px 0 0; text-align: center; }
  .mainbar { position: relative; }
}
@media (max-width: 760px) {
  body { font-size: 17px; }
  .wrap { padding: 0 16px; }
  .utility-note { display: none; }
  .utility { justify-content: flex-end; }
  .featured-grid, .explained-grid, .two-col { grid-template-columns: 1fr; gap: 36px; }
  .featured-grid { padding-top: 48px; padding-bottom: 48px; }
  .featured-visual { max-width: 340px; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .themes { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr 1fr; gap: 16px; }
  .compare-row { grid-template-columns: 1fr 1fr; }
  .compare-row span:first-child { grid-column: 1 / -1; font-weight: 600; color: #fff; }
  .compare-head span:first-child { display: none; }
  .events li { grid-template-columns: 1fr; gap: 4px; }
  .cta { flex-direction: column; align-items: flex-start; }
  .footer-grid { grid-template-columns: 1fr; }
  .band, #approach, #insights, .intro, .cta { padding-top: 52px; padding-bottom: 52px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
