/* ==========================================================================
   Dawit Chun, portfolio (v2)
   Paper, ink, and one accent: rescue orange.
   ========================================================================== */

:root {
  --bg: #ffffff;          /* paper */
  --surface: #f4f4f5;     /* a shade darker than paper */
  --card: #ffffff;
  --ink: #15171a;
  --ink-2: #3d4046;
  --muted: #6a6d74;
  --hair: #e4e4e7;
  --hair-2: #cacacf;
  --accent: #d24a12;      /* graphics: bars, dots, rules */
  --accent-ink: #b23c0b;  /* the accent as text, readable on paper */
  --accent-soft: #fbe9dd;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --container: 1240px;
  --gutter: clamp(20px, 4vw, 48px);
  --header-h: 68px;
  --radius: 4px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

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

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

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 600; }
h1, h2, h3, h4 { margin: 0; }
::selection { background: var(--accent-soft); }

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

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  border-radius: var(--radius);
}
.skip-link:focus { top: 16px; }

.text-link {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--hair-2);
  transition: color .2s ease, text-decoration-color .2s ease;
}
.text-link:hover { color: var(--accent-ink); text-decoration-color: currentColor; }

/* Shared type
   ========================================================================== */

.eyebrow,
.kicker {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: .01em;
  color: var(--muted);
}

.display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 5.6vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -.025em;
}
.display em { font-style: italic; }

.h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.8rem, 3.2vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -.018em;
}

.lead {
  max-width: 64ch;
  margin-top: 22px;
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--ink-2);
}

/* Links and buttons
   ========================================================================== */

.pill-link {
  color: var(--ink);
  font-size: .9rem;
  font-weight: 500;
  line-height: 1.5;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: var(--hair-2);
  transition: color .2s ease, text-decoration-color .2s ease;
}
.pill-link:hover { color: var(--accent-ink); text-decoration-color: currentColor; }
.pill-link--accent { color: var(--accent-ink); }

.link-arrow {
  display: inline-block;
  color: var(--ink);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  text-decoration-color: var(--hair-2);
  transition: color .2s ease, text-decoration-color .2s ease;
}
/* inline-block keeps the arrow out of the underline */
.link-arrow::after {
  content: "→";
  display: inline-block;
  margin-left: .4em;
  transition: transform .25s var(--ease);
}
.link-arrow:hover { color: var(--accent-ink); text-decoration-color: currentColor; }
.link-arrow:hover::after { transform: translateX(3px); }
.link-arrow--strong { font-size: 1.02rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 16px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font-size: .92rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn--solid { background: var(--ink); color: var(--bg); }
.btn--solid:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn__ext { font-size: .85em; opacity: .7; }

.project__links,
.pub__links,
.stream__links,
.entry__links,
.page-links {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 20px;
}

.badge {
  color: var(--accent-ink);
  font-size: .86rem;
  font-weight: 600;
}

/* Chips & tags
   ========================================================================== */

.chips,
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tags li {
  padding: 3px 9px;
  border: 1px solid var(--hair-2);
  border-radius: 3px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: .74rem;
  line-height: 1.5;
}

/* Header
   ========================================================================== */

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

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--serif);
  font-size: 1.45rem;
  line-height: 1;
  letter-spacing: -.01em;
  text-decoration: none;
  white-space: nowrap;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2vw, 30px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav__link {
  position: relative;
  display: inline-block;
  padding: 6px 0;
  color: var(--ink-2);
  font-size: .92rem;
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s ease;
}
.nav__link:hover { color: var(--ink); }

.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav__link:hover::after { transform: scaleX(1); background: var(--hair-2); }
.nav__link[aria-current="page"] { color: var(--ink); }
.nav__link[aria-current="page"]::after { transform: scaleX(1); background: var(--accent); }

/* the CV sits apart as a small outlined button */
.nav__link--cv,
.nav__link--btn {
  padding: 6px 12px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  color: var(--ink);
  font-weight: 500;
  transition: background-color .2s ease, color .2s ease;
}
.nav__link--cv::after,
.nav__link--btn::after { display: none; }
.nav__link--cv:hover,
.nav__link--btn:hover { background: var(--ink); color: var(--bg); }

.nav-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

.nav-toggle__bar {
  position: absolute;
  left: 11px;
  right: 11px;
  height: 1.5px;
  background: currentColor;
  transition: transform .3s var(--ease);
}
.nav-toggle__bar:first-child { top: 17px; }
.nav-toggle__bar:last-child { top: 25px; }

.site-header.is-open .nav-toggle__bar:first-child { transform: translateY(4px) rotate(45deg); }
.site-header.is-open .nav-toggle__bar:last-child { transform: translateY(-4px) rotate(-45deg); }

@media (max-width: 1040px) {
  :root { --header-h: 60px; }

  .nav-toggle { display: block; }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    background: var(--bg);
    border-bottom: 1px solid var(--ink);
  }
  .site-header.is-open .nav { display: block; }

  .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-width: var(--container);
    margin-inline: auto;
    padding: 4px var(--gutter) 20px;
  }

  .nav__link {
    display: block;
    padding: 14px 0;
    border-bottom: 1px solid var(--hair);
    font-size: 1.08rem;
  }
  .nav__link::after { display: none; }
  .nav__link[aria-current="page"] { font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); padding-left: 12px; }
  .nav__link--cv,
  .nav__link--btn { margin-top: 16px; padding: 12px 16px; border-bottom: 1px solid var(--ink); text-align: center; }
}

/* Home: hero
   ========================================================================== */

.hero { padding-block: clamp(32px, 4vw, 56px) clamp(32px, 4vw, 52px); }
.hero + .section { padding-top: clamp(24px, 3vw, 44px); }

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4.6fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.hero__title {
  max-width: 12.5em;
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 3.6vw, 3.1rem);
  line-height: 1.1;
  letter-spacing: -.02em;
}
.hero__title em { font-style: normal; }

.hero__lede {
  max-width: 56ch;
  margin: clamp(20px, 2.6vw, 30px) 0 0;
  color: var(--ink);
  font-size: 1.12rem;
  line-height: 1.55;
}

.hero__story {
  max-width: 62ch;
  margin: 12px 0 0;
  color: var(--ink-2);
}
.hero__story strong { white-space: nowrap; }

.hero__status {
  margin: 16px 0 0;
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--accent-ink);
}

.hero__contact {
  margin: 6px 0 0;
  font-family: var(--mono);
  font-size: .85rem;
}
.hero__contact a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--hair-2); text-underline-offset: 3px; }
.hero__contact a:hover { color: var(--accent-ink); text-decoration-color: currentColor; }

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.hero__portrait { margin: 0; }
.hero__portrait img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 40%;
  border-radius: var(--radius);
}

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__portrait { order: -1; max-width: 260px; }
}

@media (max-width: 560px) {
  .hero__actions { gap: 8px; }
  .btn { min-height: 40px; padding: 7px 12px; font-size: .88rem; }
}

/* Sections
   ========================================================================== */

.section { padding-block: clamp(56px, 8vw, 104px); }
.section + .section { padding-top: 0; }

/* a section title sitting on a rule, with an optional link at the far end */
.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: clamp(28px, 4vw, 44px);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ink);
}
.bar__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  line-height: 1.1;
  letter-spacing: -.015em;
}
.bar__link { font-size: .95rem; }

/* Home: featured research and publications, one list with a video or figure beside each
   ========================================================================== */

.bar__links { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 0; }

.works { margin: 0; padding: 0; list-style: none; }
.work {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
  padding: 24px 0;
  border-bottom: 1px solid var(--hair);
}
.work:first-child { padding-top: 0; }

.work__media {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  background: #0f1012;
}
.work__media video,
.work__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .8s var(--ease);
}
.work__media:hover video,
.work__media:hover img { transform: scale(1.03); }
/* a figure on white: a hairline keeps its edge on the paper background */
.work__media--light { background: #fff; }
.work__media--light img { border: 1px solid var(--hair); border-radius: var(--radius); }

.work__label { margin: 0; font-family: var(--mono); font-size: .78rem; color: var(--accent-ink); }
.work__title {
  margin-top: 6px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.2rem, 1.7vw, 1.42rem);
  line-height: 1.22;
  letter-spacing: -.005em;
}
.work__title a { text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .35s var(--ease); }
.work__title a:hover { background-size: 100% 1px; }
.work__authors,
.work__meta { margin: 8px 0 0; color: var(--ink-2); font-size: .95rem; line-height: 1.55; }
.work__authors strong { color: var(--ink); }
.work__note { margin: 2px 0 0; color: var(--muted); font-size: .88rem; }
.work__links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 20px; margin-top: 12px; }

@media (max-width: 760px) {
  .work { grid-template-columns: 1fr; gap: 14px; }
  .work__media { max-width: 520px; }
}

/* Home: selected honors
   ========================================================================== */

.honors {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.honor { padding-top: 0; }
.honor__media { display: block; overflow: hidden; aspect-ratio: 16 / 9; margin-bottom: 14px; border-radius: var(--radius); background: #0f1012; }
.honor__year { display: block; }
.honor__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.honor__media:hover img { transform: scale(1.03); }
.honor__name a { text-decoration: none; }
.honor__name a:hover { color: var(--accent-ink); }
.honor__year { font-family: var(--mono); font-size: .78rem; color: var(--accent-ink); }
.honor__name { margin-top: 6px; font-family: var(--serif); font-weight: 400; font-size: 1.35rem; line-height: 1.2; }
.honor__meta { margin: 8px 0 0; color: var(--ink-2); font-size: .94rem; line-height: 1.5; }

@media (max-width: 800px) {
  .honors { grid-template-columns: 1fr; }
}

/* Home: media coverage
   ========================================================================== */

.media { margin: 0; padding: 0; list-style: none; }
.media__item {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--hair);
}
.media__item:first-child { padding-top: 0; }
.media__item time { padding-top: 3px; font-family: var(--mono); font-size: .8rem; color: var(--muted); white-space: nowrap; }
.media__src { margin: 0 0 2px; font-size: .88rem; font-weight: 600; color: var(--ink); }
.media__kind { margin-left: 8px; font-family: var(--mono); font-size: .72rem; font-weight: 400; color: var(--muted); }
.media__title {
  color: var(--ink-2);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: var(--hair-2);
  transition: color .2s ease, text-decoration-color .2s ease;
}
.media__title:hover { color: var(--accent-ink); text-decoration-color: currentColor; }
.media__note { margin: 4px 0 0; color: var(--muted); font-size: .88rem; }
.media__more { margin: 22px 0 0; font-size: .95rem; }

@media (max-width: 560px) {
  .media__item { grid-template-columns: 1fr; gap: 2px; }
}

/* Home: research vision, in short
   ========================================================================== */

.vision {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}

.vision__intro { position: sticky; top: calc(var(--header-h) + 32px); }

.vision__q {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2rem, 3.6vw, 3rem);
  line-height: 1.06;
  letter-spacing: -.02em;
}
.vision__lead { margin-top: 20px; color: var(--ink-2); }

.theses {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}
.thesis {
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr);
  gap: 0 12px;
  padding: 22px 0;
  border-top: 1px solid var(--hair);
}
.thesis:first-child { padding-top: 0; border-top: 0; }
.thesis__num {
  grid-row: 1 / span 3;
  font-family: var(--serif);
  font-size: 2rem;
  line-height: 1;
  color: var(--accent-ink);
}
.thesis__name { font-family: var(--serif); font-weight: 500; font-size: 1.35rem; line-height: 1.25; }
.thesis p { margin: 8px 0 0; color: var(--ink-2); font-size: .98rem; }
.thesis__link { justify-self: start; margin-top: 10px; font-size: .9rem; }
.thesis__link span { color: var(--muted); font-weight: 400; }

@media (max-width: 900px) {
  .vision { grid-template-columns: 1fr; }
  .vision__intro { position: static; }
}

/* Inner pages
   ========================================================================== */

.page-head {
  padding-block: clamp(48px, 7vw, 96px) clamp(36px, 5vw, 60px);
}
.page-head .kicker { margin-bottom: 18px; }
.page-links { margin-top: 20px; }

.jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--hair);
}
.jump a {
  color: var(--ink-2);
  font-size: .93rem;
  text-decoration: none;
  transition: color .2s ease;
}
.jump a::before {
  content: "↓";
  margin-right: 6px;
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--accent-ink);
}
.jump a:hover { color: var(--accent-ink); }

.group { padding-block: clamp(44px, 6vw, 80px); }

/* a section head sits on an ink rule inside the column, like the bars on the home page */
.group__head {
  margin-bottom: clamp(28px, 4vw, 44px);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ink);
}
.group__head .lead { margin-top: 12px; font-size: 1.04rem; }
.group__head + .pubs,
.group__head + .ts-list { border-top: 0; }
.group__head + .pubs > .pub:first-child { padding-top: 0; }

.group--tight { padding-block: clamp(32px, 4.5vw, 56px); }
.group--tight .group__head { margin-bottom: 22px; }
.group--tight .h2 { font-size: clamp(1.55rem, 2.6vw, 2.05rem); }
.group--tight:last-of-type { padding-bottom: clamp(64px, 9vw, 112px); }

/* Research: experience entries */

.entry { padding-block: 0 clamp(36px, 5vw, 56px); }
.entry + .entry { padding-top: clamp(36px, 5vw, 56px); border-top: 1px solid var(--hair); }

.entry__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 24px;
}

.entry__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 2.4vw, 1.95rem);
  line-height: 1.1;
  letter-spacing: -.015em;
}

.entry__role {
  width: 100%;
  margin: 0;
  color: var(--ink-2);
  order: 3;
}

.entry__date {
  margin: 0;
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--muted);
  white-space: nowrap;
}

.entry__summary {
  max-width: 68ch;
  margin-top: 18px;
  color: var(--ink-2);
}

.entry__links { margin-top: 16px; }
.entry .tags { margin-top: 28px; }
.entry__more { margin-top: 24px; }

.bullets {
  margin: 0;
  padding-left: 1.1em;
  color: var(--ink-2);
}
.bullets li + li { margin-top: 10px; }
.bullets li::marker { color: var(--accent); }
.bullets + .after-list { margin-top: 22px; }

.stream {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
  padding: 32px 0;
  border-top: 1px solid var(--hair);
}
.stream--cont { padding-top: 0; border-top: 0; }

.thread__title {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.3;
}

.thread__num {
  flex: none;
  padding-top: .35em;
  font-family: var(--mono);
  font-size: .7em;
  font-weight: 400;
  color: var(--accent-ink);
}

.stream__text p { color: var(--ink-2); font-size: .98rem; }
.stream__links { margin-top: 16px; }

@media (max-width: 900px) {
  .stream { grid-template-columns: 1fr; }
}

.oss__list {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--hair);
}

.oss__row {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) auto;
  gap: 8px 24px;
  align-items: baseline;
  padding: 14px 4px;
  border-bottom: 1px solid var(--hair);
  text-decoration: none;
  transition: background-color .2s ease;
}
.oss__row:hover { background: var(--surface); }

.oss__repo {
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--ink);
}

.oss__desc { color: var(--ink-2); font-size: .95rem; line-height: 1.6; }
.oss__desc code { font-family: var(--mono); font-size: .85em; }

.oss__state { font-family: var(--mono); color: var(--muted); font-size: .78rem; }
.oss__state--merged { color: var(--accent-ink); font-weight: 500; }

@media (max-width: 700px) {
  .oss__row { grid-template-columns: minmax(0, 1fr) auto; }
  .oss__desc { grid-column: 1 / -1; grid-row: 2; }
}

/* Research: a project inside its window */

.project {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(32px, 5vw, 72px);
}

.project__meta {
  position: sticky;
  top: calc(var(--header-h) + 32px);
  align-self: start;
}

.project__kicker { margin: 0 0 12px; font-family: var(--mono); font-size: .78rem; line-height: 1.5; color: var(--muted); }

.project__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  line-height: 1.08;
  letter-spacing: -.015em;
}

.project__tagline {
  margin: 12px 0 0;
  font-size: 1.05rem;
  color: var(--ink-2);
}

.project__venue {
  margin: 18px 0 0;
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--muted);
}

.project__badges:not(:empty) { margin-top: 8px; }
.project__links { margin-top: 16px; }

.project__note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.5;
}

.project__h {
  margin: 34px 0 10px;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--ink);
}

.project__body > p,
.project__body > .bullets { color: var(--ink-2); }

.project__role {
  margin-top: 32px;
  padding: 18px 22px;
  border-left: 2px solid var(--accent);
  background: var(--surface);
  color: var(--ink-2);
  font-size: .98rem;
}

.project__role span {
  display: block;
  margin-bottom: 4px;
  font-family: var(--mono);
  font-size: .76rem;
  color: var(--accent-ink);
}

.project__body > .fig,
.project__body > .video-figure { margin: 28px 0 24px; }
.project__body > .fig:first-child,
.project__body > .video-figure:first-child { margin-top: 0; }

@media (max-width: 900px) {
  .project { grid-template-columns: 1fr; }
  .project__meta { position: static; }
}

/* Photos, figures, video
   ========================================================================== */

.photo {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.fig { margin: 0; }

.fig img,
.fig video {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  background: #fff;
}

.fig a { display: block; cursor: zoom-in; }

.fig figcaption {
  grid-column: 1 / -1;
  margin-top: 10px;
  color: var(--muted);
  font-size: .85rem;
  line-height: 1.5;
}

/* Two images side by side at equal height: columns sized by aspect ratio */
.fig-pair {
  display: grid;
  grid-template-columns: var(--cols, 1.806fr .75fr);
  gap: 12px;
  align-items: start;
}

@media (max-width: 560px) {
  .fig-pair { grid-template-columns: 1fr; }
}

/* Smaller figure, centered in the column; caption stays centered under it */
.fig--center {
  max-width: var(--maxw, 520px);
  margin-inline: auto !important;
}
.fig--center figcaption { text-align: center; }
.fig--pixel img { image-rendering: pixelated; background: #000; }

.video-figure { margin: 0; }
.video-figure figcaption { margin-top: 10px; color: var(--muted); font-size: .85rem; }

.video {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: #000;
}

.video__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .82;
  transition: opacity .3s ease;
}
.video:hover .video__thumb { opacity: 1; }

.video__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video__play::before {
  content: "";
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .95);
  transition: transform .3s var(--ease), background-color .3s ease;
}
.video:hover .video__play::before { transform: scale(1.06); background: #fff; }

.video__play::after {
  content: "";
  position: absolute;
  margin-left: 5px;
  border-style: solid;
  border-width: 10px 0 10px 17px;
  border-color: transparent transparent transparent var(--accent);
}

.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Two portrait videos side by side */
.video-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.video-pair video {
  width: 100%;
  height: auto;
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  background: #111;
}

/* Research cards (each opens a window)
   ========================================================================== */

.rcards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(28px, 3vw, 40px) clamp(20px, 3vw, 36px);
  margin-top: 30px;
}

.rcard {
  display: flex;
  flex-direction: column;
  text-decoration: none;
}

.rcard__media {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--hair);
}
.rcard__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s var(--ease);
}
.rcard:hover .rcard__media img { transform: scale(1.03); }

.rcard__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding-top: 16px;
}

.rcard__kicker {
  font-family: var(--mono);
  font-size: .76rem;
  line-height: 1.5;
  color: var(--muted);
}

.rcard__title {
  margin-top: 6px;
  font-family: var(--serif);
  font-size: clamp(1.3rem, 1.9vw, 1.55rem);
  line-height: 1.18;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  text-decoration-color: transparent;
  transition: text-decoration-color .25s ease;
}
.rcard:hover .rcard__title { text-decoration-color: var(--accent); }

.rcard__desc {
  margin-top: 8px;
  color: var(--ink-2);
  font-size: .95rem;
  line-height: 1.6;
  text-wrap: pretty;
}

.rcard__meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: .85rem;
  line-height: 1.5;
}
.rcard__meta .badge { display: block; margin: 4px 0 0; }

.rcard__more {
  align-self: flex-start;
  margin-top: auto;
  padding-top: 12px;
  color: var(--ink);
  font-size: .88rem;
  font-weight: 500;
}
.rcard__more::after {
  content: "→";
  display: inline-block;
  margin-left: .4em;
  transition: transform .25s var(--ease);
}
.rcard:hover .rcard__more { color: var(--accent-ink); }
.rcard:hover .rcard__more::after { transform: translateX(3px); }

/* a card that spans the row, image beside the text */
.rcard--wide {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(20px, 3vw, 40px);
  align-items: center;
}
.rcard--wide .rcard__media { aspect-ratio: 16 / 8; background: #fff; }
.rcard--wide .rcard__media img { object-fit: contain; padding: 14px; }
.rcard--wide .rcard__body { padding-top: 0; }
.rcard--wide .rcard__title { font-size: clamp(1.6rem, 2.4vw, 2rem); }

/* a card with links of its own (ROBOTIS's threads): "Read more" covers the card, the links sit above it */
.rcard--links { position: relative; }
.rcard--links .rcard__more { text-decoration: none; }
.rcard--links .rcard__more::before { content: ""; position: absolute; inset: 0; }
.rcard__links { display: flex; flex-wrap: wrap; gap: 2px 16px; margin-top: 10px; }
.rcard__links a {
  position: relative;
  z-index: 1;
  color: var(--ink-2);
  font-size: .85rem;
  font-weight: 500;
  line-height: 1.6;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--hair-2);
  transition: color .2s ease, text-decoration-color .2s ease;
}
.rcard__links a:hover { color: var(--accent-ink); text-decoration-color: currentColor; }

/* diagrams and renders on white, shown whole */
.rcard__media--light { background: #fff; }
.rcard__media--light img { object-fit: contain; padding: 10px; }

/* the two featured papers under ROBOTIS, and the rest of the work three to a row */
.rcards--pair { margin-top: clamp(40px, 5vw, 56px); padding-top: clamp(32px, 4vw, 44px); border-top: 1px solid var(--hair); }
.rcards--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rcards--three .rcard__title { font-size: clamp(1.2rem, 1.6vw, 1.35rem); }
.rcards--three .rcard__desc { font-size: .92rem; }

@media (max-width: 1000px) {
  .rcards--three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .rcards,
  .rcards--three { grid-template-columns: 1fr; }
  .rcard--wide { grid-template-columns: 1fr; }
  .rcard--wide .rcard__body { padding-top: 16px; }
}

/* Research: every project gets the same row, grouped by area
   ========================================================================== */

.areas { padding-bottom: clamp(64px, 9vw, 112px); }
.area {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 16px 32px;
  padding: 40px 0;
  border-top: 1px solid var(--hair);
}
.area:first-child { border-top: 1px solid var(--ink); }
.area__label {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  align-self: start;
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.3rem, 2vw, 1.6rem);
  line-height: 1.15;
  letter-spacing: -.01em;
}
.area__rows { display: grid; gap: 44px; }

.proj {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(20px, 3vw, 32px);
  align-items: start;
}
.proj__media {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  background: #0f1012;
}
.proj__media img,
.proj__media video { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
a.proj__media:hover img,
a.proj__media:hover video { transform: scale(1.03); }
.proj__media--light { background: #fff; box-shadow: inset 0 0 0 1px var(--hair); }
.proj__media--light img,
.proj__media--light video { object-fit: contain; }
.proj__kicker { margin: 0; font-family: var(--mono); font-size: .78rem; color: var(--accent-ink); }
.proj__title {
  margin-top: 6px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.4rem, 2.2vw, 1.8rem);
  line-height: 1.12;
  letter-spacing: -.01em;
}
.proj__title a { text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .35s var(--ease); }
.proj__title a:hover { background-size: 100% 1px; }
.proj__role { margin: 6px 0 0; color: var(--muted); font-size: .92rem; line-height: 1.5; }
.proj__role .badge { display: inline-block; margin-left: 10px; }
.proj__desc { margin: 12px 0 0; color: var(--ink-2); font-size: .98rem; line-height: 1.65; }
.proj__links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; margin-top: 14px; }

@media (max-width: 960px) {
  .area { grid-template-columns: 1fr; }
  .area__label { position: static; }
}
@media (max-width: 760px) {
  .proj { grid-template-columns: 1fr; gap: 14px; }
  .proj__role .badge { display: block; margin: 4px 0 0; }
}


/* the pop-up window
   ========================================================================== */

html.modal-open { overflow: hidden; }

.modal {
  width: min(940px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 48px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(21, 23, 26, .28);
}

.modal::backdrop {
  background: rgba(21, 23, 26, .6);
}

.modal__inner {
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(28px, 4vw, 52px) clamp(22px, 4vw, 56px) clamp(32px, 4vw, 56px);
}

.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--hair-2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .94);
  color: var(--ink);
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.modal__close svg { width: 18px; height: 18px; }
.modal__close:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.modal__kicker {
  margin: 0 0 14px;
  padding-right: 48px;
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--muted);
}

/* inside a window, everything reads top to bottom in one column */
.modal .reveal { opacity: 1 !important; transform: none !important; }
.modal .stream,
.modal .stream--cont {
  grid-template-columns: 1fr;
  gap: 22px;
  padding: 0;
  border: 0;
}
.modal .stream + .stream { margin-top: 30px; }
.modal .stream__text > .thread__title { padding-right: 40px; }
.modal .stream__text > .fig,
.modal .stream__text > .video-figure { margin: 26px 0 28px; }
.modal .stream__text > .fig:last-child { margin-bottom: 0; }
.modal .thread__title { font-size: clamp(1.5rem, 2.4vw, 1.9rem); line-height: 1.15; letter-spacing: -.01em; }
.modal .thread__num { font-size: .78rem; padding-top: .7em; }
.modal .project {
  grid-template-columns: 1fr;
  gap: 26px;
}
.modal .project__meta { position: static; padding-right: 48px; }
.modal .oss { padding: 0; border: 0; }

@media (prefers-reduced-motion: no-preference) {
  .modal[open] { animation: modal-in .3s var(--ease); }
  .modal[open]::backdrop { animation: backdrop-in .3s ease; }
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 600px) {
  .modal { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
  .modal__inner { max-height: calc(100dvh - 16px); }
}
.modal:focus,
.modal:focus-visible { outline: none; }
/* a list in a window, narrower than a project */
@media (min-width: 601px) {
  .modal--list { width: min(760px, calc(100vw - 32px)); }
}

/* Publications (and the lists on Honors)
   ========================================================================== */

.pubs {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--ink);
}

.pub {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 32px;
  padding: 26px 0;
  border-bottom: 1px solid var(--hair);
}

.pub__venue {
  padding-top: 4px;
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--accent-ink);
}

.pub__title {
  margin-bottom: 6px;
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.45;
}
.pub__title a { text-decoration: none; }
.pub__title a:hover { color: var(--accent-ink); }

.pub__authors,
.pub__meta {
  margin: 0;
  color: var(--ink-2);
  font-size: .95rem;
  line-height: 1.6;
}
.pub__authors strong { color: var(--ink); }

.pub__note { margin: 2px 0 0; color: var(--muted); font-size: .86rem; }
.pub__links { margin-top: 12px; }
.pub__links .badge { margin-right: 4px; }

.pub__bookslist { display: grid; gap: 22px; }
.pub__alt { color: var(--muted); font-weight: 400; }

.bar + .pubs { border-top: 0; }
.bar + .pubs > .pub:first-child { padding-top: 0; }

@media (max-width: 640px) {
  .pub { grid-template-columns: 1fr; gap: 8px; }
}

/* Honors: certificates and photos under an entry */
.pub__photo { margin: 16px 0 0; }
.pub__imgs { display: flex; flex-wrap: wrap; gap: 10px; }
.pub__imgs a { display: block; flex: none; cursor: zoom-in; }
.pub__imgs-break { flex-basis: 100%; height: 0; }
.pub__imgs img,
.pub__imgs video {
  display: block;
  width: auto;
  height: calc(var(--h, 215px) * var(--k, 1));
  border: 1px solid var(--hair);
  border-radius: var(--radius);
}
.pub__imgs video { background: #000; }
.pub__text { margin: 10px 0 0; max-width: 760px; color: var(--ink-2); font-size: .95rem; line-height: 1.65; }
.pub__video { max-width: 520px; margin: 16px 0 0; }
.pub__photo figcaption { margin-top: 8px; color: var(--muted); font-size: .82rem; line-height: 1.45; }
@media (max-width: 640px) {
  .pub__imgs { --k: .72; }
}

/* Honors: every award as an equal card on a shelf for its year
   ========================================================================== */

.shelf {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 12px 28px;
  padding: 32px 0;
  border-top: 1px solid var(--hair);
}
.group__head + .shelf { padding-top: 0; border-top: 0; }
.shelf__year {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  align-self: start;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.2rem, 3.6vw, 3rem);
  line-height: .9;
  letter-spacing: -.02em;
}
.shelf--plain .shelf__grid { grid-column: 2; }
.shelf__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.shelf__also { grid-column: 2; margin: 6px 0 0; color: var(--ink-2); font-size: .95rem; }
.shelf__also span { margin-right: 12px; font-family: var(--mono); font-size: .76rem; color: var(--muted); }

.acard { display: flex; flex-direction: column; height: 100%; text-decoration: none; }
.acard__frame {
  display: block;
  overflow: hidden;
  aspect-ratio: 1;
  border-radius: var(--radius);
  background: #0f1012;
}
.acard__frame img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
/* a certificate sits whole on a white mat, like a framed document */
.acard__frame--doc { background: #fff; box-shadow: inset 0 0 0 1px var(--hair); }
.acard__frame--doc img { object-fit: contain; padding: 14px; }
.acard:hover .acard__frame img { transform: scale(1.03); }
.acard__result {
  margin-top: 16px;
  font-family: var(--serif);
  font-size: clamp(1.55rem, 2.2vw, 1.9rem);
  line-height: 1.05;
  letter-spacing: -.015em;
  color: var(--accent-ink);
}
.acard__name { margin-top: 8px; color: var(--ink); font-size: .98rem; font-weight: 600; line-height: 1.35; }
.acard__detail { margin-top: 4px; color: var(--muted); font-size: .88rem; line-height: 1.45; }
.acard:hover .acard__name { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }

@media (max-width: 1100px) {
  .shelf__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .shelf { grid-template-columns: 1fr; }
  .shelf__year { position: static; }
  .shelf--plain .shelf__grid,
  .shelf__also { grid-column: 1; }
  .shelf__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 14px; }
}

/* an award's window: what it was, then every certificate and photo at a readable size */
.award__title {
  margin: 0;
  padding-right: 48px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  line-height: 1.1;
  letter-spacing: -.015em;
}
.award__meta { margin: 10px 0 0; color: var(--ink-2); }
.award__note { max-width: 70ch; margin: 12px 0 0; color: var(--ink-2); }
.award__links { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 20px; }
/* photos share a row at one height, each sized by its own shape; one alone never grows past 520px tall */
.gallery { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; margin-top: 24px; }
.gallery a { display: block; flex: var(--r, 1) 1 calc(var(--r, 1) * 240px); max-width: calc(var(--r, 1) * 520px); cursor: zoom-in; }
.gallery img { width: 100%; height: auto; border: 1px solid var(--hair); border-radius: var(--radius); background: #fff; }

/* Teaching & Service: one card per activity
   ========================================================================== */

.tcards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tcards > .is-wide { grid-column: span 2; }
.tcard { display: flex; flex-direction: column; height: 100%; text-decoration: none; }
.tcard__visual {
  position: relative;
  display: block;
  overflow: hidden;
  height: clamp(190px, 17vw, 244px);
  border-radius: var(--radius);
  background: #0f1012;
}
.tcard__visual img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.tcard:hover .tcard__visual img { transform: scale(1.03); }
/* the two courses as type, for a role with no photos */
.tcard__visual--type { display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; padding: 22px 24px; background: var(--ink); }
.tcard__visual--type span { font-family: var(--mono); font-size: clamp(2rem, 3.4vw, 2.8rem); line-height: 1.05; letter-spacing: -.02em; color: var(--bg); }
.tcard__visual--type span + span { color: #efa77f; }
/* U9 Change: its three certificates, with a plain caption */
.tcard__visual--certs { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px clamp(14px, 3vw, 24px); background: var(--surface); }
.tcard__certs { display: flex; gap: 10px; }
.tcard__certs img { width: auto; height: clamp(104px, 11vw, 168px); border: 1px solid var(--hair); border-radius: 2px; background: #fff; }
.tcard__caption { color: var(--muted); font-size: .8rem; line-height: 1.4; text-align: center; }
.tcard__visual--video::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .95) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6.5v11l9-5.5z' fill='%23d24a12'/%3E%3C/svg%3E") center / 26px no-repeat;
}
.tcard__when { margin-top: 16px; font-family: var(--mono); font-size: .76rem; color: var(--muted); }
.tcard__facts { display: flex; flex-wrap: wrap; gap: 2px 22px; margin-top: 6px; }
.tcard__facts span { font-family: var(--serif); font-size: clamp(1.5rem, 2.2vw, 1.85rem); line-height: 1.05; letter-spacing: -.015em; color: var(--accent-ink); }
.tcard__title { margin-top: 8px; color: var(--ink); font-size: 1.02rem; font-weight: 600; line-height: 1.35; }
.tcard:hover .tcard__title { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.tcard__award { margin-top: 4px; color: var(--accent-ink); font-size: .88rem; font-weight: 600; }
.tcard__line { margin-top: 6px; color: var(--ink-2); font-size: .93rem; line-height: 1.55; }
.tcards__also { margin: clamp(32px, 4vw, 44px) 0 0; padding-top: 18px; border-top: 1px solid var(--hair); color: var(--ink-2); font-size: .95rem; }
.tcards__also span { margin-right: 12px; font-family: var(--mono); font-size: .76rem; color: var(--muted); }

@media (max-width: 1000px) {
  .tcards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .tcards { grid-template-columns: 1fr; }
  .tcards > .is-wide { grid-column: auto; }
}

/* a story's window: the old page's layout, read top to bottom */
.modal--story .ts-title { padding-right: 48px; font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1.1; letter-spacing: -.015em; }
.modal--story .ts-story__head { margin-bottom: 24px; }
.modal--story .ts-years { margin-bottom: 0; }

/* Teaching & Service: text beside photos, one story block, an hours bar
   ========================================================================== */

.ts-list { border-top: 1px solid var(--ink); }
.ts-item { padding: clamp(28px, 4vw, 44px) 0; border-bottom: 1px solid var(--hair); }
.ts-when { margin: 0 0 6px; font-family: var(--mono); font-size: .78rem; color: var(--muted); }
.ts-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.3vw, 1.75rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -.01em;
}
.ts-where { margin: 8px 0 0; color: var(--ink-2); font-size: .95rem; line-height: 1.55; }
.ts-text { margin: 14px 0 0; color: var(--ink-2); font-size: .98rem; line-height: 1.7; }
.ts-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 18px; }

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

/* one large photo with two beside it */
.ts-mosaic {
  display: grid;
  grid-template-columns: var(--cols, 2fr 1fr);
  gap: 10px;
  margin: 0;
}
.ts-mosaic a { display: block; aspect-ratio: 4 / 3; cursor: zoom-in; }
.ts-mosaic a:first-child { grid-row: span 2; aspect-ratio: auto; }
.ts-mosaic img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 1px solid var(--hair);
  border-radius: var(--radius);
}

/* Cambodia */
.ts-story { padding: clamp(36px, 5vw, 56px) 0; border-bottom: 1px solid var(--hair); }
.ts-story__head { max-width: 780px; margin-bottom: clamp(24px, 3vw, 32px); }
.ts-story .ts-mosaic { --cols: 8fr 3fr; }
.ts-years {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 4vw, 56px);
  margin: clamp(28px, 4vw, 44px) 0;
}
.ts-year { padding-top: 18px; border-top: 1px solid var(--ink); }
.ts-year__num { margin: 0 0 4px; font-family: var(--serif); font-size: 2rem; line-height: 1; color: var(--accent-ink); }
.ts-year h4 { margin: 10px 0 0; font-size: 1.02rem; font-weight: 600; }
.ts-year .ts-text { margin-top: 10px; }
.ts-years--courses { margin: 24px 0 0; }
/* photos under each year: equal tiles, tall items fill two rows */
.ts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-flow: dense;
  gap: 10px;
  margin: 18px 0 0;
}
.ts-grid > * { display: block; aspect-ratio: 3 / 2; min-height: 0; }
.ts-grid > .is-tall { grid-row: span 2; aspect-ratio: auto; }
.ts-grid a { cursor: zoom-in; }
.ts-grid img,
.ts-grid video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  background: #000;
}
.ts-grid .is-doc img { object-fit: contain; background: #fff; }
.ts-bullets { margin-top: 12px; font-size: .96rem; line-height: 1.65; }

/* U9 Change: five years of connecting sponsors and children, in numbers */
.ts-stats { display: flex; flex-wrap: wrap; gap: 14px 44px; margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--hair); }
.ts-stats div { display: flex; flex: 1 1 0; flex-direction: column; min-width: 150px; }
.ts-stats dt { font-family: var(--serif); font-size: clamp(2rem, 3.4vw, 2.6rem); line-height: 1; color: var(--accent-ink); }
.ts-stats dd { margin: 6px 0 0; color: var(--ink-2); font-size: .88rem; }
.ts-pair--more { margin-top: 10px; }

/* an award under a volunteer role, and the smart farm set apart with its video */
.ts-award { margin: 6px 0 0; font-size: .9rem; font-weight: 600; color: var(--accent-ink); }
.ts-farm {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
  margin-top: clamp(24px, 3vw, 32px);
  padding: clamp(20px, 3vw, 28px);
  border-left: 2px solid var(--accent);
  background: var(--surface);
}
.ts-farm__title { margin: 0; font-family: var(--serif); font-size: clamp(1.3rem, 2vw, 1.55rem); font-weight: 400; line-height: 1.2; }
.ts-farm .ts-text { margin-top: 10px; }
.ts-farm__video { margin: 0; }
@media (max-width: 860px) {
  .ts-farm { grid-template-columns: 1fr; }
}
.ts-item .pub__imgs { margin: 0; }
.ts-below { margin-top: 20px; }
.ts-year .pub__photo { margin-top: 16px; }
.ts-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
}
.ts-pair a { display: block; cursor: zoom-in; }
.ts-pair img { display: block; width: 100%; aspect-ratio: 3 / 2; height: auto; object-fit: cover; object-position: var(--pos, 50% 50%); border: 1px solid var(--hair); border-radius: var(--radius); }
.ts-item .pub__video { max-width: none; margin-top: 10px; }

/* beside text, a photo mosaic runs the full height of the text */
.ts-split--fill { align-items: stretch; }
.ts-split--fill > div:last-child { display: flex; }
.ts-split--fill .ts-mosaic { flex: 1; grid-template-rows: 1fr 1fr; min-height: 320px; }
.ts-split--fill .ts-mosaic a { aspect-ratio: auto; min-height: 0; }
.ts-split--fill .ts-mosaic img { object-position: var(--pos, 50% 50%); }

@media (max-width: 860px) {
  .ts-split, .ts-years { grid-template-columns: 1fr; }
  .ts-split--fill .ts-mosaic { min-height: 0; grid-template-rows: none; }
  .ts-split--fill .ts-mosaic a { aspect-ratio: 4 / 3; }
  .ts-split--fill .ts-mosaic a:first-child { aspect-ratio: auto; }
}

/* Research vision page: an essay
   ========================================================================== */

.argument {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
}
.argument + .argument { margin-top: clamp(56px, 8vw, 104px); }

.argument__label {
  margin-bottom: 14px;
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.2vw, 1.8rem);
  line-height: 1.2;
  letter-spacing: -.01em;
  color: var(--ink);
}
.argument p { color: var(--ink-2); }

@media (max-width: 860px) {
  .argument { grid-template-columns: 1fr; }
}

.pull-quote {
  margin: 1.2em 0 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--accent);
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  line-height: 1.4;
  color: var(--ink);
}
.pull-quote strong { font-weight: 500; color: var(--accent-ink); }

/* columns sized by each image's aspect ratio (402/616 and 894/490) so both share one height */
.figure-pair {
  display: grid;
  grid-template-columns: .653fr 1.824fr;
  gap: 12px;
  align-items: start;
}

.ideas { margin-top: clamp(64px, 8vw, 112px); }

.ideas__intro {
  max-width: 64ch;
  margin-bottom: 28px;
}

.ideas__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1.12;
  letter-spacing: -.015em;
}

.ideas__lead {
  margin: 14px 0 0;
  color: var(--ink-2);
  font-size: 1.06rem;
}

/* each idea is a row: its number and name in the margin, the argument beside */
.ideas__list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--ink);
}

.idea {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 8px clamp(28px, 4vw, 64px);
  padding: 28px 0;
  border-bottom: 1px solid var(--hair);
}

.js .idea.reveal:nth-child(2) { transition-delay: .08s; }
.js .idea.reveal:nth-child(3) { transition-delay: .16s; }

.idea__num {
  display: block;
  font-family: var(--serif);
  font-size: 2.4rem;
  line-height: 1;
  color: var(--accent-ink);
}

.idea__name {
  margin: 10px 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 2.2vw, 1.8rem);
  line-height: 1.15;
}

.idea p { margin: 0; color: var(--ink-2); font-size: 1.02rem; }

@media (max-width: 760px) {
  .idea { grid-template-columns: 1fr; }
}

.ideas__intro.phd { margin: clamp(40px, 5vw, 56px) 0 0; }

.closing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  margin-top: clamp(56px, 7vw, 96px);
  padding-top: clamp(28px, 4vw, 40px);
  border-top: 3px solid var(--ink);
}

.closing__text {
  max-width: 46ch;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  line-height: 1.25;
  letter-spacing: -.01em;
}
.closing__text strong { font-weight: 500; font-style: italic; color: var(--accent-ink); }

/* How the work connects: a tree
   ========================================================================== */

.tree { margin-top: clamp(48px, 6vw, 72px); }

.tree__root {
  position: relative;
  width: fit-content;
  margin: 0 auto;
  padding: 10px 22px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--bg);
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.4;
  text-align: center;
}

.tree__root::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  height: 32px;
  border-left: 1px solid var(--ink);
}

.tree__branches {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.tree__branch {
  position: relative;
  padding: 32px 8px 0;
  text-align: center;
}

/* each branch draws half of the crossbar on either side, plus its drop line */
.tree__branch::before,
.tree__branch::after {
  content: "";
  position: absolute;
  top: 0;
  width: 50%;
  height: 32px;
  border-top: 1px solid var(--ink);
}
.tree__branch::before { left: 0; }
.tree__branch::after { right: 0; border-left: 1px solid var(--ink); }
.tree__branch:first-child::before { border-top-color: transparent; }
.tree__branch:last-child::after { border-top-color: transparent; }

.tree__label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 176px);
  min-height: 3.6em;
  margin: 0 auto;
  padding: 6px 12px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--card);
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.3;
}

.tree__branch--main .tree__label {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
}

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

.tree__leaves li {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center; /* a label wider than its column stays centered */
  padding-top: 24px;
}

.tree__leaves li::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 50%;
  height: 14px;
  border-left: 1px solid var(--hair-2);
}

.tree__leaves a {
  display: inline-block;
  text-decoration: none;
}

.tree__name {
  display: block;
  color: var(--ink);
  font-size: .9rem;
  white-space: nowrap;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: var(--hair-2);
  transition: color .2s ease, text-decoration-color .2s ease;
}
.tree__leaves a:hover .tree__name { color: var(--accent-ink); text-decoration-color: currentColor; }

.tree__meta {
  display: block;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--muted);
  line-height: 1.4;
}

/* Narrow screens: the same tree, drawn top to bottom with a left rail */
@media (max-width: 960px) {
  .tree__root { margin: 0; }
  .tree__root::after { display: none; }

  .tree__branches {
    grid-template-columns: 1fr;
    margin: 0 0 0 22px;
  }

  .tree__branch {
    padding: 18px 0 0 28px;
    text-align: left;
  }

  .tree__label {
    display: inline-block;
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 6px 14px;
  }

  .tree__name { white-space: normal; }

  .tree__branch::before {
    left: 0;
    width: 20px;
    height: 36px;
    border-top: 0;
    border-left: 1px solid var(--ink);
    border-bottom: 1px solid var(--ink);
  }

  .tree__branch::after {
    left: 0;
    right: auto;
    bottom: 0;
    width: 0;
    height: auto;
    border-top: 0;
  }
  .tree__branch:last-child::after { display: none; }

  .tree__leaves {
    margin: 2px 0 0 14px;
    border-left: 1px solid var(--hair-2);
  }

  .tree__leaves li { align-items: flex-start; padding: 12px 0 0 18px; }

  .tree__leaves li::before {
    top: 23px;
    left: 0;
    width: 12px;
    height: 0;
    border-left: 0;
    border-top: 1px solid var(--hair-2);
  }
}

/* the full research vision, read in a window on the home page */
.essay__title {
  max-width: 18ch;
  margin: 0;
  padding-right: 48px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -.02em;
}
.essay__lead { margin: 18px 0 clamp(36px, 5vw, 56px); color: var(--ink-2); font-size: 1.08rem; }
.modal .argument + .argument { margin-top: clamp(40px, 6vw, 64px); }
.modal .ideas { margin-top: clamp(48px, 6vw, 72px); }
.modal .closing { margin-top: clamp(40px, 6vw, 64px); }

/* the tree drawn top to bottom with a left rail, for narrow spaces like a window */
.tree--rail .tree__root { margin: 0; }
.tree--rail .tree__root::after { display: none; }
.tree--rail .tree__branches { grid-template-columns: 1fr; margin: 0 0 0 22px; }
.tree--rail .tree__branch { padding: 18px 0 0 28px; text-align: left; }
.tree--rail .tree__label { display: inline-block; width: auto; min-height: 0; margin: 0; padding: 6px 14px; }
.tree--rail .tree__name { white-space: normal; }
.tree--rail .tree__branch::before { left: 0; width: 20px; height: 36px; border-top: 0; border-left: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.tree--rail .tree__branch::after { left: 0; right: auto; bottom: 0; width: 0; height: auto; border-top: 0; }
.tree--rail .tree__branch:last-child::after { display: none; }
.tree--rail .tree__leaves { margin: 2px 0 0 14px; border-left: 1px solid var(--hair-2); }
.tree--rail .tree__leaves li { align-items: flex-start; padding: 12px 0 0 18px; }
.tree--rail .tree__leaves li::before { top: 23px; left: 0; width: 12px; height: 0; border-left: 0; border-top: 1px solid var(--hair-2); }

/* Journey: what Taejae is, then the rotation as a route you can step along
   ========================================================================== */

.jr-standfirst {
  max-width: 920px;
  margin: 28px 0 0;
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.1vw, 1.6rem);
  line-height: 1.5;
  color: var(--ink);
}
.jr-standfirst em { color: var(--accent-ink); }
.jr-standfirst a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 5px; }
.jr-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: clamp(28px, 5vw, 72px);
  align-items: stretch;
}
.jr-headtext .display { margin-bottom: 28px; }
.jr-head .jr-standfirst { margin: 0; }
/* the class poster runs from the top of the title to the last line of the text */
.jr-poster { position: relative; margin: 0; }
.jr-poster a { position: absolute; top: calc(clamp(2.6rem, 5.6vw, 4.5rem) * .16); bottom: 0; right: 0; display: block; } /* top lines up with the title's capitals */
.jr-poster img { display: block; width: auto; height: 100%; border-radius: var(--radius); }
.jr-head .jr-standfirst--sub { margin-top: 18px; color: var(--ink-2); font-size: clamp(1.08rem, 1.6vw, 1.22rem); }

/* a stop's photos: one large, the rest as thumbnails that swap in */
.jr-gallery__main { display: block; aspect-ratio: 3 / 2; cursor: zoom-in; }
.jr-gallery__main img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
  transition: opacity .25s ease;
}
.jr-gallery__main img.is-swapping { opacity: 0; }
.jr-gallery__thumbs { display: flex; gap: 8px; margin-top: 10px; }
.jr-gallery__main[hidden], .jr-gallery__video[hidden] { display: none; }
.jr-gallery__video { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: contain; border-radius: var(--radius); background: #111; }
.jr-gallery__thumb { position: relative; }
.jr-gallery__thumb.is-video::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 7px 0 7px 12px;
  border-color: transparent transparent transparent #fff;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5));
}
.jr-soon {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 3 / 2;
  margin: 0;
  border: 1px dashed var(--hair-2);
  border-radius: var(--radius);
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  font-style: italic;
  color: var(--muted);
}
.jr-gallery__thumb {
  flex: 1 1 0;
  max-width: 64px;
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 3px;
  background: none;
  cursor: pointer;
  opacity: .55;
  outline-offset: 2px;
  transition: opacity .2s ease, box-shadow .2s ease;
}
.jr-gallery__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.jr-gallery__thumb:hover { opacity: .9; }
.jr-gallery__thumb[aria-pressed="true"] { opacity: 1; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }

/* the map strip: land drawn once as an image, the route drawn over it */
.jr-map { margin: 4px 0 26px; }
.jr-map__scroll { overflow-x: auto; }
.jr-map__canvas { position: relative; min-width: 760px; aspect-ratio: 1000 / 212.5; }
.jr-map__canvas img,
.jr-map__canvas svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.jr-map__canvas svg { overflow: visible; }
.jr-map__canvas img {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 72%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 72%, transparent 100%);
}
.jr-leg { fill: none; stroke-width: 1.4; stroke-linecap: round; transition: stroke .35s ease, opacity .35s ease; }
.jr-leg.is-future { stroke: #c8c4ba; stroke-dasharray: .006 .012; }
.jr-leg.is-past { stroke: #3d4046; stroke-dasharray: none; opacity: .75; }
.jr-leg.is-current { stroke: var(--accent); stroke-width: 2.2; stroke-dasharray: 1; animation: jr-draw 1s var(--ease) both; }
.jr-leg.is-planned.is-past,
.jr-leg.is-planned.is-current { stroke-dasharray: .006 .012; animation: none; }
@keyframes jr-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.jr-traveler { opacity: 0; transition: opacity .35s ease; pointer-events: none; }
.jr-traveler { filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff) drop-shadow(0 2px 3px rgba(21, 23, 26, .25)); }
.jr-bot__head, .jr-bot__body { fill: var(--accent); }
.jr-bot__visor { fill: #15171a; }
.jr-bot__eye { fill: #8fe3ff; }
.jr-bot__ant { stroke: var(--accent); stroke-width: 1.4; stroke-linecap: round; }
.jr-bot__tip { fill: #ffc24a; }
.jr-bot__wheel { fill: #15171a; }
.jr-pin__dot { fill: var(--bg); stroke: #b3afa5; stroke-width: 1.5; transition: fill .3s ease, stroke .3s ease; }
.jr-pin__halo { fill: var(--accent); opacity: 0; transition: opacity .3s ease; }
.jr-pin text { font-family: var(--mono); font-size: 11.5px; fill: var(--muted); paint-order: stroke; stroke: var(--bg); stroke-width: 3.5px; stroke-linejoin: round; transition: fill .3s ease; }
.jr-pin.is-visited .jr-pin__dot { fill: var(--ink); stroke: var(--ink); }
.jr-pin.is-visited text { fill: var(--ink); }
.jr-pin.is-here .jr-pin__dot { fill: var(--accent); stroke: var(--accent); }
.jr-pin.is-here .jr-pin__halo { opacity: .18; }
.jr-pin.is-here text { fill: var(--accent-ink); font-weight: 500; }
@media (prefers-reduced-motion: reduce) {
  .jr-leg.is-current { animation: none; }
}

.jr-route__scroll { overflow-x: auto; padding: 10px 8px 8px; margin: -10px -8px 0; }
.jr-route__stops {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  min-width: 860px;
  margin: 0;
  padding: 0;
  list-style: none;
}
/* the line through the stops: travelled part solid, the rest dashed */
.jr-route__stops::before,
.jr-route__stops::after {
  content: "";
  position: absolute;
  top: 8px;
  height: 0;
}
.jr-route__stops::before {
  left: calc(100% / var(--n) / 2);
  width: calc(100% / var(--n) * var(--now));
  border-top: 2px solid var(--ink);
}
.jr-route__stops::after {
  left: calc(100% / var(--n) / 2 + 100% / var(--n) * var(--now));
  right: calc(100% / var(--n) / 2);
  border-top: 2px dashed var(--hair-2);
}
.jr-route__stop button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0 4px 10px;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
}
.jr-route__dot {
  position: relative;
  z-index: 1;
  width: 18px;
  height: 18px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--bg);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.jr-route__stop.is-done .jr-route__dot { background: var(--ink); }
.jr-route__stop.is-later .jr-route__dot { border-color: var(--hair-2); border-style: dashed; }
.jr-route__stop.is-interlude .jr-route__dot, .jr-route__stop.is-trip .jr-route__dot { width: 12px; height: 12px; margin-top: 3px; margin-bottom: 3px; }
.jr-route__stop.is-interlude .jr-route__city, .jr-route__stop.is-trip .jr-route__city { font-size: clamp(.98rem, 1.4vw, 1.1rem); }
.jr-route__stop.is-now .jr-route__dot { border-color: var(--accent); background: var(--accent); }
.jr-route__city { font-family: var(--serif); font-size: clamp(1.05rem, 1.6vw, 1.3rem); line-height: 1.2; }
.jr-route__when { font-family: var(--mono); font-size: .72rem; color: var(--muted); }
.jr-route__stop.is-now .jr-route__when::after { content: "now"; margin-left: 6px; padding: 1px 5px; border-radius: 2px; background: var(--accent-soft); color: var(--accent-ink); }
.jr-route__stop button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.jr-route__stop button:hover .jr-route__city { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.jr-route__stop button[aria-selected="true"] .jr-route__dot { transform: scale(1.25); box-shadow: 0 0 0 5px var(--accent-soft); }
.jr-route__stop button[aria-selected="true"] .jr-route__city { color: var(--accent-ink); }

.jr-panel {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(28px, 4vw, 56px);
  margin-top: 28px;
  padding-top: 32px;
  border-top: 1px solid var(--hair);
  outline: none;
}
.jr-panel[hidden] { display: none; }
.jr-panel__meta { margin: 0 0 6px; font-family: var(--mono); font-size: .78rem; color: var(--muted); }
.jr-panel__city {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.1rem, 4.2vw, 3.1rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -.02em;
}
.jr-text { margin: 16px 0 0; color: var(--ink-2); font-size: 1rem; line-height: 1.7; }
.jr-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 14px; }
.jr-panel__season { font-size: .5em; color: var(--muted); font-style: italic; }
.jr-work { margin-top: 26px; }
.jr-work__h { margin: 0 0 8px; font-family: var(--mono); font-size: .76rem; color: var(--muted); }
.jr-work ul { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--hair); }
.jr-work a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hair);
  color: inherit;
  text-decoration: none;
}
.jr-work__name { font-weight: 600; font-size: .98rem; transition: color .2s ease; }
.jr-work__what { grid-column: 1; color: var(--ink-2); font-size: .9rem; line-height: 1.5; }
.jr-work__go { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--muted); transition: transform .2s var(--ease), color .2s ease; }
.jr-work a:hover .jr-work__name,
.jr-work a:hover .jr-work__go { color: var(--accent-ink); }
.jr-work a:hover .jr-work__go { transform: translateX(3px); }
.jr-civic { margin-top: 24px; padding: 18px 20px 20px; border-left: 2px solid var(--accent); background: var(--surface); }
.jr-civic__label { margin: 0 0 4px; font-family: var(--mono); font-size: .76rem; color: var(--accent-ink); }
.jr-civic__title { margin: 0 0 8px; font-family: var(--serif); font-size: 1.2rem; font-weight: 500; line-height: 1.3; }
.jr-civic p:not(.jr-civic__label) { margin: 0; color: var(--ink-2); font-size: .95rem; line-height: 1.65; }
.jr-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 28px; }
.jr-nav .jr-next { margin-left: auto; }
/* the previous link points back: its arrow goes first */
.jr-nav .jr-prev::after { content: none; }
.jr-nav .jr-prev::before { content: "←"; display: inline-block; margin-right: .4em; }
.jr-panel__media { display: flex; flex-direction: column; }
.jr-extra { width: 190px; margin: auto 0 0 auto; padding-top: 24px; }
.jr-extra a { display: block; cursor: zoom-in; }
.jr-extra img { display: block; width: 100%; height: auto; border: 1px solid var(--hair); border-radius: 12px; }
.jr-extra figcaption { margin-top: 8px; color: var(--muted); font-size: .8rem; text-align: center; }

@media (max-width: 860px) {
  .jr-panel { grid-template-columns: 1fr; }
  .jr-panel__media { order: -1; }
  .jr-head { grid-template-columns: 1fr; gap: 24px; }
  .jr-poster a { position: static; display: inline-block; }
  .jr-poster img { height: auto; width: 150px; }
}

/* Footer / contact
   ========================================================================== */

.site-footer {
  padding-block: clamp(56px, 8vw, 96px) 28px;
  background: var(--ink);
  color: #ecebe6;
}

.site-footer .eyebrow { color: #9a9b9f; }

.footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 48px;
  align-items: end;
}

.footer__lead {
  max-width: 40ch;
  margin: 0 0 22px;
  color: #c4c4c0;
  font-size: 1.05rem;
}

.footer__email {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3.6vw, 2.8rem);
  line-height: 1.2;
  letter-spacing: -.01em;
  text-decoration: none;
  word-break: break-word;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 2px no-repeat;
  transition: background-size .35s var(--ease);
}
.footer__email:hover { background-size: 100% 2px; }

.footer__links {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer__links a,
.footer__links > li > span {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #2f3136;
  text-decoration: none;
  color: #ecebe6;
}
.footer__links > li > span { color: #9a9b9f; }
.footer__links a:hover { color: #ffffff; border-bottom-color: var(--accent); }

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  margin-top: clamp(48px, 7vw, 80px);
  font-family: var(--mono);
  font-size: .76rem;
  color: #8d8e92;
}
.footer__bottom a { text-decoration: none; }
.footer__bottom a:hover { color: #ecebe6; }

@media (max-width: 800px) {
  .footer__grid { grid-template-columns: 1fr; }
}

/* Motion: hero plays on load, everything else reveals on scroll
   ========================================================================== */

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .js .intro { animation: rise .8s var(--ease) both; animation-delay: calc(var(--i, 0) * 80ms); }
}

.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* About: the intro reads at a comfortable width, and each civic project opens on request */
.jr-head .jr-standfirst--sub { max-width: 44rem; }
.jr-civic__label { display: block; }
.jr-civic__title { display: block; }
details.jr-civic > summary { display: block; list-style: none; cursor: pointer; }
details.jr-civic > summary::-webkit-details-marker { display: none; }
details.jr-civic > summary::after { content: "Read more \2192"; display: inline-block; margin-top: 2px; font-size: .88rem; font-weight: 500; color: var(--ink); text-decoration: underline 1px var(--hair-2); text-underline-offset: 5px; }
details.jr-civic[open] > summary::after { content: "Close"; }
details.jr-civic > summary:hover::after { text-decoration-color: var(--ink); }
details.jr-civic > p { margin-top: 12px; }

/* ==========================================================================
   Small labels in the reading font, and research cards boxed again (2026-10-03)
   ========================================================================== */

.eyebrow, .kicker, .tags li, .hero__status, .work__label, .honor__year, .media__item time, .media__kind,
.jump a::before, .entry__date, .thread__num, .oss__repo, .oss__state, .project__kicker, .project__venue,
.project__role span, .rcard__kicker, .proj__kicker, .modal__kicker, .pub__venue, .shelf__also span,
.tcard__visual--type span, .tcard__when, .tcards__also span, .ts-when, .tree__meta, .jr-pin text,
.jr-route__when, .jr-panel__meta, .jr-work__h, .jr-civic__label, .footer__bottom {
  font-family: var(--sans);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}
.tcard__visual--type span { letter-spacing: -.02em; }

/* the picture and the words sit inside one card */
.rcards { gap: 20px; }
.rcard {
  overflow: hidden;
  border: 1px solid var(--hair);
  border-radius: 10px;
  background: var(--card);
  transition: border-color .25s ease, box-shadow .35s var(--ease);
}
.rcard:hover { border-color: var(--hair-2); box-shadow: 0 12px 28px rgba(21, 23, 26, .07); }
.rcard__media { border-radius: 0; box-shadow: none; border-bottom: 1px solid var(--hair); }
.rcard:hover .rcard__media img { transform: scale(1.02); }
.rcard__body { padding: 18px 20px 20px; }
.rcard__kicker { font-size: .8rem; font-weight: 500; color: var(--muted); }
.rcard__more { padding-top: 14px; }

/* Research entries (ROBOTIS, Ubion): their dates and tags use the reading font too */
.entry__date, .tags li { font-family: var(--sans); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.tags li { font-size: .8rem; }
/* a wide research card keeps its picture beside the words, divided by a hairline */
.rcard--wide .rcard__media { border-bottom: 0; border-right: 1px solid var(--hair); }
@media (max-width: 760px) { .rcard--wide .rcard__media { border-right: 0; border-bottom: 1px solid var(--hair); } }

/* Teaching: one photo shown whole on top, the other two beneath it (no cropping of the main photo) */
.ts-split--fill > div:last-child:has(.ts-mosaic--top) { align-items: flex-start; }
.ts-mosaic--top, .ts-split--fill .ts-mosaic--top { flex: 1 1 auto; grid-template-columns: 1fr 1fr; grid-template-rows: none; min-height: 0; }
.ts-mosaic--top a, .ts-split--fill .ts-mosaic--top a { aspect-ratio: 4 / 3; min-height: 0; }
.ts-mosaic--top a:first-child, .ts-split--fill .ts-mosaic--top a:first-child { grid-column: 1 / -1; grid-row: auto; aspect-ratio: 4 / 3; }

/* U9 Change: the three certificates as large as their box allows; on a wide screen the card beside it matches its height */
.tcard__visual--certs { gap: 12px; padding: 18px 22px 14px; }
.tcard__certs { gap: 14px; max-width: 100%; }
.tcard__certs img { flex: 0 1 auto; min-width: 0; object-fit: contain; }
@media (min-width: 1001px) {
  .tcards > .is-wide .tcard__visual--certs,
  .tcards > .is-wide + li .tcard__visual { height: clamp(272px, 24vw, 340px); }
  .tcard__certs { flex: 1 1 0; min-height: 0; }
  .tcard__certs img { width: auto; height: 100%; }
}
@media (max-width: 1000px) {
  .tcard__visual--certs { height: auto; }
  .tcard__certs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: min(100%, 660px); }
  .tcard__certs img { width: 100%; height: auto; }
}
/* in its window, the certificates fill the column, three across */
.pub__imgs--fill { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pub__imgs--fill a { min-width: 0; }
.pub__imgs--fill img { width: 100%; height: auto; }

/* a wide research card (PDPM, IGEN): the figure fills its side of the card, the words sit in even padding */
.rcard--wide { align-items: stretch; }
.rcard--wide .rcard__media { aspect-ratio: auto; min-height: 260px; }
.rcard--wide .rcard__body { justify-content: center; padding: 28px 32px 28px 0; }
@media (max-width: 760px) {
  .rcard--wide .rcard__media { aspect-ratio: 16 / 9; min-height: 0; }
  .rcard--wide .rcard__body { padding: 18px 20px 20px; }
}

/* Honors, Fellowships and programs: no year column, so the cards start at the left edge, at the award cards' size */
.shelf--plain { grid-template-columns: minmax(0, 1fr); }
.shelf--plain .shelf__grid { grid-column: 1; grid-template-columns: repeat(4, calc((100% - 168px - 66px) / 4)); }
@media (max-width: 1100px) { .shelf--plain .shelf__grid { grid-template-columns: repeat(3, calc((100% - 168px - 44px) / 3)); } }
@media (max-width: 760px) { .shelf--plain .shelf__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rcard--wide .rcard__more { margin-top: 0; }

/* About: a stop with many photos wraps its thumbnails into rows, each a readable size */
.jr-gallery__thumbs { flex-wrap: wrap; }
.jr-gallery__thumb { flex: 0 0 56px; max-width: none; }
@media (max-width: 520px) { .jr-gallery__thumb { flex-basis: 48px; } }

/* About: a portrait photo is shown whole in the gallery frame, on dark, like the videos */
.jr-gallery__main img.is-tall { object-fit: contain; background: #111; }

/* Charts in project windows: one accent for MU, ink and gray for everything else
   ========================================================================== */

.project__body > .fig-pair { margin: 28px 0 24px; }

.chart__scroll {
  overflow-x: auto;
  padding: 14px 14px 8px;
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  background: #fff;
}

.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart svg text { font-family: var(--sans); font-size: 12px; fill: var(--ink-2); }
.chart svg .ttl { font-size: 13px; font-weight: 600; fill: var(--ink); }
.chart svg .lb { font-size: 12.5px; fill: var(--ink); }
.chart svg .tk { font-size: 11.5px; fill: var(--muted); }
.chart svg .ref { font-size: 11px; fill: var(--muted); }
.chart svg .val { font-size: 12px; font-weight: 600; fill: var(--ink); }
.chart svg .grid { stroke: var(--hair); stroke-width: 1; }
.chart svg .zero { stroke: var(--hair-2); stroke-width: 1; }
.chart svg .band { fill: var(--surface); }
.chart svg .stem { stroke: var(--hair-2); stroke-width: 2; }
.chart svg .ci { stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.chart svg .ln-mu { stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart svg .ln-alt { stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart svg .ln-ref { stroke: var(--ink-2); stroke-width: 1; }
.chart svg .dot-mu { fill: var(--accent); stroke: #fff; stroke-width: 2; }
.chart svg .dot-alt { fill: #fff; stroke: var(--muted); stroke-width: 2; }
.chart svg .dot-ref { fill: #fff; stroke: var(--ink-2); stroke-width: 2; }
.chart svg .bar-mu { fill: var(--accent); }
.chart svg .bar-alt { fill: var(--muted); }
.chart svg .hit { fill: transparent; }
.chart svg .mark { cursor: default; outline: none; }
.chart svg .mark:hover .hit, .chart svg .mark:focus-visible .hit,
.chart svg rect.mark:hover, .chart svg rect.mark:focus-visible { fill: rgba(21, 23, 26, .05); }

.chart { position: relative; }

.chart__tip {
  position: absolute;
  z-index: 2;
  max-width: 300px;
  padding: 6px 10px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font-size: .78rem;
  line-height: 1.4;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 10px));
}

.chart__data { margin-top: 8px; font-size: .85rem; color: var(--muted); }
.chart__data summary { cursor: pointer; }
.chart__table { overflow-x: auto; margin-top: 8px; }
.chart__table table { width: 100%; border-collapse: collapse; font-size: .8rem; font-variant-numeric: tabular-nums; }
.chart__table th, .chart__table td { padding: 5px 10px 5px 0; border-bottom: 1px solid var(--hair); text-align: left; font-weight: 400; white-space: nowrap; }
.chart__table thead th { color: var(--ink); font-weight: 600; }
.chart svg .val { paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; }

/* Project windows: smaller headings, headline numbers, and folded detail
   ========================================================================== */

.project__sub {
  margin: 30px 0 10px;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 18px 0 8px;
}
.stat {
  padding: 14px 14px 12px;
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  background: #fff;
}
.stat__value { font-size: 1.75rem; font-weight: 600; line-height: 1.1; color: var(--ink); }
.stat__label { margin-top: 8px; font-size: .78rem; line-height: 1.4; color: var(--muted); }
@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}

.fold { margin: 22px 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.fold > summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  list-style: none;
  cursor: pointer;
  font-size: .95rem;
  font-weight: 500;
  color: var(--ink);
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: "+"; color: var(--accent-ink); font-weight: 600; }
.fold[open] > summary::after { content: "\2212"; }
.fold__body { padding: 4px 0 22px; }
.fold__body > p, .fold__body > .bullets { color: var(--ink-2); }
.fold__body > .fig, .fold__body > .fig-pair { margin: 22px 0; }
.fold__body > .project__h:first-child { margin-top: 0; }

/* A wide chart scrolls inside its own frame and must not stretch the window on a phone */
.project__body, .project__meta, .fold, .fold__body, .chart, .chart__scroll, .chart__data { min-width: 0; max-width: 100%; }

/* PDPM window: interactive figures (assets/js/pdpm.js) and results tables
   ========================================================================== */

.pdpm .chart__scroll { padding: 14px 14px 12px; }
.pdpm-seg { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.pdpm-seg button,
.pdpm-replay {
  padding: 4px 11px;
  border: 1px solid var(--hair-2);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-2);
  font: inherit;
  font-size: .8rem;
  line-height: 1.5;
  cursor: pointer;
}
.pdpm-seg button:hover, .pdpm-replay:hover { border-color: var(--ink-2); }
.pdpm-seg button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.pdpm-replay { margin-top: 8px; }
.pdpm-range { display: flex; align-items: center; gap: 12px; margin-top: 10px; font-size: .85rem; color: var(--ink-2); }
.pdpm-range input { flex: 1; min-width: 120px; accent-color: var(--ink); }
.pdpm-range output { min-width: 3.4em; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }

.chart svg .tok { transition: transform var(--dur, 400ms) linear, opacity .25s ease; }
.chart svg .tok--alu { fill: #3d4046; }
.chart svg .tok--mem { fill: #fff; stroke: #3d4046; stroke-width: 2; }
.chart svg .tok--br { fill: var(--accent); }
.chart svg .tok--sq { fill: #fff; stroke: #b9b5ab; stroke-width: 1.5; stroke-dasharray: 3 2; }
.chart svg .pdpm-reg { fill: #15171a; stroke: #15171a; stroke-width: 1; transition: fill .45s ease, stroke .45s ease; }
.chart svg .pdpm-reg.is-off { fill: #fff; stroke: #b9b5ab; stroke-dasharray: 3 2; }
.chart svg .pdpm-byp path { fill: none; stroke: #d6d2c8; stroke-width: 1.4; transition: stroke .45s ease, fill .45s ease; }
.chart svg .pdpm-byp path:last-child { fill: #fff; }
.chart svg .pdpm-byp.is-on path { stroke: var(--accent); }
.chart svg .pdpm-byp.is-on path:last-child { fill: var(--accent-soft); }
.chart svg .pdpm-draw { stroke-dasharray: 1; stroke-dashoffset: 0; transition: stroke-dashoffset 1.6s var(--ease); }
.chart svg.is-hidden .pdpm-draw { stroke-dashoffset: 1; }
.chart svg .pdpm-col { transition: fill .5s ease; }
.chart svg .pdpm-slide { transition: transform .8s var(--ease); }
.chart svg .pdpm-pt { transition: opacity .45s ease; }
.chart svg.is-waiting .pdpm-pt { opacity: 0; }
.chart svg .pdpm-pt.is-dom { opacity: .16; }
.chart svg .pdpm-keep { opacity: 0; transition: opacity .4s ease .2s; }
.chart svg .pdpm-pt:not(.is-in) .pdpm-keep,
.chart svg:not(.is-waiting) .pdpm-pt.is-in .pdpm-keep { opacity: 1; }
.chart svg .pdpm-late, .chart svg .pdpm-playhead { transition: opacity .4s ease; }

.ptable { margin: 26px 0 24px; overflow-x: auto; }
.ptable table { width: 100%; border-collapse: collapse; font-size: .86rem; font-variant-numeric: tabular-nums; border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); }
.ptable th, .ptable td { padding: 6px 10px; text-align: right; white-space: nowrap; font-weight: 400; color: var(--ink-2); }
.ptable th:first-child, .ptable td:first-child { text-align: left; padding-left: 0; white-space: normal; }
.ptable thead th { color: var(--ink); font-weight: 600; border-bottom: 1px solid var(--ink); }
.ptable tbody th { padding-top: 12px; color: var(--ink); font-weight: 600; text-align: left; }
.ptable tr.is-us td { background: var(--surface); color: var(--ink); }
.ptable tr.is-us td:first-child { padding-left: 8px; }
.ptable td:first-child { padding-left: 8px; }
.ptable caption { caption-side: bottom; padding-top: 8px; text-align: left; color: var(--muted); font-size: .8rem; }

/* ICCD 2026 section at the top of the PDPM window */
.project__body > .project__h--first { margin-top: 0; }
.pdpm-anim__bar { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0 0 10px; }
.pdpm-anim__bar .pdpm-seg { margin: 0; }
.pdpm-anim video { cursor: pointer; background: #fff; }
.pdpm-anim__note { margin: 10px 0 0; min-height: 3.2em; color: var(--ink-2); font-size: .9rem; line-height: 1.55; }
