/* Travis (Xiaoyu) Zhao — academic site
   Palette: ink #1B2432 / paper #FAFAF7 / seal #A63A2B / slate #5B6572 / hairline #E3E1DA
   Type: Spectral (display) / Source Sans 3 (body) / IBM Plex Mono (meta) */

:root {
  --ink: #1B2432;
  --paper: #FAFAF7;
  --seal: #A63A2B;
  --slate: #5B6572;
  --hairline: #E3E1DA;
  --maxw: 720px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

body {
  font-family: "Source Sans 3", -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
}

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

/* ---------- Header ---------- */
header {
  border-bottom: 1px solid var(--hairline);
  padding: 28px 0 20px;
}

.header-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}

.brand-name {
  font-family: "Spectral", serif;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

nav {
  display: flex;
  gap: 22px;
}

nav a {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--slate);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

nav a:hover, nav a:focus-visible { color: var(--ink); }
nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--seal);
}

a:focus-visible {
  outline: 2px solid var(--seal);
  outline-offset: 3px;
}

/* ---------- Main ---------- */
main { padding: 48px 0 72px; }

h1 {
  font-family: "Spectral", serif;
  font-size: 38px;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 8px;
}

.subtitle {
  font-size: 18px;
  color: var(--slate);
  margin-bottom: 28px;
}

h2 {
  font-family: "Spectral", serif;
  font-size: 24px;
  font-weight: 600;
  margin: 44px 0 14px;
}

p + p { margin-top: 14px; }

a { color: var(--seal); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

/* Eyebrow labels */
.eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--seal);
  display: block;
  margin-bottom: 6px;
}

/* ---------- Paper entries ---------- */
.paper {
  border-top: 1px solid var(--hairline);
  padding: 26px 0;
}
.paper:last-of-type { border-bottom: 1px solid var(--hairline); }

.paper h3 {
  font-family: "Spectral", serif;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 6px;
}

.paper .meta {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  color: var(--slate);
  margin-bottom: 12px;
}

.paper .abstract { margin-bottom: 12px; }

.paper details summary {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--slate);
  cursor: pointer;
  margin-bottom: 8px;
}
.paper details summary:hover { color: var(--ink); }
.paper details ul { margin: 6px 0 10px 22px; font-size: 15.5px; }
.paper details li { margin-bottom: 3px; }

/* Featured JMP card on home */
/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--ink);
  padding: 10px 18px;
  border-radius: 3px;
  text-decoration: none;
  transition: background 0.15s ease;
}
.btn:hover { background: var(--seal); }
.btn.secondary {
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
}
.btn.secondary:hover { color: var(--seal); border-color: var(--seal); background: transparent; }

/* ---------- Teaching table ---------- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 8px;
  font-size: 16px;
}
th {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate);
  text-align: left;
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--ink);
  font-weight: 500;
}
td {
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
}

ul.plain { margin: 10px 0 0 22px; }
ul.plain li { margin-bottom: 6px; }

/* ---------- Contact block ---------- */
.contact-block {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
  font-size: 16px;
  color: var(--slate);
}
.contact-block strong { color: var(--ink); }

/* ---------- CV embed ---------- */
.cv-frame {
  width: 100%;
  height: 900px;
  border: 1px solid var(--hairline);
  margin-top: 20px;
}

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--hairline);
  padding: 20px 0 36px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12.5px;
  color: var(--slate);
}

/* ---------- Mobile ---------- */
@media (max-width: 560px) {
  h1 { font-size: 30px; }
  .header-inner { flex-direction: column; align-items: flex-start; }
  nav { gap: 16px; flex-wrap: wrap; }
  .cv-frame { height: 520px; }
}

/* ---------- Headshot ---------- */
.hero {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.hero-text { flex: 1; }

.hero-side {
  width: 235px;
  flex-shrink: 0;
}

.headshot {
  width: 100%;
  height: auto;
  margin-top: 10px;
  border-radius: 4px;
  border: 1px solid var(--hairline);
}

.hero-side .contact-block {
  margin-top: 16px;
  padding-top: 0;
  border-top: none;
  font-size: 14.5px;
  line-height: 1.5;
}

@media (max-width: 600px) {
  .hero { flex-direction: column; align-items: center; }
  .hero-side { width: 200px; }
  .headshot { margin-top: 0; }
}
