:root {
  --bg:     light-dark(#ffffff, #2e3440);
  --ink:    light-dark(#1a1a1a, #d8dee9);
  --muted:  light-dark(#666666, #9aa5b8);
  --rule:   light-dark(#e5e5e5, #3b4252);
  --accent: light-dark(#0b6e6e, #88c0d0);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 100%;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  width: 100%;
  max-width: 46rem;
  margin: 0 auto;
  padding: 5rem 1.5rem 3rem;
}

/* Header */

header {
  margin-bottom: 4rem;
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.6rem, 8vw, 4rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0.75rem 0 1.5rem;
  font-size: 1.15rem;
  color: var(--muted);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

/* Sections: heading in a left column on wide screens, stacked on small ones */

section {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 0.5rem 2rem;
  padding: 2rem 0;
  border-top: 1px solid var(--rule);
}

h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.6;
}

h3 {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
}

.content {
  max-width: 34rem;
}

.content p {
  margin: 0 0 1rem;
}

.content p:last-child {
  margin-bottom: 0;
}

.meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.projects {
  list-style: none;
  margin: 0;
  padding: 0;
}

.projects li + li {
  margin-top: 1.5rem;
}

.projects h3 + p,
article h3 + p {
  margin-top: 0.25rem;
}

/* Links */

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

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

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

h3 a {
  color: inherit;
}

/* Footer */

footer {
  width: 100%;
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 2.5rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.875rem;
}

footer p {
  margin: 0;
}

/* Small screens */

@media (max-width: 40rem) {
  main {
    padding-top: 3rem;
  }

  header {
    margin-bottom: 2.5rem;
  }

  section {
    grid-template-columns: 1fr;
  }
}
