:root {
  --bg: #faf6f0;
  --bg-elevated: #ffffff;
  --text: #2e2a26;
  --text-muted: #6b6259;
  --accent: #c1611f;
  --accent-soft: #f0dcc8;
  --border: #e7ddd0;
  --shadow: 0 1px 2px rgba(60, 40, 20, 0.06), 0 4px 16px rgba(60, 40, 20, 0.05);
  --max-width: 720px;
}

:root[data-theme="dark"] {
  --bg: #211d1a;
  --bg-elevated: #2b2621;
  --text: #f1ece4;
  --text-muted: #b3a99c;
  --accent: #e8935a;
  --accent-soft: #3d3229;
  --border: #3d352c;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 4px 16px rgba(0, 0, 0, 0.25);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #211d1a;
    --bg-elevated: #2b2621;
    --text: #f1ece4;
    --text-muted: #b3a99c;
    --accent: #e8935a;
    --accent-soft: #3d3229;
    --border: #3d352c;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 4px 16px rgba(0, 0, 0, 0.25);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, "Times New Roman", serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

h1, h2, h3 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.25;
  font-weight: 650;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.brand:hover { text-decoration: none; color: var(--accent); }

.site-nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.95rem;
}
.site-nav a { color: var(--text-muted); }
.site-nav a:hover { color: var(--accent); text-decoration: none; }

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: 999px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}

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

.hero {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  padding: 3rem 0 2.5rem;
  flex-wrap: wrap;
}
.hero-photo {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow);
  border: 3px solid var(--bg-elevated);
  flex-shrink: 0;
}
.hero-text { flex: 1; min-width: 260px; }
.hero-text h1 { margin: 0 0 0.6rem; font-size: 1.9rem; }
.hero-tagline { margin: 0 0 1.1rem; color: var(--text-muted); }
.hero-links { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.hero-links a { color: var(--text-muted); display: inline-flex; align-items: center; }
.hero-links a:hover { color: var(--accent); }
.section { padding: 2.25rem 0; border-top: 1px solid var(--border); }
.section h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0 0 1.25rem;
}

.timeline-item + .timeline-item { margin-top: 1.75rem; }
.timeline-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 0.75rem; margin-bottom: 0.4rem; }
.timeline-heading h3 { margin: 0; font-size: 1.05rem; }
.timeline-date {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.timeline-item p { margin: 0; }

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.project-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
}
.project-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}
.project-card p {
  margin: 0 0 0.5rem;
  color: var(--text-muted);
  font-size: 0.94rem;
}
.project-card a { font-size: 0.88rem; font-weight: 600; }

.education-list { list-style: none; margin: 0; padding: 0; }
.education-list li { margin-bottom: 0.5rem; }
.muted { color: var(--text-muted); }

.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin: 0.75rem 0 1.25rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.9rem;
}
.copyright { color: var(--text-muted); font-size: 0.85rem; margin: 0; }

@media (max-width: 600px) {
  .site-nav { display: none; }
  .hero { flex-direction: column; text-align: center; padding-top: 2rem; }
  .hero-links { justify-content: center; }
  .project-grid { grid-template-columns: 1fr; }
}
