:root {
  --bg: #faf8f5;
  --paper: #ffffff;
  --ink: #1a1a1a;
  --muted: #7a7a7a;
  --rule: #e0ddd8;
  --accent: #2563eb;
  --radius: 8px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --paper: #1a1a1a;
    --ink: #e8e8e8;
    --muted: #8a8a8a;
    --rule: #2a2a2a;
    --accent: #60a5fa;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  max-width: 72ch;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Navigation */
.nav {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 3rem;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}
.nav a:hover { color: var(--accent); }

/* Typography */
h1, h2, h3 {
  font-family: "Iowan Old Style", "Charter", Georgia, serif;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0;
}
h1 { font-size: 2.8rem; margin-bottom: 0.3em; }
h2 { font-size: 1.6rem; margin-bottom: 1rem; color: var(--muted); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 0.75em; }
.muted { color: var(--muted); }
a { color: var(--accent); text-underline-offset: 0.15em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Header */
header { margin-bottom: 4rem; }
.name { margin-top: 0.5rem; }
.tagline { font-size: 1.1rem; }

/* Sections */
section { margin-bottom: 4rem; }

/* Project grid */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.project {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.project:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.project-thumb {
  width: 100%;
  height: 140px;
  background: var(--rule);
  border-radius: 4px;
  margin-bottom: 0.75rem;
}
.project-title { margin-bottom: 0.3em; }
.project-desc { font-size: 0.9rem; }

/* Contact form */
.field {
  margin-bottom: 1rem;
}
label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.3em;
  color: var(--muted);
}
input, textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font: inherit;
  font-size: 0.95rem;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  transition: border-color 0.2s;
}
input:focus, textarea:focus {
  border-color: var(--accent);
  outline: none;
}
button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0.65rem 1.5rem;
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  transition: opacity 0.2s;
}
button:hover { opacity: 0.85; }
.form-status {
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

/* Footer */
footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
}
footer .attribution { font-size: 0.75rem; opacity: 0.7; margin-top: 0.25rem; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
