/* =========================================================
   babapic — Base / Reset
   ========================================================= */

/* Self-hosted (same-origin) — no third-party font request, keeps the
   "nothing leaves your browser" story true for the shell too. Latin
   subset only (matches every string used across the site's copy).
   Regular weight only: this face has no true bold, so headline weight
   comes from size/spacing, not synthetic bolding. */
@font-face {
  font-family: "Libre Caslon Display";
  src: url("/assets/fonts/libre-caslon-display.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  /* Off-canvas mobile nav (.nav-links, <780px) sits just off the right edge
     via translateX(100%) rather than display:none, so its layout box still
     extends past the viewport — clip it here instead of hiding the panel,
     which would kill its slide-in transition. */
  overflow-x: hidden;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  color: inherit;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

/* Serif is reserved for true headline scale (h1) only — h2/h3/h4 stay in
   the system sans so the display face reads as a deliberate accent, not
   a wash applied to every heading. */
h1,
h2,
h3,
h4 {
  color: var(--color-text-heading);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-heading);
}

h1 {
  font-family: var(--font-serif);
  font-size: var(--fs-h1);
  font-weight: var(--fw-regular);
  line-height: var(--lh-tight);
  letter-spacing: -0.005em;
}

h2 {
  font-size: var(--fs-h2);
  letter-spacing: -0.01em;
}

h3 {
  font-size: var(--fs-h3);
  font-weight: var(--fw-medium);
}

small {
  font-size: var(--fs-small);
  color: var(--color-text-muted);
}

::selection {
  background: var(--color-accent-muted);
  color: var(--color-text-heading);
}

/* Consistent, visible focus ring everywhere — accessibility baseline */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -48px;
  left: var(--space-4);
  background: var(--color-accent);
  color: #fff;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  z-index: 1000;
  transition: top var(--dur-fast) var(--ease);
}

.skip-link:focus {
  top: var(--space-4);
}

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