/* ==========================================================================
   base.css — document ground, the 1728 frame, and shared typography.
   ========================================================================== */

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Lenis drives the scroll; it needs the document to keep its natural height. */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* The 1728 frame. Past it the composition centres instead of stretching.
   overflow-x: clip (not hidden) clips the bleed decorations without turning
   this into a scroll container, which would take ScrollTrigger's scroller
   away from the window. */
.page {
  position: relative;
  max-width: var(--container-width);
  margin-inline: auto;
  overflow-x: clip;
  background:
    url("../assets/images/starfield.jpg") repeat-y center top / 100% auto,
    var(--color-bg);
}

/* Note on content-visibility: it is deliberately NOT used on these sections.
   A skipped subtree reports contain-intrinsic-size rather than its real
   height, so ScrollTrigger measures every start/end past it against the wrong
   geometry and the pinned rail jumps as you scroll. Below-the-fold cost is
   paid down with lazy images and an idle WebGL layer instead. */

/* ---------- shared typography ---------- */
.h-section {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 14, "wdth" 100;
  font-weight: 700;
  font-size: var(--text-display);
  letter-spacing: -0.4px;
  line-height: var(--leading-display);
  text-align: center;
  color: var(--color-text);
}

.h-panel {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 14, "wdth" 100;
  font-weight: 700;
  font-size: var(--text-panel);
  letter-spacing: -0.4px;
  line-height: 1.042;                 /* 50 / 48 */
  text-align: center;
  color: var(--color-text);
}

.lede {
  font-family: var(--font-body);
  font-variation-settings: "opsz" 28;
  font-weight: 500;
  font-size: var(--text-lg);
  line-height: var(--leading-lg);
  text-align: center;
  color: var(--color-text);
}

/* Screen-reader-only, used by the skip link and the rail's live region. */
.sr-only {
  position: absolute;
  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 {
  position: absolute;
  top: 0; left: 50%;
  transform: translate(-50%, -120%);
  z-index: var(--z-loader);
  padding: 12px 20px;
  background: var(--color-accent);
  color: var(--color-on-pass);
  font-family: var(--font-display);
  font-weight: 700;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: transform var(--dur-base) var(--ease-out);
}
.skip-link:focus-visible { transform: translate(-50%, 0); }
