:root {
  color-scheme: light;
  --bg: #f8f7f3;
  --surface: #ffffff;
  --surface-soft: #f1f0ea;
  --text: #202124;
  --muted: #5f6368;
  --border: #dedbd2;
  --accent: #7a2e2e;
  --accent-strong: #642323;
  --accent-soft: #f3e7e4;
  --shadow: 0 16px 40px rgba(32, 33, 36, 0.08);
  --max-width: 1120px;
  --radius: 8px;
  --header-height: 70px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #151719;
  --surface: #1f2225;
  --surface-soft: #191c1f;
  --text: #edeae3;
  --muted: #b5b0a8;
  --border: #353a3f;
  --accent: #d69a8f;
  --accent-strong: #efb5aa;
  --accent-soft: #342724;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

body.nav-open {
  overflow: hidden;
}

a {
  color: var(--accent);
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
  text-underline-offset: 0.18em;
  transition: color 160ms ease, text-decoration-color 160ms ease, border-color 160ms ease, background 160ms ease;
}

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

a:focus-visible,
button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 3px;
}

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

h1,
h2,
h3 {
  line-height: 1.18;
  letter-spacing: 0;
}

h1 {
  margin-bottom: 16px;
  font-size: clamp(3rem, 8vw, 5.8rem);
  font-weight: 750;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 720;
}

h3 {
  margin-bottom: 12px;
  font-size: 1.2rem;
}

.container {
  width: min(100% - 40px, var(--max-width));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 100;
  transform: translateY(-160%);
  background: var(--surface);
  color: var(--text);
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.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;
  top: 0;
  z-index: 20;
  min-height: var(--header-height);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(14px);
}

.nav {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand {
  color: var(--text);
  font-weight: 720;
  text-decoration: none;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 600;
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--text);
}

.theme-toggle,
.nav-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.9rem;
}

.theme-icon {
  color: var(--accent);
  font-size: 1rem;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  margin-left: auto;
  padding: 0;
}

.nav-toggle span:not(.sr-only) {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: currentColor;
  border-radius: 999px;
}

.section {
  padding: 94px 0;
}

.section-alt {
  background: var(--surface-soft);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.hero {
  min-height: calc(100svh - var(--header-height));
  display: flex;
  align-items: center;
  padding: 82px 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  gap: 52px;
  align-items: center;
}

.eyebrow {
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 780;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tagline {
  margin-bottom: 24px;
  color: var(--muted);
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.35;
}

.hero-text {
  max-width: 780px;
  margin-bottom: 30px;
  font-size: 1.08rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 15px;
  font-size: 0.92rem;
  font-weight: 680;
  text-decoration: none;
}

.button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.button.primary:hover {
  background: var(--accent-strong);
  color: #ffffff;
}

.button.disabled {
  cursor: not-allowed;
  opacity: 0.64;
}

.hero-panel,
.text-card,
.project-card,
.publication-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 28px;
}

.hero-panel h2 {
  margin-bottom: 18px;
  font-size: 1.2rem;
}

.snapshot-list {
  margin: 0;
}

.snapshot-list div {
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

.snapshot-list div:first-child {
  padding-top: 0;
  border-top: 0;
}

.snapshot-list dt {
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 780;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.snapshot-list dd {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.math-note {
  margin-bottom: 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.95rem;
}

.overview {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.overview article {
  min-height: 210px;
  padding: 30px 26px;
  border-left: 1px solid var(--border);
}

.overview article:last-child {
  border-right: 1px solid var(--border);
}

.overview span {
  display: inline-block;
  margin-bottom: 34px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 760;
}

.overview h2 {
  margin-bottom: 10px;
  font-size: 1.15rem;
}

.overview p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.55;
}

.section-heading {
  max-width: 740px;
  margin-bottom: 34px;
}

.research-grid,
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.project-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.text-card,
.project-card {
  padding: 26px;
}

.text-card p,
.project-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.timeline-list {
  display: grid;
  gap: 16px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 28px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
}

.timeline-item:last-child {
  border-bottom: 1px solid var(--border);
}

.timeline-date {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 740;
}

.timeline-item h3 {
  margin-bottom: 8px;
}

.timeline-item p {
  max-width: 820px;
  margin-bottom: 0;
  color: var(--muted);
}

.card-meta {
  display: inline-flex;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 720;
}

.publication-list {
  display: grid;
  gap: 16px;
}

.publication-card {
  padding: 24px 26px;
}

.publication-card h3 {
  margin-bottom: 8px;
  font-size: 1.15rem;
}

.publication-authors,
.publication-venue {
  margin-bottom: 8px;
  color: var(--muted);
}

.publication-venue {
  font-size: 0.96rem;
}

.publication-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.publication-actions a {
  font-weight: 700;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.tag-list li {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 3px 9px;
  font-size: 0.78rem;
}

.more-link {
  margin: 24px 0 0;
  font-weight: 700;
}

.contact-section {
  padding-bottom: 104px;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.contact-grid a,
.contact-grid span {
  display: flex;
  align-items: center;
  min-height: 54px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px 16px;
}

.contact-grid span {
  color: var(--muted);
}

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

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 0;
  color: var(--muted);
  font-size: 0.92rem;
}

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

.footer-links {
  display: flex;
  gap: 16px;
}

@media (max-width: 900px) {
  :root {
    --header-height: 64px;
  }

  .container {
    width: min(100% - 32px, var(--max-width));
  }

  .nav {
    gap: 12px;
  }

  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: fixed;
    inset: var(--header-height) 0 auto 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
  }

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

  .nav-links a {
    padding: 16px;
    border-top: 1px solid var(--border);
    color: var(--text);
  }

  .theme-label {
    display: none;
  }

  .hero-grid,
  .overview-grid,
  .research-grid,
  .project-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding: 64px 0;
  }

  .section {
    padding: 68px 0;
  }

  .hero-grid {
    gap: 32px;
  }

  .overview article {
    min-height: auto;
    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .overview article:first-child {
    border-top: 0;
  }

  .overview article:last-child {
    border-right: 0;
  }

  .overview span {
    margin-bottom: 18px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

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

  h1 {
    font-size: 3rem;
  }

  .button-row {
    align-items: stretch;
  }

  .button {
    width: 100%;
  }

  .publication-card,
  .text-card,
  .project-card,
  .hero-panel {
    padding: 22px;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

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