/* --- tokens --- */
:root {
  --bg: #11110f;
  --text: #f2f0eb;
  --muted: #9a9892;
  --rule: #2b2a27;
  --link-line: #5c5a55;
  --focus: #f2f0eb;
  --content: 42rem; /* ~672px */
  --pad: 1.5rem;
}

/* --- reset --- */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family:
    "Iowan Old Style",
    "Palatino Linotype",
    Palatino,
    Georgia,
    "Times New Roman",
    serif;
  font-size: 1.0625rem;
  line-height: 1.7;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
p,
ul {
  margin: 0;
}

/* --- layout --- */

.skip-link {
  position: absolute;
  left: var(--pad);
  top: -3rem;
  z-index: 10;
  padding: 0.35rem 0.6rem;
  background: var(--bg);
  color: var(--text);
}

.skip-link:focus {
  top: 0.75rem;
}

body {
  max-width: var(--content);
  margin: 0 auto;
  padding: 3.5rem var(--pad) 4rem;
}

@media (min-width: 900px) {
  body {
    /* slightly left of center so it reads as a page, not a template */
    margin-left: max(var(--pad), calc(50vw - 26rem));
    margin-right: auto;
    padding-top: 5rem;
    padding-bottom: 5.5rem;
  }
}

/* --- type --- */

h1 {
  font-size: 2.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

section[id] {
  scroll-margin-top: 1.25rem;
}

h2 {
  margin: 2.75rem 0 0.85rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

p + p {
  margin-top: 1rem;
}

.tagline {
  margin: 0.45rem 0 1.35rem;
  color: var(--muted);
  font-size: 0.98rem;
}

.meta,
.skills {
  color: var(--muted);
  font-size: 0.92rem;
}

code {
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
}

/* --- nav --- */

.nav {
  margin-bottom: 3.25rem;
  font-size: 0.92rem;
}

.nav a + a {
  margin-left: 1.15rem;
}

/* --- links --- */

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--link-line);
  transition: text-decoration-color 0.15s ease, opacity 0.15s ease;
}

a:hover {
  text-decoration-color: currentColor;
}

a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  text-decoration: none;
}

/* --- lists --- */

.project-list,
.plain-list,
.link-list {
  padding: 0;
  list-style: none;
}

.project-list > li + li,
.plain-list > li + li {
  margin-top: 1.15rem;
}

.plain-list > li {
  padding-left: 0;
}

.link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
}

.site-footer {
  margin-top: 3.5rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.85rem;
}

/* --- motion --- */

@media (prefers-reduced-motion: no-preference) {
  body {
    animation: enter 0.45s ease-out both;
  }
}

@keyframes enter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

  body {
    animation: none;
  }
}

/* --- mobile --- */

@media (max-width: 640px) {
  :root {
    --pad: 1.15rem;
  }

  body {
    padding-top: 2rem;
    padding-bottom: 3rem;
    font-size: 1rem;
  }

  h1 {
    font-size: 2.15rem;
  }

  .nav {
    margin-bottom: 2.25rem;
  }

  h2 {
    margin-top: 2.25rem;
  }
}
