/* ==========================================================================
   Hi-impact Storm Laboratory (HiSL) — Kyungpook National University
   Modern academic theme
   ========================================================================== */

:root {
  --bg:          #ffffff;
  --bg-soft:     #f5f7fa;
  --bg-deep:     #0f2036;
  --ink:         #16202c;
  --ink-soft:    #5d6b7a;
  --ink-faint:   #8d99a6;
  --line:        #e2e8f0;
  --line-soft:   #eef2f6;
  --accent:      #12456f;
  --accent-lift: #1d6aa8;
  --accent-wash: #eaf2f9;
  --maxw:        1120px;
  --serif: "Source Serif 4", "Spectral", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic",
          "Apple SD Gothic Neo", Roboto, sans-serif;
}

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

/* The browser's [hidden] rule is only as specific as a class, so any element
   we give a display value would keep showing when JS sets .hidden = true.
   State it once, forcefully, rather than per component. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-lift); text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2rem, 4.2vw, 2.9rem); }
h2 { font-size: clamp(1.5rem, 2.8vw, 1.95rem); }
h3 { font-size: 1.16rem; }

p { margin: 0 0 1.1em; }

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

.narrow { max-width: 780px; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  /* Tall enough that the 58px mark keeps air above and below it. */
  min-height: 82px;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand:hover { text-decoration: none; }

.brand-mark {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 8px;
  background: var(--accent);
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* The logo is a transparent PNG whose artwork already fills a circle, so it
   needs no background and no rounding — that would clip the lettering ring. */
.brand-logo {
  width: 58px;
  height: 58px;
  flex: none;
  object-fit: contain;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.22; }
.brand-title {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}
.brand-sub {
  font-size: 0.74rem;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
}

.nav { display: flex; align-items: center; gap: 4px; }

.nav a {
  position: relative;
  display: block;
  padding: 9px 13px;
  border-radius: 7px;
  color: var(--ink-soft);
  font-size: 0.93rem;
  font-weight: 500;
}
.nav a:hover { background: var(--bg-soft); color: var(--ink); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-wash); }

/* ---------- Hero ------------------------------------------------------ */

.hero {
  background: linear-gradient(170deg, var(--bg-deep) 0%, #16375a 62%, #1d5182 100%);
  color: #eaf1f8;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(46% 60% at 84% 22%, rgba(120, 190, 245, 0.24), transparent 70%),
    radial-gradient(40% 52% at 10% 88%, rgba(90, 150, 210, 0.20), transparent 72%);
  pointer-events: none;
}

.hero .wrap { position: relative; z-index: 1; padding-block: clamp(56px, 9vw, 104px); }

.hero .eyebrow {
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #9fc4e4;
  margin-bottom: 18px;
}

.hero h1 { color: #fff; max-width: 17ch; margin-bottom: 20px; }

.hero-lede {
  max-width: 62ch;
  font-size: 1.06rem;
  color: #c8dcee;
  margin-bottom: 28px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.9rem;
  color: #a9c8e2;
}
.hero-meta strong { color: #fff; font-weight: 600; }

/* ---------- Page header (inner pages) --------------------------------- */

.page-head {
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}
.page-head .wrap { padding-block: clamp(40px, 6vw, 64px); }
.page-head .eyebrow {
  font-size: 0.74rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  font-weight: 600;
}
.page-head p { max-width: 66ch; color: var(--ink-soft); margin-bottom: 0; }

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

section.band { padding-block: clamp(48px, 7vw, 80px); }
section.band.soft { background: var(--bg-soft); border-block: 1px solid var(--line); }

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 28px;
}
.section-title h2 { margin: 0; }
.section-title .more { font-size: 0.9rem; font-weight: 500; }

.lede { font-size: 1.06rem; color: var(--ink-soft); max-width: 68ch; }

/* ---------- Keyword chips -------------------------------------------- */

.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }

.chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.86rem;
  color: var(--ink-soft);
  white-space: nowrap;
}
section.soft .chip { background: #fff; }

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

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
}
.card h3 { margin-bottom: 8px; }
.card p:last-child { margin-bottom: 0; }
.card .num {
  font-family: var(--serif);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent);
  display: block;
  margin-bottom: 10px;
}

/* The keywords for a line of work, set under the paragraph that explains them.
   A rule above them separates the terms from the prose without needing a
   heading; they are quieter than the text they follow.

   `margin-top: auto` in a flex column pins them to the foot of the card, so the
   rules line up across a row even though the paragraphs differ in length. */
.card:has(.card-keys) { display: flex; flex-direction: column; }
.card p:has(+ .card-keys) { margin-bottom: 0; }

.card-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  /* The rule reads better running the full width of the card. */
  margin-inline: -24px;
  padding-inline: 24px;
}
.card-keys .key {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 11px;
  font-size: 0.76rem;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  background: #fff;
  white-space: nowrap;
}
/* On the tinted band the plain white pill is what makes them read as chips. */
.band.soft .card-keys .key { background: #fff; }

.card.link-card { transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.card.link-card:hover {
  border-color: #c6d5e4;
  box-shadow: 0 6px 20px rgba(18, 69, 111, 0.07);
}

/* ---------- Stats ----------------------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.stat { background: #fff; padding: 22px 20px; }
.stat .figure {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.1;
}
.stat .label {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin-top: 4px;
}

/* ---------- Publication list ----------------------------------------- */

.pub-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
}

.pub-search {
  flex: 1 1 280px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 14px;
  font: inherit;
  font-size: 0.94rem;
  color: var(--ink);
  background: #fff;
}
.pub-search:focus { outline: 2px solid var(--accent-lift); outline-offset: -1px; }

.filters { display: flex; flex-wrap: wrap; gap: 6px; }

.filter-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 7px 15px;
  font: inherit;
  font-size: 0.86rem;
  cursor: pointer;
}
.filter-btn:hover { border-color: #c6d5e4; color: var(--ink); }
.filter-btn[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.pub-count { font-size: 0.88rem; color: var(--ink-faint); margin-bottom: 18px; min-height: 1.4em; }

.pub-section + .pub-section { margin-top: 44px; }

.kind-head {
  font-size: 1.3rem;
  padding-bottom: 12px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--accent);
}

.year-group { margin-bottom: 34px; }
.year-group > h3 {
  font-size: 0.86rem;
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}

ol.pub-list { list-style: none; margin: 0; padding: 0; }

.pub {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 0 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-soft);
}
.pub:last-child { border-bottom: 0; }

.pub .idx {
  font-family: var(--serif);
  font-size: 0.88rem;
  color: var(--ink-faint);
  padding-top: 2px;
  font-variant-numeric: tabular-nums;
}

.pub .title {
  font-family: var(--serif);
  font-size: 1.04rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}
.pub .authors { font-size: 0.9rem; color: var(--ink-soft); margin-bottom: 2px; }
.pub .authors .me { color: var(--ink); font-weight: 600; }
.pub .authors .supervised {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

/* Three separate statements on their own lines — what is listed, what the
   formatting means, and how to search. Spans rather than <br> so each line can
   carry its own spacing and still wrap normally when the column is narrow. */
.intro-lines > span { display: block; }
.intro-lines > span + span { margin-top: 6px; }

/* The notation is explained in the page intro, which shows it inline. */
.page-head .supervised {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
.pub .venue { font-size: 0.89rem; color: var(--ink-faint); }
.pub .venue em { color: var(--ink-soft); font-style: italic; }

.empty-state {
  padding: 40px 0;
  text-align: center;
  color: var(--ink-faint);
}

/* ---------- Selected papers ------------------------------------------- */

.paper + .paper {
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}

/* With a figure the entry becomes two columns, alternating sides down the
   page; without one the text simply runs at reading width. */
.paper.has-figure {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 32px;
  align-items: start;
}
.paper.has-figure.flip .paper-figure { order: 2; }

/* --fig-w is the width the picture will draw at, worked out from the file's
   own proportions in figure_width(). Without it a tall figure shrinks to fit
   the height cap while the caption keeps the whole column, leaving the text
   hanging out past both sides of the picture. */
.paper-figure {
  margin: 0;
  text-align: center;
  max-width: min(100%, var(--fig-w, 100%));
  justify-self: center;
}

/* Journal figures come in every shape, including panels stacked two deep.
   Cap the height so a tall one cannot push the row out of proportion; the
   image links through to full size for anyone who wants to read the axes.
   Change 560 here and FIGURE_MAX_HEIGHT in lib/data.php together. */
.paper-figure img {
  width: 100%;
  max-height: 560px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.paper-figure figcaption {
  font-size: 0.84rem;
  color: var(--ink-faint);
  margin-top: 10px;
  line-height: 1.55;
  text-align: left;
}

.paper-body { max-width: 68ch; }

.paper-title {
  font-size: 1.18rem;
  line-height: 1.35;
  margin-bottom: 8px;
}
.paper-title a { color: inherit; }
.paper-title a:hover { color: var(--accent); }

.paper-cite {
  font-size: 0.89rem;
  color: var(--ink-faint);
  margin-bottom: 14px;
  line-height: 1.6;
}
.paper-cite .authors { color: var(--ink-soft); }
.paper-cite .me { color: var(--ink); font-weight: 600; }
.paper-cite .supervised {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
.paper-cite em { font-style: italic; }

.paper-note {
  font-size: 1rem;
  color: var(--ink-soft);
  margin-bottom: 0;
}

@media (max-width: 860px) {
  .paper.has-figure { grid-template-columns: 1fr; gap: 20px; }
  .paper.has-figure.flip .paper-figure { order: 0; }
}

/* ---------- Media list ------------------------------------------------ */

ol.media-list { list-style: none; margin: 0; padding: 0; }

.media-item {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 0 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}
.media-item:last-child { border-bottom: 0; }

.media-date {
  font-family: var(--serif);
  font-size: 0.88rem;
  color: var(--ink-faint);
  padding-top: 2px;
  white-space: nowrap;
}

.media-outlet {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2px;
}
.media-title {
  display: block;
  font-family: var(--serif);
  font-size: 1.02rem;
  color: var(--ink);
  line-height: 1.45;
}
.media-title a { color: inherit; }
.media-title a:hover { color: var(--accent); }

/* Quiet enough not to compete with the headline it explains. */
.media-gone {
  display: block;
  font-size: 0.78rem;
  color: var(--ink-faint);
  margin-top: 3px;
}

@media (max-width: 720px) {
  .media-item { grid-template-columns: 1fr; gap: 4px; }
  .media-date { padding-top: 0; }
}

/* ---------- Member cards --------------------------------------------- */

.member {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
}

.avatar {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 50%;
  background: var(--accent-wash);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1rem;
}
.member.lead .avatar { background: var(--accent); color: #fff; }
.avatar.photo { object-fit: cover; background: var(--bg-soft); }

.pub .title a { color: inherit; }
.pub .title a:hover { color: var(--accent); }

.member .name { font-family: var(--serif); font-size: 1.08rem; font-weight: 600; }
.member .role { font-size: 0.88rem; color: var(--accent); font-weight: 500; }
/* Concurrent posts each get a line, with the department under the title. */
.member .role + .role { margin-top: 4px; }
.member .role-unit {
  display: block;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--ink-faint);
}
.member .note { font-size: 0.87rem; color: var(--ink-soft); margin-top: 6px; }

.subhead {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  margin: 0 0 22px;
}

table.alumni {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}
table.alumni th {
  text-align: left;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
  padding: 0 14px 10px 0;
  border-bottom: 1px solid var(--line);
}
table.alumni td {
  padding: 13px 14px 13px 0;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
  color: var(--ink-soft);
}
table.alumni td:first-child { color: var(--ink); font-weight: 500; white-space: nowrap; }

table.alumni .thesis {
  display: block;
  margin-top: 5px;
  font-size: 0.87rem;
  color: var(--ink-faint);
  line-height: 1.5;
}
table.alumni .thesis em { color: var(--ink-soft); }

/* Each post held, with its own dates — a former member's row is the whole
   record, so nothing is summarised away. */
table.alumni .held {
  display: block;
  margin-top: 4px;
}
table.alumni .held:first-child { margin-top: 0; }
/* Its own line, always. Inline, the dates landed after the department on one
   row and under it on the next, depending on how the name happened to wrap. */
table.alumni .held-when {
  display: block;
  color: var(--ink-faint);
  font-size: 0.86rem;
}

/* The degree is what a reader scans for, so it is lifted out of the list of
   posts rather than set in the same grey as everything else. */
table.alumni .degree {
  display: block;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}
.degree-badge {
  display: inline-block;
  background: var(--accent-wash);
  color: var(--accent);
  border-radius: 5px;
  padding: 1px 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-right: 6px;
}
table.alumni .degree-when {
  color: var(--ink-faint);
  font-size: 0.85rem;
  margin-right: 6px;
}
.degree-thesis { color: var(--ink-soft); }

table.alumni .earlier-role {
  display: block;
  margin-top: 5px;
  font-size: 0.85rem;
  color: var(--ink-faint);
  line-height: 1.5;
}

/* ---------- Member detail --------------------------------------------- */

.member .name a { color: inherit; }
.member .name a:hover { color: var(--accent); }

.member .stint {
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin: 6px 0 0;
  line-height: 1.5;
}
.member .stint .unit { display: block; }
.member .stint .since { color: var(--ink-soft); }

.member .earlier {
  font-size: 0.83rem;
  color: var(--ink-faint);
  margin: 6px 0 0;
  line-height: 1.5;
}

/* A degree finished here. Same treatment as in the alumni table, so the two
   read as the same fact whether the person has left or not. */
.member .thesis {
  font-size: 0.83rem;
  color: var(--ink-faint);
  margin: 6px 0 0;
  line-height: 1.5;
}
.member .thesis em { color: var(--ink-soft); }

.member .more { margin: 10px 0 0; font-size: 0.86rem; }

/* Which of the four lines of work a person is on. Small and quiet — the card's
   job is still the name; each tag jumps to that section of Research. */
.member .lines {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 0;
}
.line-tag {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  white-space: nowrap;
  text-decoration: none;
}
.line-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* ---------- Principal investigator page -------------------------------- */

.pi-head {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 44px;
}
.pi-portrait {
  width: 150px;
  height: 150px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-soft);
}
.pi-contact { flex: 1 1 320px; min-width: 0; font-size: 0.94rem; }
.pi-contact p { margin-bottom: 14px; color: var(--ink-soft); }
.pi-contact-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 3px;
}
.pi-links { display: flex; flex-wrap: wrap; gap: 6px 20px; }

/* Spelt out rather than linked, so give it the even spacing of an address. */
.pi-email { letter-spacing: 0.01em; }

.pi-section + .pi-section { margin-top: 40px; }

ul.pi-list { list-style: none; margin: 0; padding: 0; }
ul.pi-list li {
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr);
  gap: 0 20px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.93rem;
  line-height: 1.6;
}
ul.pi-list li:last-child { border-bottom: 0; }
ul.pi-list .when { color: var(--ink-faint); font-variant-numeric: tabular-nums; }
ul.pi-list .what { color: var(--ink-soft); }

@media (max-width: 720px) {
  ul.pi-list li { grid-template-columns: 1fr; gap: 2px; padding: 9px 0; }
  .pi-portrait { width: 110px; height: 110px; }
}
.table-scroll { overflow-x: auto; }

/* Four columns of prose do not fit a phone, and sideways scrolling hides the
   column that matters most. Below this width each row becomes its own block
   with the column name in front of the value. */
@media (max-width: 640px) {
  .table-scroll { overflow-x: visible; }
  table.alumni, table.alumni tbody, table.alumni tr, table.alumni td { display: block; width: 100%; }
  table.alumni thead { display: none; }
  table.alumni tr {
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
  }
  table.alumni tr:last-child { border-bottom: 0; }
  table.alumni td {
    border: 0;
    padding: 2px 0;
    white-space: normal;
  }
  table.alumni td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-top: 8px;
  }
  table.alumni td:first-child::before { margin-top: 0; }
  table.alumni td:first-child { font-size: 1.02rem; }
}

/* ---------- Album ----------------------------------------------------- */

/* One photo per event, so each card carries its own caption rather than being
   a cover standing in for a folder. */
.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 24px;
}

.event {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  text-decoration: none;
  cursor: zoom-in;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.event:hover {
  text-decoration: none;
  border-color: #c6d5e4;
  box-shadow: 0 8px 24px rgba(18, 69, 111, 0.09);
}
.event:focus-visible { outline: 3px solid var(--accent-lift); outline-offset: 2px; }

.event-shot {
  display: block;
  aspect-ratio: 4 / 3;
  max-width: 100%;
  background: var(--bg-soft);
  overflow: hidden;
}
/* No long-press "save image" sheet on a phone, and no drag ghost on a desktop.
   A deterrent only — see the note in main.js. */
.event-shot img,
.lb-image {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}

.event-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.event:hover .event-shot img { transform: scale(1.03); }

/* Pushed to the bottom so cards in a row line their images up even when one
   caption runs to two lines. */
.event-body {
  display: block;
  padding: 15px 17px 17px;
  margin-top: auto;
}
.event-title {
  display: block;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 3px;
}
.event-date { display: block; font-size: 0.82rem; color: var(--ink-faint); }
.event-caption {
  display: block;
  margin-top: 7px;
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* ---------- Lightbox --------------------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 18, 28, 0.94);
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  justify-items: center;
  padding: 24px;
}

.lb-image {
  grid-column: 2;
  max-width: 100%;
  max-height: 86vh;
  object-fit: contain;
  border-radius: 6px;
}

.lightbox button {
  background: rgba(255, 255, 255, 0.09);
  border: 0;
  color: #fff;
  border-radius: 50%;
  width: 46px;
  height: 46px;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}
.lightbox button:hover { background: rgba(255, 255, 255, 0.2); }

.lb-prev { grid-column: 1; }
.lb-next { grid-column: 3; }
.lb-close {
  position: absolute;
  top: 18px;
  right: 20px;
  font-size: 1.9rem;
}

/* Carries the event name as well as the count, so it has to be able to wrap
   without running under the previous/next buttons. */
.lb-counter {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(680px, calc(100% - 140px));
  text-align: center;
  color: #9fb5c9;
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0;
}

body.lb-open { overflow: hidden; }

@media (max-width: 600px) {
  .lightbox { grid-template-columns: 44px 1fr 44px; padding: 12px; }
  .lightbox button { width: 38px; height: 38px; font-size: 1.3rem; }
  .event-grid { grid-template-columns: 1fr; gap: 16px; }
}

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

.site-footer {
  background: var(--bg-deep);
  color: #9fb5c9;
  padding-block: 48px 36px;
  font-size: 0.9rem;
}
.site-footer h4 {
  color: #fff;
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.site-footer a { color: #bcd4e8; }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }

/* Both marks carry dark lettering, so on the dark footer they sit on white
   plates. Each artwork is circular and inscribed in its square canvas, so a
   50% radius contains all of it without clipping the ring. */
.footer-marks {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

/* Both marks are circular artwork inscribed in a square canvas, so they fill
   the 80px circle edge to edge with no padding — the 50% radius lands exactly
   on the artwork's own outer ring. The white background only shows through the
   transparent corners, which the radius clips away. */
.footer-logo {
  width: 80px;
  height: 80px;
  flex: none;
  border-radius: 50%;
  background: #fff;
  padding: 0;
  object-fit: cover;
}

.footer-tagline {
  color: #7fa8c9;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  margin-top: -8px;
}
.site-footer li { margin-bottom: 7px; }

/* Two blocks: the lab on the left, the page list flush right. */
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 40px 64px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.footer-grid p { margin-bottom: 0.6em; }

.footer-bottom {
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.84rem;
  color: #7d94a9;
}

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

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Seven items no longer fit beside the mark and the two-line wordmark much
   below this: between roughly 940 and 1023px the lab name starts wrapping.
   The menu therefore collapses earlier than the rest of the layout does.
   Re-check this width if a nav item is added or renamed, or the mark resized. */
@media (max-width: 1023px) {
  .nav-toggle { display: block; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 10px 24px 16px;
  }
  .nav.open { display: flex; }
  .site-header { position: sticky; }
  .header-inner { position: relative; }
}

@media (max-width: 720px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .pub { grid-template-columns: 1fr; }
  .pub .idx { display: none; }
  .hero-meta { flex-direction: column; gap: 6px; }
}

@media (max-width: 460px) {
  .wrap { padding-inline: 18px; }
  .brand-mark, .brand-logo { width: 40px; height: 40px; font-size: 0.85rem; }
  .brand-title { font-size: 0.92rem; }
  .brand-sub { font-size: 0.66rem; }
  .card { padding: 20px; }
  .member { padding: 16px; }
}

@media print {
  .site-header, .site-footer, .pub-toolbar, .hero::after { display: none; }
  body { font-size: 11pt; }
}
