/* NRICH site styles. Hand-written, no framework.
   Brand: light base throughout; ink for text, buttons and footer; accent for
   highlights, link underlines and the primary button fill.

   Contrast rule (brand guide check): accent #7FB8F5 text on paper or white is
   about 2:1 and fails AA. On light backgrounds link TEXT is ink with a 2 px
   accent underline; accent-coloured link text appears only in the ink footer.
   Grey text #66707F is used only on paper or white, never on #E6E9EF.
   Form-field borders (none yet) use --field-line, not --line. */

:root {
  --ink: #16213A;
  --accent: #7FB8F5;
  --accent-tint: #E3EFFC;
  --paper: #F8F9FB;
  --white: #FFFFFF;
  --grey: #66707F;
  --line: #E6E9EF;
  --field-line: #B8C2D6;
  --ph-bg: #FFF3B0;
  --ph-line: #E9D36A;

  --font: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "Geist", system-ui, sans-serif; /* owner decision 2026-11-05: labels in tracked Geist caps, no monospace */

  --radius: 8px;
  --max: 1200px;
  --gutter: 16px;
  --measure: 70ch;
  --header-h: 64px;
}

@media (min-width: 600px) { :root { --gutter: 32px; } }

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.55;
  overflow-x: hidden;
}

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

/* ---------- Type ---------- */

h1, h2, h3, h4 { font-weight: 600; margin: 0 0 0.5em; text-wrap: balance; }
h1 { font-size: 40px; line-height: 1.05; letter-spacing: -0.02em; }
h2 { font-size: 28px; line-height: 1.15; letter-spacing: -0.01em; }
h3 { font-size: 20px; line-height: 1.25; }
@media (min-width: 900px) {
  h1 { font-size: 56px; }
  h2 { font-size: 36px; }
  h3 { font-size: 22px; }
}

p, ul, ol { margin: 0 0 1em; }
p, li { max-width: var(--measure); }
strong { font-weight: 600; }

.eyebrow, .label, .group-label, .sec-num, .jump-label, .phase-name, .slot-label, .footer-heading {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 12px;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 400;
}
.eyebrow { color: var(--grey); margin-bottom: 16px; }
.label { color: var(--grey); margin: 32px 0 12px; }

.standfirst { font-size: 20px; line-height: 1.45; color: var(--ink); max-width: 60ch; }
@media (min-width: 900px) { .standfirst { font-size: 22px; } }

/* ---------- Links ---------- */

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
a:hover { text-decoration-color: var(--ink); text-decoration-thickness: 3px; }

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
  border-radius: 2px;
}
main:focus { outline: none; }

.skip-link {
  position: absolute; left: 8px; top: -100px; z-index: 100;
  background: var(--ink); color: var(--white); padding: 12px 16px; border-radius: var(--radius);
  text-decoration: none;
}
.skip-link:focus { top: 8px; outline-color: var(--accent); }

.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;
}

/* ---------- Placeholders: anything still in [square brackets] ---------- */

.ph {
  background: var(--ph-bg);
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--ph-line);
  border-radius: 3px;
  padding: 0 0.2em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* ---------- Layout ---------- */

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

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 10px 20px;
  border-radius: var(--radius);
  font-weight: 600; font-size: 16px; line-height: 1.2;
  text-decoration: none;
  border: 2px solid transparent;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn-primary { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.btn-primary:hover { background: #A5CDF8; border-color: var(--ink); }
.btn-ink { background: var(--ink); color: var(--white); border-color: var(--ink); }
.btn-ink:hover { background: #24345A; border-color: #24345A; }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-secondary:hover { background: var(--white); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0; }

.more a { font-weight: 600; }
.more a::after { content: " →" / ""; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper);
}
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 16px; }
.brand { display: block; flex: none; text-decoration: none; }
.brand img { width: 120px; height: auto; }

.nav-toggle {
  order: 3; flex: none; margin-left: auto;
  width: 44px; height: 44px; margin-right: -8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; border-radius: var(--radius); cursor: pointer; color: var(--ink);
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  display: block; width: 22px; height: 2px; background: currentColor; position: relative; content: "";
}
.nav-toggle-bars::before { position: absolute; top: -7px; }
.nav-toggle-bars::after { position: absolute; top: 7px; }
.nav-open .nav-toggle-bars { background: transparent; }
.nav-open .nav-toggle-bars::before { top: 0; transform: rotate(45deg); }
.nav-open .nav-toggle-bars::after { top: 0; transform: rotate(-45deg); }

.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-list li { max-width: none; }
.nav-list a, .nav-dropdown summary {
  display: block; text-decoration: none; color: var(--ink); font-size: 15px; font-weight: 400;
  cursor: pointer;
}
.nav-list a:hover, .nav-dropdown summary:hover { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.nav-list a[aria-current="page"], .nav-list .is-section {
  text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 4px; font-weight: 600;
}
.nav-dropdown summary { list-style: none; }
.nav-dropdown summary a { padding: 0; text-decoration: inherit; text-decoration-color: inherit; color: inherit; font: inherit; }
.nav-dropdown summary::-webkit-details-marker { display: none; }
/* No dropdown chevron by owner decision; the label alone opens the menu. */
.nav-sub { list-style: none; margin: 0; padding: 0; }

/* Mobile menu (below 900 px) */
@media (max-width: 899.98px) {
  .site-nav {
    display: none;
    position: absolute; left: 0; right: 0; top: var(--header-h);
    background: var(--paper); border-bottom: 1px solid var(--line);
    max-height: calc(100vh - var(--header-h)); overflow-y: auto;
    padding: 8px var(--gutter) 24px;
  }
  .nav-open .site-nav { display: block; }
  .nav-list > li { border-bottom: 1px solid var(--line); }
  .nav-list a, .nav-dropdown summary { padding: 14px 0; font-size: 17px; }
  .nav-sub { padding: 0 0 8px 16px; }
  .nav-sub a { padding: 10px 0; }
}
@media (max-width: 380px) {
  .brand img { width: 100px; }
}

/* Desktop nav (900 px and up) */
@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .site-nav { margin-left: auto; }
  .nav-list { display: flex; align-items: center; gap: 4px; }
  .nav-list a, .nav-dropdown summary { padding: 8px 10px; border-radius: var(--radius); white-space: nowrap; }
  .nav-dropdown { position: relative; }
  .nav-sub {
    position: absolute; top: calc(100% + 10px); left: 0; min-width: 260px; width: max-content; max-width: min(420px, 90vw);
    background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(22, 33, 58, 0.08);
    padding: 8px;
  }
  .nav-sub a { padding: 10px 12px; white-space: nowrap; }
  .nav-sub a:hover { background: var(--paper); }
}
@media (min-width: 900px) and (max-width: 1099.98px) {
  .nav-list a, .nav-dropdown summary { padding: 8px 6px; font-size: 14px; }
  .header-inner { gap: 8px; }
  .brand img { width: 104px; }
}

/* ---------- Breadcrumb ---------- */

.breadcrumb ol {
  list-style: none; margin: 0; padding: 28px 0 0;
  display: flex; flex-wrap: wrap; gap: 6px;
  font-family: var(--mono); font-weight: 500; font-size: 13px; letter-spacing: 0.02em; color: var(--grey);
}
.breadcrumb li { max-width: none; }
.breadcrumb a { color: var(--grey); text-decoration-thickness: 1px; }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb [aria-current] { color: var(--ink); }

/* ---------- Page heads ---------- */

.page-head { padding: 32px 0 40px; border-bottom: 1px solid var(--line); margin-bottom: 40px; }
.page-head .eyebrow { margin-top: 16px; }

.detail-head { display: grid; gap: 32px; align-items: center; }
@media (min-width: 900px) {
  .detail-head { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px; padding-top: 40px; }
}

/* ---------- Illustration and placeholder slots ---------- */

.slot {
  border: 2px dashed var(--field-line);
  border-radius: var(--radius);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; text-align: center; color: var(--grey);
}
.slot-label { color: var(--grey); max-width: 32ch; }
.slot-3x2 { aspect-ratio: 3 / 2; width: 100%; }
.slot-16x10 { aspect-ratio: 16 / 10; width: 100%; }
.slot-text { margin: 8px 0 48px; padding: 48px 24px; }
.slot-text p { margin: 0; }
.slot-diagram { margin: 0 0 1em; min-height: 160px; }
.slot-diagram figcaption { font-family: var(--mono); font-size: 13px; line-height: 1.5; max-width: 60ch; }

/* ---------- Detail pages (disciplines, sectors, airline) ---------- */

.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; padding-bottom: 32px; }
.jump-aside { min-width: 0; }
.jump {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px;
}
.jump-label { color: var(--grey); margin: 0 0 12px; }
.jump ul { list-style: none; margin: 0; padding: 0; }
.jump li { margin: 0; max-width: none; }
.jump a {
  display: block; padding: 6px 0; font-size: 15px; line-height: 1.35;
  text-decoration-thickness: 1px; text-decoration-color: transparent;
}
.jump a:hover { text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.jump-groups > li + li { margin-top: 12px; }
.jump-groups strong { font-family: var(--mono); font-weight: 500; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--grey); }
@media (min-width: 900px) {
  .detail-grid { grid-template-columns: 260px minmax(0, 1fr); gap: 56px; }
  .detail-grid.no-aside { grid-template-columns: minmax(0, 1fr); }
  .detail-grid.no-aside .detail-body { max-width: 820px; }
  .jump-aside { position: relative; }
  .jump {
    position: sticky; top: calc(var(--header-h) + 24px);
    max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto;
  }
}

.section { padding: 8px 0 32px; }
.detail-body > .section { border-top: 1px solid var(--line); padding-top: 32px; margin-top: 8px; }
.detail-body > .section:first-child { border-top: 0; padding-top: 0; }
.sec-num { color: var(--grey); margin: 0 0 8px; }
.group-label {
  display: inline-block; color: var(--ink); background: var(--accent-tint);
  padding: 4px 10px; border-radius: 999px; margin: 0 0 16px;
}
.prose h3 { margin-top: 1.5em; }

/* Link rows (e.g. "Capabilities: A · B · C") */
.links .sep { color: var(--grey); }
.links-label { font-weight: 600; }

/* ---------- Tables ---------- */

.table-wrap {
  overflow-x: auto; margin: 0 0 1em;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--white);
}
table { border-collapse: collapse; width: 100%; min-width: 720px; font-size: 14px; line-height: 1.35; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
thead th { font-weight: 600; font-size: 13px; background: var(--paper); }
tbody tr:last-child > * { border-bottom: 0; }
tbody th { font-weight: 600; white-space: nowrap; }
td.empty { background: var(--paper); }

/* ---------- Cards ---------- */

.cards { display: grid; gap: 16px; margin: 24px 0 32px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; display: flex; flex-direction: column;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.card:hover { border-color: var(--field-line); box-shadow: 0 6px 20px rgba(22, 33, 58, 0.06); }
.card h3 { margin: 0 0 12px; font-size: 20px; text-wrap: pretty; }
.card h3 a { text-decoration-thickness: 2px; }
.card p { margin: 0 0 12px; }
.card-links, .card-link { margin-top: auto !important; padding-top: 12px; font-size: 15px; }
.card-link { font-weight: 600; }
.phase-name { color: var(--ink); background: var(--accent-tint); align-self: flex-start; padding: 4px 10px; border-radius: 999px; }

/* Problem families */
.family { padding-top: 16px; }
.family .cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.family .card h3 { font-size: 19px; line-height: 1.3; }

/* Quote cards (Home problems teaser) */
.quote-cards { list-style: none; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.quote-cards li { max-width: none; }
.quote-cards a {
  display: block; height: 100%;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 24px; font-size: 18px; line-height: 1.4; font-weight: 600;
  text-decoration: none; border-left: 4px solid var(--accent);
}
.quote-cards a:hover { border-color: var(--field-line); border-left-color: var(--ink); }

/* Pills (sector strip, family jump) */
.pills { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pills li { max-width: none; }
.pills a {
  display: inline-block; padding: 8px 14px; border-radius: 999px;
  background: var(--white); border: 1px solid var(--field-line);
  text-decoration: none; font-size: 15px;
}
.pills a:hover { border-color: var(--ink); background: var(--accent-tint); }
.pill-group { margin: 40px 0 8px; }
.family-jump { margin-top: 16px; }

/* ---------- Home ---------- */

.hero { padding: 48px 0 56px; border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) {
  .hero { padding: 80px 0 88px; }
  .hero-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; }
}

/* Scroll hero (home page). The section is the pinned scroll: .hero-stage sticks under the
   header while the section scrolls past, and hero.js maps that progress to the drawing.
   Without the hero-pin class (no JavaScript, no WebGL, reduced motion) it is a normal hero. */
.hero-scroll { padding: 0; }
.hero-stage { position: relative; padding: 48px 0 56px; }
.hero-stage > .hero-grid { position: relative; z-index: 2; }
.hero-copy { will-change: opacity, transform; }
.hero-visual { aspect-ratio: 4 / 3; width: 100%; }
.hero-visual img { width: 100%; height: auto; }
.hero-fallback { display: none; }
.no-webgl .hero-fallback { display: block; }
.hero-canvas, .hero-leaders, .hero-labels { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-canvas { display: block; z-index: 0; }
.hero-leaders { z-index: 1; max-width: none; }
.hero-labels { z-index: 1; overflow: hidden; }
.no-webgl .hero-canvas, .no-webgl .hero-leaders, .no-webgl .hero-labels { display: none; }
.hero-leaders polyline { fill: none; stroke: var(--accent); stroke-width: 1; opacity: 0; }
.hero-leaders circle { fill: var(--accent); opacity: 0; }
.hero-label {
  position: absolute; left: 0; top: 0; opacity: 0; white-space: nowrap; will-change: transform, opacity;
  font-family: var(--mono); font-size: 11px; line-height: 16px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink);
}
.hero-label-n { color: var(--grey); margin-right: 0.9em; }
@media (min-width: 900px) { .hero-stage { padding: 80px 0 88px; } }

.hero-pin .hero-scroll { height: 200vh; }
.hero-pin .hero-stage {
  position: sticky; top: var(--header-h); overflow: hidden; padding: 0;
  height: calc(100vh - var(--header-h)); height: calc(100svh - var(--header-h));
  display: flex; align-items: center;
}
.hero-pin .hero-stage > .hero-grid { width: 100%; }
.hero-pin .hero-stage .hero-visual { aspect-ratio: auto; height: min(78vh, 760px); }
.hero-pin .hero-copy h1 { font-size: clamp(44px, 5.2vw, 72px); }
@media (min-width: 900px) { .hero-pin .hero-scroll { height: 300vh; } }
@media (max-width: 599.98px) { .hero-leaders, .hero-labels { display: none; } }
.band { padding: 56px 0 24px; border-bottom: 1px solid var(--line); }
@media (min-width: 900px) { .band { padding: 80px 0 40px; } }
.band .section { padding: 0 0 24px; }

/* ---------- Closing call-out block (unused in the first release: no contact call to action) ---------- */

.cta {
  margin: 48px 0 72px; padding: 40px 32px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  border-top: 4px solid var(--accent);
}
.cta h2 { margin-bottom: 12px; }
.cta .actions { margin-bottom: 0; }

/* ---------- Articles (About, Privacy) ---------- */

.article { max-width: 720px; padding-bottom: 24px; }
.article .page-head { margin-bottom: 32px; }
.article .section { padding: 16px 0 16px; }
.article + .cta, .wrap > .cta { max-width: none; }

/* ---------- Footer ---------- */

.site-footer { background: var(--ink); color: var(--white); padding: 28px 0 18px; }
.site-footer a { color: var(--white); text-decoration-color: var(--accent); }
.site-footer a:hover { color: var(--accent); }
.site-footer :focus-visible { outline-color: var(--accent); }
.footer-inner { display: grid; gap: 16px; justify-items: center; text-align: center; }
@media (min-width: 900px) { .footer-inner { grid-template-columns: 1fr; justify-items: center; } }
.footer-brand img { width: 120px; }
.footer-descriptor { margin: 20px 0 0; }
.footer-nav { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.footer-heading { color: var(--accent); margin: 0 0 12px; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; }
.footer-nav li { margin: 0 0 8px; }
.footer-nav a { text-decoration-color: transparent; }
.footer-nav a:hover { text-decoration-color: var(--accent); }
.footer-base { display: grid; grid-template-columns: 1fr; align-items: center; margin-top: 20px; padding-top: 0; border-top: 0; font-size: 14px; }
.footer-base p { margin: 0; }
.footer-privacy { justify-self: end; }
.footer-copy { justify-self: center; text-align: center; font-size: 13px; font-weight: 300; color: var(--white); opacity: 1; }  /* owner: F4, quiet */
.footer-base a { text-decoration: none; }
.footer-base a:hover { color: var(--accent); }

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Owner decision 2026-11-05: the hero uses the full screen width on large displays. */
@media (min-width: 1400px) {
  .hero-pin .hero-stage > .hero-grid, .hero-scroll .hero-grid { max-width: min(1800px, 94vw); }
  .hero-pin .hero-grid { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 32px; }
  .hero-pin .hero-stage .hero-visual { height: min(84vh, 900px); }
  .hero-pin .hero-copy h1 { font-size: clamp(56px, 4.6vw, 96px); }
}

/* Owner decision 2026-11-05: dropdown items highlight as blue text, no underline.
   #2F6FBF keeps AA contrast on the pale background; the ice-blue accent would not. */
.nav-sub a, .nav-sub a:hover, .nav-sub a:focus-visible { text-decoration: none; }
.nav-sub a:hover, .nav-sub a:focus-visible { color: #2F6FBF; }

/* Owner decision 2026-11-05: use the accent more generously in non-text elements. */
/* Owner 2026-11-05: no accent line on top of cards on hover. */
.card:hover { box-shadow: 0 6px 18px rgba(22, 33, 58, 0.06); }
.page-head { border-bottom-color: var(--accent); }
hr { border: 0; border-top: 2px solid var(--accent); width: 56px; margin: 40px 0; }
main ul:not(.nav-list):not(.nav-sub):not(.jump) li::marker { color: var(--accent); }
.sec-num { color: #2F6FBF; }
.jump a.is-active, .jump-groups a.is-active { border-left: 2px solid var(--accent); padding-left: 10px; }
footer .footer-descriptor { color: var(--accent); }

.illustration { margin: 0; }
.illustration img { display: block; width: 100%; height: auto; border-radius: var(--radius); }

/* Owner feedback 2026-11-05 evening: pages feel empty on wide screens. Scale up past 1400 px. */
@media (min-width: 1400px) {
  :root { --max: 1440px; }
  body { font-size: 18px; }
  h2 { font-size: 44px; }
  h3 { font-size: 24px; }
  .standfirst { font-size: 22px; }
  .journey-home .wrap, .page-home .wrap { max-width: min(1760px, 94vw); }
}
@media (min-width: 1800px) {
  :root { --max: 1600px; }
  body { font-size: 19px; }
}

.diagram { margin: 24px 0 32px; }
.diagram img { display: block; width: 100%; height: auto; }
