* {
  box-sizing: border-box;
}

/* `hidden` must win over component display rules (.btn-row { display: flex }…). */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  /* Paper grain (CSS dots, no image) over a faint terracotta halo at the top. */
  background:
    radial-gradient(color-mix(in srgb, var(--text) var(--grain), transparent) 1px, transparent 1px) 0 0 / 4px 4px,
    var(--halo) no-repeat,
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-2);
  text-decoration: underline;
}

/* Keyboard focus: visible on every interactive element, never on mouse click. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
textarea:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: none;
}

/* Form controls inherit the page font; :where keeps it overridable by any class. */
:where(button, input[type="submit"]) {
  font: inherit;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.narrow {
  max-width: 760px;
}

h1,
h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.2;
  font-optical-sizing: auto;
}
h1 {
  font-size: var(--text-2xl);
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
}
h2 {
  font-size: var(--text-lg);
  margin: 2rem 0 0.75rem;
  letter-spacing: -0.01em;
}
h3 {
  font-size: var(--text-base);
  margin: 1.25rem 0 0.5rem;
}
.subtitle {
  color: var(--muted);
  margin: 0 0 1.5rem;
  font-size: var(--text-base);
}

