/* ============================================
   TOKENS
   ============================================ */
:root {
  --bg: #FAF9F5;
  --surface: #F1EEE5;
  --ink: #1E2A32;
  --ink-soft: #5C6B72;
  --ink-faint: #8A96A0;
  --accent: #2D6E63;
  --accent-soft: #E4EEEB;
  --accent-2: #7A3B47;
  --line: #DEDACD;
  --shadow: 0 1px 2px rgba(30, 42, 50, 0.04);

  --font-display: 'Spectral', Georgia, serif;
  --font-body: 'Public Sans', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #12161A;
  --surface: #1A2025;
  --ink: #E9ECEC;
  --ink-soft: #93A2A8;
  --ink-faint: #5E6C72;
  --accent: #5CB3A3;
  --accent-soft: #1C2C29;
  --accent-2: #C98A96;
  --line: #262E33;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================
   RESET & BASE
   ============================================ */
* { 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;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

.wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 32px;
}

.wrap-narrow {
  max-width: 760px;
}

a {
  color: var(--accent);
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}

a:hover { text-decoration-color: var(--accent); }

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

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0;
}

/* ============================================
   THEME TOGGLE
   ============================================ */
.theme-toggle {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px 6px 6px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  box-shadow: var(--shadow);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.theme-toggle-track {
  position: relative;
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: var(--line);
  display: inline-block;
  transition: background 0.3s ease;
}

.theme-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform 0.3s ease;
}

html[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(16px);
}

/* ============================================
   HERO
   ============================================ */
.hero {
  padding: 100px 0 48px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 18px;
}

.name {
  font-size: clamp(48px, 9vw, 84px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
}

.hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 28px;
}

.hero-photo {
  width: 208px;
  height: 208px;
  object-fit: cover;
  border-radius: 28px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  flex-shrink: 0;
  margin-left: 160px;
  margin-top: 110px;
}

.tagline {
  font-size: 19px;
  color: var(--ink-soft);
  max-width: 560px;
  margin: -110px 0 36px;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 28px;
  margin-bottom: 28px;
}

.hero-links a {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
}

.hero-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.contact-row {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  padding: 0;
  margin: 0;
  font-size: 14px;
}

.contact-row a {
  text-decoration: none;
  color: var(--ink-soft);
}

.contact-row a:hover { color: var(--accent); }

/* ============================================
   WAVEFORM DIVIDER (signature element)
   ============================================ */
.waveform-divider {
  width: 100%;
  overflow: hidden;
  line-height: 0;
}

.waveform-divider svg {
  width: 100%;
  height: 60px;
  display: block;
}

.waveform-divider--small svg { height: 32px; }

.waveform-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.55;
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: draw-line 1.6s ease forwards;
}

@keyframes draw-line {
  to { stroke-dashoffset: 0; }
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
  padding: 64px 0;
}

.section-title {
  font-size: 32px;
  font-weight: 500;
  margin-bottom: 28px;
  letter-spacing: -0.01em;
}

.section-intro {
  color: var(--ink-soft);
  margin-top: -14px;
  margin-bottom: 32px;
  max-width: 60ch;
}

/* ============================================
   OBJECTIVE
   ============================================ */
.objective-body {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 24px;
  background: var(--surface);
}

.objective-body p {
  margin: 0 0 16px;
  color: var(--ink-soft);
}

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

.placeholder-note {
  color: var(--ink-faint);
  font-style: italic;
  margin: 0;
}

/* ============================================
   TIMELINE
   ============================================ */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--line);
}

.timeline-item {
  position: relative;
  padding: 0 0 40px 32px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.03em;
}

.timeline-body h3 {
  font-size: 20px;
  font-weight: 500;
  margin: 6px 0 2px;
}

.timeline-org {
  color: var(--accent);
  font-size: 14px;
  margin: 0 0 10px;
}

.timeline-body p:last-child {
  color: var(--ink-soft);
  margin: 0;
  font-size: 15px;
}

/* ============================================
   PUBLICATIONS
   ============================================ */
.pub-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.pub-item {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  position: relative;
}

.pub-item:first-child:not(.pub-item--featured) { padding-top: 0; }

.pub-item--featured {
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 32px 24px 22px;
  margin-bottom: 8px;
}

.pub-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.pub-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
}

.pub-tag--first {
  color: var(--accent);
  border-color: var(--accent);
}

.pub-title {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.35;
  margin: 0 0 8px;
}

.pub-authors {
  font-size: 14.5px;
  color: var(--ink-soft);
  margin: 0 0 6px;
  line-height: 1.6;
}

.pub-authors strong {
  color: var(--ink);
  font-weight: 700;
}

.pub-venue {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-faint);
  margin: 0;
}

.pub-venue a { color: var(--accent); }

/* Hoverable "why I liked this paper" callouts on select entries */
.pub-item--annotated { cursor: default; }

.pub-item--annotated .pub-title {
  display: inline;
  cursor: pointer;
  text-decoration: underline dotted var(--ink-faint);
  text-underline-offset: 4px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.pub-item--annotated:hover .pub-title {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.pub-callout {
  position: absolute;
  top: 0;
  width: 240px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(30, 42, 50, 0.08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  pointer-events: none;
  z-index: 10;
}

.pub-callout p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  font-style: italic;
}

.pub-callout--right { left: calc(100% + 32px); }
.pub-callout--left { right: calc(100% + 32px); }

.pub-item--annotated:hover .pub-callout {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Only show callouts when there's room beside the text column */
@media (max-width: 1280px) {
  .pub-callout { display: none; }
}

/* ============================================
   PROJECTS
   ============================================ */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.project-item {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.project-item h3 {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 10px;
}

.project-item p {
  color: var(--ink-soft);
  margin: 0 0 12px;
  font-size: 15px;
}

.project-link {
  font-family: var(--font-mono);
  font-size: 13px;
  text-decoration: none;
}

/* ============================================
   SERVICE
   ============================================ */
.service-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.service-list h3 {
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 4px;
}

.service-org {
  color: var(--ink-soft);
  font-size: 14.5px;
  margin: 0;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  padding: 56px 0 80px;
  border-top: 1px solid var(--line);
  margin-top: 24px;
}

.footer-name {
  font-family: var(--font-display);
  font-size: 20px;
  margin: 0 0 16px;
}

.footer .contact-row {
  margin-bottom: 24px;
}

.back-to-top {
  font-family: var(--font-mono);
  font-size: 13px;
  text-decoration: none;
  color: var(--ink-faint);
}

.back-to-top:hover { color: var(--accent); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 640px) {
  .wrap { padding: 0 20px; }
  .hero { padding: 84px 0 40px; }
  .theme-toggle { top: 16px; right: 16px; }
  .section { padding: 48px 0; }
  .pub-item--featured { padding: 18px; }
  .hero-top { flex-direction: column-reverse; align-items: flex-start; gap: 20px; }
  .hero-photo { width: 128px; height: 128px; margin-left: 0; margin-top: 0; }
  .tagline { margin-top: 0; }
}
