/* Phat Tran — single column, top navigation, no fixed sidebar.
   Type: Newsreader (reading) + IBM Plex Sans (metadata).
   Accent: pine/mint. Dark mode is its own palette, not an inversion. */

@font-face {
  font-family: "Newsreader";
  src: url("assets/fonts/newsreader-roman.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("assets/fonts/newsreader-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("assets/fonts/ibm-plex-sans.woff2") format("woff2");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f7f5f0;
  --ink: #1b1f1d;
  --muted: #5a615d;
  --line: #c9c2b4;
  --accent: #1f5f4c;
  --accent-hover: #123f32;
  --rule: color-mix(in srgb, #1f5f4c 45%, transparent);

  --serif: "Newsreader", "Iowan Old Style", "Source Serif 4", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121614;
    --ink: #e8e6e0;
    --muted: #a6ada8;
    --line: #3a423d;
    --accent: #8ccfb3;
    --accent-hover: #c7f0df;
    --rule: color-mix(in srgb, #8ccfb3 45%, transparent);
  }
}

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

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.25rem/1.65 var(--serif);
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
p, figure { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 500; }
ul { list-style: none; margin: 0; padding: 0; }
a {
  color: inherit;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
a:hover { color: var(--accent-hover); }

.about-body a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }

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

.skip {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  font: 500 0.9375rem/1 var(--sans);
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

.container {
  width: min(1120px, calc(100% - 64px));
  margin-inline: auto;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font: 600 1.0625rem/1 var(--sans);
  letter-spacing: -0.01em;
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  font: 400 0.9375rem/1 var(--sans);
  text-decoration: none;
  transition: color 0.15s ease;
}
.site-nav a:hover { color: var(--accent-hover); }
.site-nav a[aria-current] {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--accent);
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: stretch;
  gap: clamp(48px, 6vw, 88px);
  padding: 64px 0 72px;
}
.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  margin-bottom: 18px;
  font: 400 0.875rem/1.5 var(--sans);
  color: var(--muted);
}

.hero h1 {
  max-width: 16ch;
  font-size: clamp(2.6rem, 5.2vw, 4.2rem);
  line-height: 1.06;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.hero-lede {
  text-wrap: pretty;
  max-width: 42ch;
  margin-top: 22px;
  font-size: 1.5rem;
  line-height: 1.35;
  letter-spacing: -0.008em;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 30px;
  font: 400 0.9375rem/1.5 var(--sans);
}
.quick-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: currentColor;
  text-underline-offset: 4px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
.quick-links a:hover,
.quick-links a:focus-visible {
  color: var(--accent-hover);
  text-decoration-color: currentColor;
}

.hero-figure {
  position: relative;
  width: 100%;
  max-width: 360px;
  justify-self: end;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--line);
}
.hero-figure img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
}

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

.section {
  padding: 64px 0;
  border-top: 1px solid var(--line);
}
.section-head { margin-bottom: 32px; }
.section-head .eyebrow {
  margin-bottom: 8px;
  font: 500 0.6875rem/1.4 var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.section h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 3.2vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.about-body { max-width: none; }
.about-body p { text-wrap: pretty; }
.about-body p + p { margin-top: 1.25em; }

/* ---------- Publications ---------- */

.pubs { max-width: none; }

.feature,
.papers li {
  display: block;
  max-width: none;
  padding: 26px 0;
  border-top: 1px dashed var(--line);
}

.paper-title {
  font-size: 1.375rem;
  line-height: 1.3;
  letter-spacing: -0.004em;
  text-wrap: pretty;
}
.paper-title a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: currentColor;
  text-underline-offset: 3px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
.paper-title a:hover,
.paper-title a:focus-visible {
  color: var(--accent-hover);
  text-decoration-color: currentColor;
}

.summary {
  margin-top: 10px;
  font-style: normal;
  text-wrap: pretty;
  font-size: 1.125rem;
  line-height: 1.6;
}

.authors,
.venue {
  font: 400 0.9375rem/1.55 var(--sans);
  color: var(--muted);
}
.authors { margin-top: 12px; }
.authors strong { font-weight: 600; color: var(--ink); }
.venue { margin-top: 2px; }

.award {
  margin-top: 2px;
  font: 400 0.875rem/1.55 var(--sans);
  color: var(--accent);
  font-weight: 500;
}

.venue a {
  position: relative;
  display: inline-block;
  min-width: 0;
  margin-left: 0.9em;
  font-weight: 500;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
}
.venue a::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(100%, 44px);
  height: 44px;
  transform: translate(-50%, -50%);
}
.venue a:hover,
.venue a:focus-visible {
  color: var(--accent-hover);
  text-decoration-color: currentColor;
}

.papers { margin-top: 0; }
.scholar { margin-top: 32px; }
.scholar a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font: 500 0.9375rem/1.55 var(--sans);
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: currentColor;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}
.scholar a:hover,
.scholar a:focus-visible { color: var(--accent-hover); }

.about-body a:hover,
.about-body a:focus-visible,
.quick-links a:hover,
.quick-links a:focus-visible,
.paper-title a:hover,
.paper-title a:focus-visible,
.venue a:hover,
.venue a:focus-visible,
.scholar a:hover,
.scholar a:focus-visible {
  text-decoration-thickness: 2px;
}

/* ---------- Curved record roadmap ---------- */

.roadmap { position: relative; padding-top: 4px; }
.roadmap-top { position: relative; height: 110px; }
.roadmap-label { display: none; }
.rm-edu {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--x);
  transform: translateX(-50%);
  width: clamp(180px, 24vw, 260px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.rm-edu h3 {
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.2;
}
.rm-edu p {
  margin-top: auto;
  font: 400 0.875rem/1.5 var(--sans);
  color: var(--muted);
}
.roadmap-curve {
  display: block;
  width: 100%;
  height: 140px;
}
.roadmap-curve path {
  fill: none;
  stroke: var(--line);
  stroke-width: 1.25;
  stroke-dasharray: 7 7;
  stroke-linecap: round;
}
.roadmap-years {
  position: relative;
  height: 22px;
  margin-top: 4px;
}
.roadmap-years span {
  position: absolute;
  transform: translateX(-50%);
  font: 400 0.75rem/1 var(--sans);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.roadmap-work {
  position: relative;
  height: 76px;
  margin-top: 24px;
}
.rm-work {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--x);
  transform: translateX(-50%);
  width: clamp(110px, 15vw, 170px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.rm-work h3 {
  font: 500 1.1875rem/1.25 var(--serif);
}
.rm-work p {
  margin-top: auto;
  font: 400 0.8125rem/1.45 var(--sans);
  color: var(--muted);
}

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

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  font: 400 0.9375rem/1.5 var(--sans);
  color: var(--muted);
}

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

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 40px;
    padding: 56px 0 64px;
  }
  .hero-figure {
    position: relative;
    justify-self: center;
    width: 100%;
    max-width: 420px;
    aspect-ratio: 4 / 5;
  }
  .hero-figure img {
    position: static;
    height: 100%;
  }
  .hero h1 { max-width: 18ch; }
  .section { padding: 56px 0; }
  .pubs { max-width: none; }
}

@media (max-width: 600px) {
  .container { width: calc(100% - 32px); }
  .header-inner { min-height: 56px; gap: 12px; }
  .brand { font-size: 0.9375rem; }
  .site-nav { gap: 12px; }
  .site-nav a { font-size: 0.8125rem; }
  .hero { padding: 40px 0 56px; }
  .hero h1 { font-size: 2.3rem; }
  .hero-lede { font-size: 1.25rem; margin-top: 16px; }
  .quick-links { gap: 4px 16px; margin-top: 20px; }
  .hero-figure { max-width: 300px; }
  body { font-size: 1.125rem; line-height: 1.55; }
  .section { padding: 48px 0; }
  .section-head { margin-bottom: 24px; }
  .section h2 { font-size: 1.75rem; }
  .paper-title { font-size: 1.3125rem; }
  .summary,
  .rm-note { font-size: 1.125rem; line-height: 1.55; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .skip, .site-header { display: none; }
  .container { width: 100%; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .hero { display: block; padding: 0 0 24px; }
  .hero-figure { position: relative; max-width: 180px; aspect-ratio: 4 / 5; }
  .hero-figure img { position: static; height: 100%; }
  .section { padding: 24px 0; }
  section + section { border-top: 1px solid #ccc; }
  .feature, .papers li { break-inside: avoid; }
}

@media (max-width: 760px) {
  .roadmap { padding: 0; }
  .roadmap-label {
    display: block;
    margin: 0 0 12px;
    font: 500 0.6875rem/1.4 var(--sans);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .roadmap-label:not(:first-child) { margin-top: 28px; }
  .roadmap-top { height: auto; display: grid; gap: 20px; }
  .rm-edu {
    position: static;
    transform: none;
    width: auto;
    display: block;
    text-align: left;
  }
  .rm-edu p { margin-top: 6px; }
  .roadmap-curve, .roadmap-years { display: none; }
  .roadmap-work {
    height: auto;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    display: grid;
    gap: 18px;
  }
  .rm-work {
    position: static;
    transform: none;
    width: auto;
    display: block;
    text-align: left;
    padding-left: 18px;
  }
  .rm-work p { margin-top: 2px; }
  .rm-note { font-size: 1.125rem; line-height: 1.55; }
}


@media print {
  :root {
    --paper: #fff;
    --ink: #000;
    --muted: #3f4643;
    --line: #c3c3c3;
    --accent: #1f5f4c;
    --rule: color-mix(in srgb, #1f5f4c 45%, transparent);
  }
  .section { border-top-color: #ccc; }
  .section-head { break-after: avoid; }
  .roadmap, .rm-edu { break-inside: avoid; }
}

@page { margin: 14mm; }
