/* ── Reset & Base ─────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-bg: #f5f1eb;
  --color-bg-alt: #ece7df;
  --color-text: #2d2a26;
  --color-text-muted: #6b6560;
  --color-accent: #3d6b5e;
  --color-accent-hover: #2d5248;
  --color-border: #d5cec3;
  --color-card: #faf8f5;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;
  --max-width: 900px;
  --nav-height: 60px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-serif);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.75;
  font-size: 17px;
  zoom: 1.5;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

/* ── Nav ─────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(245, 241, 235, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 1000;
  font-family: var(--font-sans);
}

.nav-name {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--color-text);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

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

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

/* ── Layout ──────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 6rem;
}

.section {
  padding: 5rem 0;
}

.section-alt {
  background: var(--color-bg-alt);
}

/* ── Hero ────────────────────────────────────── */
.hero {
  position: relative;
  min-height: calc(100vh / 1.5);
  display: flex;
  align-items: center;
  padding: calc(var(--nav-height) + 2rem) 2rem 4rem;
  overflow: hidden;
}

#raster-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 4rem;
}

.hero-text {
  position: relative;
  flex: 1;
}

.hero-text-fade {
  position: absolute;
  inset: -1rem;
  background: rgba(245, 241, 235, 0.85);
  z-index: -1;
  pointer-events: none;
}

.hero h1 {
  font-size: 2.4rem;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.bio {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
  line-height: 1.8;
}

.hero-photo {
  flex-shrink: 0;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--color-border);
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Buttons ─────────────────────────────────── */
.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  border: none;
  transition: background 0.2s, color 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  text-decoration: none;
}

.btn-secondary {
  background: transparent;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
}

.btn-secondary:hover {
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
}

/* ── About ───────────────────────────────────── */
.about-block {
  margin-bottom: 3rem;
}

.about-block:last-child {
  margin-bottom: 0;
}

h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: var(--color-text);
}

.about-block p {
  margin-bottom: 1rem;
  color: var(--color-text-muted);
}

.principles {
  display: grid;
  gap: 1.5rem;
}

.principle {
  padding: 1.5rem;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.principle h4 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.principle p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* ── Projects ────────────────────────────────── */
.project-cards {
  display: grid;
  gap: 2rem;
}

.project-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 2rem;
}

.project-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.project-summary {
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.project-toggle {
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

.project-detail {
  display: none;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.project-detail.open {
  display: block;
}

.project-detail h4 {
  font-size: 1.05rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.project-detail h4:first-child {
  margin-top: 0;
}

.project-detail p {
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}

.project-detail ul {
  color: var(--color-text-muted);
  margin: 0.5rem 0 1rem 1.5rem;
}

.project-detail li {
  margin-bottom: 0.5rem;
}

/* ── Publications ────────────────────────────── */
.pub-group {
  margin-bottom: 2.5rem;
}

.pub-group:last-child {
  margin-bottom: 0;
}

.pub-group h3 {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
}

.pub-entry {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

.pub-entry:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.pub-entry h4 {
  font-size: 1.05rem;
  line-height: 1.4;
  margin-bottom: 0.4rem;
}

.pub-meta {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}

.pub-entry > p:last-child {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

/* ── Contact ─────────────────────────────────── */
.contact-section {
  text-align: center;
}

.contact-section p {
  color: var(--color-text-muted);
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.contact-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 2rem;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  min-width: 200px;
  transition: border-color 0.2s;
}

.contact-link:hover {
  border-color: var(--color-accent);
  text-decoration: none;
}

.contact-label {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: 0.3rem;
}

/* ── Footer ──────────────────────────────────── */
.footer {
  text-align: center;
  padding: 2rem;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--color-border);
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 768px) {
  body {
    font-size: 16px;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(245, 241, 235, 0.98);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 1rem 2rem;
    gap: 0.75rem;
    border-bottom: 1px solid var(--color-border);
  }

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

  .hero-content {
    flex-direction: column-reverse;
    text-align: center;
    gap: 2rem;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .hero-photo {
    width: 180px;
    height: 180px;
  }

  .cta-group {
    justify-content: center;
  }

  .contact-links {
    flex-direction: column;
    align-items: center;
  }

  h2 {
    font-size: 1.6rem;
  }

  .section {
    padding: 3.5rem 0;
  }

  #raster-canvas {
    opacity: 0.12;
  }
}

@media (max-width: 480px) {
  #raster-canvas {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  #raster-canvas {
    display: none;
  }
}
