:root {
  color-scheme: dark;
  --bg: #081013;
  --bg-elevated: #0d181c;
  --bg-soft: #122126;
  --text: #edf7f6;
  --text-muted: #9bb0b2;
  --text-soft: #cad8d6;
  --line: rgba(191, 229, 225, 0.14);
  --line-strong: rgba(124, 221, 213, 0.34);
  --accent: #69e2d0;
  --accent-2: #b8f47a;
  --accent-3: #f2c66d;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --radius: 8px;
  --max-width: 1180px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f7faf8;
  --bg-elevated: #ffffff;
  --bg-soft: #edf4f2;
  --text: #102024;
  --text-muted: #5c6e70;
  --text-soft: #314548;
  --line: rgba(20, 56, 61, 0.14);
  --line-strong: rgba(0, 132, 118, 0.34);
  --accent: #007f73;
  --accent-2: #5d8f00;
  --accent-3: #9f6500;
  --shadow: 0 24px 70px rgba(36, 55, 58, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 78% 4%, rgba(105, 226, 208, 0.16), transparent 28rem),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    var(--bg);
  background-size: auto, 72px 72px, 72px 72px, auto;
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  letter-spacing: 0;
}

a {
  color: inherit;
}

img,
svg {
  display: block;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 100;
  transform: translateY(-160%);
  border-radius: 6px;
  background: var(--text);
  color: var(--bg);
  padding: 0.65rem 0.85rem;
  font-weight: 800;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
}

.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(100% - 2rem, var(--max-width));
  margin: 0 auto;
  min-height: 72px;
}

.brand,
.nav-links,
.theme-toggle,
.button {
  display: inline-flex;
  align-items: center;
}

.brand {
  gap: 0.65rem;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  width: 0.85rem;
  height: 0.85rem;
  border: 2px solid var(--accent);
  border-radius: 999px;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 16%, transparent);
}

.nav-links {
  gap: 1.2rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.nav-links a,
.contact-links a {
  text-decoration: none;
}

.nav-links a:hover,
.contact-links a:hover {
  color: var(--accent);
}

.theme-toggle {
  gap: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text);
  min-height: 40px;
  padding: 0 0.85rem;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
}

.toggle-icon {
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: inset -4px -2px 0 color-mix(in srgb, var(--bg) 70%, transparent);
}

.section-shell {
  width: min(100% - 2rem, var(--max-width));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.8fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  min-height: calc(100vh - 72px);
  padding: clamp(4rem, 8vw, 7rem) 0;
}

.eyebrow {
  margin: 0 0 0.85rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 12ch;
  margin-bottom: 1rem;
  font-size: clamp(3.4rem, 8.2vw, 6.7rem);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 1rem;
  font-size: clamp(2rem, 4.2vw, 4.25rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0.55rem;
  font-size: 1.05rem;
  line-height: 1.2;
}

.hero-lede {
  max-width: 800px;
  margin-bottom: 1.25rem;
  color: var(--text-soft);
  font-size: clamp(1.35rem, 2.8vw, 2.25rem);
  line-height: 1.18;
}

.hero-summary,
.section-body > p,
.contact p {
  color: var(--text-muted);
  font-size: 1.08rem;
}

.hero-summary {
  max-width: 680px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text);
  padding: 0 1rem;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 900;
}

.button:hover,
.theme-toggle:hover {
  border-color: var(--line-strong);
}

.button-primary {
  border-color: transparent;
  background: var(--accent);
  color: var(--bg);
}

.hero-visual {
  position: relative;
  min-height: 600px;
}

.portrait-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
}

.portrait-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: inherit;
  pointer-events: none;
}

.portrait-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 28%;
  filter: saturate(0.9) contrast(1.05);
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.44fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  padding: clamp(4rem, 8vw, 7rem) 0;
  border-top: 1px solid var(--line);
}

.section-heading {
  position: sticky;
  top: 104px;
  align-self: start;
}

.method-grid,
.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.method-grid article,
.tool-card,
.publication {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
}

.method-grid article,
.tool-card {
  padding: 1.15rem;
}

.method-grid span,
.tool-kicker,
.pub-year {
  color: var(--accent-3);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.method-grid p,
.tool-card p,
.timeline p,
.pub-meta {
  color: var(--text-muted);
}

.publication-list {
  display: grid;
  gap: 0.85rem;
}

.publication {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 0.2rem 1.25rem;
  padding: 1rem;
  text-decoration: none;
}

.publication:hover,
.tool-card:hover {
  border-color: var(--line-strong);
}

.pub-year {
  grid-row: span 2;
  padding-top: 0.18rem;
}

.pub-title {
  color: var(--text);
  font-weight: 850;
  line-height: 1.35;
}

.pub-meta {
  font-size: 0.92rem;
}

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

.tool-card {
  min-height: 210px;
  color: inherit;
  text-decoration: none;
}

.tool-card h3 {
  margin-top: 1.5rem;
  font-size: 1.8rem;
}

.timeline {
  display: grid;
  gap: 1.2rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: path;
}

.timeline li {
  position: relative;
  padding-left: 3rem;
  counter-increment: path;
}

.timeline li::before {
  content: counter(path, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
}

.timeline span {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 900;
}

.contact {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(280px, 0.55fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
  padding: clamp(4rem, 8vw, 7rem) 0;
  border-top: 1px solid var(--line);
}

.contact-links {
  display: grid;
  gap: 0.75rem;
}

.contact-links a {
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.75rem;
  color: var(--text-soft);
  font-weight: 850;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  width: min(100% - 2rem, var(--max-width));
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 920px) {
  .nav-links {
    display: none;
  }

  .hero,
  .section-grid,
  .contact {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 0;
  }

  .hero-visual {
    min-height: 0;
  }

  .portrait-card {
    max-width: 520px;
  }

  .section-heading {
    position: static;
  }

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

@media (max-width: 640px) {
  .nav-shell {
    min-height: 64px;
  }

  .brand span:last-child {
    display: none;
  }

  .theme-toggle {
    padding: 0 0.7rem;
  }

  .toggle-text {
    display: none;
  }

  h1 {
    font-size: clamp(3rem, 16vw, 4.45rem);
  }

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

  .button {
    justify-content: center;
  }

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

  .pub-year {
    grid-row: auto;
  }

  .site-footer {
    display: block;
  }

  .site-footer p + p {
    margin-top: 0.35rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
