/* ==========================================================================
   Base — reset, container, type hierarchy, prose rules, reveal
   ========================================================================== */

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

html {
  /* Drives every rem on the site — see --font-size-root in tokens.css. */
  font-size: var(--font-size-root);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h-scrolled) + var(--s-5));
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  text-rendering: optimizeLegibility;
  /* Justified mobile prose must never produce sideways scroll */
  overflow-x: hidden;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

figure,
blockquote {
  margin: 0;
}

hr {
  border: 0;
  border-top: 1px solid var(--line-neutral);
  margin: 0;
}

::selection {
  background: var(--rose);
  color: var(--off-white);
}

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

body.no-scroll {
  overflow: hidden;
}

.skip-link {
  position: absolute;
  left: var(--s-4);
  top: -100px;
  z-index: 999;
  background: var(--purple);
  color: var(--off-white);
  padding: var(--s-3) var(--s-5);
  border-radius: var(--r-btn);
  transition: top var(--dur-fast) var(--ease);
}
.skip-link:focus {
  top: var(--s-4);
}

/* ==========================================================================
   CONTAINER
   All content lives inside .wrap. Nothing reaches the viewport edge except
   deliberate full-bleed BACKGROUNDS — whose content still sits in a .wrap.
   ========================================================================== */
.wrap {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Full-bleed background helper: the element spans the viewport, its child
   .wrap keeps the content on the global grid. */
.bleed {
  width: 100%;
}

.section {
  padding-block: var(--section-y);
}

.section--tight {
  padding-block: clamp(3rem, 5vw, 4.5rem);
}

/* Continues the band directly above it — no top padding, so the two read as
   one column of content rather than two stacked bands. */
.section--flush-top {
  padding-top: 0;
}

/* Shared photographic backdrop. The photo sits behind the section; a purple
   wash on ::before holds the type at AA. Any section using it must be
   position: relative with isolation: isolate. */
.backdrop {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
}
.backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}
.backdrop--even img {
  object-position: 50% 42%;
}

/* ==========================================================================
   TYPE HIERARCHY (plan.txt section 04)
   Headings are left-aligned everywhere — hero, section heads, cards, CTA
   band, footer. One global rule so it cannot drift section by section.
   ========================================================================== */
h1,
h2,
h3,
h4,
h5,
h6,
.display,
.h1,
.h2,
.h3,
.h4 {
  text-align: left;
  margin: 0;
  color: var(--purple);
  line-height: var(--lh-heading);
  text-wrap: balance;
}

/* Instrument Serif carries display / h1 / h2 — the brand voice. */
.display,
h1,
.h1,
h2,
.h2 {
  font-family: var(--font-display);
  font-weight: var(--wt-h);
  font-feature-settings: "kern" 1, "liga" 1;
}

/* h3 / h4. */
h3,
.h3,
h4,
.h4 {
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: -0.005em;
}

.display {
  font-size: var(--fs-display);
  font-weight: var(--wt-display);
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
}
h1,
.h1 {
  font-size: var(--fs-h1);
  line-height: var(--lh-tight);
  letter-spacing: -0.018em;
}
h2,
.h2 {
  font-size: var(--fs-h2);
  letter-spacing: -0.014em;
}
h3,
.h3 {
  font-size: var(--fs-h3);
}
h4,
.h4 {
  font-size: var(--fs-h4);
}

/* --- Eyebrow — IBM Plex Mono, the data layer (plan.txt section 03) ------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--rose);
  margin: 0 0 var(--s-4);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  text-align: left;
  max-width: none;
}

.on-dark h1,
.on-dark h2,
.on-dark h3,
.on-dark h4,
.on-dark .h1,
.on-dark .h2,
.on-dark .h3,
.on-dark .h4,
.on-dark .display {
  color: var(--off-white);
}
.on-dark .eyebrow {
  color: var(--rose-bright);
}

/* ==========================================================================
   PROSE
   Ragged-right at every width. Mobile used to be justified + hyphenated,
   but on a narrow column that still left wide gaps between words and split
   words like "deter-mine", so it was dropped (2026-11-22).
   ========================================================================== */
p,
.prose {
  margin: 0 0 var(--s-5);
  color: var(--text-muted);
  max-width: var(--measure);

  text-align: left;
  hyphens: manual;
  -webkit-hyphens: manual;
  text-wrap: pretty;
  overflow-wrap: break-word;
}

p:last-child {
  margin-bottom: 0;
}

/* Opt OUT — anything that is not running prose */
.no-justify,
.btn,
.link,
.nav a,
label,
figcaption,
li,
.eyebrow,
.crumbs,
.form-note,
.form-status {
  text-align: left;
  hyphens: manual;
  -webkit-hyphens: manual;
}

.on-dark p,
.on-dark .prose {
  color: var(--text-on-dark-muted);
}

/* Light surfaces sitting inside a dark band keep their own dark text — the
   .on-dark colours above must not cascade into white cards and panels. */
.on-dark .card,
.on-dark .form-panel {
  color: var(--text);
}
.on-dark .card h1,
.on-dark .card h2,
.on-dark .card h3,
.on-dark .card h4,
.on-dark .card .h1,
.on-dark .card .h2,
.on-dark .card .h3,
.on-dark .card .h4,
.on-dark .form-panel h1,
.on-dark .form-panel h2,
.on-dark .form-panel h3,
.on-dark .form-panel h4,
.on-dark .form-panel .h1,
.on-dark .form-panel .h2,
.on-dark .form-panel .h3,
.on-dark .form-panel .h4 {
  color: var(--text-strong);
}
.on-dark .card p,
.on-dark .card .prose,
.on-dark .form-panel p,
.on-dark .form-panel .prose {
  color: var(--text-muted);
}

.body-lg {
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: var(--text);
}

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

.measure {
  max-width: var(--measure);
}
.measure-sm {
  max-width: var(--measure-sm);
}

/* --- Section head --------------------------------------------------------- */
.section-head {
  max-width: 760px;
  margin-bottom: clamp(var(--s-6), 3vw, var(--s-8));
}
.section-head p {
  margin-top: var(--s-5);
}

/* --- Data / numerals — IBM Plex Mono ------------------------------------- */
.data {
  font-family: var(--font-mono);
  font-size: var(--fs-data);
  font-variant-numeric: tabular-nums;
}

/* --- Utilities ------------------------------------------------------------ */
.mt-6 {
  margin-top: var(--s-5);
}
.mt-7 {
  margin-top: var(--s-6);
}
.mt-8 {
  margin-top: var(--s-7);
}
.mt-10 {
  margin-top: var(--s-9);
}

/* Phones: the gaps above were sized for desktop and stacked into big empty
   bands on a narrow screen, so each steps down one size. */
@media (max-width: 619.98px) {
  p,
  .prose {
    margin-bottom: var(--s-4);
  }
  .mt-6 { margin-top: var(--s-4); }
  .mt-7 { margin-top: var(--s-5); }
  .mt-8 { margin-top: var(--s-6); }
  .mt-10 { margin-top: var(--s-8); }
  .section--tight {
    padding-block: 2.5rem;
  }
}

.rule {
  height: 1px;
  background: var(--line-neutral);
  border: 0;
}

.bg-offwhite {
  background: var(--off-white-deep);
}
.bg-white {
  background: var(--white);
}
.bg-purple {
  background: var(--purple);
}

.on-dark {
  color: var(--text-on-dark);
}

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

/* --- Reveal on scroll (progressive enhancement) --------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  filter: blur(3px);
  transition: opacity var(--dur-reveal) var(--ease-out),
    transform var(--dur-reveal) var(--ease-out),
    filter var(--dur-reveal) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal.is-in {
  opacity: 1;
  transform: none;
  filter: none;
}
/* Without JS the content must still be visible */
.no-js .reveal {
  opacity: 1;
  transform: none;
  filter: none;
}

@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;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
    filter: none;
  }
}
