/* ═══════════════════════════════════════════════════════════════
   jlzhao.pages.iu.edu · business professional
   Recruiter first door · resume / narrative hub.

   Restraint is the point: upright serif display, tight leading, a
   small type scale, near-neutral colour, and navy reserved for
   links, focus, and the one institutional accent IU expects.
   Nothing here should read as a brand ... it should read as a
   person who knows the register.

   1. tokens ....... slate / sage / navy roles, type, space
   2. reset + base . document, headings, prose measure, links
   3. shell ........ skip link, full-bleed sticky nav, wrap
   4. content ...... mast, rows, portrait, buttons
   5. footer
   6. states ....... focus, target, dark, reduced motion, print

   Self-contained: no local @import. The Google Fonts call is the
   only remote dependency and every family has a system fallback,
   so the page holds its register if the CDN is blocked.
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,400;8..60,500;8..60,600&family=Inter:wght@400;500;600&display=swap');

/* ── 1. tokens ─────────────────────────────────────────────── */

:root {
  /* palette · desaturated slate + dulled sage · professional paper */
  --slate: #5a7482;
  --slate-deep: #3d5561;
  --sage: #8a9a7a;
  --navy: #0c447c;
  --navy-deep: #093566;
  --bg: #fafaf8;
  --paper: #ffffff;
  --ink: #2b2f2c;
  --ink-soft: #4a504c;
  --rule: rgba(43, 47, 44, 0.14);
  --rule-strong: rgba(43, 47, 44, 0.28);

  /* roles */
  --surface: var(--bg);
  --surface-raised: var(--paper);
  --accent: var(--navy);
  --accent-quiet: var(--slate-deep);

  --font-display: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-body: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-sc: 'Songti SC', 'SimSun', 'Noto Serif SC', Georgia, serif;

  /* type · fluid only where it earns it. Body stays at the 16px
     floor on every screen; the display sizes breathe. */
  --step--1: 0.875rem; /* 14px captions · GOV.UK removed 14 from the body scale */
  --step-0: 1rem; /* 16px floor */
  --step-1: 1.125rem;
  --step-2: clamp(1.25rem, 1.16rem + 0.4vw, 1.375rem);
  --step-3: clamp(1.55rem, 1.3rem + 1.1vw, 1.95rem);

  /* space · 8px base, named by use */
  --space-3xs: 2px;
  --space-2xs: 4px;
  --space-xs: 8px;
  --space-s: 16px;
  --space-m: 24px;
  --space-l: 36px;
  --space-xl: 56px;
  --space-2xl: 80px;

  /* legacy aliases · older selectors in this file used numbers */
  --space-1: var(--space-xs);
  --space-2: var(--space-s);
  --space-3: var(--space-m);
  --space-4: var(--space-l);
  --space-5: var(--space-xl);

  --measure: 64ch;
  --measure-tight: 30ch;
  --shell: 720px;
  --gutter: clamp(20px, 4vw, 24px);

  --radius: 4px;
  --nav-h: 3.25rem;
  --tap: 44px;

  --layer-nav: 90;
  --layer-skip: 200;

  --dur: 150ms;
  --ease: ease;

  color-scheme: light;
}

/* ── 2. reset + base ───────────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 0.5rem);
  /* keep the centred column from jumping between short and long
     pages when the scrollbar appears */
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--surface);
  background-color: #fafaf8;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.5625; /* 25px on 16px · GOV.UK 5px rhythm */
  -webkit-font-smoothing: antialiased;
  /* Inter and Source Serif ship real weights; never synthesise */
  font-synthesis-weight: none;
  accent-color: var(--accent);
}

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

[lang|='zh'],
.photo-caption {
  font-family: var(--font-sc);
}

/* ── type: upright, no italics, quiet weight changes ───────── */

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-style: normal;
  color: var(--slate-deep);
  margin: 0 0 0.35em;
  line-height: 1.18;
  letter-spacing: -0.005em;
  /* a headline should break where the sense breaks */
  text-wrap: balance;
  max-inline-size: var(--measure-tight);
}

h1 {
  font-size: var(--step-3);
  font-weight: 600;
  letter-spacing: -0.014em; /* Source Serif sets loose at display size */
}

h2 {
  font-size: var(--step-2);
}

h3 {
  font-size: var(--step-1);
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0;
}

p {
  margin: 0 0 0.85em;
  color: var(--ink-soft);
  max-inline-size: var(--measure);
  /* no single-word last lines in the narrative sections */
  text-wrap: pretty;
}

p b,
p strong {
  color: var(--ink);
  font-weight: 600;
}

a {
  color: var(--accent);
  text-decoration-color: var(--sage);
  text-underline-offset: 2px;
  text-decoration-thickness: from-font;
  transition: color var(--dur) var(--ease);
}

a:hover {
  color: var(--slate-deep);
  text-decoration-color: currentColor;
}

.lede {
  max-inline-size: var(--measure);
}

.eyebrow {
  display: block;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5em;
}

/* dates and durations line up down the column */
time,
.row .label {
  font-variant-numeric: tabular-nums;
}

/* ── 3. shell ──────────────────────────────────────────────── */

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100%;
  z-index: var(--layer-skip);
  padding: 0.6rem 1rem;
  background: var(--navy);
  background-color: #0c447c;
  color: #ffffff;
  font-weight: 600;
  text-decoration: underline;
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
}

.skip-link:focus,
.skip-link:focus-visible {
  top: 0.5rem;
  color: #ffffff;
  outline: 3px solid #ffffff;
  outline-offset: 3px;
}

/* HARD RULE: solid opaque nav · never glass.
   The bar is full-bleed so nothing scrolls past it in the margins;
   the links stay on the 720px column via a centring pad. */
.site-jump,
.theme-iu-pages .site-jump {
  position: sticky;
  top: 0;
  z-index: var(--layer-nav);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0 var(--space-2xs);
  min-height: var(--nav-h);
  padding-block: max(0px, env(safe-area-inset-top, 0px)) 0;
  padding-inline: max(var(--space-s), calc((100% - var(--shell)) / 2 + var(--space-s)));
  background: #fafaf8;
  background-color: #fafaf8;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  opacity: 1;
  border-bottom: 1px solid var(--rule);
}

.site-jump a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 12px;
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--slate-deep);
  text-decoration: none;
  /* reserve the hover rule so the bar never reflows by a pixel */
  border-bottom: 2px solid transparent;
}

.site-jump a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.site-jump a[aria-current='page'] {
  color: var(--accent);
  border-bottom-color: var(--accent);
  pointer-events: none;
}

.wrap {
  max-inline-size: var(--shell);
  margin-inline: auto;
  padding: var(--space-l) var(--gutter) var(--space-2xl);
}

section {
  margin-top: var(--space-l);
}

#main {
  scroll-margin-top: calc(var(--nav-h) + 0.5rem);
}

.section-head {
  border-bottom: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  padding-bottom: var(--space-xs);
  padding-left: 12px;
  margin-bottom: var(--space-s);
}

.section-head span {
  display: block;
  font-size: var(--step--1);
  color: var(--ink-soft);
  margin-top: var(--space-3xs);
}

/* ── 4. content ────────────────────────────────────────────── */

/* rows: plain lines, not cards · resume register */

.rows {
  display: flex;
  flex-direction: column;
}

.row {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: var(--space-s);
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}

.row:last-child {
  border-bottom: none;
}

.row .label {
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--slate-deep);
  /* the label sits on the first line of the entry beside it */
  line-height: 1.5625;
}

.row p:last-child {
  margin-bottom: 0;
}

/* mast / hero: eyebrow · name · value · CTAs · quiet portrait */

.mast {
  padding-bottom: var(--space-2xs);
}

.mast-grid {
  display: grid;
  gap: var(--space-m);
  align-items: start;
}

@media (min-width: 560px) {
  .mast-grid {
    grid-template-columns: 1fr auto;
    gap: var(--space-l);
  }

  .portrait {
    justify-self: end;
  }
}

.credential-line {
  font-size: var(--step-0);
  color: var(--ink);
  border-left: 2px solid var(--accent);
  padding-left: 14px;
  margin: 14px 0 var(--space-s);
  max-inline-size: var(--measure);
}

.mast .lede {
  margin-bottom: 1.1em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 1.5rem;
}

.portrait {
  margin: 0;
  max-width: 148px;
}

/* photo: near-square, understated, no offset frame */

.photo {
  display: block;
  width: 100%;
  max-width: 148px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: 50% 18%;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  background: var(--surface-raised);
}

.photo-caption {
  margin-top: 10px;
  margin-bottom: 0.5rem;
  font-size: var(--step--1);
  color: var(--ink-soft);
  max-inline-size: none;
}

/* CTAs: solid contrast · never same-colour text on fill.
   a:hover colour must NOT bleed onto .btn (that was the suck bug). */

a.btn,
a.btn:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 9px 18px;
  min-height: var(--tap);
  background: var(--slate-deep);
  background-color: #3d5561;
  color: #ffffff;
  border: 1px solid var(--slate-deep);
  border-radius: var(--radius);
  font-size: var(--step--1);
  font-weight: 600;
  text-decoration: none;
  transition:
    background var(--dur) var(--ease),
    color var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}

a.btn:hover,
a.btn:focus-visible {
  background: var(--slate);
  background-color: #5a7482;
  border-color: var(--slate);
  color: #ffffff;
}

a.btn:active {
  /* 1px, not a bounce · this register does not animate */
  transform: translateY(1px);
}

a.btn-outline,
a.btn-outline:visited {
  background: var(--paper);
  background-color: #ffffff;
  color: var(--slate-deep);
  border: 1px solid var(--slate-deep);
}

a.btn-outline:hover,
a.btn-outline:focus-visible {
  background: var(--slate-deep);
  background-color: #3d5561;
  border-color: var(--slate-deep);
  color: #ffffff;
}

/* ── 5. footer: quiet, sign-off register, not a nav dump ───── */

footer {
  margin-top: var(--space-xl);
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}

footer .footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) 20px;
  margin-bottom: 12px;
}

footer .footer-links a {
  font-size: var(--step--1);
  color: var(--ink-soft);
  text-decoration: none;
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
}

footer .footer-links a:hover {
  color: var(--slate-deep);
  text-decoration: underline;
}

footer .footer-meta {
  font-size: var(--step--1);
  color: var(--ink-soft);
  max-inline-size: none;
}

.site-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-s);
  font-size: 0.85rem;
  padding-top: var(--space-2xs);
  margin-bottom: 12px;
}

.site-switcher a {
  color: var(--ink-soft);
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.site-switcher a:hover {
  color: var(--slate-deep);
  text-decoration: underline;
}

.site-switcher .current {
  font-weight: 700;
  color: var(--accent);
  pointer-events: none;
  opacity: 1;
}

/* ── 6. states ─────────────────────────────────────────────── */

a:focus-visible,
a.btn:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* a jump link should say where it landed */
section:target > .section-head,
section:target > h2 {
  outline: 3px solid var(--accent);
  outline-offset: 6px;
}

::selection {
  background: var(--accent);
  color: #ffffff;
}

/* ── narrow screens ────────────────────────────────────────── */

@media (max-width: 600px) {
  .row {
    grid-template-columns: 1fr;
    gap: var(--space-3xs);
    padding: 12px 0;
  }

  footer .footer-links {
    flex-direction: column;
    gap: var(--space-2xs);
  }

  .wrap {
    padding: 28px var(--gutter) 64px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions a.btn {
    width: 100%;
  }

  .site-jump {
    justify-content: flex-start;
  }
}

/* ── reduced motion ────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
    animation: none !important;
  }
}

/* ── print ─────────────────────────────────────────────────── */

/* Recruiters print this page. Give them the narrative and the
   links spelled out, not the chrome. */
@media print {
  .site-jump,
  .skip-link,
  .hero-actions,
  .site-switcher,
  footer .footer-links {
    display: none;
  }

  body {
    background: #ffffff;
    color: #000000;
    font-size: 10.5pt;
    line-height: 1.4;
  }

  .wrap {
    max-inline-size: none;
    padding: 0;
  }

  a {
    color: #000000;
    text-decoration: underline;
  }

  main a[href^='http']::after,
  main a[href^='mailto']::after {
    content: ' (' attr(href) ')';
    font-size: 8.5pt;
    word-break: break-all;
  }

  h1,
  h2,
  h3 {
    color: #000000;
    break-after: avoid;
  }

  .row,
  .portrait,
  .credential-line {
    break-inside: avoid;
  }

  section {
    margin-top: 18pt;
  }
}
