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

html { max-width: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 1rem); overflow-x: clip; }

body {
  margin: 0;
  min-width: 0;
  background-color: var(--paper);
  background-image: repeating-linear-gradient(0deg, transparent 0, transparent 31px, var(--line-soft) 32px);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  max-width: 100%;
  overflow-x: clip;
  transition: background-color .25s ease, color .25s ease;
}

body.is-locked { overflow: hidden; }

::selection { background: var(--yellow); color: var(--black); }

a { color: inherit; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

:focus-visible { outline: 3px solid var(--paper); outline-offset: 2px; box-shadow: 0 0 0 6px var(--ink) !important; }

h1, h2, h3, p, blockquote { margin-top: 0; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

ul { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  top: .75rem;
  left: .75rem;
  z-index: 1000;
  padding: .75rem 1rem;
  background: var(--yellow);
  border: var(--border);
  color: var(--black);
  font-weight: 800;
  transform: translateY(-160%);
}

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

.section { position: relative; padding: var(--section-y) var(--page-x); }

.section-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 25rem);
  gap: clamp(2rem, 3vw, 2.5rem);
  align-items: end;
  margin-bottom: clamp(3rem, 4.5vw, 4.5rem);
}

.section-header > * { min-width: 0; }

.section-index {
  display: inline-flex;
  margin-bottom: 1rem;
  padding: .5rem .78rem;
  background: var(--yellow);
  border: var(--border);
  color: var(--black);
  font-size: var(--label-size);
  font-weight: 800;
  letter-spacing: .085em;
  text-transform: uppercase;
  box-shadow: 3px 3px 0 var(--ink);
  transform: rotate(-1deg);
}

.section-header h2 {
  margin-bottom: 0;
  font-family: var(--display);
  font-size: clamp(3.25rem, 6vw, 7rem);
  line-height: .86;
  letter-spacing: -.065em;
}

.section-header h2 span { color: var(--blue); }

.section-summary {
  margin: 0;
  padding-left: 1.25rem;
  border-left: 3px solid var(--coral);
  color: var(--muted);
  font-size: clamp(1rem, 1.35vw, 1.2rem);
  line-height: 1.65;
}

.scroll-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: 3px;
  background: transparent;
  pointer-events: none;
}

.scroll-progress span { display: block; width: 100%; height: 100%; background: var(--coral); transform: scaleX(0); transform-origin: left center; will-change: transform; }

.reveal { opacity: 1; transform: none; }
.js.motion-ready .reveal { opacity: 0; translate: 0 2rem; transition: opacity .7s var(--ease), translate .7s var(--ease); }
.js.motion-ready .reveal.is-visible { opacity: 1; translate: 0 0; }

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 999;
  width: 2.7rem;
  height: 2.7rem;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(-50%, -50%, 0);
  transition: width .18s ease, height .18s ease, background-color .18s ease, opacity .18s ease;
}

.cursor span { position: absolute; inset: 50% auto auto 50%; width: .3rem; height: .3rem; border-radius: 50%; background: var(--coral); transform: translate(-50%, -50%); }
.cursor.is-visible { opacity: 1; }
.cursor.is-hovering { width: 4rem; height: 4rem; background: color-mix(in srgb, var(--yellow) 45%, transparent); }

@media (pointer: coarse), (prefers-reduced-motion: reduce) { .cursor { display: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js.motion-ready .reveal { opacity: 1; translate: 0; }
}
