/* GEMSTONE — NSF Programmable Cloud Laboratory node
   Type: Libre Franklin (display/UI) + Karla (body) */

:root {
  --navy:      #12497E;
  --deep:      #001327;
  --accent:    #E36C09;
  /* darker orange for small text on light backgrounds: 4.8:1 on white (AA);
     keep --accent for large/graphic elements only */
  --accent-ink: #B85500;
  --ink:       #16202B;
  --body:      #3C4A59;
  --muted:     #5C6875;
  --quiet:     #64717F;
  --rule:      #DCE1E7;
  --tint:      #F4F6F8;
  --paper:     #FFFFFF;
  --on-deep:   #AEC2DA;
  --on-deep-q: #7D97B4;
  --deep-rule: #16324F;

  --display: 'Libre Franklin', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --text: Karla, system-ui, -apple-system, 'Segoe UI', sans-serif;

  --wrap: 1160px;
  --gutter: 40px;
  --rail: 240px;
  --header-h: 76px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--text);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; letter-spacing: -0.01em; margin: 0; }

p { margin: 0; text-wrap: pretty; }

a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--accent-ink); }

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}

h1[id], h2[id], h3[id] { scroll-margin-top: calc(var(--header-h) + 24px); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

img, svg { max-width: 100%; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--deep); color: #fff; padding: 12px 20px;
  font-family: var(--display); font-size: 14px;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------- mark ---------- */
.mark { width: 34px; height: 34px; flex: none; }
.m-corner { fill: var(--navy); }
.m-edge   { fill: #5E93CE; }
.m-core   { fill: var(--accent); }
.on-dark .m-corner { fill: #FFFFFF; }
.on-dark .m-edge   { fill: #4E7DAF; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,0.94);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  min-height: var(--header-h);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 40px; padding-top: 14px; padding-bottom: 14px;
}
.brand { display: flex; align-items: center; gap: 14px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand__name { font-family: var(--display); font-size: 21px; font-weight: 700; letter-spacing: 0.07em; color: var(--navy); }

.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 30px; }
.site-nav a {
  position: relative; display: inline-block; padding: 8px 0;
  font-family: var(--display); font-size: 15px; font-weight: 500; letter-spacing: 0.02em;
  color: var(--body);
}
.site-nav a:hover { color: var(--accent-ink); }
.site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px;
  height: 2px; background: var(--accent);
}

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--deep); color: #fff; border-bottom: 4px solid var(--accent); }
/* soft light behind the hero gem so it sits on the ground instead of floating */
.hero::before {
  content: ""; position: absolute; right: -60px; top: -80px; width: 640px; height: 640px;
  background: radial-gradient(circle, rgba(45,110,185,0.30) 0%, rgba(0,19,39,0) 68%);
  pointer-events: none; z-index: 0;
}
/* the logo's own 45° lattice, continued across the hero ground so the network
   sits on a fabric; masked so it fades out before it reaches the headline */
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    repeating-linear-gradient(45deg, rgba(125,151,180,0.07) 0 1px, transparent 1px 44px),
    repeating-linear-gradient(-45deg, rgba(125,151,180,0.07) 0 1px, transparent 1px 44px);
  -webkit-mask-image: linear-gradient(100deg, transparent 32%, rgba(0,0,0,0.55) 58%, #000 82%);
  mask-image: linear-gradient(100deg, transparent 32%, rgba(0,0,0,0.55) 58%, #000 82%);
}
/* the lab photograph behind the network graphic. The overlay gradients fade it
   to solid --deep on the left (behind the headline) and soften top and bottom,
   so the photo, the constellation, and the page read as one scene */
.hero__bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.hero__bg img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 72% center;
}
.hero__bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle 480px at 76% 52%, rgba(0,19,39,0.62) 0%, rgba(0,19,39,0.25) 62%, rgba(0,19,39,0) 100%),
    linear-gradient(90deg, #001327 0%, #001327 14%, rgba(0,19,39,0.94) 40%, rgba(0,19,39,0.62) 64%, rgba(0,19,39,0.42) 100%),
    linear-gradient(180deg, rgba(0,19,39,0.5) 0%, rgba(0,19,39,0.12) 45%, rgba(0,19,39,0.5) 100%);
}
.hero .wrap { position: relative; z-index: 1; }
.hero .wrap { padding-top: 96px; padding-bottom: 88px; display: flex; flex-wrap: wrap; gap: 72px; align-items: flex-start; }
.hero__main { flex: 1 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 26px; }
.hero h1 { font-size: clamp(34px, 4.4vw, 52px); line-height: 1.12; letter-spacing: -0.02em; color: #fff; }
.hero__lede { font-size: 20px; line-height: 1.62; color: #C3D0DE; max-width: 660px; }

/* full-colour mark in the hero, extended into the network it stands for.
   The slight negative right margin lets the constellation reach toward the
   viewport edge (the hero's overflow:hidden crops it cleanly on smaller screens). */
.hero__gem { flex: 0 1 420px; min-width: 0; display: flex; justify-content: center; align-self: center; margin-right: -70px; }
.hero__gem svg { width: 100%; max-width: 480px; height: auto; }
.g-corner { fill: #3D87D6; }
.g-edge   { fill: #1B558F; }
.g-core   { fill: #F27C12; }
/* the network around the node: lab tiles, unlinked far nodes, links, pulses */
.g-tile { fill: #06213C; stroke: #3D87D6; stroke-width: 2; stroke-linejoin: round; }
.g-glyph { stroke: #AFD2F5; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.g-dot  { fill: #AFD2F5; stroke: none; }
.g-far  { fill: #3D87D6; opacity: .35; }
/* dotted trails: zero-length dashes with round caps render as strings of dots */
.g-link { stroke: #4586C6; stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 0.1 8; }
.g-ring { stroke: #2E6CA8; stroke-width: 1.5; stroke-linecap: round; stroke-dasharray: 0.1 7; opacity: .55; }
.g-flow { stroke: #BFDCF8; stroke-width: 2.4; stroke-linecap: round; opacity: 0; }

.kicker { font-family: var(--display); font-size: 13px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--quiet); }
/* long-form kicker (e.g. the spelled-out GEMSTONE acronym): keep the label voice
   but drop the all-caps so the initial capitals read naturally */
.kicker--plain { text-transform: none; letter-spacing: 0.03em; font-size: 15px; line-height: 1.5; max-width: 640px; }
.hero .kicker { color: var(--on-deep-q); }

/* the one-line network affiliation directly under the hero headline */
.hero__network { font-size: 18px; line-height: 1.6; color: #C3D0DE; margin-top: -8px; max-width: 660px; }
.hero__network a, .hero__lede a {
  color: #fff; font-weight: 600;
  text-decoration: underline; text-underline-offset: 4px;
  text-decoration-thickness: 2px; text-decoration-color: rgba(255,255,255,0.45);
}
.hero__network a:hover, .hero__lede a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.label { font-family: var(--display); font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--quiet); }
.label--accent { color: var(--accent-ink); }
.hero .label, .on-dark .label { color: var(--on-deep-q); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; font-family: var(--display); font-size: 15px; font-weight: 600;
  letter-spacing: 0.02em; padding: 14px 26px; border: 1px solid transparent;
}
.btn--primary { background: var(--accent); color: var(--deep); }
.btn--primary:hover { background: #fff; color: var(--deep); }
.btn--ghost { border-color: #3C5878; color: #fff; }
.btn--ghost:hover { border-color: #fff; color: #fff; }
.btn--navy { background: var(--navy); color: #fff; }
.btn--navy:hover { background: var(--accent-ink); color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; padding-top: 8px; }

/* ---------- stat strip ---------- */
.stats { background: var(--tint); border-bottom: 1px solid var(--rule); }
.stats .wrap { padding-top: 40px; padding-bottom: 40px; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 40px; }
.stat__n { font-family: var(--display); font-size: 34px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; color: var(--navy); }
.stat__l { font-size: 15px; line-height: 1.5; color: var(--muted); margin-top: 6px; }

/* ---------- section shell (rail + body) ---------- */
.section { padding-top: 88px; padding-bottom: 88px; }
.section--tint { background: var(--tint); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding-top: 72px; padding-bottom: 72px; }
.split { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); gap: 72px; align-items: start; }
.rail { display: flex; flex-direction: column; gap: 12px; }
.rail--sticky { position: sticky; top: calc(var(--header-h) + 40px); }
.rail::before { content: ""; display: block; width: 40px; height: 3px; background: var(--accent); }
.rail h1 { font-size: 34px; letter-spacing: -0.02em; line-height: 1.15; }
.rail h2 { font-size: 26px; line-height: 1.22; }
.rail__note { font-size: 16px; line-height: 1.6; color: var(--quiet); }
.rail__more { font-family: var(--display); font-size: 15px; font-weight: 500; padding-top: 6px; }

.flow { display: flex; flex-direction: column; gap: 44px; max-width: 800px; }
.flow--tight { gap: 34px; }
.flow--wide { max-width: 820px; }
.flow h2 { font-size: 25px; }
.flow h3 { font-size: 20px; }
.flow p { font-size: 18px; line-height: 1.72; color: var(--body); }
.flow .lede { font-size: 22px; line-height: 1.6; color: var(--ink); }
.stack { display: flex; flex-direction: column; gap: 16px; }

.pull { border-left: 3px solid var(--accent); padding: 4px 0 4px 26px; }
.pull p { font-size: 19px; line-height: 1.68; color: var(--ink); }

.note { border: 1px solid var(--rule); background: var(--tint); padding: 26px 30px; }
.note p { font-size: 17px; line-height: 1.65; color: var(--body); }

/* ---------- office address + map ---------- */
.office { display: grid; gap: 16px; align-items: stretch; }
@media (min-width: 820px) { .office { grid-template-columns: minmax(276px, 2fr) 3fr; } }
.office .note { display: flex; flex-direction: column; justify-content: space-between; gap: 16px; }
.office__maplink { font-size: 15px; }
.office__map { border: 1px solid var(--rule); background: var(--tint); }
.office__map iframe { display: block; width: 100%; height: 100%; min-height: 300px; border: 0; }

/* ---------- grids of cells ---------- */
.cells { display: grid; gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.cells--1 { grid-template-columns: minmax(0, 1fr); }
.cells--2 { grid-template-columns: repeat(auto-fit, minmax(276px, 1fr)); }
.cells--3 { grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); }
.cells--5 { grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); }
/* 1100px, not 1000px: below that the five-across cells get too narrow and
   the Emerald wordmark wraps to three lines, breaking cross-cell alignment */
@media (min-width: 1100px) { .cells--5 { grid-template-columns: repeat(5, 1fr); } }
.cell { background: var(--paper); padding: 26px 30px; display: flex; flex-direction: column; gap: 8px; }
.cell--tint { background: var(--tint); }
/* a cell that spans the full row of its grid (e.g. the FAIR-data cell that
   would otherwise sit alone in a 3-column row) */
.cell--wide { grid-column: 1 / -1; }
.cell h3 { font-size: 18px; font-weight: 600; }
.cell p { font-size: 16px; line-height: 1.65; color: var(--muted); }
.cell__meta { font-size: 14px; color: var(--quiet); }

/* pipeline */
.pipeline .cell p { font-size: 15px; line-height: 1.6; }
.pipeline .cells { counter-reset: pstep; }
.pipeline .cell { counter-increment: pstep; }
.pipeline .cell .label::before {
  content: counter(pstep, decimal-leading-zero) "\2002\00B7\2002";
  color: var(--quiet); font-weight: 700;
}

/* partner strip */
.partner h3 { font-size: 16px; line-height: 1.3; }
.partner p { font-size: 14px; line-height: 1.55; padding-top: 4px; }
/* location sits at the cell's bottom edge so a long city name ("West
   Lafayette, IN") can wrap without pushing the role text out of line
   with the neighboring cells */
.partner .cell__meta { order: 1; margin-top: auto; padding-top: 6px; }
/* per-logo heights come from partners.yml (logo_h), tuned so the marks
   carry equal visual weight despite very different aspect ratios */
.partner { padding-left: 24px; padding-right: 24px; }
.partner__logo { display: flex; align-items: center; gap: 9px; min-height: 32px; }
.partner__wordmark {
  font-family: var(--display); font-size: 14px; font-weight: 600;
  line-height: 1.15; letter-spacing: 0.01em; color: var(--ink);
}
.partner__logo img { max-height: 30px; width: auto; max-width: 100%; }

/* cell icons */
.cell__icon { color: var(--navy); margin-bottom: 4px; }
.cell__icon .icon { width: 26px; height: 26px; display: block; }

/* objective rows */
.objective { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 26px; padding: 28px 30px; }
.objective__tag {
  font-family: var(--display); font-size: 12px; font-weight: 700; letter-spacing: 0.1em;
  color: #fff; background: var(--navy); padding: 6px 0; text-align: center; height: fit-content;
}
.objective h3 { font-size: 19px; font-weight: 600; }
.objective p { font-size: 17px; line-height: 1.68; color: var(--muted); }

/* institution rows */
.inst { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 30px; padding: 24px 30px; }
.inst h3 { font-size: 17px; font-weight: 600; }
.inst p { font-size: 16px; line-height: 1.65; color: var(--muted); }

/* people — PI rows: portrait left, identity + bio right */
.person {
  padding: 32px 30px;
  display: grid; grid-template-columns: 132px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  column-gap: 30px; row-gap: 14px;
  align-items: start;
}
.person h3 { font-family: var(--display); font-size: 23px; font-weight: 700; letter-spacing: -0.01em; }
.person__meta { display: flex; flex-direction: column; gap: 7px; }
.person__org { font-size: 16px; color: var(--muted); }
.person__bio { grid-column: 2; font-size: 17px; line-height: 1.7; color: var(--body); max-width: 620px; }
.person__photo {
  grid-row: 1 / 3; width: 132px; height: 132px; object-fit: cover; flex: none;
  border-radius: 50%;
}
.person__photo--placeholder {
  display: flex; align-items: center; justify-content: center;
  background: var(--tint) url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20120%20120'%3E%3Cg%20transform='rotate(45%2060%2060)'%20fill='%2312497E'%20fill-opacity='0.05'%3E%3Crect%20x='18'%20y='18'%20width='24'%20height='24'/%3E%3Crect%20x='48'%20y='18'%20width='24'%20height='24'/%3E%3Crect%20x='78'%20y='18'%20width='24'%20height='24'/%3E%3Crect%20x='18'%20y='48'%20width='24'%20height='24'/%3E%3Crect%20x='48'%20y='48'%20width='24'%20height='24'/%3E%3Crect%20x='78'%20y='48'%20width='24'%20height='24'/%3E%3Crect%20x='18'%20y='78'%20width='24'%20height='24'/%3E%3Crect%20x='48'%20y='78'%20width='24'%20height='24'/%3E%3Crect%20x='78'%20y='78'%20width='24'%20height='24'/%3E%3C/g%3E%3C/svg%3E") no-repeat center / 130%;
  color: var(--navy);
  font-family: var(--display); font-size: 34px; font-weight: 700; letter-spacing: 0.02em;
}
/* rows without a bio: identity block centers against the portrait */
.person--brief .person__meta { grid-row: 1 / 3; align-self: center; }
.team-note { font-size: 15px; line-height: 1.6; color: var(--quiet); }

/* contact cells */
.contact-cell a { font-family: var(--display); font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.contact-cell { padding: 28px 30px; }

/* ---------- news ---------- */
.news-list { display: flex; flex-direction: column; }
.news-item { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 32px; padding: 30px 0; border-top: 1px solid var(--rule); }
.news-item:last-of-type { border-bottom: 1px solid var(--rule); }
.news-item time { font-family: var(--display); font-size: 14px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--quiet); padding-top: 4px; }
.news-item h2, .news-item h3 { font-size: 21px; font-weight: 600; line-height: 1.35; }
.news-item p { font-size: 17px; line-height: 1.65; color: var(--muted); margin-top: 8px; }
a.news-item { color: var(--ink); padding-left: 12px; padding-right: 12px; margin-left: -12px; margin-right: -12px; }
a.news-item:hover { background: var(--tint); color: var(--ink); }
.section--tint a.news-item:hover { background: var(--paper); }

.post-title { font-size: 30px; line-height: 1.2; }
.post-body { max-width: 720px; display: flex; flex-direction: column; gap: 20px; }
.post-body p { font-size: 18px; line-height: 1.72; color: var(--body); }
.post-body h2 { font-size: 23px; margin-top: 12px; }
.post-body ul { margin: 0; padding-left: 22px; font-size: 18px; line-height: 1.72; color: var(--body); }
.post-body li { margin-bottom: 8px; }
.post-body figure { margin: 4px 0; }
.post-body figure img, .team-photo img, .figure img { display: block; width: 100%; height: auto; border-radius: 10px; }
.post-body figcaption, .team-photo figcaption, .figure figcaption { margin-top: 10px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.team-photo, .figure { margin: 0; }

/* homepage facility band: photographic proof of the stats above it */
.facility .wrap { padding-top: 44px; padding-bottom: 24px; display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 28px; align-items: start; }
.facility figure { margin: 0; }
.facility img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 10px; }
.facility figcaption { margin-top: 10px; font-size: 14px; line-height: 1.5; color: var(--muted); }

/* ---------- signup ---------- */
.signup { border: 1px solid var(--rule); background: var(--tint); padding: 26px 30px; display: flex; flex-direction: column; gap: 10px; }
.signup h3 { font-size: 17px; font-weight: 600; }
.signup p { font-size: 16px; line-height: 1.65; color: var(--muted); }
.signup__row { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 6px; }

/* ---------- CTA panel ---------- */
.cta { background: var(--deep); padding: 34px 38px; display: flex; flex-direction: column; gap: 12px; }
.cta h2 { font-size: 21px; font-weight: 600; color: #fff; }
.cta p { font-size: 17px; line-height: 1.65; color: var(--on-deep); max-width: 560px; }
.cta .btn-row { padding-top: 8px; }

/* ---------- footer ---------- */
.site-footer { margin-top: auto; background: var(--deep); color: var(--on-deep); }
.site-footer .wrap { padding-top: 56px; padding-bottom: 40px; display: flex; flex-wrap: wrap; gap: 56px; }
.site-footer__brand { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.site-footer__brand .brand__name { color: #fff; font-size: 18px; }
.site-footer__brand p { font-size: 15px; line-height: 1.65; color: var(--on-deep-q); max-width: 420px; }
.site-footer__col { flex: 0 1 200px; display: flex; flex-direction: column; gap: 12px; }
.site-footer__col .label { color: var(--on-deep-q); }
.site-footer__col a { font-size: 15px; color: var(--on-deep); }
.site-footer__col a:hover { color: #fff; }
.site-footer__legal { border-top: 1px solid var(--deep-rule); }
.site-footer__legal .wrap { padding-top: 22px; padding-bottom: 22px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 30px; }
.site-footer__legal p { font-size: 14px; color: var(--on-deep-q); }
.site-footer__meta { display: flex; flex-direction: column; gap: 6px; text-align: right; }
.site-footer__nsf { display: flex; align-items: center; gap: 16px; }
.site-footer__nsf img { flex: none; width: 52px; height: 52px; }

.page-shell { display: flex; flex-direction: column; min-height: 100vh; }

/* citation block */
.cite { font-family: ui-monospace, Menlo, monospace; font-size: 14px; line-height: 1.7; }

/* funder block (NSF logo + support statement) */
.funder { display: flex; align-items: center; gap: 30px; }
.funder img { flex: none; width: 96px; height: 96px; }
@media (max-width: 600px) {
  .funder { flex-direction: column; align-items: flex-start; gap: 20px; }
  .site-footer__meta { text-align: left; }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .rail--sticky { position: static; }
  .section { padding-top: 56px; padding-bottom: 56px; }
  .hero .wrap { padding-top: 64px; padding-bottom: 56px; gap: 40px; }
  /* once the hero wraps, the gem sits under the text — keep it a signature, not a billboard */
  .hero__gem { flex-basis: 100%; justify-content: flex-end; margin-right: 0; }
  .hero__gem svg { max-width: 250px; }
  /* the glassware would sit behind the text column here — keep the ground clean */
  .hero__bg { display: none; }
  .site-header .wrap { gap: 4px 28px; padding-top: 12px; padding-bottom: 12px; }
  .site-nav { gap: 2px 24px; }
  .objective { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .objective__tag { width: 92px; }
  .inst { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .news-item { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}

@media (max-width: 600px) {
  :root { --gutter: 22px; }
  /* on phones the gem would eat a whole screen below the text — keep the ground clean */
  .hero::before, .hero::after, .hero__gem { display: none; }
  body { font-size: 16px; }
  /* a two-row wrapped header would cover a third of a phone screen if it stayed stuck */
  .site-header { position: static; }
  .brand__name { font-size: 19px; }
  .mark { width: 30px; height: 30px; }
  .flow p, .post-body p, .post-body ul { font-size: 17px; }
  .flow .lede { font-size: 20px; }
  .cell, .contact-cell, .person { padding: 22px; }
  .person { grid-template-columns: 84px minmax(0, 1fr); column-gap: 18px; }
  .person__photo { grid-row: 1; width: 84px; height: 84px; }
  .person__photo--placeholder { font-size: 24px; }
  .person__meta { align-self: center; }
  .person h3 { font-size: 20px; }
  .person__bio { grid-column: 1 / -1; }
  .person--brief .person__meta { grid-row: 1; }
  .cta { padding: 26px 24px; }
}

/* ---------- roadmap timeline ---------- */
.roadmap {
  list-style: none; margin: 8px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 28px; counter-reset: step;
}
.roadmap li {
  counter-increment: step; position: relative;
  border-top: 3px solid var(--rule); padding-top: 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.roadmap li::before { content: ""; position: absolute; top: -3px; left: 0; width: 40px; height: 3px; background: var(--accent); }
.roadmap h3 { font-size: 16px; font-weight: 600; line-height: 1.35; }
.roadmap h3::before {
  content: counter(step, decimal-leading-zero);
  display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.12em;
  color: var(--accent-ink); margin-bottom: 6px;
}
.roadmap p { font-size: 15px; line-height: 1.6; color: var(--muted); }

/* ---------- interactive pipeline (vision) ---------- */
.pipeviz { display: flex; flex-direction: column; gap: 18px; margin-top: 8px; }

.pipeviz__stages {
  display: grid;
  grid-template-columns: minmax(0,1fr) 20px minmax(0,1fr) 20px minmax(0,1fr) 20px minmax(0,1fr) 20px minmax(0,1fr);
  align-items: stretch;
}
.pipeviz__arrow { display: flex; align-items: center; justify-content: center; color: #B7C3D0; }
.pipeviz__arrow svg { width: 16px; height: 16px; transition: color .2s ease; }
.pipeviz__arrow.is-past { color: var(--accent); }

.pipeviz__stage {
  position: relative; cursor: pointer; text-align: left;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--rule); border-top: 3px solid var(--rule);
  padding: 16px 14px 14px; margin: 0;
  display: flex; flex-direction: column; gap: 10px;
  font-family: var(--text);
  transition: border-color .2s ease, background-color .2s ease;
}
.pipeviz__stage:hover { border-color: #AFBCCA; border-top-color: #AFBCCA; }
.pipeviz__stage[aria-selected="true"] {
  background: var(--tint); border-top-color: var(--accent);
  box-shadow: 0 8px 20px rgba(18, 73, 126, 0.09);
}
.pipeviz__stage[aria-selected="true"] .icon { color: var(--accent-ink); }
.pipeviz__stage.is-past { border-top-color: #F0C69C; }
.pipeviz__stage.is-past .icon { opacity: 0.72; }
.pipeviz__stage .icon { width: 24px; height: 24px; color: var(--navy); transition: color .2s ease, opacity .2s ease; }
.pipeviz__num { color: var(--accent-ink); margin-right: 7px; }

/* fills under the active stage while auto-advance is running (duration matches the JS interval) */
.pipeviz__stage::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
}
.pipeviz__stage.is-timing::after { animation: pipeviz-timer 4.2s linear forwards; }
@keyframes pipeviz-timer { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.pipeviz__meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pipeviz__tag {
  font-family: var(--display); font-size: 11px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--quiet);
}
.pipeviz__name { font-family: var(--display); font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.pipeviz__desc { font-size: 13px; line-height: 1.45; color: var(--muted); }
.pipeviz__ai {
  position: absolute; top: -9px; right: 10px;
  font-family: var(--display); font-size: 10px; font-weight: 700; letter-spacing: 0.14em;
  color: var(--deep); background: var(--accent); padding: 2px 7px;
}

/* dashed return path: PCL Test Bed back to ORE */
.pipeviz__loop {
  grid-column: 3 / 10; position: relative; height: 18px; margin: 0 13%;
  border: 1px dashed #B7C3D0; border-top: 0;
  transition: border-color .3s ease;
}
/* at the execution stage, the return path comes alive */
.pipeviz.is-looping .pipeviz__loop { border-color: var(--accent); }
.pipeviz.is-looping .pipeviz__loop::before { border-bottom-color: var(--accent); }
.pipeviz.is-looping .pipeviz__loop-label { color: var(--accent-ink); }
.pipeviz__track { display: flex; flex-direction: column; }
.pipeviz__loop::before {
  content: ""; position: absolute; top: -7px; left: -5.5px; width: 0; height: 0;
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-bottom: 7px solid #9FB0C0;
}
.pipeviz__loop-label {
  position: absolute; left: 50%; bottom: 0; transform: translate(-50%, 50%);
  background: var(--paper); padding: 0 12px; white-space: nowrap;
  font-family: var(--display); font-size: 11px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--quiet);
}

.pipeviz__panel {
  border: 1px solid var(--rule); background: var(--tint);
  padding: 22px 26px; flex-direction: column; gap: 6px; display: none;
}
.pipeviz__panel.is-active { display: flex; }
@media (prefers-reduced-motion: no-preference) {
  .pipeviz__panel.is-active { animation: pipeviz-fade .32s ease both; }
}
@keyframes pipeviz-fade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.pipeviz .pipeviz__panel h3 { font-size: 17px; font-weight: 600; }
.pipeviz .pipeviz__panel p { font-size: 16px; line-height: 1.65; color: var(--body); }

@media (max-width: 759px) {
  .pipeviz__stages { grid-template-columns: minmax(0, 1fr); }
  .pipeviz__arrow { padding: 5px 0; }
  .pipeviz__arrow svg { transform: rotate(90deg); }
  .pipeviz__stage { flex-direction: row; align-items: center; gap: 14px; padding: 14px 16px; border-top-width: 1px; border-left-width: 3px; }
  .pipeviz__stage[aria-selected="true"] { border-top-color: var(--rule); border-left-color: var(--accent); }
  .pipeviz__stage.is-past { border-top-color: var(--rule); border-left-color: #F0C69C; }
  .pipeviz__stage:hover { border-top-color: #AFBCCA; }
  .pipeviz__loop { display: none; }
  .pipeviz__panel { padding: 20px; }
}

/* the loop needs the track to be one grid so it can span stage columns */
@media (min-width: 760px) {
  .pipeviz__track { display: grid; grid-template-columns: minmax(0,1fr) 20px minmax(0,1fr) 20px minmax(0,1fr) 20px minmax(0,1fr) 20px minmax(0,1fr); row-gap: 12px; }
  .pipeviz__stages { display: contents; }
}

/* ---------- network viz (vision): pairwise tangle vs the AMBER hub ---------- */
.netviz { display: flex; flex-direction: column; gap: 14px; margin-top: 24px; }

.netviz__switch { display: flex; flex-wrap: wrap; gap: 8px; }
.netviz__mode {
  cursor: pointer; font-family: var(--display); font-size: 13px; font-weight: 600;
  letter-spacing: 0.04em; color: var(--body);
  background: var(--paper); border: 1px solid var(--rule); padding: 9px 16px;
  transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}
.netviz__mode:hover { border-color: #AFBCCA; color: var(--ink); }
.netviz__mode[aria-pressed="true"] {
  background: var(--deep); border-color: var(--deep); color: #fff;
  box-shadow: inset 0 -3px 0 var(--accent);
}

.netviz__stage { border: 1px solid var(--rule); background: var(--paper); padding: 10px; }
.netviz__svg { display: block; width: 100%; height: auto; }

/* the tangle: one hand-maintained translation per pair */
.netviz__mesh line { stroke: #9FB0C0; stroke-width: 1.3; transition: opacity .45s ease; }
.netviz.is-hub .netviz__mesh line { opacity: 0; }

/* the spokes: one translation per node, through the standard */
.netviz__spokes line {
  stroke: var(--navy); stroke-width: 1.7; stroke-linecap: round;
  stroke-dasharray: 5 9; opacity: 0; transition: opacity .45s ease .12s;
}
.netviz.is-hub .netviz__spokes line { opacity: 0.6; }
@media (prefers-reduced-motion: no-preference) {
  .netviz.is-hub .netviz__spokes line { animation: netviz-flow 1.4s linear infinite; }
}
@keyframes netviz-flow { to { stroke-dashoffset: -14; } }

.netviz__hub { opacity: 0; transition: opacity .4s ease .1s; }
.netviz.is-hub .netviz__hub { opacity: 1; }
.netviz__hub-gem {
  fill: var(--accent);
  transform-box: fill-box; transform-origin: center;
  transform: rotate(45deg) scale(0.55);
  transition: transform .45s cubic-bezier(.2, .8, .3, 1.2);
}
.netviz.is-hub .netviz__hub-gem { transform: rotate(45deg) scale(1); }
.netviz__hub-name {
  font-family: var(--display); font-size: 15px; font-weight: 700;
  letter-spacing: 0.06em; fill: var(--deep); text-anchor: middle;
}
.netviz__hub-sub {
  font-family: var(--display); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; fill: var(--quiet); text-anchor: middle;
  /* paper halo so crossing spokes don't run through the label */
  stroke: var(--paper); stroke-width: 4; paint-order: stroke;
}

.netviz__node rect { fill: var(--paper); stroke: var(--rule); }
.netviz__node-key { stroke: #AFBCCA; stroke-width: 3; }
.netviz__node--live .netviz__node-key { stroke: var(--accent); }

.netviz__node-name { font-family: var(--display); font-size: 13px; font-weight: 700; fill: var(--ink); text-anchor: middle; }
.netviz__node-sub { font-family: var(--text); font-size: 11px; fill: var(--muted); text-anchor: middle; }

/* the open slot: labs still to join */
.netviz__node--ghost rect { stroke-dasharray: 5 4; }
.netviz__node--ghost .netviz__node-name { fill: var(--muted); }
.netviz__node--ghost .netviz__node-sub { fill: var(--quiet); }
.netviz__mesh line.netviz__link--ghost { stroke-dasharray: 3 5; opacity: 0.65; }
.netviz.is-hub .netviz__mesh line.netviz__link--ghost { opacity: 0; }
.netviz.is-hub .netviz__spokes line.netviz__link--ghost { opacity: 0.35; }

.netviz__captions { border: 1px solid var(--rule); background: var(--tint); padding: 16px 22px; }
.netviz__caption { display: none; align-items: baseline; gap: 16px; }
.netviz:not(.is-hub) .netviz__caption--mesh { display: flex; }
.netviz.is-hub .netviz__caption--hub { display: flex; }
@media (prefers-reduced-motion: no-preference) {
  .netviz:not(.is-hub) .netviz__caption--mesh,
  .netviz.is-hub .netviz__caption--hub { animation: pipeviz-fade .32s ease both; }
}
.netviz__count {
  font-family: var(--display); font-size: 30px; font-weight: 700;
  letter-spacing: -0.02em; line-height: 1; flex: none;
}
.netviz__caption--mesh .netviz__count { color: var(--quiet); }
.netviz__caption--hub .netviz__count { color: var(--accent-ink); }
.netviz__captext { font-size: 15px; line-height: 1.6; color: var(--body); }
.netviz__captext strong { color: var(--ink); }

.netviz .netviz__legend { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--quiet); }

@media (max-width: 599px) {
  .netviz__stage { overflow-x: auto; }
  .netviz__svg { min-width: 560px; }
}

/* ---------- team map (five sites, one distributed laboratory) ---------- */
/* full-width map on top; institutions as a horizontal tab strip below,
   detail panel underneath (same idiom as the pipeline viz) */
.teammap { display: flex; flex-direction: column; gap: 18px; margin-top: 8px; }
/* home page: the flow gap is enough; pull the map up toward its intro line */
.flow .teammap { margin-top: -18px; }
/* inside a tinted section the paper/tint tab roles swap so selection still reads */
.section--tint .teammap__tab { background: var(--tint); }
.section--tint .teammap__tab[aria-selected="true"],
.section--tint .teammap__panel { background: var(--paper); }
.teammap__side { display: contents; }
/* stage is the positioning context for the floating detail card */
.teammap__stage { position: relative; border: 1px solid var(--rule); background: var(--paper); padding: 18px 26px; }
.teammap__svg { display: block; width: 100%; height: auto; }

.teammap__land { fill: #EDF1F5; stroke: #C9D3DD; stroke-width: 1; }
.teammap__borders { fill: none; stroke: var(--paper); stroke-width: 1; }

/* constellation arcs between sites (drawn by JS) */
.teammap__link {
  fill: none; stroke: var(--navy); stroke-width: 1.5; stroke-linecap: round;
  stroke-dasharray: 3 8; opacity: 0.18; transition: opacity .25s ease;
}
.teammap__link.is-active { opacity: 0.7; }

.teammap__site { cursor: pointer; }
.teammap__hit { fill: none; pointer-events: all; }
.teammap__dot {
  fill: var(--navy); stroke: var(--paper); stroke-width: 2.5;
  transition: fill .2s ease;
}
.teammap__site:hover .teammap__dot, .teammap__site.is-active .teammap__dot { fill: var(--accent); }
.teammap__pulse {
  fill: none; stroke: var(--accent); stroke-width: 2; opacity: 0;
  transform-box: fill-box; transform-origin: center;
}
.teammap__sitename {
  font-family: var(--display); font-size: 19px; font-weight: 600;
  fill: var(--ink); paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round;
}
.teammap__siteloc {
  font-family: var(--text); font-size: 14px; fill: var(--quiet);
  paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round;
}
.teammap__site.is-active .teammap__sitename { fill: var(--accent-ink); }

.teammap__list { display: flex; flex-wrap: wrap; }
.teammap__tab {
  flex: 1 1 200px; cursor: pointer; text-align: left;
  margin: 0 -1px -1px 0; /* collapse shared 1px borders between neighbors */
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--rule); border-top: 3px solid var(--rule);
  padding: 12px 16px; display: flex; align-items: center; gap: 14px;
  font-family: var(--text);
  transition: border-color .2s ease, background-color .2s ease;
}
.teammap__tab:hover { border-top-color: #AFBCCA; }
.teammap__tab[aria-selected="true"] {
  background: var(--tint); border-top-color: var(--accent);
  position: relative; z-index: 1; /* keep the accent edge above collapsed neighbors */
}
.teammap__tab-logo {
  width: 30px; height: 30px; object-fit: contain; flex: none;
  filter: grayscale(1); opacity: .55;
  transition: filter .2s ease, opacity .2s ease;
}
.teammap__tab:hover .teammap__tab-logo,
.teammap__tab[aria-selected="true"] .teammap__tab-logo { filter: none; opacity: 1; }
.teammap__tab-text { display: flex; flex-direction: column; gap: 1px; }
.teammap__tab-name { font-family: var(--display); font-size: 15px; font-weight: 600; }
.teammap__tab-loc { font-size: 13px; color: var(--quiet); }

/* the detail card floats over the map beside the selected dot (JS sets
   left/top as percentages of the stage and flips it away from near edges),
   so the institution text is read in the context of the map itself */
.teammap__panels {
  position: absolute; z-index: 2; width: min(340px, 52%);
  transform: translate(20px, 14px);
  pointer-events: none; /* keep dots under the card hoverable */
}
.teammap__panels.is-flip-x { transform: translate(calc(-100% - 20px), 14px); }
.teammap__panels.is-flip-y { transform: translate(20px, calc(-100% - 14px)); }
.teammap__panels.is-flip-x.is-flip-y { transform: translate(calc(-100% - 20px), calc(-100% - 14px)); }

.teammap__panel {
  border: 1px solid var(--rule); background: var(--tint);
  box-shadow: 0 10px 28px rgba(0, 19, 39, 0.14);
  padding: 16px 20px; flex-direction: column; gap: 8px; display: none;
}
.teammap__panel.is-active { display: flex; }
@media (prefers-reduced-motion: no-preference) {
  .teammap__panel.is-active { animation: pipeviz-fade .32s ease both; }
}
.teammap .teammap__panel h3 { font-size: 17px; font-weight: 600; }
.teammap .teammap__panel p { font-size: 15px; line-height: 1.65; color: var(--body); }

@media (max-width: 900px) {
  .teammap__stage { padding: 12px 10px; }
}
@media (max-width: 700px) {
  /* labels would render at ~6px once the SVG shrinks — the list carries the names */
  .teammap__sitename, .teammap__siteloc { display: none; }
  .teammap__dot { r: 9; }
  .teammap__pulse { r: 9; }
  /* too little room to float the card over the small map: let it sit statically
     below the SVG, still inside the map frame */
  .teammap__panels { position: static; width: auto; transform: none !important; pointer-events: auto; margin-top: 10px; }
  .teammap__panel { box-shadow: none; }
  /* stacked tabs: the selected edge moves from top to left, like the pipeline viz */
  .teammap__tab { border-top: 1px solid var(--rule); border-left: 3px solid var(--rule); }
  .teammap__tab:hover { border-top-color: var(--rule); border-left-color: #AFBCCA; }
  .teammap__tab[aria-selected="true"] { border-top-color: var(--rule); border-left-color: var(--accent); }
}

/* ---------- motion (all guarded by prefers-reduced-motion) ---------- */
a, .btn, .site-nav a { transition: color .15s ease, background-color .15s ease, border-color .15s ease; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  /* one-time hero entrance */
  .hero__main > *, .hero__gem {
    opacity: 0; transform: translateY(12px);
    animation: rise-in .55s ease forwards;
  }
  .hero__main > :nth-child(2) { animation-delay: .07s; }
  .hero__main > :nth-child(3) { animation-delay: .14s; }
  .hero__main > :nth-child(4) { animation-delay: .21s; }
  .hero__gem { animation-delay: .28s; }
  @keyframes rise-in { to { opacity: 1; transform: none; } }

  /* the blueprint ground fades in after the foreground has arrived */
  .hero__bg { opacity: 0; animation: fade-in .9s ease .4s forwards; }
  @keyframes fade-in { to { opacity: 1; } }

  /* pulses travelling from the GEMSTONE node out along its network links.
     One short dash per link; the long gap keeps a single pulse in flight. */
  .g-flow {
    opacity: .85;
    stroke-dasharray: 10 400;
    stroke-dashoffset: 10;
    animation: gem-flow 5.2s linear infinite;
  }
  @keyframes gem-flow { to { stroke-dashoffset: -175; } }

  /* scroll reveal — class is added by JS, so no-JS visitors see static content */
  .reveal {
    opacity: 0; transform: translateY(14px);
    transition: opacity .5s ease, transform .5s ease;
    transition-delay: var(--reveal-delay, 0s);
  }
  .reveal.is-visible { opacity: 1; transform: none; }

  /* team map: sonar pulse on the active site, slow dash drift on its arcs */
  .teammap__site.is-active .teammap__pulse { animation: teammap-pulse 2.4s ease-out infinite; }
  @keyframes teammap-pulse {
    0% { transform: scale(1); opacity: 0.55; }
    75% { transform: scale(3.4); opacity: 0; }
    100% { transform: scale(3.4); opacity: 0; }
  }
  .teammap__link.is-active { animation: teammap-dash 1.4s linear infinite; }
  /* dasharray is 3 8, so an 11-unit offset loops seamlessly */
  @keyframes teammap-dash { to { stroke-dashoffset: -11; } }
}

/* ---------- mobile disclosure nav ---------- */
.nav-toggle { display: none; }

@media (max-width: 767px) {
  .nav-toggle {
    display: inline-flex; align-items: center; gap: 10px;
    font-family: var(--display); font-size: 14px; font-weight: 600; letter-spacing: 0.04em;
    color: var(--ink); background: transparent; border: 1px solid var(--rule);
    padding: 9px 14px; cursor: pointer;
  }
  .nav-toggle__icon {
    display: block; width: 15px; height: 2px; background: currentColor;
    box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor;
  }
  .site-nav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 0; padding: 2px 0 14px; }
  .site-nav a { padding: 11px 0; font-size: 16px; border-top: 1px solid var(--rule); }
  .site-nav a:first-child { border-top: 0; }
  .site-nav a[aria-current="page"]::after { right: auto; width: 40px; bottom: 6px; }
  .site-header.nav-open .site-nav { display: flex; }
}

@media print {
  .site-header, .site-nav, .signup, .cta { display: none; }
  body { color: #000; }
}
