/* NMR RF Lab: site styles
   Colors and type are set once in :root; change them there. */

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/ibm-plex-mono-normal-400.woff2) format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/ibm-plex-mono-normal-500.woff2) format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(../fonts/ibm-plex-sans-normal-400.woff2) format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/ibm-plex-sans-italic-400.woff2) format('woff2');
}
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(../fonts/newsreader-normal-400-600.woff2) format('woff2');
}
@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
  src: url(../fonts/newsreader-italic-400-600.woff2) format('woff2');
}

:root {
  --navy-deep: #0b1a38;
  --navy: #193b7b;
  --navy-soft: #e8eef9;
  --maroon: #500000;
  --trace: #bcd2ff;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --ink: #141c2e;
  --muted: #56617a;
  --line: #d8deea;

  --serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;

  --wrap: 72rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
}

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

a { color: var(--navy); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--maroon); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
  border-radius: 2px;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.12; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.3rem, 5.2vw, 3.6rem); letter-spacing: -0.015em; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.25rem); letter-spacing: -0.01em; }
h3 { font-size: 1.35rem; line-height: 1.25; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul { margin: 0; padding: 0; list-style: none; }
sup { font-size: 0.68em; line-height: 0; }

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

.label {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--navy); color: #fff; padding: 0.6rem 1rem; z-index: 10;
}
.skip:focus { left: 0; color: #fff; }

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

.site-header {
  background: var(--surface);
  border-top: 4px solid var(--maroon);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 0.25rem 2rem;
  padding-block: 0.85rem;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.7rem;
  color: var(--navy); text-decoration: none;
  font-family: var(--serif); font-weight: 600; font-size: 1.45rem; letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand svg { width: 3.4rem; height: 1.7rem; flex: none; }
.brand:hover { color: var(--navy); }

.nav ul { display: flex; flex-wrap: wrap; gap: 0.1rem 1.6rem; }
.nav a {
  display: block; padding: 0.45rem 0;
  color: var(--ink); text-decoration: none;
  font-size: 0.95rem; font-weight: 500;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--navy); border-bottom-color: var(--line); }
.nav a[aria-current="page"] { color: var(--maroon); border-bottom-color: var(--maroon); }

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

.hero { background: var(--navy-deep); color: #fff; overflow: hidden; }
.hero .wrap {
  display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 4rem); align-items: center;
  padding-block: clamp(3.5rem, 8vw, 6rem);
}
.hero .label { color: var(--trace); }
.hero h1 { margin: 1rem 0 1.4rem; }
.hero h1 em { font-style: italic; color: var(--trace); }
.hero p { color: #d5def0; max-width: 34rem; font-size: 1.125rem; }
.hero p a { color: #fff; font-weight: 500; }
.hero p a:hover { color: var(--trace); }

.scope { margin: 0; }
.scope svg { width: 100%; height: auto; display: block; overflow: visible; }
.scope .axis { stroke: rgba(188, 210, 255, 0.28); stroke-width: 1; }
.scope .plot { position: relative; }
.scope .trace {
  fill: none; stroke: var(--trace); stroke-width: 1.8;
  stroke-linejoin: round; stroke-linecap: round;
}
/* The trace sits in its own SVG layer and is revealed left to right by clipping
   that layer's box. No stroke-dash animation since it breaks on iOS Safari */
.scope .sweep {
  position: absolute; inset: 0;
  -webkit-clip-path: inset(-8px 100% -8px -8px);
  clip-path: inset(-8px 100% -8px -8px);
  animation: sweep 2.8s cubic-bezier(0.3, 0.1, 0.2, 1) 0.2s forwards;
}
.scope figcaption {
  display: flex; justify-content: space-between; margin-top: 0.6rem;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: rgba(188, 210, 255, 0.75);
}
@keyframes sweep {
  to { -webkit-clip-path: inset(-8px); clip-path: inset(-8px); }
}

.fields { background: var(--navy); color: #fff; }
.fields ul {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
}
.fields li { padding: 1.15rem 1.25rem 1.2rem 0; }
.fields li + li { padding-left: 1.25rem; border-left: 1px solid rgba(255, 255, 255, 0.18); }
.fields b {
  display: block; font-family: var(--mono); font-weight: 500; font-size: 1.3rem;
  font-variant-numeric: tabular-nums;
}
.fields span { font-size: 0.875rem; color: #cdd9f1; line-height: 1.4; display: block; }

/* ---------- Sections ---------- */

.section { padding-block: clamp(3rem, 7vw, 5rem); }
.section + .section { border-top: 1px solid var(--line); }
.section-head { margin-bottom: 2.2rem; max-width: 46rem; }
.section-head .label { display: block; margin-bottom: 0.6rem; }
.section-head p { margin-top: 0.9rem; color: var(--muted); }

.split {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(1.5rem, 5vw, 4rem); align-items: start;
}

.focus > li { padding: 1.05rem 0; border-top: 1px solid var(--line); font-size: 1.125rem; }
.focus > li:last-child { border-bottom: 1px solid var(--line); }
.focus ul { margin-top: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.focus ul li {
  font-size: 0.875rem; color: var(--navy);
  background: var(--navy-soft); padding: 0.2rem 0.65rem; border-radius: 999px;
}

.more {
  display: inline-block; margin-top: 1.4rem;
  font-weight: 500; text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.plate {
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  padding: clamp(0.75rem, 2vw, 1.5rem);
}
.plate img { margin-inline: auto; }
a.plate { display: block; }
a.plate:hover { border-color: var(--navy); }

.affil { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.affil a {
  display: flex; align-items: center; justify-content: center;
  min-height: 5.5rem; padding: 0.9rem 1rem;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface); text-decoration: none; text-align: center;
  font-family: var(--serif); font-size: 1.15rem; font-weight: 500; line-height: 1.2;
}
.affil a.maroon { background: #560001; border-color: #560001; }
.affil a:hover { border-color: var(--navy); }
.affil img { max-height: 3.4rem; width: auto; }

/* ---------- Inner page header ---------- */

.page-head { background: var(--surface); border-bottom: 1px solid var(--line); }
.page-head .wrap { padding-block: clamp(2.5rem, 6vw, 4rem) clamp(2rem, 4vw, 2.75rem); }
.page-head h1 { margin-top: 0.7rem; }
.page-head p { margin-top: 1rem; max-width: 42rem; color: var(--muted); font-size: 1.125rem; }

.toc { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin-top: 1.6rem; }
.toc a { font-size: 0.95rem; font-weight: 500; }

/* ---------- Research ---------- */

.facility {
  display: grid; grid-template-columns: 14rem minmax(0, 1fr);
  gap: 1.25rem 2.25rem; padding: 1.75rem 0; border-top: 1px solid var(--line);
}
.facility:last-of-type { border-bottom: 1px solid var(--line); }
.facility img { width: 100%; border-radius: 4px; aspect-ratio: 5 / 3; object-fit: cover; }
.facility h3 { margin: 0.35rem 0 0.6rem; }
.facility p { max-width: 44rem; }
.kit { margin-top: 0.9rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.15rem 2rem; max-width: 50rem; }
.kit li { padding: 0.4rem 0 0.4rem 1.1rem; position: relative; font-size: 0.98rem; border-bottom: 1px dotted var(--line); }
.kit li::before {
  content: ""; position: absolute; left: 0; top: 1.05em;
  width: 0.45rem; height: 1px; background: var(--maroon);
}

.project {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 1.5rem clamp(1.5rem, 4vw, 3.5rem); align-items: start;
  padding: 2.25rem 0; border-top: 1px solid var(--line);
}
.project-text { position: sticky; top: 1.5rem; }
.project-text h3 { margin-bottom: 0.8rem; font-size: 1.5rem; }
.project-text p { color: #2c3650; }
.figs { display: grid; gap: 1rem; }
.figs img { width: 100%; max-width: 650px; margin-inline: auto; }

.pubs { border-top: 1px solid var(--line); }
.pubs li {
  display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: 1rem;
  padding: 0.95rem 0; border-bottom: 1px solid var(--line);
  font-size: 0.98rem; line-height: 1.55;
}
.pubs .yr { font-family: var(--mono); font-weight: 500; color: var(--maroon); font-variant-numeric: tabular-nums; }
.pubs a { overflow-wrap: anywhere; }

/* ---------- People ---------- */

.pi {
  display: grid; grid-template-columns: auto minmax(0, 1fr);
  gap: 1.5rem 2.25rem; align-items: start; max-width: 54rem;
}
.portrait { width: 136px; height: 150px; object-fit: cover; border-radius: 4px; background: var(--navy-soft); }
.pi h2 { margin: 0.3rem 0 0.8rem; }

.people { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.person {
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  padding: 1.4rem;
}
.person .portrait { width: 112px; height: 112px; border-radius: 50%; margin-bottom: 1rem; }
.person h3 { margin: 0.25rem 0 0.6rem; }
.person p { font-size: 0.98rem; }
.thesis { margin-top: 0.9rem; padding-top: 0.9rem; border-top: 1px solid var(--line); font-size: 0.92rem; color: var(--muted); }
.thesis b { display: block; font-family: var(--mono); font-size: 0.7rem; font-weight: 500; letter-spacing: 0.09em; text-transform: uppercase; margin-bottom: 0.2rem; }

.rows { border-top: 1px solid var(--line); }
.rows li {
  display: grid; grid-template-columns: minmax(0, 15rem) 4rem minmax(0, 1fr);
  gap: 0.25rem 1.5rem; padding: 0.8rem 0; border-bottom: 1px solid var(--line);
  font-size: 0.98rem;
}
.rows.two li { grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); }
.rows .name { font-weight: 600; }
.rows .yr { font-family: var(--mono); color: var(--maroon); font-variant-numeric: tabular-nums; }
.rows .what { color: #2c3650; }
.degree { margin: 2.25rem 0 0.9rem; }
.degree:first-of-type { margin-top: 0; }

/* ---------- Courses ---------- */

.courses { border-top: 1px solid var(--line); }
.courses li {
  display: grid; grid-template-columns: 11rem minmax(0, 1fr);
  gap: 0.25rem 2rem; padding: 1.25rem 0; border-bottom: 1px solid var(--line);
}
.courses .code { font-family: var(--mono); font-weight: 500; color: var(--maroon); padding-top: 0.2rem; }
.courses h3 { font-size: 1.3rem; }
.courses p { margin-top: 0.4rem; color: #2c3650; max-width: 44rem; }
.courses .tag { font-family: var(--sans); font-size: 0.8rem; font-weight: 500; color: var(--navy); background: var(--navy-soft); padding: 0.1rem 0.55rem; border-radius: 999px; margin-left: 0.4rem; vertical-align: 0.15em; }

/* ---------- Contact ---------- */

.contact-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  padding: 1.75rem;
}
.card h2 { font-size: 1.6rem; margin: 0.3rem 0 1.1rem; }
.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.5rem 1.25rem; margin: 0; }
.facts dt { font-family: var(--mono); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); padding-top: 0.3rem; }
.facts dd { margin: 0; font-size: 1.1rem; overflow-wrap: anywhere; }
.join h3 { margin: 1.6rem 0 0.4rem; }
.join h2 + h3 { margin-top: 1.2rem; }
.join p { max-width: 40rem; }

.places { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.place {
  display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  overflow: hidden; text-decoration: none; color: var(--ink);
}
.place:hover { border-color: var(--navy); color: var(--ink); }
.place img { width: 100%; aspect-ratio: 5 / 2; object-fit: cover; }
.place div { padding: 1.1rem 1.25rem 1.25rem; }
.place h3 { margin: 0.25rem 0 0.3rem; color: var(--navy); }
.place p { font-size: 0.95rem; color: var(--muted); }

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

.site-footer { background: var(--navy-deep); color: #c9d4ea; margin-top: 0; font-size: 0.95rem; }
.site-footer .wrap {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 3fr) minmax(0, 4fr);
  gap: 2rem; padding-block: 3rem 2.5rem;
}
.site-footer .brand { color: #fff; font-size: 1.3rem; }
.site-footer p { margin-top: 0.8rem; max-width: 24rem; }
.site-footer h2 { font-family: var(--mono); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.09em; text-transform: uppercase; color: var(--trace); margin-bottom: 0.7rem; }
.site-footer li { padding: 0.18rem 0; }
.site-footer a { color: #fff; text-decoration-color: rgba(255, 255, 255, 0.35); }
.site-footer a:hover { color: var(--trace); }
.site-footer a:focus-visible { outline-color: var(--trace); }
.legal { border-top: 1px solid rgba(255, 255, 255, 0.14); }
.legal .wrap { display: block; padding-block: 1rem; font-size: 0.82rem; color: #9fb0d2; }

/* ---------- Responsive ---------- */

@media (max-width: 60rem) {
  .people { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .affil { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project { grid-template-columns: minmax(0, 1fr); }
  .project-text { position: static; }
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 48rem) {
  body { font-size: 1rem; }
  .hero .wrap, .split { grid-template-columns: minmax(0, 1fr); }
  .fields ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fields li, .fields li + li { padding: 1rem 1rem 1rem 0; border-left: 0; }
  .fields li:nth-child(even) { padding-left: 1rem; border-left: 1px solid rgba(255, 255, 255, 0.18); }
  .fields li:nth-child(n+3) { border-top: 1px solid rgba(255, 255, 255, 0.18); }
  .facility { grid-template-columns: minmax(0, 1fr); }
  .facility img { max-width: 20rem; }
  .kit { grid-template-columns: minmax(0, 1fr); }
  .pubs li { grid-template-columns: minmax(0, 1fr); gap: 0.15rem; }
  .rows li, .rows.two li { grid-template-columns: minmax(0, 1fr) auto; }
  .rows .what { grid-column: 1 / -1; }
  .courses li { grid-template-columns: minmax(0, 1fr); }
  .site-footer .wrap { grid-template-columns: minmax(0, 1fr); }
  .places { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 34rem) {
  .people { grid-template-columns: minmax(0, 1fr); }
  .pi { grid-template-columns: minmax(0, 1fr); }
  .nav ul { gap: 0.1rem 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scope .sweep { animation: none; -webkit-clip-path: none; clip-path: none; }
}

@media print {
  .site-header .nav, .site-footer, .scope { display: none; }
  body { background: #fff; }
}
