:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --text: #1d1d1b;
  --muted: #5f5d58;
  --border: #e6e2da;
  --accent: #1f6f5c;
  --accent-contrast: #ffffff;
  --max: 960px;
  --radius: 14px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141513;
    --surface: #1c1e1b;
    --text: #ecebe6;
    --muted: #a3a19a;
    --border: #2d302b;
    --accent: #5cc4a6;
    --accent-contrast: #0e1a16;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #141513;
  --surface: #1c1e1b;
  --text: #ecebe6;
  --muted: #a3a19a;
  --border: #2d302b;
  --accent: #5cc4a6;
  --accent-contrast: #0e1a16;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

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

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

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px 24px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
}

.logo {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
  color: var(--text);
  text-decoration: none;
}

.site-header nav { display: flex; gap: 20px; margin-left: auto; }

.site-header nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}

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

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: none; }
  :root:not([data-theme="light"]) .icon-moon { display: inline; }
}

/* Layout */
main { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

.hero { padding: 96px 0 100px; }

.avatar {
  display: block;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 24px;
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero h1 { font-size: clamp(48px, 9vw, 88px); letter-spacing: -0.02em; }

.tagline {
  max-width: 34em;
  margin: 20px 0 36px;
  font-size: clamp(18px, 2.4vw, 22px);
  color: var(--muted);
}

.cta { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-block;
  padding: 12px 22px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.btn:hover { transform: translateY(-1px); border-color: var(--muted); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}

.btn-primary:hover { border-color: var(--accent); }

.section { padding: 72px 0; border-top: 1px solid var(--border); }

.section h2 { font-size: clamp(30px, 4.5vw, 40px); margin-bottom: 24px; }

.lead { max-width: 38em; color: var(--muted); margin: 0 0 32px; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; }

.timeline li { display: grid; grid-template-columns: 160px 1fr; gap: 24px; }

.when { color: var(--muted); font-size: 15px; padding-top: 3px; }

.timeline h3, .card h3 { font-size: 21px; margin-bottom: 6px; }

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

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.tag {
  display: inline-block;
  margin-bottom: 12px;
  padding: 2px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.more {
  display: inline-block;
  margin-top: 14px;
  font-weight: 500;
  text-decoration: none;
}

.timeline .links { display: flex; gap: 16px; margin-top: 8px; }
.timeline .links a { font-weight: 500; text-decoration: none; }

/* Projects */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.project {
  display: block;
  color: inherit;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  padding-bottom: 20px;
}

a.project { transition: transform 0.15s ease, border-color 0.15s ease; }
a.project:hover { transform: translateY(-2px); border-color: var(--muted); }

.project .media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--border);
  margin-bottom: 16px;
}

.project .media img { width: 100%; height: 100%; object-fit: cover; display: block; }

.project .media.video::after {
  content: "▶";
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding-left: 3px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 13px;
}

.project .year,
.project h3,
.project p { margin-left: 20px; margin-right: 20px; }

.project .year { display: block; color: var(--accent); font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.project h3 { font-size: 21px; margin-bottom: 6px; }
.project p { margin-top: 0; margin-bottom: 0; color: var(--muted); font-size: 15px; }

/* Drawings */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.gallery a {
  display: block;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  background: var(--border);
}

.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.gallery a:hover img { transform: scale(1.04); }

.lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 92vw;
  max-height: 92vh;
}

.lightbox::backdrop { background: rgba(0, 0, 0, 0.85); }

.lightbox img {
  display: block;
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 6px;
}

.lightbox-close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

/* Contact */
.contact .socials {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 28px 0 0;
  padding: 0;
}

.socials a { color: var(--muted); font-weight: 500; }
.socials a:hover { color: var(--text); }

/* Footer */
.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px 24px 48px;
  color: var(--muted);
  font-size: 14px;
  border-top: 1px solid var(--border);
}

.site-footer p { margin: 0; }
.site-footer a { color: var(--muted); }

/* Mobile */
@media (max-width: 640px) {
  .site-header { gap: 12px; padding: 12px 16px; }
  .site-header nav { gap: 14px; }
  .site-header nav a { font-size: 14px; }
  .site-header nav .nav-extra { display: none; }
  .gallery { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  main { padding: 0 16px; }
  .hero { padding: 72px 0 64px; }
  .section { padding: 56px 0; }
  .timeline li { grid-template-columns: 1fr; gap: 4px; }
  .site-footer { padding: 28px 16px 40px; }
}

@media (max-width: 400px) {
  .site-header nav { gap: 12px; }
  .site-header nav a { font-size: 13px; }
}
