:root {
  --bg: #fdfcfa;
  --fg: #111111;
  --muted: #6b6b6b;
  --rule: #e0ddd7;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e0e;
    --fg: #eae7e1;
    --muted: #8d8a84;
    --rule: #262626;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "EB Garamond", Georgia, "Times New Roman", serif;
  font-size: 20px;
  line-height: 1.6;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 14vh 1.5rem 8rem;
}

/* ---- type ---- */

h1 {
  margin: 0;
  font-size: 2.4rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

p { margin: 0 0 1.1rem; }

.sub {
  margin: 0.6rem 0 0;
  font-style: italic;
  color: var(--muted);
}

section { margin-top: 3rem; }

/* ---- links ---- */

.links {
  margin-top: 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.75rem;
}

a { color: inherit; }

.link {
  position: relative;
  text-decoration: none;
  padding-bottom: 2px;
}

.link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.32s cubic-bezier(0.2, 0.7, 0.3, 1);
}

section .link::after { transform: scaleX(1); opacity: 0.32; }

.link:hover::after,
.link:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
  opacity: 1;
}

.link:focus-visible {
  outline: none;
  opacity: 0.6;
}

/* ---- footer ---- */

footer {
  margin-top: 3.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
}

/* ---- entrance ---- */

.reveal {
  opacity: 0;
  transform: translateY(0.6rem);
  animation: rise 0.75s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
  animation-delay: calc(var(--i) * 110ms + 60ms);
}

@keyframes rise {
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; transform: none; }
  .link::after { transition: none; }
}

/* ---- small screens ---- */

@media (max-width: 33rem) {
  body { font-size: 18px; }
  main { padding-top: 8vh; }
  h1 { font-size: 2rem; }
}
