:root {
  --bg: #f5f0e6;
  --paper: #ffffff;
  --ink: #1a1814;
  --muted: #6b6358;
  --rule: #d9cfbf;
  --accent: #1a4f7a;
  --accent-light: #e8f0f8;
  --radius: 4px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1814;
    --paper: #221f1a;
    --ink: #e8dfd0;
    --muted: #8a8174;
    --rule: #3a342c;
    --accent: #6ea8d8;
    --accent-light: #1e2a33;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  max-width: 70ch;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
}
h1, h2, h3 {
  font-family: "Iowan Old Style", "Charter", Georgia, serif;
  letter-spacing: -0.01em;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; border-bottom: 1px solid var(--rule); padding-bottom: 0.25em; }
.muted { color: var(--muted); }
a { color: var(--accent); text-underline-offset: 0.15em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip-link {
  position: absolute; top: -40px; left: 0;
  background: var(--accent); color: #fff;
  padding: 0.5rem 1rem; z-index: 100; text-decoration: none;
}
.skip-link:focus { top: 0; }

/* Navigation */
header {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2rem;
}
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.logo {
  font-family: "Iowan Old Style", "Charter", Georgia, serif;
  font-size: 1.2rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
}
.logo:hover { color: var(--accent); }
.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.25rem;
}
.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
  padding: 0.25em 0;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--ink);
  border-bottom: 2px solid var(--accent);
}

/* Hero */
.hero { margin-bottom: 2.5rem; }
.hero h1 { margin-top: 0.5em; font-size: 2.4rem; }
.subtitle { font-size: 1.1rem; margin-bottom: 0.25em; }

/* Sections */
section { margin-bottom: 2rem; }
section ul { padding-left: 1.25rem; }
section li { margin-bottom: 0.4em; }

/* Papers / entries */
.paper { margin-bottom: 2rem; }
.paper h2 { border-bottom: none; font-size: 1.2rem; margin-top: 0; }
.meta { font-size: 0.9rem; color: var(--muted); margin-bottom: 0.5rem; }
.abstract {
  font-size: 0.95rem;
  line-height: 1.65;
  padding: 1rem;
  background: var(--accent-light);
  border-radius: var(--radius);
  border-left: 3px solid var(--accent);
}
.paper-links { margin-top: 0.75rem; }
.paper-links a { margin-right: 1rem; }

/* Entry (CV) */
.entry { margin-bottom: 1.25rem; }
.entry-title { font-weight: 600; margin-bottom: 0.15em; }
.entry-meta { font-size: 0.9rem; color: var(--muted); margin-bottom: 0.3em; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.45em 1em;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; color: #fff; }

/* Form */
form { margin: 1.5rem 0; }
.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.3em;
}
.field input,
.field textarea {
  width: 100%;
  padding: 0.5em 0.75em;
  font: inherit;
  font-size: 0.95rem;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.field input:focus,
.field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}
.form-status {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  padding: 0.5em 0.75em;
  background: var(--accent-light);
  border-radius: var(--radius);
}
.alt-contact { margin-top: 2rem; }

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

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