/* ─────────────────────────────────────────────────────────────────
   tokens
   ───────────────────────────────────────────────────────────────── */
:root {
  --bg:        #FFF6EC;
  --bg-soft:   #FFEFDC;
  --ink:       #1B1530;
  --ink-soft:  #4A3F66;
  --muted:     #8A7FA8;
  --line:      #E7D9C4;

  --pink:      #FF6BAA;
  --lav:       #C7B8FF;
  --peach:     #FFC79A;
  --mint:      #A6E8C0;
  --cyan:      #79D6F0;
  --yellow:    #FFE066;

  --shadow-sm: 0 2px 0 var(--ink);
  --shadow-md: 0 4px 0 var(--ink);
  --shadow-lg: 0 6px 0 var(--ink);

  --radius:    14px;
  --radius-lg: 22px;

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --maxw: 760px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:       #15101F;
    --bg-soft:  #1E1830;
    --ink:      #F4EDFF;
    --ink-soft: #C9BEE6;
    --muted:    #9C90BD;
    --line:     #2F2745;
    --shadow-sm: 0 2px 0 #0a0712;
    --shadow-md: 0 4px 0 #0a0712;
    --shadow-lg: 0 6px 0 #0a0712;
  }
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  text-decoration-color: var(--pink);
  transition: color .15s ease, text-decoration-color .15s ease;
}
a:hover {
  color: var(--pink);
  text-decoration-color: var(--ink);
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.05;
}

em {
  font-style: italic;
  font-family: var(--font-display);
  font-weight: 700;
}

p { margin: 0 0 1em; }

/* ─────────────────────────────────────────────────────────────────
   decorative blobs
   ───────────────────────────────────────────────────────────────── */
.blobs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .55;
  animation: drift 22s ease-in-out infinite alternate;
}
.blob-1 { width: 520px; height: 520px; background: var(--lav);   top: -180px; left: -120px; }
.blob-2 { width: 460px; height: 460px; background: var(--peach); top:  40%;   right: -160px; animation-delay: -7s; }
.blob-3 { width: 380px; height: 380px; background: var(--mint);  bottom: -120px; left: 20%; animation-delay: -14s; }

@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, -30px) scale(1.08); }
}

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

/* ─────────────────────────────────────────────────────────────────
   top bar
   ───────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 28px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
  color: var(--ink);
  margin-right: auto;
}
.brand:hover { color: var(--pink); }

.topbar nav {
  display: flex;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
}
.topbar nav a {
  text-decoration: none;
  color: var(--ink-soft);
  padding: 4px 8px;
  border-radius: 8px;
}
.topbar nav a:hover {
  background: var(--lav);
  color: var(--ink);
}

.ghost-btn {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-soft);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .1s ease, box-shadow .1s ease;
}
.ghost-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.ghost-btn:active { transform: translateY(1px); box-shadow: none; }

@media (max-width: 640px) {
  .topbar { padding: 12px 16px; flex-wrap: wrap; }
  .topbar nav { order: 3; width: 100%; justify-content: flex-start; flex-wrap: wrap; gap: 8px; }
  .ghost-btn { margin-left: auto; }
}

/* ─────────────────────────────────────────────────────────────────
   layout
   ───────────────────────────────────────────────────────────────── */
main {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px 80px;
}

.section {
  padding: 70px 0 30px;
  border-top: 1px dashed var(--line);
}

.section h2 {
  font-size: clamp(28px, 4vw, 40px);
  margin: 0 0 28px;
}

.section-lede {
  color: var(--ink-soft);
  margin-top: -18px;
  margin-bottom: 28px;
  font-size: 15px;
}

/* ─────────────────────────────────────────────────────────────────
   hero
   ───────────────────────────────────────────────────────────────── */
.hero {
  padding: 90px 0 40px;
}

.kicker {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 18px;
  letter-spacing: 0.02em;
}
.hero h1 {
  font-size: clamp(40px, 7vw, 72px);
  margin: 0 0 24px;
  line-height: 1.02;
}

.hl {
  display: inline-block;
  padding: 0 .15em;
  border-radius: 6px;
  position: relative;
  white-space: nowrap;
}
.hl-pink { background: var(--pink);  color: #fff; transform: rotate(-1.5deg); }
.hl-mint { background: var(--mint);  color: var(--ink); transform: rotate(0.7deg); }

.lede {
  font-size: 19px;
  color: var(--ink-soft);
  max-width: 56ch;
  margin: 0 0 28px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 28px;
}
.badge {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 5px 11px;
  background: var(--bg-soft);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.badge-live::before { color: #00b870; }
.badge-live { background: #fffbe7; }
@media (prefers-color-scheme: dark) {
  .badge-live { background: #3a3320; }
}

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transition: transform .1s ease, box-shadow .1s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); color: var(--ink); }
.btn:active { transform: translateY(2px); box-shadow: none; }
.btn-primary { background: var(--pink); color: #fff; }
.btn-primary:hover { color: #fff; }
.btn-ghost   { background: var(--bg-soft); color: var(--ink); }

/* ─────────────────────────────────────────────────────────────────
   stickers (section labels)
   ───────────────────────────────────────────────────────────────── */
.sticker {
  display: inline-block;
  padding: 4px 14px 6px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  transform: rotate(-2deg);
  font-style: normal;
}
.s-lav   { background: var(--lav); }
.s-peach { background: var(--peach); }
.s-mint  { background: var(--mint); }
.s-cyan  { background: var(--cyan); }
.s-pink  { background: var(--pink); color: #fff; }

/* ─────────────────────────────────────────────────────────────────
   about
   ───────────────────────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 36px;
}
@media (max-width: 700px) {
  .about-grid { grid-template-columns: 1fr; }
}
.about-text p { font-size: 17px; }

.quick-facts {
  background: var(--bg-soft);
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  box-shadow: var(--shadow-md);
  align-self: start;
}
.quick-facts h3 {
  margin: 0 0 12px;
  font-size: 20px;
}
.quick-facts ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 14.5px;
}
.quick-facts li { padding: 4px 0; border-bottom: 1px dashed var(--line); }
.quick-facts li:last-child { border-bottom: 0; }
.quick-facts strong {
  display: inline-block;
  width: 60px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

/* ─────────────────────────────────────────────────────────────────
   publications
   ───────────────────────────────────────────────────────────────── */
/* publications — grouped by year, compact */
.pub-list {
  padding: 0;
  margin: 0;
  position: relative;
}
.pub-list::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 56px;
  bottom: 10px;
  width: 0;
  border-left: 2px dashed var(--line);
  z-index: 0;
}

.year-h {
  font-family: var(--font-display);
  font-size: 26px;
  margin: 22px 0 6px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  padding-left: 30px;
  position: relative;
}
.year-h:first-child { margin-top: 0; }

.pub {
  position: relative;
  padding: 7px 10px 7px 30px;
  border-radius: 10px;
  transition: background .15s ease, transform .15s ease;
}
.pub::before {
  content: '';
  position: absolute;
  left: 0;
  top: 17px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--pub-accent, var(--lav));
  border: 2px solid var(--ink);
  box-shadow: 0 0 0 3px var(--bg);
  z-index: 1;
  transition: transform .15s ease;
}
.pub:hover {
  background: color-mix(in srgb, var(--pub-accent, var(--lav)) 12%, transparent);
  transform: translateX(2px);
}
.pub:hover::before { transform: scale(1.18); }

.pub h4 {
  font-family: var(--font-display);
  font-size: 17px;
  margin: 0 0 2px;
  line-height: 1.3;
  font-weight: 700;
}
.pub h4 a { text-decoration: none; }
.pub h4 a:hover { color: var(--pub-accent, var(--pink)); }

.pub-authors {
  font-size: 13px;
  margin: 0 0 4px;
  color: var(--ink-soft);
  line-height: 1.45;
}
.pub-authors strong { color: var(--ink); }

.pub-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11.5px;
}
.pub-venue {
  color: var(--ink);
  opacity: .6;
}
.pub-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
}
.pub-tags a {
  padding: 1px 8px;
  background: color-mix(in srgb, var(--pub-accent, var(--lav)) 22%, transparent);
  border: 1px solid var(--ink);
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  font-size: 11.5px;
}
.pub-tags a:hover {
  background: var(--pub-accent, var(--yellow));
  color: var(--ink);
}

@media (max-width: 540px) {
  .pub-list::before { display: none; }
  .year-h { padding-left: 0; font-size: 22px; }
  .pub { grid-template-columns: 1fr; gap: 4px; padding: 6px 0; }
  .pub::before { display: none; }
}

.muted { color: var(--muted); font-size: 14px; }

/* ─────────────────────────────────────────────────────────────────
   cv
   ───────────────────────────────────────────────────────────────── */
.cv-block { margin-bottom: 32px; }
.cv-block h3 {
  font-size: 22px;
  margin: 0 0 12px;
  display: inline-block;
  border-bottom: 3px solid var(--mint);
  padding-bottom: 2px;
}
.cv-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.cv-list li {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.cv-list li:last-child { border-bottom: 0; }
.cv-when {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  padding-top: 2px;
}
.cv-what { font-size: 15.5px; }
.cv-note {
  grid-column: 2;
  font-size: 13.5px;
  color: var(--ink-soft);
}

@media (max-width: 540px) {
  .cv-list li { grid-template-columns: 1fr; gap: 2px; }
  .cv-note { grid-column: 1; }
}

/* ─────────────────────────────────────────────────────────────────
   misc grid
   ───────────────────────────────────────────────────────────────── */
.misc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (max-width: 600px) {
  .misc-grid { grid-template-columns: 1fr; }
}
.misc-card {
  background: var(--bg-soft);
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-md);
  transition: transform .15s ease, box-shadow .15s ease;
}
.misc-card:nth-child(1) { transform: rotate(-.6deg); }
.misc-card:nth-child(2) { transform: rotate(.5deg); }
.misc-card:nth-child(3) { transform: rotate(.4deg); }
.misc-card:nth-child(4) { transform: rotate(-.5deg); }
.misc-card:hover {
  transform: translateY(-3px) rotate(0deg);
  box-shadow: var(--shadow-lg);
}
.misc-card h3 { margin: 0 0 6px; font-size: 19px; }
.misc-card p { margin: 0; font-size: 15px; color: var(--ink-soft); }
.tiny-list { margin: 6px 0 0; padding-left: 18px; font-size: 14.5px; color: var(--ink-soft); }
.tiny-list li { padding: 1px 0; }

/* ─────────────────────────────────────────────────────────────────
   contact
   ───────────────────────────────────────────────────────────────── */
.section-contact .big-line {
  font-family: var(--font-display);
  font-size: clamp(22px, 3.4vw, 30px);
  margin: 6px 0 12px;
  line-height: 1.2;
}
.section-contact .big-line a {
  text-decoration-thickness: 2.5px;
  text-decoration-color: var(--pink);
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}
.social {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 8px 14px;
  background: var(--bg-soft);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--ink);
  transition: transform .1s ease, box-shadow .1s ease, background .1s ease;
}
.social:nth-child(odd):hover { background: var(--lav); }
.social:nth-child(even):hover { background: var(--peach); }
.social:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); color: var(--ink); }

/* ─────────────────────────────────────────────────────────────────
   footer
   ───────────────────────────────────────────────────────────────── */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 40px 20px 60px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
}

/* ─────────────────────────────────────────────────────────────────
   sparkles (rendered by script.js)
   ───────────────────────────────────────────────────────────────── */
.sparkle {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  font-size: 14px;
  animation: sparkle-pop 900ms ease-out forwards;
  will-change: transform, opacity;
}
@keyframes sparkle-pop {
  0%   { transform: translate(-50%, -50%) scale(.4) rotate(0);    opacity: 0; }
  20%  { transform: translate(-50%, -50%) scale(1)  rotate(20deg); opacity: 1; }
  100% { transform: translate(-50%, -90%) scale(.2) rotate(40deg); opacity: 0; }
}

/* selection */
::selection {
  background: var(--yellow);
  color: var(--ink);
}
