@import url("https://fonts.googleapis.com/css2?family=Inter:wght@100..900&family=Source+Serif+4:wght@400;500;600;700&display=swap");

:root {
  --paper: #ffffff;
  --surface: #ffffff;
  --ink: #1f4f7a;
  --muted: #4b5563;
  --line: #dce2e9;
  --accent: #2f7d32;
  --accent-deep: #2f5f9f;
  --accent-soft: #e5f3e3;
  --warm: #2f7d32;
  --max-width: 792px;
  --shadow: 0 18px 48px rgba(31, 79, 122, 0.08);
  --header: rgba(255, 255, 255, 0.96);
  --focus: #287d59;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

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

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

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
  border-radius: 3px;
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
.site-name {
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 500;
}

h1 {
  max-width: 820px;
  margin-bottom: 1.2rem;
  font-size: clamp(2.4rem, 5.2vw, 4.65rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

h3 {
  margin-bottom: 0.45rem;
  font-size: 1.27rem;
  line-height: 1.35;
}

.container {
  width: min(calc(100% - 2.5rem), var(--max-width));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.9rem;
  background: var(--ink);
  color: #fff;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: var(--header);
  backdrop-filter: blur(14px);
}

.header-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-name {
  color: var(--ink);
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: clamp(0.85rem, 2vw, 1.7rem);
}

.site-nav a {
  color: var(--muted);
  font-size: 0.91rem;
  font-weight: 650;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.site-nav a:hover,
.site-nav a[aria-current="location"] {
  color: var(--accent);
}

.menu-button {
  display: none;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.menu-button span:not(.sr-only) {
  display: block;
  width: 100%;
  height: 2px;
  margin: 5px 0;
  background: var(--ink);
  transition: transform 160ms ease, opacity 160ms ease;
}

.hero {
  display: flow-root;
  padding-top: 2rem;
  padding-bottom: clamp(0.75rem, 1.5vw, 1.25rem);
  border-bottom: 0;
}

.portrait-wrap {
  position: relative;
  float: left;
  width: 210px;
  max-width: 100%;
  aspect-ratio: 4 / 5;
  margin: 0.55rem 2rem 1rem 0;
}

.portrait,
.portrait-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(31, 79, 122, 0.08);
  box-shadow: var(--shadow);
}

.portrait {
  z-index: 2;
  object-fit: cover;
  object-position: center;
  background: var(--surface);
}

.portrait-fallback {
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-family: inherit;
  font-size: clamp(2.5rem, 8vw, 5rem);
}

.eyebrow,
.section-number,
.project-meta,
.timeline-date,
.news-list time {
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow {
  margin-bottom: 1rem;
  color: var(--warm);
}

.lead {
  max-width: 820px;
  margin-bottom: 1.25rem;
  color: var(--ink);
  font-family: inherit;
  font-size: clamp(1.27rem, 2.2vw, 1.65rem);
  line-height: 1.5;
}

.hero-copy > p:not(.eyebrow):not(.lead) {
  max-width: none;
  color: var(--muted);
}

.intro-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  margin-bottom: 1rem;
}

.intro-heading h1 {
  margin-bottom: 0;
}

.contact-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
}

.contact-links a {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  text-decoration: none;
}

.contact-links svg {
  display: block;
  width: 22px;
  height: 22px;
}

.contact-links a,
.project-links a {
  font-size: 0.93rem;
  font-weight: 700;
}

/* Full-width content below the About section */
.content-grid {
  display: block;
  padding-top: 0;
}

.main-column {
  width: 100%;
  min-width: 0;
}

.section {
  padding-bottom: clamp(5rem, 8vw, 7rem);
}

.section:last-child {
  padding-bottom: 0;
}

.section-heading {
  display: grid;
  grid-template-columns: 1.5rem 1fr;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.1rem;
}

.section-heading h2,
.section-heading p {
  margin-bottom: 0;
}

.section-number {
  color: var(--warm);
}

.section-icon {
  display: block;
  width: 1.5rem;
  height: 1.5rem;
  color: var(--warm);
}

#projects {
  margin-inline: 0;
}

#projects #projects-title {
  font-size: 1.55rem;
  line-height: 1.2;
}

/* Projects: simple editorial list, no cards */
.project-list {
  width: 100%;
  border-top: 1px solid var(--line);
}

.project {
  padding: 1.15rem 0 1.25rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transition: none;
}

.project:hover {
  border-color: var(--line);
  box-shadow: none;
  transform: none;
}

.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 2rem;
  margin-bottom: 0.4rem;
  color: var(--warm);
}

.project h3 {
  max-width: 1000px;
  margin-bottom: 0.35rem;
  font-size: 1.2rem;
}

.project-season {
  font-family: Inter, ui-sans-serif, sans-serif;
  display: inline-block;
  margin-left: 0.4rem;
  color: var(--accent);
  font-size: 0.8rem;
  font-style: italic;
  font-weight: 400;
  white-space: nowrap;
}

.project-title-link {
  position: relative;
  z-index: 10;
  display: inline;
  width: fit-content;
  max-width: 100%;
  color: var(--ink);
  cursor: pointer;
  pointer-events: auto !important;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.project-title-link:hover,
.project-title-link:focus-visible {
  color: var(--accent);
  text-decoration-color: currentColor;
}

/* Project detail pages */
.project-page {
  padding-block: clamp(2rem, 4vw, 3.5rem);
}

.project-detail {
  max-width: var(--max-width);
}

.project-back {
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

.project-detail-meta {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 0.8rem;
  color: var(--warm);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.project-detail h1 {
  max-width: 820px;
  margin-bottom: 1.25rem;
  font-size: clamp(1.85rem, 3.4vw, 2.9rem);
  line-height: 1.12;
}

.project-detail-lead {
  max-width: 820px;
  color: var(--ink);
  font-family: inherit;
  font-size: clamp(1.2rem, 2.1vw, 1.55rem);
  line-height: 1.5;
}

.project-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.project-detail-tags li {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.project-detail-tags li:not(:last-child)::after {
  content: "·";
  margin-inline: 0.5rem;
  color: #a4a293;
}

.project-detail-link {
  margin-top: 1.25rem;
}

.project-detail-section {
  max-width: 820px;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.project-detail-section h2 {
  font-size: 1.5rem;
}

.project-detail-section p {
  color: var(--muted);
}

.project p {
  max-width: 1000px;
  margin-bottom: 0.4rem;
  color: var(--muted);
}

.project-links {
  margin: 0.4rem 0 0;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0.45rem 0 0;
  padding: 0;
  list-style: none;
}

.tags li {
  padding: 0;
  border-radius: 0;
  background: none;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.tags li:not(:last-child)::after {
  content: "·";
  margin-inline: 0.5rem;
  color: #a4a293;
}

/* Background */
.timeline {
  width: 100%;
  border-top: 1px solid var(--line);
}

.timeline-item {
  display: grid;
  grid-template-columns: minmax(120px, 0.28fr) minmax(0, 1fr);
  gap: 2rem;
  padding: 1.8rem 0;
  border-bottom: 1px solid var(--line);
}

.timeline-date {
  margin-bottom: 0;
  color: var(--warm);
}

.timeline-item h3 {
  margin-bottom: 0.25rem;
}

.timeline-item div p {
  margin-bottom: 0;
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.footer-inner {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.footer-inner p {
  margin-bottom: 0;
}

@media (max-width: 850px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .side-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
  }

  .side-section + .side-section {
    margin-top: 0;
  }

  .connect-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  body {
    font-size: 16px;
  }

  .menu-button {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 1px);
    right: 0;
    left: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.45rem 1.25rem 1rem;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
    box-shadow: 0 18px 30px rgba(31, 79, 122, 0.08);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--line);
  }

  .site-nav a:last-child {
    border-bottom: 0;
  }

  .menu-button[aria-expanded="true"] span:nth-of-type(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .menu-button[aria-expanded="true"] span:nth-of-type(2) {
    opacity: 0;
  }

  .menu-button[aria-expanded="true"] span:nth-of-type(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .portrait-wrap {
    float: none;
    margin: 0.55rem 0 1.5rem;
  }

  .research-item {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

  .side-column {
    grid-template-columns: 1fr;
  }

  .connect-card {
    grid-column: auto;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 0.3rem;
    padding-block: 1.5rem;
  }
}

@media (max-width: 480px) {
  .container {
    width: min(calc(100% - 1.5rem), var(--max-width));
  }

  .section-heading {
    grid-template-columns: 1.5rem 1fr;
    gap: 0.5rem;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .project-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.1rem;
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

.tags,
.project-detail-tags,
.project-meta,
.project-detail-meta {
  display: none;
}

:root[data-theme="dark"] {
  --paper: #0b1730;
  --surface: #142542;
  --ink: #e6edf7;
  --muted: #b9c7dc;
  --line: #30415d;
  --accent: #9acb70;
  --accent-deep: #b8df94;
  --accent-soft: #23352a;
  --warm: #9acb70;
  --header: rgba(11, 23, 48, 0.96);
  --focus: #9fc7ff;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.2);
  color-scheme: dark;
}

.theme-toggle {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}

.theme-toggle:hover {
  background: var(--accent-soft);
}

.theme-toggle svg {
  width: 22px;
  height: 22px;
}

.theme-toggle .theme-sun,
[data-theme="dark"] .theme-toggle .theme-moon {
  display: none;
}

[data-theme="dark"] .theme-toggle .theme-sun {
  display: block;
}

.skip-link {
  color: var(--paper);
}

@media (max-width: 700px) {
  .menu-button {
    margin-left: auto;
    flex-shrink: 0;
  }

  .header-inner {
    gap: 0.5rem;
  }
}

.hero-copy h1 {
  margin-bottom: 0;
  font-size: clamp(1.9rem, 3.6vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.hero-copy .research-interests {
  font-weight: 700;
}

.project:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  align-items: start;
  gap: 1.5rem;
}

.project-copy {
  min-width: 0;
}

.project-image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
  font-size: 0.7rem;
}

.project-image-placeholder svg {
  width: 28px;
  height: 28px;
  color: var(--accent);
}

@media (max-width: 600px) {
  .project:not([hidden]) {
    grid-template-columns: minmax(0, 1fr) 88px;
    gap: 0.75rem;
  }

  .project-image-placeholder {
    aspect-ratio: 1;
    padding: 0.4rem;
    font-size: 0.6rem;
  }
}

.project-image-link {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: center;
  text-decoration: none;
  font-size: 0.65rem;
  cursor: zoom-in;
}

.project-image-link img {
  width: 100%;
  height: auto;
  background: #fff;
}

.project-image-link span {
  display: block;
  padding: 0.35rem;
}

.image-viewer {
  width: min(1100px, calc(100% - 2rem));
  max-width: none;
  max-height: calc(100dvh - 2rem);
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
}

.image-viewer::backdrop {
  background: rgba(0, 0, 0, 0.75);
}

.image-viewer form {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.5rem;
}

.image-viewer-close {
  min-height: 44px;
  padding: 0.4rem 1rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.image-viewer > img {
  width: 100%;
  height: auto;
  max-height: calc(100dvh - 7rem);
  object-fit: contain;
}

body:has(.image-viewer[open]) {
  overflow: hidden;
}

#projects {
  padding-bottom: 2.5rem;
}

#background-title {
  font-size: 1.55rem;
  line-height: 1.2;
}

#background .timeline-item {
  padding-block: 1rem;
  gap: 0.5rem 1.5rem;
}

#background .timeline-item h3 {
  font-size: 1.2rem;
}

#background .timeline-date {
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
}

.degree-note {
  margin-left: 0.4rem;
  color: var(--accent);
  font-size: 0.8rem;
  font-style: italic;
  white-space: nowrap;
}
