:root {
  --bg: #f4f1e8;
  --surface: #ebe7dc;
  --surface-strong: #dfd9cb;
  --ink: #17201d;
  --muted: #66706b;
  --line: #c9c6bb;
  --accent: #0f6d5b;
  --accent-bright: #c7f06d;
  --paper: #fbfaf6;
  --shadow: 0 24px 70px rgba(24, 32, 29, .10);
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: Iowan Old Style, Baskerville, "Times New Roman", serif;
}

[data-theme="dark"] {
  --bg: #121715;
  --surface: #1a211e;
  --surface-strong: #242c29;
  --ink: #eef2eb;
  --muted: #a2aca6;
  --line: #36403c;
  --accent: #80c9b7;
  --accent-bright: #c7f06d;
  --paper: #1d2421;
  --shadow: 0 24px 70px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.65;
  transition: background-color .25s ease, color .25s ease;
}

::selection { background: var(--accent-bright); color: #17201d; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  padding: .75rem 1rem;
  background: var(--ink);
  color: var(--bg);
}
.skip-link:focus { top: 1rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 76px;
  padding: 0 clamp(1.25rem, 4vw, 4.5rem);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
}

.wordmark {
  width: max-content;
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -.06em;
  text-decoration: none;
}
.wordmark-dot { color: var(--accent); }
.nav { display: flex; gap: 2rem; }
.nav a {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
}
.nav a:hover { color: var(--ink); }
.header-actions { display: flex; justify-content: flex-end; align-items: center; gap: .75rem; }

.theme-toggle {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.theme-toggle svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.moon-icon { display: none; }
[data-theme="dark"] .sun-icon { display: none; }
[data-theme="dark"] .moon-icon { display: block; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  min-height: 50px;
  padding: .75rem 1.25rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-decoration: none;
  transition: transform .2s ease, background-color .2s ease;
}
.button:hover { transform: translateY(-2px); background: var(--accent); border-color: var(--accent); color: var(--paper); }
.text-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  width: max-content;
  border-bottom: 1px solid currentColor;
  font-size: .87rem;
  font-weight: 700;
  text-decoration: none;
}
.text-link:hover { color: var(--accent); }
.inline-link { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); text-underline-offset: .2em; }
.inline-link:hover { color: var(--accent); text-decoration-color: currentColor; }

.hero { padding: clamp(5rem, 10vw, 9rem) clamp(1.25rem, 6vw, 7rem) 0; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .65fr); gap: clamp(3rem, 8vw, 9rem); align-items: end; max-width: 1400px; margin: 0 auto; }
.eyebrow, .section-number, .card-label, .footer-kicker {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: .5rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 16%, transparent);
}
.hero h1 {
  max-width: 920px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3.35rem, 7.2vw, 7.5rem);
  font-weight: 400;
  letter-spacing: -.065em;
  line-height: .91;
}
.hero h1 em { color: var(--accent); font-weight: 400; }
.hero-intro { max-width: 670px; margin: 2.25rem 0 0; color: var(--muted); font-size: clamp(1.05rem, 1.6vw, 1.35rem); }
.hero-intro strong { color: var(--ink); }
.hero-actions { display: flex; align-items: center; gap: 1.5rem; margin-top: 2.25rem; }
.hero-socials { display: flex; align-items: center; gap: .55rem; }
.social-icon { display: grid; width: 48px; height: 48px; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease; }
.social-icon svg { width: 18px; height: 18px; fill: currentColor; }
.social-icon:hover { border-color: var(--accent); background: var(--accent); color: var(--paper); transform: translateY(-2px); }
.icon-stroke { fill: none !important; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.now-card { padding: 1.5rem; border-top: 2px solid var(--ink); background: var(--surface); }
.card-label { margin-bottom: 1rem; }
.now-item { display: grid; grid-template-columns: 2rem 1fr; gap: 1rem; padding: 1.2rem 0; border-top: 1px solid var(--line); }
.now-index { color: var(--accent); font-family: var(--serif); font-style: italic; }
.now-item h2 { margin: 0; font-size: 1rem; line-height: 1.3; }
.now-item p { margin: .3rem 0 0; color: var(--muted); font-size: .86rem; }
.now-item div > span { color: var(--muted); font-size: .72rem; }

.hero-marquee {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  width: max-content;
  margin: clamp(4.5rem, 8vw, 8rem) 0 0;
  padding: 1rem 0;
  color: var(--muted);
  font-size: clamp(.68rem, 1vw, .85rem);
  font-weight: 800;
  letter-spacing: .14em;
  white-space: nowrap;
}
.hero-marquee i { color: var(--accent); font-style: normal; }

.section { max-width: 1400px; margin: 0 auto; padding: clamp(6rem, 10vw, 10rem) clamp(1.25rem, 6vw, 7rem); border-top: 1px solid var(--line); }
.section-heading { display: grid; grid-template-columns: minmax(180px, .6fr) 2fr; gap: 2rem; margin-bottom: clamp(3rem, 6vw, 6rem); }
.section-number { color: var(--accent); }
.section-heading h2 { max-width: 800px; margin: 0; font-family: var(--serif); font-size: clamp(2.5rem, 5vw, 5rem); font-weight: 400; letter-spacing: -.045em; line-height: 1; }

.about-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(3rem, 8vw, 9rem); }
.about-lead { margin: 0; font-family: var(--serif); font-size: clamp(1.65rem, 3vw, 2.65rem); line-height: 1.25; }
mark { padding: 0 .12em; background: linear-gradient(transparent 58%, var(--accent-bright) 58%); color: inherit; }
.about-body { max-width: 670px; color: var(--muted); font-size: 1.05rem; }
.about-body p:first-child { margin-top: 0; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: clamp(4rem, 8vw, 8rem); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts div { padding: 2rem 1.5rem; border-right: 1px solid var(--line); }
.facts div:last-child { border-right: 0; }
.facts strong { display: block; font-family: var(--serif); font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 400; line-height: 1; }
.facts span { display: block; margin-top: .75rem; color: var(--muted); font-size: .78rem; }

.research-section { max-width: none; background: #f4f1e8; color: #17201d; }
.research-section .section-heading { max-width: 1260px; margin-left: auto; margin-right: auto; }
.research-section .section-number { color: #17201d; }
.publication { display: grid; grid-template-columns: minmax(180px, .6fr) 2fr; gap: 2rem; max-width: 1260px; margin: 0 auto; padding-top: 2rem; border-top: 1px solid #c9c6bb; }
.publication-meta { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; color: #66706b; font-size: .78rem; }
.venue { display: inline-block; margin-bottom: 1rem; padding: .35rem .6rem; border: 1px solid #17201d; color: #17201d; font-weight: 800; letter-spacing: .08em; }
.publication-content { max-width: 850px; }
.publication-content h3 { margin: 0; font-family: var(--serif); font-size: clamp(2rem, 4vw, 3.8rem); font-weight: 400; letter-spacing: -.03em; line-height: 1.05; }
.publication-content p { max-width: 760px; color: #66706b; }
.publication-content .authors { margin-top: 2rem; color: #303a36; }
.author-self { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em; }
.authors sup, .author-notes sup { margin-left: .08em; color: #17201d; font-size: .68em; font-weight: 800; }
.publication-content .author-notes { display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; margin: -.45rem 0 1rem; color: #66706b; font-size: .72rem; }
.publication-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.35rem; }
.publication-action { display: inline-flex; align-items: center; gap: .7rem; min-height: 42px; padding: .55rem .9rem; border: 1px solid #17201d; color: #17201d; font-size: .73rem; font-weight: 800; letter-spacing: .04em; text-decoration: none; transition: background-color .2s ease, color .2s ease, transform .2s ease; }
.publication-action:hover { background: #17201d; color: #f4f1e8; transform: translateY(-2px); }

.timeline { position: relative; }
.timeline-item { display: grid; grid-template-columns: minmax(150px, .55fr) 36px 1.7fr; gap: 1rem; padding: 2.5rem 0; border-top: 1px solid var(--line); }
.timeline-date { color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .04em; }
.timeline-marker { position: relative; }
.timeline-marker::before { content: ""; position: absolute; top: .35rem; left: 50%; width: 9px; height: 9px; border: 2px solid var(--accent); border-radius: 50%; background: var(--bg); transform: translateX(-50%); }
.timeline-marker::after { content: ""; position: absolute; top: 1.25rem; bottom: -3rem; left: 50%; width: 1px; background: var(--line); }
.timeline-item:last-child .timeline-marker::after { display: none; }
.timeline-place { margin: 0 0 .5rem; color: var(--accent); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.timeline-content h3 { margin: 0; font-family: var(--serif); font-size: clamp(1.6rem, 3vw, 2.5rem); font-weight: 400; }
.timeline-content ul { max-width: 700px; margin: 1rem 0 0; padding-left: 1.2rem; color: var(--muted); }

.projects-section { max-width: none; padding-left: max(clamp(1.25rem, 6vw, 7rem), calc((100vw - 1400px) / 2 + 7rem)); padding-right: max(clamp(1.25rem, 6vw, 7rem), calc((100vw - 1400px) / 2 + 7rem)); background: var(--surface); }
.project-accordion-list { border-top: 1px solid var(--line); }
.project-accordion { border-bottom: 1px solid var(--line); }
.project-accordion summary { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr) 3rem; gap: 1.25rem; align-items: center; padding: clamp(1.4rem, 3vw, 2.3rem) 0; cursor: pointer; list-style: none; }
.project-accordion summary::-webkit-details-marker { display: none; }
.project-accordion summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.project-number { align-self: start; color: var(--accent); font-family: var(--serif); font-size: 1rem; font-style: italic; }
.project-summary-copy { display: grid; grid-template-columns: minmax(170px, .55fr) minmax(0, 1.45fr); gap: clamp(1rem, 3vw, 3rem); align-items: center; }
.project-topline { color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.project-title { max-width: 720px; font-family: var(--serif); font-size: clamp(1.45rem, 3vw, 2.5rem); letter-spacing: -.03em; line-height: 1.08; transition: color .2s ease; }
.project-accordion summary:hover .project-title, .project-accordion[open] .project-title { color: var(--accent); }
.project-toggle { position: relative; display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--line); border-radius: 50%; transition: border-color .2s ease, transform .25s ease; }
.project-toggle::before, .project-toggle::after { content: ""; position: absolute; width: 13px; height: 1px; background: currentColor; transition: transform .25s ease; }
.project-toggle::after { transform: rotate(90deg); }
.project-accordion[open] .project-toggle { border-color: var(--accent); transform: rotate(180deg); }
.project-accordion[open] .project-toggle::after { transform: rotate(0deg); }
.project-panel { padding: 0 4.25rem 2.5rem 4.75rem; animation: project-reveal .35s ease both; }
.project-panel > p { max-width: 720px; margin: 0; color: var(--muted); font-size: 1rem; }
.project-panel-footer { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; margin-top: 1.5rem; }
.project-tags { display: flex; flex-wrap: wrap; gap: .45rem; }
.project-tags span { padding: .3rem .65rem; border: 1px solid currentColor; border-radius: 99px; font-size: .68rem; }
.project-link { display: inline-flex; flex: 0 0 auto; align-items: center; gap: .4rem; border-bottom: 1px solid currentColor; font-size: .75rem; font-weight: 800; letter-spacing: .05em; text-decoration: none; text-transform: uppercase; }
.project-link:hover { color: var(--accent); }
.github-link-icon { flex: 0 0 auto; width: 14px; height: 14px; fill: currentColor; }
@keyframes project-reveal { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.compact-section { padding-bottom: clamp(6rem, 10vw, 10rem); }
.more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(3rem, 8vw, 8rem); }
.more-column > h3 { margin: 0 0 1.5rem; padding-bottom: .8rem; border-bottom: 2px solid var(--ink); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; }
.clean-list { margin: 0; padding: 0; list-style: none; }
.clean-list li { display: grid; grid-template-columns: 80px 1fr; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.clean-list li > span { color: var(--accent); font-size: .75rem; font-weight: 700; }
.clean-list p { margin: 0; color: var(--muted); font-size: .88rem; }
.clean-list strong { color: var(--ink); }
.more-column .skills-title { margin-top: 3rem; }
.skill-cloud { display: flex; flex-wrap: wrap; gap: .5rem; }
.skill-cloud span { padding: .48rem .85rem; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: .75rem; }

.footer { display: grid; grid-template-columns: 1.5fr 1fr; gap: 4rem; align-items: end; padding: clamp(4rem, 8vw, 8rem) clamp(1.25rem, 6vw, 7rem); background: var(--accent); color: #f8fbf6; }
.footer-kicker { color: #d6ebe4; }
.footer h2 { max-width: 760px; margin: 0; font-family: var(--serif); font-size: clamp(3rem, 7vw, 7rem); font-weight: 400; letter-spacing: -.06em; line-height: .9; }
.footer-contact { display: flex; flex-direction: column; align-items: flex-start; gap: .75rem; }
.footer-contact a { border-bottom: 1px solid currentColor; font-weight: 700; text-decoration: none; }
.footer-contact p { margin: 2rem 0 0; color: #d6ebe4; font-size: .72rem; }
.footer-socials { display: flex; flex-wrap: wrap; gap: .85rem 1.35rem; }
.footer-contact .footer-social { display: inline-flex; align-items: center; gap: .5rem; border-bottom: 0; }
.footer-social svg { width: 18px; height: 18px; fill: currentColor; }
.footer-social:hover span { border-bottom: 1px solid currentColor; }

.reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s ease, transform .7s ease; }
.reveal-delay { transition-delay: .15s; }
.reveal.is-visible { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .site-header { grid-template-columns: 1fr auto; }
  .nav { display: none; }
  .hero-grid, .about-grid, .more-grid, .footer { grid-template-columns: 1fr; }
  .hero-grid { align-items: start; }
  .now-card { max-width: 620px; }
  .section-heading { grid-template-columns: 1fr; gap: .5rem; }
  .publication { grid-template-columns: 1fr; gap: 2rem; }
  .publication-meta { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .venue { margin: 0 1rem 0 0; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .facts div:nth-child(2) { border-right: 0; }
  .facts div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .project-summary-copy { grid-template-columns: 1fr; gap: .35rem; }
}

@media (max-width: 560px) {
  .site-header { min-height: 64px; }
  .hero { padding-top: 4.5rem; }
  .hero h1 { font-size: clamp(3rem, 15vw, 4.6rem); }
  .hero-actions { align-items: flex-start; flex-direction: column; }
  .timeline-item { grid-template-columns: 16px 1fr; gap: .75rem; }
  .timeline-date { grid-column: 2; margin-bottom: -.4rem; }
  .timeline-marker { grid-column: 1; grid-row: 1 / 3; }
  .timeline-content { grid-column: 2; }
  .project-accordion summary { grid-template-columns: 2rem minmax(0, 1fr) 2.6rem; gap: .7rem; }
  .project-toggle { width: 36px; height: 36px; }
  .project-panel { padding: 0 0 2rem 2.7rem; }
  .project-panel-footer { align-items: flex-start; flex-direction: column; gap: 1.2rem; }
  .facts { grid-template-columns: 1fr; }
  .facts div { border-right: 0; border-bottom: 1px solid var(--line); }
  .facts div:last-child { border-bottom: 0; }
  .footer { gap: 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-header, .theme-toggle, .hero-marquee, .hero-actions { display: none !important; }
  :root { --bg: #fff; --ink: #111; --surface: #fff; --paper: #fff; --muted: #444; --line: #bbb; }
  .hero, .section { padding: 2rem 0; }
  .research-section { background: #fff; color: #111; }
  .research-section .section-number, .publication-content .text-link { color: #111; }
  .publication-content p, .publication-content .authors, .publication-meta { color: #333; }
  .project-accordion { break-inside: avoid; }
  .project-accordion .project-panel { display: block !important; }
  .footer { display: none; }
}
