/* ==========================================================================
   Base — reset, typography, layout primitives
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + env(safe-area-inset-top, 0px));
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--body);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg, video, canvas { max-width: 100%; display: block; }
a { color: inherit; }
p { margin: 0; }
button, input, select, textarea { font: inherit; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  letter-spacing: -.025em;
  line-height: .98;
}

:focus-visible { outline: 2px solid var(--c-cyan); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--c-magenta); color: #fff; }
[hidden] { display: none !important; }

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

.skip-link {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--deep);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform .2s var(--ease);
}
.skip-link:focus { transform: none; }

/* Layout primitives */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

.sec { --sec-pad: clamp(56px, min(7vw, 10vh), 104px); position: relative; padding: var(--sec-pad) 0; }
/* Menu jumps skip most of the top padding so the heading sits just under the nav */
.sec[id] { scroll-margin-top: calc(24px - var(--sec-pad)); }

/* Section heading */
.head { margin-bottom: clamp(28px, min(3.6vw, 5vh), 56px); }
.head h2 { max-width: 24ch; font-size: clamp(32px, 5vw, 62px); margin-bottom: 18px; text-wrap: balance; }
.head p { color: var(--soft); font-size: clamp(16px, 1.5vw, 19px); text-wrap: pretty; }

@media (max-width: 720px) {
  body { font-size: 16px; }
}

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