/* ============================================================
   Founders Bridge — Reset, page atmosphere, type primitives
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
}

/* Paper grain. Fixed so it reads as the stock the page is printed on
   rather than something that scrolls with the content. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  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.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--acid); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}
.on-ink :focus-visible { outline-color: var(--acid); }

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; }

/* ===== Layout ===== */
.shell {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  position: relative;
  padding-block: var(--space-section);
  border-top: 1px solid var(--rule);
}
.section--sm { padding-block: var(--space-section-sm); }

/* Dark surfaces invert the whole token set they consume. */
.on-ink {
  background: var(--ink);
  color: var(--on-ink);
}
.on-ink .section-title { color: var(--on-ink); }
.on-ink .lede { color: var(--on-ink-muted); }
.on-ink .index-label { color: var(--on-ink-muted); }

.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-3xl);
  line-height: var(--leading-snug);
  letter-spacing: var(--track-tight);
  text-wrap: balance;
}

.section-title em {
  font-style: italic;
  /* the accent can never be type on paper, so it becomes the ground */
  background: linear-gradient(var(--acid), var(--acid)) no-repeat;
  background-size: 100% 0.42em;
  background-position: 0 78%;
  padding-inline: 0.08em;
}
/* Inverse of the paper rule: on ink, acid is legible as type, so drop the
   highlight ground and colour the word instead. */
.on-ink .section-title em {
  color: var(--acid);
  background: none;
  padding-inline: 0;
}

.lede {
  font-size: var(--text-lg);
  line-height: var(--leading-loose);
  color: var(--ink-3);
  max-width: var(--maxw-text);
  text-wrap: pretty;
}

/* Small-caps metadata label — the editorial workhorse. */
.index-label {
  display: inline-flex;
  align-items: baseline;
  gap: 0.75em;
  font-size: var(--text-micro);
  font-weight: 500;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.index-label__no {
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap; /* keep the number and its rule on one line at 320px */
}
.index-label__no::after {
  content: "";
  display: inline-block;
  width: 1.4em;
  height: 1px;
  margin-left: 0.75em;
  vertical-align: middle;
  background: var(--rule-strong);
}
.on-ink .index-label__no { color: var(--acid); }
.on-ink .index-label__no::after { background: var(--rule-ink); }

/* ===== Section header: index rail + title + lede ===== */
.head {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 4fr);
  gap: clamp(1.5rem, 1rem + 3vw, 5rem);
  align-items: end;
  margin-bottom: clamp(2.5rem, 1.6rem + 3.4vw, 5rem);
}
.head__title { margin-top: 1.1rem; }
@media (max-width: 860px) {
  .head { grid-template-columns: 1fr; align-items: start; gap: 1.5rem; }
}

/* ===== Reveal ===== */
/* Scoped to .js (set by an inline head script) so the page degrades to
   fully visible content when JavaScript is unavailable or fails. */
.js .reveal {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition:
    opacity var(--dur-slow) var(--ease) var(--reveal-delay, 0ms),
    transform var(--dur-slow) var(--ease) var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.js .reveal.is-in {
  opacity: 1;
  transform: none;
  will-change: auto;
}

/* ===== Reduced motion ===== */
@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;
  }
  .js .reveal { opacity: 1; transform: none; }
  /* Never leave the headline masked while waiting on a font. !important
     because the initial states live in later stylesheets at equal weight. */
  .js .hero__title .line > span,
  .js .hero__title em::before,
  .js .span-rule__span { transform: none !important; }
}

