/* Engineering Space for Everyone — styles
   Tokens first, then base, layout and components. Mobile-first. */

/* ---------- Fonts (self-hosted, latin subset) ---------- */
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/source-sans-3-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/source-sans-3-italic-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/source-serif-4-bold-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/source-serif-4-italic-latin.woff2") format("woff2");
}

/* ---------- Tokens ---------- */
:root {
  --navy: #0B1F3A;
  --navy-deep: #061226;
  --gold: #C9A227;
  --gold-ink: #8A6A0A;
  --ice: #E8EEF6;
  --slate: #4A5A70;
  --sky: #8FA9C8;
  --ink: #1A2233;
  --white: #FFFFFF;

  --font-serif: "Source Serif 4", Cambria, Georgia, serif;
  --font-sans: "Source Sans 3", Calibri, system-ui, sans-serif;

  --s-1: 4px; --s-2: 8px; --s-3: 16px; --s-4: 24px; --s-5: 32px;
  --s-6: 48px; --s-7: 64px; --s-8: 96px; --s-9: 128px;

  --radius: 8px;
  --shadow: 0 2px 8px rgb(11 31 58 / 0.08);
  --shadow-lift: 0 8px 20px rgb(11 31 58 / 0.14);
  --header-h: 72px;
  --gutter: 24px;
}

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

html {
  scroll-padding-top: calc(var(--header-offset, var(--header-h)) + var(--s-3));
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.125rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

h1, h2, h3, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }

h1, h2 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.15;
  color: var(--navy);
}
h1 { font-size: clamp(2.5rem, 5vw + 1rem, 4.5rem); }
h2 { font-size: clamp(2rem, 3vw + 1rem, 3rem); }
h3 {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--navy);
}

a { color: var(--navy); text-decoration: underline; text-underline-offset: 0.15em; }

/* Focus: gold ring with a navy inner ring, so it reads on white, ice and navy. */
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--navy);
}
/* Programmatic focus targets (headings, main) are not interactive. */
[tabindex="-1"]:focus { outline: none; box-shadow: none; }

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

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 24px; height: 24px;
  fill: currentColor;
  flex: none;
}

.container {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: var(--s-3);
  top: var(--s-3);
  z-index: 100;
  padding: 12px var(--s-4);
  min-height: 48px;
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
  border-radius: var(--radius);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* ---------- Header + nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--navy);
  color: var(--white);
  border-bottom: 1px solid rgb(143 169 200 / 0.25);
}
.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2) var(--s-4);
  min-height: var(--header-h);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--white);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.2;
  text-decoration: none;
}

.nav-toggle { display: none; }

.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.nav-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
  color: var(--white);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  border-top: 3px solid transparent;
}
.nav-list a:hover { border-bottom-color: var(--sky); }
.nav-list a[aria-current="true"] { border-bottom-color: var(--gold); }

/* Mobile with JavaScript: collapse links behind the Menu button. */
@media (max-width: 767.98px) {
  .js .header-inner { flex-wrap: nowrap; }
  .js .wordmark { font-size: 1rem; }
  .js .site-nav { position: static; }
  .js .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    min-height: 44px;
    padding: 0 var(--s-3);
    background: transparent;
    color: var(--white);
    border: 2px solid var(--white);
    border-radius: var(--radius);
    font: 700 1rem var(--font-sans);
    cursor: pointer;
  }
  .js .nav-toggle .icon { width: 18px; height: 18px; }
  .js .nav-list {
    display: none;
    position: absolute;
    left: 0; right: 0;
    top: 100%;
    flex-direction: column;
    gap: var(--s-2);
    padding: var(--s-3) var(--gutter) var(--s-4);
    background: var(--navy);
    border-bottom: 1px solid rgb(143 169 200 / 0.25);
  }
  .js .nav-list.is-open { display: flex; }
  .js .nav-list a { width: 100%; font-size: 1.125rem; }
  /* Without JS, links simply wrap under the wordmark. */
  .nav-list { margin-bottom: var(--s-2); }
  .js .nav-list { margin-bottom: 0; }
}

/* ---------- Sections ---------- */
.section { padding-block: var(--s-7); }
.section-white { background: var(--white); }
.section-ice { background: var(--ice); }
.section-navy { background: var(--navy); color: var(--white); }
.section-navy h1, .section-navy h2, .section-navy h3 { color: var(--white); }
.section-navy a { color: var(--gold); }

.section h2 { margin-bottom: var(--s-4); }

.lead, .thesis {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.375rem;
  line-height: 1.5;
  max-width: 65ch;
  margin-bottom: var(--s-6);
}
.section-white .thesis, .section-ice .thesis,
.section-white .lead, .section-ice .lead { color: var(--ink); }

.kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-3);
  margin-bottom: var(--s-3);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.section-white .kicker { color: var(--gold-ink); }
.section-ice .kicker { color: var(--slate); }
.kicker .chip { letter-spacing: normal; text-transform: none; }

.eyebrow {
  margin-bottom: var(--s-3);
  color: var(--gold);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.citation {
  margin-top: var(--s-3);
  color: var(--slate);
  font-size: 0.9375rem;
  max-width: 90ch;
}
.citation cite { font-style: italic; }

.note {
  margin-top: var(--s-5);
  color: var(--slate);
  font-size: 1rem;
  max-width: 65ch;
}

/* ---------- Components ---------- */
.icon-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 56px; height: 56px;
  border-radius: 50%;
}
.icon-circle--navy { background: var(--navy); color: var(--white); }
.icon-circle--gold { background: var(--gold); color: var(--navy); }
.icon-circle--slate { background: var(--slate); color: var(--white); }

.card {
  background: var(--ice);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--s-4);
}
.section-ice .card { background: var(--white); }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 12px;
  border: 1.5px solid var(--gold);
  border-radius: 999px;
  background: var(--white);
  color: var(--navy);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.5;
  font-style: normal;
}
.section-navy .chip { background: var(--gold); color: var(--navy); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px var(--s-4);
  border-radius: var(--radius);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
}
.section-navy .btn-primary,
.btn-primary { background: var(--gold); color: var(--navy); border: 2px solid var(--gold); }
.btn-primary:hover { background: var(--white); border-color: var(--white); }
.section-navy .btn-secondary,
.btn-secondary { background: transparent; color: var(--white); border: 2px solid var(--white); }
.btn-secondary:hover { background: var(--white); color: var(--navy); }

.band {
  padding: var(--s-5);
  border-radius: var(--radius);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.25rem, 2vw + 0.5rem, 1.75rem);
  line-height: 1.45;
}
.band p { max-width: 50ch; }
.band-center { text-align: center; }
.band-center p, p.band-center { margin-inline: auto; }
.band-navy { background: var(--navy); color: var(--white); }
.band-ice { background: var(--ice); color: var(--navy); }

.quote { margin-top: var(--s-7); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-top: var(--s-8);
  padding-bottom: calc(var(--s-8) + 72px);
}
.hero-inner { position: relative; z-index: 1; }
.hero h1 { max-width: 18ch; margin-bottom: var(--s-4); }
.hero-lead {
  max-width: 40ch;
  margin-bottom: var(--s-4);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.375rem;
  line-height: 1.5;
  color: var(--white);
}
.hero-core {
  max-width: 60ch;
  margin-bottom: var(--s-6);
  color: var(--ice);
}
.hero-actions {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.horizon {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 160px;
}
.horizon .limb { fill: var(--navy-deep); }
.horizon .rim { fill: none; stroke: var(--ice); stroke-opacity: 0.35; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.horizon .stars { fill: var(--ice); opacity: 0.6; }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  gap: var(--s-5);
}
.profile-card {
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--s-5);
}
.profile-card h2 {
  color: var(--white);
  font-size: clamp(1.75rem, 2vw + 1rem, 2.25rem);
  margin-bottom: var(--s-4);
}
.headshot {
  display: block;
  width: 160px; height: 160px;
  margin-bottom: var(--s-4);
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gold);
}
.role-list { display: grid; gap: var(--s-4); }
.role { display: flex; gap: var(--s-3); align-items: flex-start; }
.role strong { display: block; line-height: 1.35; }
.role-sub { display: block; color: var(--sky); font-size: 1rem; line-height: 1.45; margin-top: 2px; }

.subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.375rem;
  line-height: 1.5;
  color: var(--slate);
  margin-bottom: var(--s-4);
}
.stat-grid {
  display: grid;
  gap: var(--s-3);
  margin-bottom: var(--s-5);
}
.stat-card {
  background: var(--ice);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--s-4);
}
.stat-num {
  display: block;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 2.5rem;
  line-height: 1.1;
  color: var(--navy);
  margin-bottom: var(--s-2);
}
.stat-text { display: block; }
.icon-rows { display: grid; gap: var(--s-4); }
.icon-row { display: flex; gap: var(--s-3); align-items: flex-start; }
.icon-row h3 { margin-bottom: var(--s-1); }
.about-details { max-width: 65ch; }
#about .band { margin-top: var(--s-6); }

/* ---------- Research overview ---------- */
.pillar-cards {
  display: grid;
  gap: var(--s-4);
}
.pillar-cards > li { display: flex; }
.pillar-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-2);
  width: 100%;
  color: var(--ink);
  text-decoration: none;
}
.pillar-card .icon-circle { margin-bottom: var(--s-2); }
.pillar-num {
  color: var(--slate);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.pillar-card h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.pillar-line { flex: 1; margin-bottom: var(--s-2); }
@media (prefers-reduced-motion: no-preference) {
  .pillar-card { transition: transform 200ms ease, box-shadow 200ms ease; }
}
.pillar-card:hover,
.pillar-card:focus-visible { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.pillar-card:focus-visible { box-shadow: 0 0 0 2px var(--navy), var(--shadow-lift); }

/* ---------- Card grids ---------- */
.card-grid {
  display: grid;
  gap: var(--s-4);
}
.feature-card .icon-circle,
.column-card .icon-circle { margin-bottom: var(--s-3); }
.feature-card h3, .column-card h3 { margin-bottom: var(--s-2); }

.column-card--navy { background: var(--navy); color: var(--white); }
.section-white .column-card--navy h3 { color: var(--white); }
.points { display: grid; gap: var(--s-2); }
.points li { position: relative; padding-left: 18px; }
.points li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.65em;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.strip {
  margin-top: var(--s-6);
  padding: var(--s-4);
  border-radius: var(--radius);
  background: var(--ice);
  box-shadow: var(--shadow);
}
.strip-title { margin-bottom: var(--s-2); }
.strip p { max-width: 75ch; }

/* ---------- Pillar 2 flow ---------- */
.flow-layout {
  display: grid;
  gap: var(--s-5);
  margin-bottom: var(--s-6);
}
.key-message {
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius);
  padding: var(--s-5);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.25rem, 2vw + 0.5rem, 1.5rem);
  line-height: 1.45;
}
.flow {
  display: grid;
  gap: var(--s-6);
  counter-reset: step;
}
.flow-step { position: relative; counter-increment: step; }
.flow-step h3::before {
  content: counter(step) ". ";
  color: var(--slate);
}
.flow-step h3 { margin-bottom: var(--s-2); font-size: 1.5rem; }
/* Gold connecting arrows between steps (decorative). */
.flow-step + .flow-step::before {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(-1 * var(--s-6) + 8px);
  width: 32px; height: 32px;
  transform: translateX(-50%) rotate(90deg);
  background: var(--gold);
  -webkit-mask: url("/assets/icons/arrow-right.svg") center / 24px 24px no-repeat;
  mask: url("/assets/icons/arrow-right.svg") center / 24px 24px no-repeat;
}

.list-title { margin-bottom: var(--s-3); }
.two-col-list {
  display: grid;
  gap: var(--s-3) var(--s-5);
  margin-bottom: var(--s-4);
  max-width: 1000px;
}
.two-col-list li { position: relative; padding-left: 28px; }
.two-col-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.35em;
  width: 16px; height: 16px;
  background: var(--navy);
  -webkit-mask: url("/assets/icons/check.svg") center / contain no-repeat;
  mask: url("/assets/icons/check.svg") center / contain no-repeat;
}
.evaluation {
  font-style: italic;
  color: var(--slate);
  max-width: 65ch;
}

/* ---------- Collaborate ---------- */
.collab-layout {
  display: grid;
  gap: var(--s-6);
  align-items: start;
}
.collab-grid {
  display: grid;
  gap: var(--s-4);
}
.collab-item {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  color: var(--white);
}
.collab-item p { padding-top: 12px; }
.contact-card {
  background: var(--navy-deep);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: var(--s-5);
}
.contact-card h3 { font-size: 1.5rem; margin-bottom: var(--s-3); }
.contact-name { font-weight: 700; }
.contact-org { color: var(--sky); margin-bottom: var(--s-4); }
.contact-links { display: grid; gap: var(--s-2); }
.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  font-weight: 700;
}
.section-navy .contact-link { color: var(--gold); }
.contact-link span { min-width: 0; overflow-wrap: anywhere; }
.closing {
  margin-top: var(--s-7);
  max-width: 60ch;
  color: var(--gold);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.25rem, 2vw + 0.5rem, 1.625rem);
  line-height: 1.45;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-deep);
  color: var(--sky);
  padding-block: var(--s-5);
  font-size: 1rem;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--s-2) var(--s-4);
}
.site-footer a { color: var(--gold); }
.footer-links > a,
.a11y-statement summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--gold);
  font-weight: 700;
}
.a11y-statement summary {
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  list-style-position: inside;
}
.a11y-body {
  max-width: 60ch;
  padding: var(--s-3) 0;
  color: var(--white);
}
.a11y-body p + p { margin-top: var(--s-2); }

/* ---------- Tablet (768–1023px) ---------- */
@media (min-width: 768px) {
  .hero-actions { flex-direction: row; flex-wrap: wrap; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .pillar-cards { grid-template-columns: repeat(3, 1fr); gap: var(--s-3); }
  .pillar-card { padding: var(--s-3); }
  .card-grid--3 { grid-template-columns: repeat(2, 1fr); }
  .card-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .collab-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col-list { grid-template-columns: 1fr 1fr; }

  .flow { grid-template-columns: repeat(3, 1fr); gap: var(--s-6); }
  .flow-step + .flow-step::before {
    left: calc(-1 * var(--s-6) + 8px);
    top: 50%;
    transform: translateY(-50%);
  }
  .footer-inner { flex-direction: row; justify-content: space-between; align-items: flex-start; }
  .footer-inner > p { padding-top: 10px; }
  .footer-links { justify-content: flex-end; }
}

/* ---------- Desktop (≥ 1024px) ---------- */
@media (min-width: 1024px) {
  :root { --gutter: 48px; }
  .section { padding-block: var(--s-8); }
  .hero { min-height: 80vh; display: flex; align-items: center; }
  .hero-inner { width: 100%; }
  .horizon { height: 200px; }

  .about-grid { grid-template-columns: 5fr 7fr; gap: var(--s-5); align-items: start; }
  .pillar-cards { gap: var(--s-5); }
  .pillar-card { padding: var(--s-4); }
  .card-grid { gap: var(--s-5); }
  .card-grid--3 { grid-template-columns: repeat(3, 1fr); }
  .card-grid--4 { grid-template-columns: repeat(4, 1fr); }

  .flow-layout { grid-template-columns: 4fr 8fr; gap: var(--s-5); align-items: center; }
  .flow { gap: var(--s-6); }

  .collab-layout { grid-template-columns: 8fr 4fr; gap: var(--s-5); }
  .collab-grid { grid-template-columns: repeat(3, 1fr); gap: var(--s-5) var(--s-4); }
  .collab-item { flex-direction: column; gap: var(--s-2); }
  .collab-item p { padding-top: 0; }
}

/* ---------- Section reveal (only when JS runs and motion is allowed) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal-on .reveal {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 200ms ease-out, transform 200ms ease-out;
  }
  .reveal-on .reveal.is-visible { opacity: 1; transform: none; }
}

/* ---------- Forced colors (Windows High Contrast) ---------- */
@media (forced-colors: active) {
  .icon-circle, .headshot { border: 2px solid CanvasText; }
  .card, .stat-card, .strip, .band, .key-message, .profile-card, .contact-card, .chip { border: 1px solid CanvasText; }
  :focus-visible { outline: 3px solid Highlight; }
  .nav-list a[aria-current="true"] { border-bottom-color: Highlight; }
  .flow-step + .flow-step::before, .two-col-list li::before { background: CanvasText; }
  .icon { fill: CanvasText; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .skip-link, .horizon { display: none; }
  .section-navy, .band-navy, .profile-card, .key-message, .column-card--navy { background: none; color: #000; }
}
