/* Natalie Hua, MD — one-page CV site */

/* ---------- Tokens ---------- */
:root {
  /* Raw OKLCH values (Lightness Chroma Hue) */
  --lch-plum:       40% 0.05 345;
  --lch-plum-deep:  29% 0.045 345;
  --lch-cream:      97% 0.013 75;
  --lch-rose:       78% 0.09 40;   /* soft rose-gold: decorative, on dark bg */
  --lch-rose-deep:  58% 0.115 30;  /* dusty rose: small accent text on light bg */
  --lch-ink:        29% 0.02 345;

  --color-plum:      oklch(var(--lch-plum));
  --color-plum-deep: oklch(var(--lch-plum-deep));
  --color-canvas:    oklch(var(--lch-cream));
  --color-rose:      oklch(var(--lch-rose));
  --color-rose-deep: oklch(var(--lch-rose-deep));
  --color-ink:       oklch(var(--lch-ink));
  --color-ink-soft:  oklch(var(--lch-ink) / 0.72);
  --color-cream-soft: oklch(var(--lch-cream) / 0.78);
  --color-rule:      color-mix(in oklch, var(--color-plum) 22%, transparent);
  --color-shade:     color-mix(in oklch, var(--color-plum) 6%, var(--color-canvas));

  --font-display: "Fraunces", "Georgia", serif;
  --font-body: "Atkinson Hyperlegible", "Verdana", sans-serif;

  /* 72ch measure keeps citation lists comfortable to read */
  --measure: 72ch;
  --section-pad: clamp(3.5rem, 8vw, 6.5rem);
  --gutter: clamp(1.25rem, 5vw, 4rem);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--color-ink);
  background: var(--color-canvas);
}

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  text-wrap: balance;
  margin: 0;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--color-plum); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }

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

html { scroll-behavior: smooth; }
section[id] { scroll-margin-top: 5rem; }

.skip-link {
  position: absolute;
  left: -200vw;
  top: 0;
  z-index: 100;
  padding: 0.75em 1.25em;
  background: var(--color-rose);
  color: var(--color-plum-deep);
  font-weight: 700;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* ---------- Sticky header ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 0.7rem var(--gutter);
  background: color-mix(in oklch, var(--color-plum-deep) 94%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid oklch(var(--lch-rose) / 0.35);
}

.brand {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-canvas);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.brand span { color: var(--color-rose); }

.site-head nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  align-items: center;
}
.site-head nav a {
  color: var(--color-cream-soft);
  text-decoration: none;
  font-size: 0.95rem;
}
.site-head nav a:hover { color: var(--color-rose); }
.site-head .nav-cta {
  color: var(--color-plum-deep);
  background: var(--color-rose);
  padding: 0.3em 0.9em;
  border-radius: 999px;
  font-weight: 700;
}
.site-head .nav-cta:hover { color: var(--color-plum-deep); filter: brightness(1.07); }

/* ---------- Eyebrow labels (with tiny pulse motif) ---------- */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75ch;
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-plum);
}
.eyebrow::before {
  content: "";
  width: 44px;
  height: 14px;
  flex: none;
  background-color: var(--color-rose);
  /* tiny EKG blip drawn as a mask, so it inherits the rose tint */
  -webkit-mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 14"><path d="M0 7h14l4-5 5 10 4-7 2 2h15" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>') center / contain no-repeat;
  mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 14"><path d="M0 7h14l4-5 5 10 4-7 2 2h15" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>') center / contain no-repeat;
}
.eyebrow--light { color: var(--color-rose); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background:
    radial-gradient(90rem 50rem at 110% -20%, oklch(48% 0.06 345 / 0.5), transparent 60%),
    radial-gradient(60rem 40rem at -20% 110%, oklch(72% 0.07 40 / 0.22), transparent 55%),
    var(--color-plum-deep);
  color: var(--color-canvas);
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  max-width: 75rem;
  margin-inline: auto;
  padding: clamp(3rem, 7vw, 6rem) var(--gutter) clamp(4rem, 8vw, 7rem);
}

.hero h1 {
  font-size: clamp(3.2rem, 8.5vw, 6rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--color-canvas);
  margin-bottom: 1.25rem;
}
.hero .degrees {
  display: inline-block;
  font-size: 0.32em;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--color-rose);
  vertical-align: 0.5em;
  border: 1.5px solid oklch(var(--lch-rose) / 0.6);
  border-radius: 999px;
  padding: 0.3em 0.9em;
  margin-left: 0.3em;
  text-wrap: nowrap;
}

.hero .lede {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  line-height: 1.6;
  max-width: 46ch;
  color: var(--color-cream-soft);
  margin-bottom: 2rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.btn {
  display: inline-block;
  padding: 0.7em 1.4em;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: filter 120ms ease, transform 120ms ease;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn--rose { background: var(--color-rose); color: var(--color-plum-deep); }
.btn--ghost {
  color: var(--color-canvas);
  border: 1.5px solid oklch(var(--lch-cream) / 0.45);
}

/* Arched portrait */
.hero-photo {
  position: relative;
  margin: 0;
  max-width: 25rem;
  justify-self: end;
}
.hero-photo img {
  border-radius: 999px 999px 18px 18px;
  box-shadow: 0 24px 60px oklch(10% 0.03 180 / 0.5);
}
/* Offset rose echo of the arch frame */
.hero-photo::before {
  content: "";
  position: absolute;
  inset: -14px 14px 14px -14px;
  border: 2px solid oklch(var(--lch-rose) / 0.65);
  border-radius: 999px 999px 18px 18px;
  pointer-events: none;
}

.photo-badge {
  position: absolute;
  left: -1.25rem;
  bottom: 1.75rem;
  background: var(--color-canvas);
  color: var(--color-plum-deep);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.3;
  padding: 0.7em 1.1em;
  border-radius: 10px;
  border-left: 5px solid var(--color-rose);
  box-shadow: 0 10px 26px oklch(10% 0.03 180 / 0.4);
  transform: rotate(-2.5deg);
}

/* Decorative EKG line along hero bottom / contact top */
.pulse-line {
  display: block;
  width: 100%;
  height: 48px;
  color: oklch(var(--lch-rose) / 0.55);
}
.pulse-line--top { transform: scaleY(-1); }

/* Staggered hero entrance */
@media (prefers-reduced-motion: no-preference) {
  .hero-text > *, .hero-photo {
    animation: rise-in 700ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
  .hero-text .eyebrow { animation-delay: 80ms; }
  .hero-text h1       { animation-delay: 160ms; }
  .hero-text .lede    { animation-delay: 260ms; }
  .hero-actions       { animation-delay: 360ms; }
  .hero-photo         { animation-delay: 200ms; }

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

  /* Scroll-triggered reveal for section content where supported */
  @supports (animation-timeline: view()) {
    .section-head, .timeline-entry, .edu-card, .research-card {
      animation: rise-in 1ms both;
      animation-timeline: view();
      animation-range: entry 0% entry 28%;
    }
  }
}

/* ---------- Sections ---------- */
.section {
  padding: var(--section-pad) var(--gutter);
  max-width: 75rem;
  margin-inline: auto;
}
.section--shaded {
  max-width: none;
  background: var(--color-shade);
}
/* Inner width for shaded full-bleed sections */
.section--shaded > * {
  max-width: calc(75rem - 2 * var(--gutter));
  margin-inline: auto;
}

.section-head { margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head h2 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  color: var(--color-plum-deep);
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.lead-paragraph {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  line-height: 1.5;
  color: var(--color-plum-deep);
}
.about-copy p + p { margin-top: 1em; }

.fact-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}
.fact-cards li {
  display: grid;
  gap: 0.2rem;
  padding: 1.1rem 1.3rem;
  background: white;
  border: 1px solid var(--color-rule);
  border-left: 5px solid var(--color-rose);
  border-radius: 10px;
}
.fact-cards strong {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--color-plum-deep);
}
.fact-cards span { color: var(--color-ink-soft); font-size: 0.95rem; }

/* ---------- Experience timeline ---------- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: clamp(2rem, 4vw, 3rem);
}

.timeline-entry {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 1.5rem;
  position: relative;
}

.entry-when {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-plum);
  line-height: 1.1;
}
.entry-when span {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--color-ink-soft);
}

.entry-body {
  background: white;
  border: 1px solid var(--color-rule);
  border-radius: 12px;
  padding: clamp(1.25rem, 3vw, 2rem);
  position: relative;
}
/* Rose pulse-dot connecting each card to its date */
.entry-body::before {
  content: "";
  position: absolute;
  left: -0.95rem;
  top: 1.9rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-rose);
  box-shadow: 0 0 0 4px oklch(var(--lch-rose) / 0.25);
}

.entry-body h3 { font-size: 1.45rem; color: var(--color-plum-deep); }
.entry-where {
  margin: 0.35rem 0 1rem;
  font-size: 0.95rem;
  color: var(--color-ink-soft);
}
.entry-body h4 {
  margin: 1.25rem 0 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-plum);
}
.entry-body ul { margin: 0; padding-left: 1.2em; }
.entry-body li { margin-bottom: 0.3em; }
.entry-body li::marker { color: var(--color-rose); }

.role-list { list-style: none; padding-left: 0 !important; }
.role-list li {
  padding: 0.45em 0;
  border-bottom: 1px dashed var(--color-rule);
}
.role-list li:last-child { border-bottom: 0; }
.role-list em { color: var(--color-ink-soft); font-style: normal; font-size: 0.9em; }

/* ---------- Education ---------- */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.25rem;
}
.edu-card {
  background: white;
  border: 1px solid var(--color-rule);
  border-top: 5px solid var(--color-plum);
  border-radius: 12px;
  padding: 1.5rem;
}
.edu-stage {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-rose-deep);
  margin-bottom: 0.5rem;
}
.edu-card h3 { font-size: 1.2rem; color: var(--color-plum-deep); margin-bottom: 0.75rem; }
.edu-card ul { margin: 0; padding-left: 1.2em; }
.edu-card li::marker { color: var(--color-rose); }

/* ---------- Credentials ---------- */
.cred-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.cred-subhead {
  font-size: 1.3rem;
  color: var(--color-plum-deep);
  margin-bottom: 1rem;
}

.badge-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.badge-list li {
  display: inline-flex;
  flex-direction: column;
  padding: 0.55em 1em;
  background: white;
  border: 1.5px solid var(--color-plum);
  border-radius: 10px;
  line-height: 1.35;
}
.badge-list strong { font-size: 0.95rem; color: var(--color-plum-deep); }
.badge-list span { font-size: 0.8rem; color: var(--color-ink-soft); }

.member-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.member-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  padding: 0.75em 0;
  border-bottom: 1px solid var(--color-rule);
}
.member-list strong { color: var(--color-plum-deep); }
.member-list span { color: var(--color-ink-soft); font-size: 0.9rem; white-space: nowrap; }

/* ---------- Scholarship ---------- */
.group-head {
  font-size: 1.5rem;
  color: var(--color-plum-deep);
  margin: clamp(2rem, 4vw, 3rem) 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--color-rose);
  display: inline-block;
}
.section-head + .group-head { margin-top: 0; }

.citation-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: var(--measure);
  counter-reset: citation;
}
.citation-list li {
  counter-increment: citation;
  position: relative;
  padding: 0.8em 0 0.8em 3rem;
  border-bottom: 1px solid var(--color-rule);
}
.citation-list li::before {
  content: counter(citation, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.95em;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-rose-deep);
}
.citation-list cite { font-style: italic; }
.citation-list strong { color: var(--color-plum-deep); }

.presentation-groups { display: grid; gap: 2rem; }
.venue-group h4 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-plum);
  margin: 0 0 0.25rem;
}
.venue-group h4 span {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-ink-soft);
  margin-left: 0.75ch;
}
.venue-group em { color: var(--color-ink-soft); font-size: 0.9em; }

.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1.25rem;
}
.research-card {
  background: var(--color-shade);
  border: 1px solid var(--color-rule);
  border-radius: 12px;
  padding: 1.5rem;
}
.research-card h4 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--color-plum-deep);
  margin: 0 0 0.5rem;
}
.research-card h4 span {
  display: block;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-ink-soft);
  margin-top: 0.3rem;
}
.research-card p { color: var(--color-ink-soft); }

/* ---------- Personal ---------- */
.personal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: clamp(2rem, 5vw, 4rem);
}
.chip-row {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.chip-row li {
  padding: 0.45em 1.1em;
  background: white;
  border: 1px solid var(--color-rule);
  border-radius: 999px;
  font-size: 0.95rem;
}

/* ---------- Contact ---------- */
.contact {
  background:
    radial-gradient(70rem 40rem at 50% 120%, oklch(72% 0.07 40 / 0.18), transparent 60%),
    var(--color-plum-deep);
  color: var(--color-canvas);
  text-align: center;
}
.contact-inner {
  max-width: 50rem;
  margin-inline: auto;
  padding: clamp(3rem, 7vw, 5.5rem) var(--gutter) clamp(4rem, 8vw, 6rem);
}
.contact .eyebrow { justify-content: center; }
.contact h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--color-canvas);
  margin-bottom: 1.5rem;
}
.contact-email {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3.5vw, 2rem);
  font-weight: 600;
  color: var(--color-rose);
  text-decoration-color: oklch(var(--lch-rose) / 0.5);
  margin-bottom: 2rem;
}
.contact-email:hover { filter: brightness(1.1); }

.social-row {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}
.social-row a {
  display: inline-block;
  padding: 0.5em 1.2em;
  border: 1.5px solid oklch(var(--lch-cream) / 0.4);
  border-radius: 999px;
  color: var(--color-cream-soft);
  text-decoration: none;
  font-size: 0.95rem;
  transition: border-color 120ms ease, color 120ms ease;
}
.social-row a:hover { border-color: var(--color-rose); color: var(--color-rose); }

/* ---------- Footer ---------- */
.site-foot {
  background: var(--color-plum-deep);
  color: oklch(var(--lch-cream) / 0.55);
  text-align: center;
  font-size: 0.85rem;
  padding: 1.5rem var(--gutter) 2rem;
  border-top: 1px solid oklch(var(--lch-cream) / 0.12);
}
.site-foot p { margin: 0.2em 0; }

/* ---------- Responsive ---------- */
@media (max-width: 56rem) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-photo { justify-self: center; max-width: 21rem; }
  .photo-badge { left: -0.5rem; }

  .about-grid,
  .cred-grid,
  .personal-grid { grid-template-columns: 1fr; }

  .timeline-entry { grid-template-columns: 1fr; gap: 0.5rem; }
  .entry-when span { display: inline; }
  .entry-body::before { display: none; }
}

@media (max-width: 36rem) {
  /* The wrapped two-row header would eat ~15% of a phone screen if sticky */
  .site-head { position: static; justify-content: center; text-align: center; }
  section[id] { scroll-margin-top: 1rem; }
  .site-head nav { justify-content: center; }
  .citation-list li { padding-left: 2.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:hover { transform: none; }
}

/* ---------- Print: the page doubles as a paper CV ---------- */
@media print {
  * { animation: none !important; }
  .site-head, .pulse-line, .hero-actions, .social-row { display: none; }
  .hero, .contact, .site-foot { background: none; color: black; }
  .hero h1, .contact h2 { color: black; }
  .section { padding: 1.5rem 0; }
  .entry-body, .edu-card, .fact-cards li { border-color: #999; box-shadow: none; }
}
