/* ---------------------------------------------------------------
   Reset, document defaults, shared primitives
   --------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  /* Anchors clear the sticky header. */
  scroll-padding-top: calc(var(--head-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

html,
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.6;
  font-feature-settings: "kern", "liga";
  padding-bottom: env(safe-area-inset-bottom);
}

/* Type defaults ------------------------------------------------- */

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.012em;
  line-height: 1.08;
  text-wrap: balance;
}

h1 { font-size: clamp(34px, 5.4vw, 66px); }
h2 { font-size: clamp(26px, 3.2vw, 40px); }
h3 { font-size: 17px; line-height: 1.3; letter-spacing: -0.004em; }

p { text-wrap: pretty; }

ul, ol { list-style: none; }

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

strong { font-weight: 600; }

/* Numerals line up wherever they are set as labels. */
.label { font-variant-numeric: tabular-nums; }

::selection { background: var(--ink); color: var(--paper); }

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

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* The skip link is the one hidden element that must be able to show. */
.visually-hidden:focus-visible {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 50;
  width: auto;
  height: auto;
  margin: 0;
  padding: 10px 16px;
  overflow: visible;
  clip-path: none;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
}

/* Motion -------------------------------------------------------- */
/* One entrance for the hero, one restrained reveal for sections.
   Both are JS-gated (`.js`) so the page is complete without them. */

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.rise { animation: rise 0.7s var(--ease) both; }
.rise-2 { animation-delay: 0.08s; }
.rise-3 { animation-delay: 0.16s; }

.js [data-reveal] { opacity: 0; }
.js [data-reveal].is-in {
  opacity: 1;
  transition: opacity 0.6s var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise { animation: none; }
  .js [data-reveal] { opacity: 1; transition: none; }
}
