/* ==========================================================================
   BASE
   Document defaults, typography scale, text utilities, focus styling.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Fonts
   The site ships with no binary font files so it runs from a bare static
   server. Drop woff2 files into assets/fonts/ and uncomment to self-host.
   -------------------------------------------------------------------------- */
/*
@font-face {
  font-family: "Space Grotesk";
  src: url("../assets/fonts/space-grotesk-variable.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
*/

html {
  scroll-behavior: smooth;
  /* Clears the header pill at the top and the docked section bar at the
     bottom, so a jumped-to section never lands underneath either */
  scroll-padding-top: calc(var(--header-bottom) + 1.5rem);
  scroll-padding-bottom: calc(var(--section-nav-bottom) + 1rem);
}

body {
  background-color: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--leading-normal);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Guard against any decorative overflow escaping the viewport */
  overflow-x: hidden;
  /* Keeps the footer clear of the docked section bar */
  padding-bottom: var(--section-nav-bottom);
}

/* --------------------------------------------------------------------------
   Headings
   -------------------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  text-wrap: pretty;
}

h1 {
  font-size: var(--text-hero);
  line-height: var(--leading-tight);
}

h2 {
  font-size: var(--text-h2);
  line-height: 1.02;
}

h3 {
  font-size: var(--text-h3);
}

h4 {
  font-size: var(--text-h4);
  letter-spacing: -0.01em;
}

p {
  text-wrap: pretty;
}

strong {
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Text utilities
   -------------------------------------------------------------------------- */

/* Neon highlight for a word or line inside a heading. Use sparingly. */
.text-accent {
  color: var(--color-accent);
}

.text-muted {
  color: var(--color-text-muted);
}

.text-subtle {
  color: var(--color-text-subtle);
}

/* Small uppercase tracking label that opens most sections */
.eyebrow {
  display: block;
  font-size: var(--text-meta);
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-text-subtle);
  margin-bottom: var(--space-md);
}

/* The little neon index that prefixes each eyebrow, e.g. "01 THE PROBLEM" */
.eyebrow__index {
  margin-right: 0.6em;
  color: var(--color-accent);
  font-variant-numeric: tabular-nums;
}

.eyebrow--accent {
  color: var(--color-accent);
}


/* Intro paragraph under a section heading */
.lede {
  color: var(--color-text-muted);
  max-width: 56ch;
  font-size: var(--text-body);
}

/* The explicit <br> in the markup controls the line break, so don't let the
   browser re-balance the lines. Narrow viewports still wrap naturally. */
.section-heading {
  max-width: 36ch;
  margin-bottom: var(--space-md);
  text-wrap: normal;
}

/* --------------------------------------------------------------------------
   Links
   -------------------------------------------------------------------------- */

/* Only inline links inside running prose get the underlined treatment.
   Navigation and list links are styled by their own components. */
p a:not([class]) {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

p a:not([class]):hover {
  color: var(--color-accent-bright);
}

/* --------------------------------------------------------------------------
   Focus
   Always visible, never removed. Two-tone so it reads on any surface.
   -------------------------------------------------------------------------- */

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

/* --------------------------------------------------------------------------
   Accessibility helpers
   -------------------------------------------------------------------------- */

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

.skip-link {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -120%);
  z-index: 100;
  background: var(--color-accent);
  color: var(--color-text-on-accent);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: transform var(--transition-fast);
}

.skip-link:focus {
  transform: translate(-50%, 0);
}

/* --------------------------------------------------------------------------
   Selection
   -------------------------------------------------------------------------- */

::selection {
  background: var(--color-accent);
  color: var(--color-text-on-accent);
}
