/* ---- Design tokens ------------------------------------------------------ */

:root {
  --bg:        #fdfdfc;
  --fg:        #1c1b19;
  --muted:     #6b6862;
  --rule:      #e5e2dc;
  --accent:    #9a3412;

  --measure:   38rem;                 /* comfortable reading width */
  --font: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-ui: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:     #16151a;
    --fg:     #e8e6e1;
    --muted:  #97938c;
    --rule:   #2e2c33;
    --accent: #f0916a;
  }
}

/* ---- Base --------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: clamp(2.5rem, 8vw, 6rem) 1.5rem;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: var(--measure);
  margin-inline: auto;
}

/* ---- Typography --------------------------------------------------------- */

h1, h2, h3 {
  font-family: var(--font-ui);
  line-height: 1.25;
  text-wrap: balance;
}

h1 {
  margin: 0;
  font-size: clamp(1.9rem, 6vw, 2.5rem);
  letter-spacing: -0.02em;
}

h2 {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

h3 {
  margin: 0 0 0.25rem;
  font-size: 1.0625rem;
  font-weight: 600;
}

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

.muted { color: var(--muted); font-weight: 400; }

/* ---- Links -------------------------------------------------------------- */

a {
  color: inherit;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 0.12s ease;
}

a:hover { color: var(--accent); }

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

/* ---- Sections ----------------------------------------------------------- */

.intro { margin-bottom: 3rem; }

.tagline {
  margin: 0.75rem 0 1.25rem;
  font-size: 1.1875rem;
  color: var(--muted);
  text-wrap: pretty;
}

section {
  padding-top: 2.5rem;
  margin-top: 2.5rem;
  border-top: 1px solid var(--rule);
}

.intro + section {
  margin-top: 0;
}

/* ---- Inline link row ---------------------------------------------------- */

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 0;
  padding: 0;
  font-family: var(--font-ui);
  font-size: 0.9375rem;
}

/* ---- Project + post lists ----------------------------------------------- */

.item + .item { margin-top: 1.5rem; }
.item p { color: var(--muted); }

.posts {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.posts li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0 1rem;
}

.posts time {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ---- Footer ------------------------------------------------------------- */

footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-family: var(--font-ui);
  font-size: 0.875rem;
  color: var(--muted);
}

/* ---- Motion ------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
