/* =========================================================================
   Magenta - reset, ground, typography, layout primitives
   ========================================================================= */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }

h1, h2, h3, h4 { margin: 0; line-height: var(--lh-snug); }
p { margin: 0 0 var(--sp-4); }
ul, ol { margin: 0; padding: 0; list-style: none; }

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

/* -------------------------------------------------------------- Paper grain
   A fixed noise layer over the whole document. SVG turbulence rather than a
   bitmap: no request, no weight, resolution independent. */
.grain {
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: 0.4;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.32'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------------ Layout */
.wrap {
  width: min(100% - (var(--gutter) * 2), var(--wrap));
  margin-inline: auto;
}

.section {
  position: relative;
  z-index: var(--z-base);
  padding-block: var(--section-y);
  overflow: clip;
}

.section--paper { background: var(--paper); }
.section--stock { background: var(--stock); }

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

/* The deep magenta, not the bright one. Paper on --m measures 3.8:1, which
   carries a big display heading but fails AA for the eyebrow and the note set
   at 13px. --m-deep is the same brand magenta darkened and measures 5.96:1, so
   everything on this ground is legible. The bright --m still does the vibrant
   work everywhere it sits behind large type or under artwork. */
.section--magenta {
  background: var(--m-deep);
  color: var(--paper);
}

/* -------------------------------------------------------------- Typography */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-display);
  text-transform: uppercase;
  text-wrap: balance;
}

.display--lg { font-size: var(--fs-h2); }
.display--md { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 3.1rem); }
.display--light { color: var(--paper); }

.display em,
.cta__title em {
  font-family: var(--font-hand);
  font-style: normal;
  text-transform: none;
  color: var(--m);
  font-size: 1.12em;
  letter-spacing: 0;
}

.display--light em { color: var(--y); }
.section--magenta .display em { color: var(--y); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin: 0 0 var(--sp-4);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--ink-soft);
}

.eyebrow--light { color: var(--paper); }

.eyebrow__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--m);
  animation: pulse 2.4s var(--ease-out) infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%      { transform: scale(1.6); opacity: 0.5; }
}

.lede {
  font-size: var(--fs-lede);
  line-height: 1.4;
  max-width: 46ch;
  text-wrap: pretty;
}

.lede--light { color: var(--paper); }

.prose { max-width: 62ch; }
.prose p { margin-bottom: var(--sp-4); }
.prose a { text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* Highlighter sweep - a marker pass over the words, clipped so it reads as
   ink laid down by hand rather than a background rectangle. */
.hl {
  background: none;
  color: inherit;
  padding: 0 0.12em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  background-image: linear-gradient(
    100deg,
    transparent 0.4%,
    var(--y) 2%,
    var(--y) 96%,
    transparent 99%
  );
  background-repeat: no-repeat;
  background-size: 100% 62%;
  background-position: 0 78%;
}

.hl--teal { background-image: linear-gradient(100deg, transparent 0.4%, var(--teal-tint) 2%, var(--teal-tint) 96%, transparent 99%); }
.hl--m { background-image: linear-gradient(100deg, transparent 0.4%, var(--m-tint) 2%, var(--m-tint) 96%, transparent 99%); }

/* ------------------------------------------------------------ Section heads */
.section-head { margin-bottom: clamp(2.5rem, 1.5rem + 3vw, 4.5rem); }
.section-head__lede { margin-top: var(--sp-5); }
.section-head--center { text-align: center; }
.section-head--center .lede { margin-inline: auto; }

.section-head--split {
  display: grid;
  gap: var(--sp-6);
  align-items: end;
}

@media (min-width: 900px) {
  .section-head--split { grid-template-columns: 1.1fr 0.9fr; }
  .section-head__aside { justify-self: end; text-align: left; }
}

/* ------------------------------------------------------------ Accessibility */
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed !important;
  top: 1rem; left: 1rem;
  z-index: 999;
  width: auto; height: auto;
  clip: auto; clip-path: none;
  padding: var(--sp-3) var(--sp-5);
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-pill);
}

/* --------------------------------------------------------- Reduced motion
   Everything decorative stops. The layout is designed to be complete when
   static, so nothing is lost - only the movement. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
