:root {
  --ink: #14201f;
  --muted: #526160;
  --soft: #f6faf8;
  --paper: #ffffff;
  --white: #ffffff;
  --teal: #0f766e;
  --teal-dark: #0b4e49;
  --coral: #c64f42;
  --amber: #d99a26;
  --line: rgba(20, 32, 31, 0.13);
  --line-strong: rgba(20, 32, 31, 0.22);
  --shadow: 0 18px 50px rgba(15, 35, 33, 0.12);
  --mono: "SFMono-Regular", "Cascadia Code", "Liberation Mono", Menlo, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
}

#network-canvas {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(15, 118, 110, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 56px 56px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 28px;
  align-items: center;
  min-height: 72px;
  padding: 14px clamp(20px, 4vw, 56px);
  border-bottom: 1px solid rgba(20, 32, 31, 0.12);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
}

.brand,
.nav-links,
.hero-actions,
.contact-links {
  display: flex;
  align-items: center;
}

.brand {
  font-weight: 760;
  text-decoration: none;
}

.brand-name {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 820;
}

.nav-links {
  justify-content: center;
  gap: clamp(14px, 3vw, 34px);
  font-size: 0.96rem;
  font-weight: 680;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
  padding: 4px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  font-size: 0.86rem;
}

.lang-switch a {
  padding: 6px 9px;
  color: var(--muted);
  text-decoration: none;
}

.lang-switch a[aria-current="page"] {
  background: var(--ink);
  color: var(--white);
  font-weight: 780;
}

.lang-switch a:hover {
  color: var(--teal-dark);
}

.nav-links a,
.button,
.publication a,
.project a,
.contact-links a,
.site-footer a {
  text-decoration: none;
}

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

.nav-links a:hover,
.site-footer a:hover {
  color: var(--teal-dark);
  text-decoration: underline;
}

.hero {
  position: relative;
  z-index: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(420px, 0.95fr) minmax(280px, 340px);
  gap: clamp(32px, 4vw, 52px);
  align-items: center;
  width: min(100% - 64px, 1120px);
  min-height: calc(100svh - 32px);
  margin: 0 auto;
  padding: clamp(54px, 7vw, 82px) 0 clamp(42px, 6vw, 72px);
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 680px;
}

.eyebrow,
.panel-label,
.pub-year,
.item-index {
  margin: 0 0 14px;
  color: var(--teal-dark);
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 18px;
  font-size: clamp(3rem, 6.3vw, 5.15rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero-line {
  max-width: 680px;
  margin-bottom: 22px;
  font-size: clamp(1.35rem, 2.35vw, 2rem);
  line-height: 1.12;
  font-weight: 760;
}

.bio-card {
  max-width: 640px;
  padding: 20px 22px;
  border-left: 4px solid var(--teal);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 36px rgba(15, 35, 33, 0.075);
}

.bio-card p {
  margin-bottom: 10px;
  color: #31413f;
  font-size: clamp(1rem, 1.35vw, 1.14rem);
  line-height: 1.72;
}

.bio-card p:last-child {
  margin-bottom: 0;
}

.bio-card .email-line {
  margin-top: 12px;
  font-weight: 760;
}

.bio-card .email-line a {
  color: var(--teal-dark);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.bio-card .email-line a:hover {
  text-decoration: underline;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-weight: 760;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.button.primary {
  background: var(--ink);
  color: var(--white);
}

.button.secondary {
  background: var(--teal);
  color: var(--white);
}

.button.ghost {
  background: rgba(255, 255, 255, 0.82);
}

.identity-panel {
  position: relative;
  z-index: 1;
  align-self: center;
  display: grid;
  align-content: center;
  gap: 18px;
}

.identity-panel img {
  width: min(100%, 300px);
  justify-self: center;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 18%;
  border: 1px solid rgba(20, 32, 31, 0.2);
  border-radius: 4px;
  box-shadow: 0 14px 38px rgba(15, 35, 33, 0.11);
}

.identity-text {
  width: min(100%, 420px);
  justify-self: center;
  padding-left: 0;
}

.keyword-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.keyword-grid span {
  padding: 7px 10px;
  border: 1px solid rgba(20, 32, 31, 0.18);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 700;
}

.section {
  padding: clamp(52px, 6vw, 78px) clamp(20px, 6vw, 90px);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(0, 1fr);
  gap: clamp(22px, 6vw, 80px);
  align-items: end;
  max-width: 1180px;
  margin: 0 auto 42px;
}

.section-heading.compact {
  display: block;
  max-width: 900px;
  margin-left: 0;
}

.section-heading h2,
.method-copy h2,
.contact-copy h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 3.4vw, 3.2rem);
  line-height: 1.04;
  letter-spacing: 0;
}

.section-heading p:not(.eyebrow),
.method-copy p:not(.eyebrow),
.contact-copy p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.08rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  max-width: 1180px;
  margin: 0 auto;
  background: var(--line);
  border: 1px solid var(--line);
}

.project {
  min-height: 214px;
  padding: clamp(22px, 3vw, 30px);
  background: var(--white);
}

.publication h3,
.project h3 {
  margin-bottom: 12px;
  font-size: clamp(1.14rem, 1.6vw, 1.42rem);
  line-height: 1.22;
}

.publication p,
.project p {
  color: var(--muted);
}

.methods-band,
.tools-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(360px, 1fr);
  gap: clamp(28px, 7vw, 90px);
  align-items: center;
}

.method-copy {
  max-width: 620px;
}

.code-window {
  overflow: hidden;
  margin: 0;
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid rgba(20, 32, 31, 0.24);
  background: #101817;
  color: #e7f7ee;
  box-shadow: var(--shadow);
  font-family: var(--mono);
  font-size: clamp(0.82rem, 1.5vw, 1rem);
  line-height: 1.75;
  white-space: pre-wrap;
}

.tools-layout {
  max-width: 1180px;
  margin: 0 auto 26px;
}

.publications-band {
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.publications-band .eyebrow,
.publications-band .pub-year {
  color: var(--teal-dark);
}

.publications-band .section-heading p {
  color: var(--muted);
}

.publication-heading {
  max-width: 1180px;
  margin: 0 auto 20px;
}

.publication-list {
  display: grid;
  gap: 1px;
  max-width: 1180px;
  margin: 0 auto;
  background: var(--line);
  border: 1px solid var(--line);
}

.publication {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px 22px;
  align-items: start;
  padding: 20px 24px;
  background: var(--white);
}

.publication h3,
.publication p:not(.pub-year) {
  grid-column: 2;
}

.publication p {
  margin-bottom: 0;
  color: var(--muted);
}

.journal {
  color: var(--ink);
  font-style: italic;
  font-weight: 560;
}

.publication a {
  color: var(--teal-dark);
  font-weight: 760;
  transition: text-decoration 160ms ease;
}

.publication a:hover {
  text-decoration: underline;
}

.current-work {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1fr);
  gap: 1px;
  max-width: 1180px;
  margin: 22px auto 0;
  background: var(--line);
  border: 1px solid var(--line);
}

.dissertation,
.working-papers article {
  padding: 22px 24px;
  background: var(--white);
}

.dissertation {
  border-top: 4px solid var(--teal);
}

.dissertation h3,
.working-papers h3 {
  margin-bottom: 12px;
  font-size: clamp(1.18rem, 1.8vw, 1.55rem);
  line-height: 1.22;
}

.dissertation p,
.working-papers p {
  color: var(--muted);
}

.working-papers {
  display: grid;
  gap: 1px;
  background: var(--line);
}

.code-band {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
}

.project {
  min-height: 230px;
}

.project a {
  color: var(--teal-dark);
  font-weight: 760;
  transition: text-decoration 160ms ease;
}

.project a:hover {
  text-decoration: underline;
}

.contact-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.72fr);
  gap: clamp(28px, 7vw, 90px);
  align-items: end;
  background: var(--white);
  border-top: 1px solid var(--line);
}

.contact-copy {
  max-width: 760px;
}

.contact-links {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.contact-links a {
  padding: 15px 16px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-weight: 760;
  overflow-wrap: anywhere;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px clamp(20px, 6vw, 90px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: var(--white);
}

.site-footer p {
  margin: 0;
}

/* === Entry animations === */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-copy .eyebrow,
.hero-copy h1,
.hero-copy .hero-line,
.hero-copy .bio-card,
.hero-copy .hero-actions,
.identity-panel {
  opacity: 0;
  animation: fadeInUp 0.7s ease forwards;
}

.hero-copy .eyebrow { animation-delay: 0.1s; }
.hero-copy h1 { animation-delay: 0.22s; }
.hero-copy .hero-line { animation-delay: 0.34s; }
.hero-copy .bio-card { animation-delay: 0.46s; }
.hero-copy .hero-actions { animation-delay: 0.58s; }
.identity-panel { animation-delay: 0.5s; }

/* === Project card hover === */
.project {
  transition: transform 220ms ease, box-shadow 220ms ease, border-left 220ms ease;
  border-left: 3px solid transparent;
}

.project:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(15, 118, 110, 0.12);
  border-left: 3px solid var(--teal);
}

/* === Photo decoration === */
.identity-panel {
  position: relative;
}

.identity-panel::before {
  content: "";
  position: absolute;
  top: -12px;
  right: -12px;
  width: 80px;
  height: 80px;
  background: var(--teal);
  opacity: 0.18;
  border-radius: 50%;
  z-index: 0;
}

.identity-panel::after {
  content: "";
  position: absolute;
  bottom: 40px;
  left: -16px;
  width: 48px;
  height: 48px;
  background: var(--coral);
  opacity: 0.14;
  border-radius: 4px;
  transform: rotate(12deg);
  z-index: 0;
}

.identity-panel img {
  position: relative;
  z-index: 1;
}

/* === Scroll reveal === */
.scroll-reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .site-header {
    grid-template-columns: 1fr auto;
    gap: 14px;
  }

  .nav-links {
    display: none;
  }

  .lang-switch {
    grid-column: 2;
  }

  .hero,
  .methods-band,
  .tools-layout,
  .contact-band,
  .section-heading {
    grid-template-columns: 1fr;
  }

  .identity-panel {
    align-content: start;
  }

  .identity-panel img {
    justify-self: start;
    width: min(78vw, 340px);
  }

  .project-grid,
  .current-work {
    grid-template-columns: 1fr;
  }

  .publication {
    grid-template-columns: 1fr;
  }

  .publication h3,
  .publication p:not(.pub-year) {
    grid-column: 1;
  }
}

@media (max-width: 560px) {
  .site-header {
    min-height: 62px;
    padding: 12px 16px;
  }

  .brand-name {
    font-size: 0.96rem;
  }

  .hero {
    min-height: auto;
    padding-top: 58px;
  }

  h1 {
    font-size: clamp(2.8rem, 14vw, 4rem);
  }

  .hero-line {
    font-size: clamp(1.35rem, 6vw, 1.8rem);
  }

  .button,
  .hero-actions {
    width: 100%;
  }

  .button {
    justify-content: center;
  }

  .site-footer {
    flex-direction: column;
  }
}

.github-note { margin-top: 16px; }
.github-note a { color: var(--teal-dark); font-weight: 760; text-decoration: underline; text-underline-offset: 3px; }
.project h3 a { color: inherit; text-decoration: none; }
.project h3 a:hover { color: var(--teal-dark); text-decoration: underline; text-underline-offset: 4px; }

