/* Stats4STEM public site — single stylesheet, no build step. */

:root {
  --ink: #0b1f3a;
  --slate: #51607a;
  --accent: #2f6fde;
  --accent-ink: #1f5bc4;   /* accent darkened for small text on light bg */
  --line: #e6e9ef;
  --tint: #f5f7fb;
  --hero-top: #eef3fa;
  --white: #ffffff;
  --band-text: #c9d4e6;    /* secondary text on the navy band */

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;

  --radius: 20px;
  --pill: 980px;
  --wrap: 1120px;
  --gutter: 22px;
  --section-y: clamp(80px, 11vw, 148px);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.53;
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; }

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

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

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

.skip {
  position: absolute;
  left: 16px; top: -60px;
  z-index: 100;
  padding: 10px 18px;
  border-radius: var(--pill);
  background: var(--ink);
  color: var(--white);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { top: 12px; }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 26px;
  border-radius: var(--pill);
  border: 1.5px solid var(--ink);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.btn-navy { background: var(--ink); color: var(--white); }
.btn-navy:hover { background: #17325a; border-color: #17325a; }
.btn-outline { background: transparent; color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--white); }
.btn-small { min-height: 34px; padding: 6px 16px; font-size: 14px; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(11, 31, 58, 0.08);
}
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.brand { display: inline-flex; align-items: center; flex-shrink: 0; }
.brand img { height: 34px; width: auto; }

.nav-desktop { display: flex; align-items: center; gap: 28px; }
.nav-desktop ul { display: flex; gap: 28px; list-style: none; }
.nav-desktop ul a {
  color: var(--ink);
  font-size: 14px;
  text-decoration: none;
  opacity: .82;
}
.nav-desktop ul a:hover { opacity: 1; }

.nav-mobile { display: none; }

@media (max-width: 760px) {
  .nav-desktop { display: none; }
  .nav-mobile { display: block; }
  .nav-mobile summary {
    list-style: none;
    display: grid;
    place-items: center;
    width: 44px; height: 44px;
    margin-right: -10px;
    border-radius: 12px;
    cursor: pointer;
  }
  .nav-mobile summary::-webkit-details-marker { display: none; }
  .burger,
  .burger::before,
  .burger::after {
    display: block;
    width: 18px; height: 1.5px;
    background: var(--ink);
    border-radius: 2px;
    transition: transform .2s ease;
  }
  .burger { position: relative; }
  .burger::before, .burger::after { content: ""; position: absolute; left: 0; }
  .burger::before { top: -6px; }
  .burger::after { top: 6px; }
  .nav-mobile[open] .burger { background: transparent; }
  .nav-mobile[open] .burger::before { transform: translateY(6px) rotate(45deg); }
  .nav-mobile[open] .burger::after { transform: translateY(-6px) rotate(-45deg); }

  .nav-mobile nav {
    position: absolute;
    left: 0; right: 0; top: 60px;
    background: rgba(255, 255, 255, 0.97);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 24px;
  }
  .nav-mobile ul { list-style: none; }
  .nav-mobile li a:not(.btn) {
    display: block;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
    text-decoration: none;
  }
  .nav-mobile li .btn { margin-top: 20px; width: 100%; }
}

/* ---------- Type scale ---------- */
h1 {
  font-size: clamp(44px, 8.4vw, 96px);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -0.045em;
}
.section-title {
  font-size: clamp(34px, 5.4vw, 60px);
  line-height: 1.06;
  font-weight: 700;
  letter-spacing: -0.035em;
  max-width: 18ch;
}
h3 {
  font-size: 21px;
  line-height: 1.24;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.section-intro {
  margin-top: 20px;
  max-width: 34em;
  color: var(--slate);
  font-size: clamp(19px, 2vw, 22px);
  line-height: 1.45;
  letter-spacing: -0.015em;
}

/* ---------- Sections ---------- */
.section { padding: var(--section-y) 0; }
.tint { background: var(--tint); }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
}
.card p { margin-top: 10px; color: var(--slate); }

/* ---------- 1. Hero ---------- */
.hero {
  background: linear-gradient(180deg, var(--hero-top) 0%, var(--white) 100%);
  padding: clamp(88px, 14vw, 176px) 0 clamp(64px, 9vw, 112px);
}
.hero-inner { text-align: center; }
.eyebrow {
  color: var(--accent-ink);
  font-size: clamp(17px, 1.8vw, 21px);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.hero h1 {
  margin: 18px auto 0;
  max-width: 12.5ch;
}
.lede {
  margin: 28px auto 0;
  max-width: 33em;
  color: var(--slate);
  font-size: clamp(19px, 2.2vw, 24px);
  line-height: 1.42;
  letter-spacing: -0.016em;
}
.actions {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

/* One orchestrated moment: the hero settles in on load. */
@media (prefers-reduced-motion: no-preference) {
  .hero-inner > * { animation: rise .9s cubic-bezier(.2, .7, .2, 1) both; }
  .hero-inner > :nth-child(2) { animation-delay: .08s; }
  .hero-inner > :nth-child(3) { animation-delay: .18s; }
  .hero-inner > :nth-child(4) { animation-delay: .28s; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- 2. Numbers ---------- */
.numbers { padding: 8px 0 clamp(72px, 9vw, 120px); }
.figures {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.figures > div {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 6px;
  padding: 40px 24px;
  text-align: center;
}
.figures > div + div { border-left: 1px solid var(--line); }
.figures dd {
  font-size: clamp(36px, 4.6vw, 58px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.figures dt { color: var(--slate); font-size: 16px; }
.caption {
  margin-top: 16px;
  text-align: center;
  color: var(--slate);
  font-size: 14px;
}
@media (max-width: 860px) {
  .figures { grid-template-columns: 1fr 1fr; }
  .figures > div:nth-child(3) { border-left: 0; }
  .figures > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .figures > div { padding: 32px 12px; }
}

/* ---------- 3. Pillars ---------- */
.pillars { padding-top: 0; }
.pillar-grid {
  margin-top: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.pillar { padding: 36px 32px 40px; background: var(--tint); border-color: transparent; }
.pillar-icon {
  width: 44px; height: 44px;
  margin-bottom: 28px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pillar h3 { font-size: 26px; letter-spacing: -0.028em; }
@media (max-width: 900px) {
  .pillar-grid { grid-template-columns: 1fr; }
}

/* ---------- 4. Platform ---------- */
.platform { background: var(--tint); }
.feature {
  margin-top: clamp(72px, 10vw, 128px);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: clamp(40px, 7vw, 96px);
}
.feature-flip .feature-media { order: 2; }
.feature-text h3 {
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.032em;
  font-weight: 700;
}
.feature-text p {
  margin-top: 18px;
  max-width: 28em;
  color: var(--slate);
  font-size: clamp(18px, 1.7vw, 20px);
  line-height: 1.5;
}
.feature-media {
  display: flex;
  justify-content: center;
  border-radius: 28px;
  background: var(--white);
  border: 1px solid var(--line);
  padding: clamp(32px, 5vw, 56px) clamp(16px, 4vw, 48px);
  overflow: hidden;
}

.phones { position: relative; width: 100%; max-width: 460px; }
.phone {
  background: var(--ink);
  padding: 9px;
  border-radius: 38px;
  box-shadow: 0 30px 60px -28px rgba(11, 31, 58, 0.45);
}
.phone img {
  width: 100%; height: auto;
  border-radius: 29px;
  background: var(--white);
}
.phone-main { width: 74%; }
.phone-second {
  position: absolute;
  right: 0;
  top: 22%;
  width: 46%;
  padding: 7px;
  border-radius: 30px;
}
.phone-second img { border-radius: 23px; }
.feature-flip .phone-main { margin: 0 auto; width: 70%; }
/* The worked-example capture has empty space below the card: crop to it. */
.phone-crop img { aspect-ratio: 780 / 1190; object-fit: cover; object-position: top; }

.panel {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 4 / 3;
  border-radius: 24px;
  background: linear-gradient(160deg, var(--hero-top), var(--white));
}
.panel svg { width: 100%; height: 100%; }

.panel-stuck .cells rect { fill: #dfe6f1; }
.panel-stuck .cells .warm { fill: #9dbbef; }
.panel-stuck .cells .hot { fill: var(--accent); }
.panel-stuck .focus { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-dasharray: 6 6; }

.panel-frq .sheet { fill: var(--white); stroke: var(--line); stroke-width: 1.5; }
.panel-frq .lines path { stroke: #cfd8e6; stroke-width: 6; stroke-linecap: round; fill: none; }
.panel-frq .models circle { fill: var(--white); stroke: var(--accent); stroke-width: 2.5; }
.panel-frq .models circle:nth-child(2) { fill: var(--accent); }
.panel-frq .links path { stroke: #9dbbef; stroke-width: 2; fill: none; stroke-dasharray: 3 5; stroke-linecap: round; }
.panel-frq .tick { stroke: var(--white); stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }

.panel-games .team circle { stroke: var(--white); stroke-width: 3; }
.panel-games .t1 circle { fill: var(--accent); }
.panel-games .t2 circle { fill: #9dbbef; }
.panel-games .t3 circle { fill: #51607a; }
.panel-games .t4 circle { fill: #c9d6ea; }
.panel-games .center { fill: var(--ink); }
.panel-games .center-q { stroke: var(--white); stroke-width: 3.5; fill: none; stroke-linecap: round; }

@media (max-width: 860px) {
  .feature { grid-template-columns: 1fr; gap: 32px; }
  .feature-flip .feature-media { order: 0; }
}

/* ---------- 5. Built for research ---------- */
.built-grid {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.card-wide { grid-column: 1 / -1; }
.card-wide p { max-width: 44em; }
@media (max-width: 760px) {
  .built-grid { grid-template-columns: 1fr; }
  .card { padding: 26px 24px; }
}

/* ---------- 6. Research ---------- */
.research-grid {
  list-style: none;
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
}
.tile {
  grid-column: span 2;
  padding: 32px 30px 36px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--white);
}
.tile h3 { font-size: 24px; letter-spacing: -0.026em; }
.tile p { margin-top: 10px; color: var(--slate); }
@media (max-width: 900px) {
  .research-grid { grid-template-columns: 1fr 1fr; }
  .tile { grid-column: span 1; }
  .tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .research-grid { grid-template-columns: 1fr; }
  .tile:last-child:nth-child(odd) { grid-column: auto; }
}

/* ---------- 7. Funding ---------- */
.funding { background: var(--ink); color: var(--white); }
.funding a { color: #9cc0ff; }
.funding-head {
  display: flex;
  align-items: center;
  gap: clamp(24px, 4vw, 44px);
}
.nsf-badge {
  flex-shrink: 0;
  padding: 14px;
  border-radius: 28px;
  background: var(--white);
}
.nsf-badge img { width: 96px; height: 96px; }
.funding .section-title { max-width: 22ch; }
.funding-total {
  margin-top: 16px;
  color: var(--band-text);
  font-size: clamp(19px, 2vw, 23px);
  letter-spacing: -0.016em;
}

.awards {
  list-style: none;
  margin-top: 64px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}
.award {
  display: grid;
  grid-template-columns: 190px 1fr 280px;
  gap: 32px;
  padding: 32px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}
.award-meta, .award-amount { display: flex; flex-direction: column; gap: 4px; }
.award-meta a { font-weight: 600; font-variant-numeric: tabular-nums; }
.award-meta span, .award-amount span { color: var(--band-text); font-size: 15px; }
.award h3 { font-size: 19px; line-height: 1.32; font-weight: 600; letter-spacing: -0.015em; }
.award-body p { margin-top: 8px; color: var(--band-text); font-size: 15px; }
.award-amount { text-align: right; }
.award-amount strong {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.funding-note { margin-top: 32px; color: var(--band-text); font-size: 15px; }

@media (max-width: 860px) {
  .funding-head { flex-direction: column; align-items: flex-start; }
  .nsf-badge { padding: 10px; border-radius: 22px; }
  .nsf-badge img { width: 72px; height: 72px; }
  .award { grid-template-columns: 1fr; gap: 12px; padding: 28px 0; }
  .award-meta { flex-direction: row; flex-wrap: wrap; column-gap: 14px; }
  .award-amount { text-align: left; }
}

/* ---------- 8. Publications ---------- */
.pubs-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: clamp(40px, 6vw, 80px);
  align-items: start;
}
.citations {
  margin-top: 48px;
  list-style: none;
}
.citations li {
  padding: 26px 0;
  border-top: 1px solid var(--line);
  max-width: 44em;
  line-height: 1.6;
}
.citations li:last-child { border-bottom: 1px solid var(--line); }
.citations cite { font-style: italic; }
.citations a {
  display: block;
  margin-top: 6px;
  font-size: 15px;
  overflow-wrap: anywhere;
}
.led-by { margin-top: 8px; background: var(--tint); border-color: transparent; }
.led-by h3 { font-size: 17px; color: var(--slate); font-weight: 600; }
.led-by .person { margin-top: 10px; color: var(--ink); font-size: 19px; line-height: 1.4; }
.led-by .person strong { font-size: 24px; letter-spacing: -0.025em; }
.inst-label { margin-top: 28px !important; font-size: 15px; }
.inst-list { list-style: none; margin-top: 10px; }
.inst-list li { padding: 9px 0; border-top: 1px solid var(--line); font-weight: 500; }
@media (max-width: 900px) {
  .pubs-layout { grid-template-columns: 1fr; }
}

/* ---------- 9. Collaborate ---------- */
.collaborate {
  background: linear-gradient(180deg, var(--white) 0%, var(--hero-top) 100%);
  text-align: center;
}
.collab-inner h2 {
  font-size: clamp(40px, 6.6vw, 76px);
  line-height: 1.04;
  font-weight: 700;
  letter-spacing: -0.042em;
}
.collab-inner p {
  margin: 24px auto 0;
  max-width: 32em;
  color: var(--slate);
  font-size: clamp(19px, 2vw, 22px);
  line-height: 1.45;
}
.collab-inner .btn { margin-top: 36px; }

/* ---------- 10. Footer ---------- */
.site-footer {
  padding: 48px 0 56px;
  border-top: 1px solid var(--line);
  background: var(--tint);
  color: var(--slate);
  font-size: 14px;
}
.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}
.footer-links { list-style: none; display: flex; flex-wrap: wrap; gap: 24px; }
.footer-links a { color: var(--ink); text-decoration: none; font-weight: 500; }
.footer-links a:hover { text-decoration: underline; }
.ack { margin-top: 28px; max-width: 64em; line-height: 1.6; }
.copy { margin-top: 16px; }

@media (max-width: 600px) {
  .phone { padding: 7px; border-radius: 28px; }
  .phone img { border-radius: 21px; }
  .phone-second { padding: 5px; border-radius: 20px; }
  .phone-second img { border-radius: 15px; }
}

/* Wide product screens (demo-data renders of real app components) */
.feature-wide { display: block; }
.feature-wide .feature-text { max-width: 760px; margin: 0 auto 32px; text-align: center; }
.screen { margin: 0 auto; max-width: 1100px; }
.screen img {
  display: block; width: 100%; height: auto;
  border-radius: 20px; border: 1px solid var(--line);
  box-shadow: 0 30px 60px -30px rgba(11, 31, 58, 0.35), 0 8px 24px -12px rgba(11, 31, 58, 0.18);
  background: #fff;
}
.screen figcaption { margin-top: 12px; text-align: center; font-size: 13px; color: var(--slate); }
.feature-wide .feature-text p { margin-left: auto; margin-right: auto; }
