/* Document defaults, layout container and accessibility. */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(circle, var(--texture-dot) 0 1.05px, transparent 1.2px);
  background-size: 12px 12px;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
}

main { overflow-x: clip; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; }
a {
  color: var(--accent-text);
  text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent);
  text-underline-offset: .15em;
}
a:hover { color: var(--link-hover); }
section, article[id] { scroll-margin-top: 32px; }
svg { display: block; flex-shrink: 0; vertical-align: middle; }

.shell {
  width: min(var(--content-width), calc(100% - 64px));
  margin-inline: auto;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.07;
  letter-spacing: -.025em;
}

h1 { font-size: clamp(3rem, 5.35vw, 4.75rem); }

h1 em { color: var(--accent-text); font-style: normal; }

h2 {
  font-size: clamp(2.2rem, 3.8vw, 3.5rem);
}

h3 { line-height: 1.2; letter-spacing: -.015em; }

.muted { color: var(--muted); }

::selection { color: var(--bg); background: var(--accent); }

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 16px;
  z-index: 20;
  padding: 12px 18px;
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
  transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }

@media (max-width: 900px) {
  .shell { width: min(calc(100% - 36px), 720px); }
}

@media (max-width: 580px) {
  .shell { width: calc(100% - 30px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
