/* Homepage — dark cinematic. Accent is the only color. */
:root {
  --bg: #0b0b0c;
  --surface: #131316;
  --border: #222226;
  --text: #e9e6df;
  --muted: #8d8a84;
  --faint: #3a3a3f;
  --accent: #d9a35b;
  --sans: 'Inter Tight', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --wrap: 1040px;
  --gutter: clamp(20px, 5vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
::selection { background: var(--accent); color: var(--bg); }

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

/* Body links: amber underline that thickens on hover */
.section p a {
  text-decoration: underline;
  text-decoration-color: rgba(217, 163, 91, .55);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: text-decoration-color .2s, text-decoration-thickness .2s;
}
.section p a:hover { text-decoration-color: var(--accent); text-decoration-thickness: 2px; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px var(--gutter);
  font-family: var(--mono); font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  transition: background .35s, border-color .35s, padding .35s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(11, 11, 12, .72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
  padding-top: 14px; padding-bottom: 14px;
}
.nav a { text-decoration: none; opacity: .8; transition: opacity .2s, color .2s; }
.nav a:hover { opacity: 1; color: var(--accent); }
.nav-name { font-weight: 500; opacity: 1 !important; }
.nav-links { display: flex; gap: clamp(14px, 2.4vw, 32px); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: flex-end;
  background:
    linear-gradient(to bottom, rgba(11, 11, 12, .55) 0%, transparent 18%, transparent 42%, rgba(11, 11, 12, .85) 78%, var(--bg) 100%),
    radial-gradient(ellipse 70% 55% at 18% 82%, rgba(11, 11, 12, .7), transparent 70%),
    url(images/hero.jpg) 50% 28% / cover no-repeat;
  overflow: hidden;
}
/* Film grain */
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  opacity: .09; mix-blend-mode: overlay;
}
.hero-inner {
  position: relative; z-index: 1;
  width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin: 0 auto; padding: 0 var(--gutter) clamp(48px, 9vh, 96px);
}
.hero h1 {
  font-weight: 300;
  text-shadow: 0 2px 30px rgba(11, 11, 12, .45);
  font-size: clamp(46px, 8.4vw, 124px);
  line-height: .95; letter-spacing: -.045em;
}
.hero .aka { font-style: italic; color: var(--muted); letter-spacing: -.03em; }
.hero-role {
  margin-top: 22px;
  font-family: var(--mono); font-size: clamp(10.5px, 1.1vw, 13px);
  letter-spacing: .3em; text-transform: uppercase; color: var(--accent);
}
.hero-loc { margin-top: 6px; color: var(--muted); font-size: 15px; }
.hero-icons { display: flex; gap: 10px; margin-top: 26px; }
.hero-icons a {
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid rgba(233, 230, 223, .22); border-radius: 50%;
  background: rgba(11, 11, 12, .35);
  transition: border-color .2s, color .2s, transform .2s;
}
.hero-icons a:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.hero-icons svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Sections ---------- */
main { max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(72px, 11vw, 128px) 0 0; }
.section-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: .28em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 28px;
  display: flex; align-items: center; gap: 16px;
}
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.section > p { max-width: 760px; color: #cfcbc3; }
/* Full content width so the right edge lines up with the card grid below.
   max-width: none resolves to main's 1040px content box. */
.section .lede { font-size: clamp(19px, 2vw, 23px); line-height: 1.6; color: var(--text); max-width: none; }

.js .section { opacity: 0; transform: translateY(12px); transition: opacity .9s ease, transform .9s ease; }
.js .section.in { opacity: 1; transform: none; }

/* ---------- About: the path ---------- */
.path { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 6px; }
.step { position: relative; padding: 0 14px; text-align: center; }
/* the spine, drawn per-step and clipped at the two ends */
.step::before {
  content: ""; position: absolute; top: 15px; left: 0; right: 0;
  height: 1px; background: var(--faint);
}
.step:first-child::before { left: 50%; }
.step:last-child::before { right: 50%; }
.step .dot {
  position: relative; z-index: 1; display: block;
  width: 9px; height: 9px; margin: 11px auto 0;
  border: 1px solid var(--muted); border-radius: 50%; background: var(--bg);
}
.step:last-child .dot {
  background: var(--accent); border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(217, 163, 91, .15);
}

.step-org { display: block; text-decoration: none; }
/* Marks are flat single-colour and transparent, but their intrinsic luma spans 8x
   (Sheffield purple 25 -> Amazon off-white 214), so --lb normalises each one to
   roughly --muted lightness. Values are 141 / measured-luma. */
.step-logo {
  display: block; margin: 20px auto 10px;
  width: 30px; height: 30px; object-fit: contain;
  filter: grayscale(1) brightness(var(--lb, 2.4)) opacity(.82);
  transition: filter .35s;
}
/* Sheffield's crest and Columbia's crown carry far more ink than the thin MSU
   helmet or the Amazon glyph, so equal luma still reads heavier -- they sit
   below the 141 target. --lsat/--lbh tame the hover reveal: both brand colours
   are vivid yet dark (#440099, #001db8), which without a lift would make
   hovering *dim* the logo instead of revealing it. */
.step[data-org="sheffield"] .step-logo { --lb: 4.4;  --lsat: .18; --lbh: 2.2; }
.step[data-org="columbia"]  .step-logo { --lb: 3.3;  --lsat: .18; --lbh: 1.9; }
.step[data-org="msu"]       .step-logo { --lb: 2.37; }
.step[data-org="amazon"]    .step-logo { --lb: .66; }
.step-org:hover .step-logo, .step-org:focus-visible .step-logo {
  filter: saturate(var(--lsat, 1)) brightness(var(--lbh, 1));
}
.step-deg { display: block; font-size: 16px; font-weight: 500; color: var(--text); transition: color .2s; }
.step-org:hover .step-deg { color: var(--accent); }
/* Reserve two lines: Sheffield's field name wraps, the other three do not, and
   without this the four year labels sit at different heights. */
.step-fld {
  display: block; font-style: italic; font-size: 14.5px; line-height: 1.45;
  color: var(--muted); margin-bottom: 3px; min-height: 2.9em;
}
.step-name { display: block; font-size: 14px; color: var(--muted); }
.step-yr {
  display: block; margin-top: 7px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em; color: var(--accent);
}
.step-adv {
  display: block; margin-top: 9px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .03em; line-height: 1.5;
  color: var(--muted);
}
.step-adv a {
  text-decoration: underline;
  text-decoration-color: rgba(217, 163, 91, .5);
  text-decoration-thickness: 1px; text-underline-offset: 3px;
  transition: color .2s, text-decoration-color .2s, text-decoration-thickness .2s;
}
.step-adv a:hover { color: var(--accent); text-decoration-color: var(--accent); text-decoration-thickness: 2px; }

/* Research cards — four themes fall into a 2x2 grid */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 36px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 24px 26px;
  display: flex; flex-direction: column;   /* lets the paper row sit at the bottom */
}
.card h3 { font-weight: 400; font-size: 20px; letter-spacing: -.01em; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 15.5px; line-height: 1.6; }
.card-papers {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: auto; padding-top: 16px;     /* pinned down so uneven card text still aligns */
}
/* Needs to out-specify `.section > p` (0,1,1), otherwise this footnote inherits
   #cfcbc3 and ends up brighter than the card text it is meant to sit behind. */
.section > p.research-earlier {
  margin-top: 26px; max-width: none;
  font-size: 14px; line-height: 1.75; color: #6d6a65;
}
.research-earlier b { color: var(--muted); font-weight: 400; }
.research-earlier a { color: var(--muted); }

/* Service */
.service li {
  display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: center;
  padding: 16px 0; border-bottom: 1px solid var(--border);
}
.service li:first-child { border-top: 1px solid var(--border); }
.service .role { font-size: 17px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip, .pill, .venue, .badge {
  font-family: var(--mono); font-size: 11px; letter-spacing: .02em; line-height: 1;
  padding: 6px 11px; border-radius: 999px; white-space: nowrap;
}
.chip { border: 1px solid #333338; color: #cfcbc3; }

/* ---------- Publications ---------- */
.pub-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 40px; }
.pub-meta .note { color: var(--muted); font-size: 14px; margin-left: 8px; }

.year-group {
  display: grid; grid-template-columns: 150px 1fr; gap: 0 24px;
  padding-top: 8px; margin-bottom: 40px;
}
.year {
  position: sticky; top: 84px; align-self: start;
  font-weight: 300; font-size: 64px; line-height: 1; letter-spacing: -.05em;
  color: var(--faint);
  transition: color .4s;
}
.year-group:hover .year { color: #5a554d; }

.pub {
  padding: 20px 18px; margin: 0 -18px;
  border-bottom: 1px solid var(--border);
  border-radius: 10px;
  transition: background .25s;
}
.pub:last-child { border-bottom: none; }
.pub:hover { background: var(--surface); }
.pub-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; }
.pub-title {
  flex: 1 1 420px;
  font-weight: 400; font-size: 18px; line-height: 1.4; letter-spacing: -.01em;
  text-decoration: none; transition: color .2s;
}
.pub:hover .pub-title, .pub-title:hover { color: var(--accent); }
.venue { border: 1px solid var(--accent); color: var(--accent); }
.venue.arxiv { border-color: #3a3a3f; color: var(--muted); }
.badge { background: var(--accent); color: var(--bg); font-weight: 500; }
.pub-authors { margin-top: 8px; font-size: 14.5px; line-height: 1.6; color: var(--muted); }
.me { color: var(--text); font-weight: 500; box-shadow: inset 0 -1px 0 rgba(217, 163, 91, .7); }
.pub-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pill {
  border: 1px solid #333338; color: #bdb8ae; text-decoration: none;
  transition: border-color .2s, color .2s, background .2s;
}
.pill:hover { border-color: var(--accent); color: var(--bg); background: var(--accent); }

/* ---------- Footer ---------- */
.footer {
  max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 96px auto 0;
  padding: 28px var(--gutter) 40px;
  display: flex; justify-content: space-between; gap: 16px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); border-top: 1px solid var(--border);
}

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav-anchor { display: none; }
  .hero {
    background:
      linear-gradient(to bottom, rgba(11, 11, 12, .55) 0%, transparent 12%, transparent 30%, rgba(11, 11, 12, .9) 50%, var(--bg) 57%),
      url(images/hero-mobile.jpg) 28% 0 / auto 58svh no-repeat var(--bg);
  }
  /* Path flips from a horizontal spine to a vertical rail */
  .path { grid-template-columns: 1fr; margin-top: 2px; }
  .step { text-align: left; padding: 0 0 24px 30px; }
  .step:last-child { padding-bottom: 0; }
  .step::before {
    top: 9px; bottom: 0; left: 4px; right: auto;
    width: 1px; height: auto;
  }
  .step:first-child::before { left: 4px; }
  .step:last-child::before { display: none; }
  .step .dot { position: absolute; top: 5px; left: 0; margin: 0; }
  .step-logo { margin: 0 0 8px; }
  .step-fld { min-height: 0; }   /* stacked rows need no height reservation */
  .cards { grid-template-columns: 1fr; }
  .service li { grid-template-columns: 1fr; gap: 10px; }
  .year-group { grid-template-columns: 1fr; }
  .year { position: static; font-size: 44px; margin-bottom: 4px; }
  .pub { padding: 18px 12px; margin: 0 -12px; }
  .pub-title { flex-basis: 100%; font-size: 17px; }
  .footer { flex-direction: column; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .section { opacity: 1; transform: none; }
}
