/* Colors: light by default, dark when the OS prefers it */
:root {
  --bg: #faf9f7;
  --surface: #ffffff;
  --text: #1d1c1a;
  --muted: #66625b;
  --border: #e5e1da;
  --accent: #2d6a58;
  --accent-soft: #e3eeea;

  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --width: 48rem;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131312;
    --surface: #1b1b19;
    --text: #ebe9e5;
    --muted: #a19d95;
    --border: #2d2c29;
    --accent: #7fc4ae;
    --accent-soft: #1d2d28;
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

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

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

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

h2 {
  font-size: 1.75rem;
  margin-bottom: 1.25rem;
}

h3 { font-size: 1.2rem; }

.container {
  width: 100%;
  max-width: var(--width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

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

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 3.75rem;
}

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

.nav nav {
  display: flex;
  gap: 1.25rem;
}

.nav nav a {
  color: var(--muted);
  font-size: 0.95rem;
  text-decoration: none;
}

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

/* Sections */
section {
  padding: 4rem 0;
  border-bottom: 1px solid var(--border);
}

section:last-child { border-bottom: 0; }

.hero { padding: 6rem 0 4.5rem; }

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(2.5rem, 8vw, 4rem);
  letter-spacing: -0.01em;
}

.lede {
  max-width: 34rem;
  margin: 1.25rem 0 2rem;
  color: var(--muted);
  font-size: 1.25rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.button {
  display: inline-block;
  padding: 0.7rem 1.2rem;
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
}

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

.button.secondary { color: var(--accent); }

.button:hover { filter: brightness(1.1); }
.button.secondary:hover { background: var(--accent-soft); filter: none; }

.about p { margin: 0 0 1rem; }
.about p:last-child { margin-bottom: 0; }

/* Projects */
.projects-list {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.15s;
}

.card:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
}

.card p {
  margin: 0.5rem 0 1rem;
  color: var(--muted);
}

.card-link {
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tags li {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
}

.contact p {
  margin: 0 0 1.5rem;
  color: var(--muted);
}

/* 404 page */
.not-found {
  padding: 8rem 0;
  text-align: center;
  border-bottom: 0;
}

.not-found h1 { font-size: clamp(2rem, 6vw, 3rem); }

.not-found p {
  margin: 1rem 0 2rem;
  color: var(--muted);
}

.not-found .actions { justify-content: center; }

/* Footer */
.site-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}

@media (max-width: 30rem) {
  .nav nav { gap: 0.9rem; }
  .hero { padding: 4rem 0 3rem; }
  section { padding: 3rem 0; }
}
