/* ---------- Design tokens ---------- */
:root {
  --bg: #faf8f4;
  --bg-alt: #f1ede4;
  --surface: #ffffff;
  --text: #2a2723;
  --text-muted: #6b6459;
  --border: #e4ddd0;
  --accent: #8a4a2f;
  --accent-strong: #6e3a24;
  --accent-soft: #f0e2d8;
  --shadow: 0 1px 2px rgba(40, 30, 20, 0.04), 0 8px 24px rgba(40, 30, 20, 0.06);
  --serif: "Source Serif 4", "Georgia", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --max-w: 780px;
}

:root[data-theme="dark"] {
  --bg: #1b1815;
  --bg-alt: #211d19;
  --surface: #24201c;
  --text: #ece6dc;
  --text-muted: #a99f8f;
  --border: #37312a;
  --accent: #e3a06f;
  --accent-strong: #f0b483;
  --accent-soft: #332720;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.3);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1815;
    --bg-alt: #211d19;
    --surface: #24201c;
    --text: #ece6dc;
    --text-muted: #a99f8f;
    --border: #37312a;
    --accent: #e3a06f;
    --accent-strong: #f0b483;
    --accent-soft: #332720;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.3);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s ease, color 0.2s ease;
}

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

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

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
  margin: 0 0 0.5em;
}

p { margin: 0 0 1.1em; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.6em;
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

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

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

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  width: 2.3rem;
  height: 2.3rem;
  cursor: pointer;
  color: var(--text);
  font-size: 1.1rem;
}

/* ---------- Layout ---------- */
main { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }

section { padding: 4.5rem 0; border-bottom: 1px solid var(--border); }
section:last-of-type { border-bottom: none; }

/* ---------- Hero ---------- */
.hero {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  padding-top: 4rem;
}

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

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

.hero h1 { font-size: 2.1rem; margin-bottom: 0.25rem; }

.hero .role { color: var(--text-muted); font-size: 1.05rem; margin-bottom: 0.6rem; }

.hero .links { display: flex; flex-wrap: wrap; gap: 0.6rem 1.1rem; font-size: 0.92rem; }
.hero .links a { text-decoration: none; }
.hero .links span { color: var(--text-muted); }

/* ---------- Section headers ---------- */
.section-head { margin-bottom: 1.8rem; }
.section-head h2 { font-size: 1.6rem; }

.subproject { margin-top: 2.8rem; }
.subproject h3 {
  font-size: 1.12rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.9rem;
}

figure { margin: 1.3rem 0; }
figure img {
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
figcaption {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
}
.chip:hover { border-color: var(--accent); color: var(--accent-strong); }

.chip.primary {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
}

/* ---------- Gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}
.gallery a { border-radius: 10px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); }
.gallery img { aspect-ratio: 1 / 1; object-fit: cover; width: 100%; height: 100%; transition: transform 0.3s ease; }
.gallery a:hover img { transform: scale(1.04); }

.wide-photo { border-radius: 10px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); margin-top: 1.5rem; }
.wide-photo img { width: 100%; max-height: 420px; object-fit: cover; }

/* ---------- Contact ---------- */
.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
  box-shadow: var(--shadow);
  text-align: left;
}
.contact-card h2 { margin-bottom: 0.4rem; }
.contact-card p { color: var(--text-muted); }

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 2.2rem 1.5rem 3rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---------- Lightbox ---------- */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 6, 0.82);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 2rem;
}
.lightbox-overlay.open { display: flex; }
.lightbox-overlay img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 8px;
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 1.5rem 1.5rem;
    gap: 0.9rem;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; align-items: center; justify-content: center; }

  .hero { flex-direction: column; text-align: center; padding-top: 2.5rem; }
  .hero .links { justify-content: center; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 420px) {
  body { font-size: 16px; }
  section { padding: 3rem 0; }
}
