/* ==========================================================================
   Ringplane — Reset, primitives, layout
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  color-scheme: dark;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--t-body);
  line-height: var(--lead-body);
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg, canvas { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }

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

::selection {
  background: var(--signal-a-32);
  color: var(--ink);
}

/* Focus: visible, branded, never suppressed. */
:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: var(--r-1);
}
:focus:not(:focus-visible) { outline: none; }

/* --------------------------------------------------------------------------
   Skip link
   -------------------------------------------------------------------------- */
.skip {
  position: absolute;
  left: var(--s-4);
  top: -100px;
  z-index: 200;
  padding: var(--s-3) var(--s-5);
  background: var(--signal);
  color: #14100a;
  font-weight: 600;
  border-radius: var(--r-2);
  transition: top var(--d-2) var(--ease-out);
}
.skip:focus { top: var(--s-4); }

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

.section {
  position: relative;
  padding-block: var(--section-y);
}
.section + .section { border-top: 1px solid var(--line); }

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

/* --------------------------------------------------------------------------
   Type primitives
   -------------------------------------------------------------------------- */
.display {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  line-height: var(--display-leading);
  text-wrap: balance;
}
.d1 { font-size: var(--t-display-1); }
.d2 { font-size: var(--t-display-2); }
.d3 { font-size: var(--t-display-3); line-height: 1.08; }

.lead {
  font-size: var(--t-lead);
  line-height: var(--lead-snug);
  color: var(--ink-2);
  text-wrap: pretty;
}

.body    { color: var(--ink-2); text-wrap: pretty; }
.muted   { color: var(--ink-3); }
.sig     { color: var(--signal); }
.steel   { color: var(--ring); }

/* Monospace telemetry label — the recurring "instrument" motif */
.label {
  font-family: var(--font-data);
  font-size: var(--t-nano);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}
.mono {
  font-family: var(--font-data);
  font-size: var(--t-micro);
  letter-spacing: var(--track-mono);
  font-variant-numeric: tabular-nums;
}

/* Section eyebrow: index + label on a hairline */
.eyebrow {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  margin-bottom: var(--s-6);
}
.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-2), transparent);
}
.eyebrow__idx {
  font-family: var(--font-data);
  font-size: var(--t-nano);
  color: var(--signal);
  letter-spacing: 0.1em;
}

/* --------------------------------------------------------------------------
   Rules & hairlines
   -------------------------------------------------------------------------- */
.rule {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 0;
}
.rule--fade {
  background: linear-gradient(90deg, transparent, var(--line-2) 22%, var(--line-2) 78%, transparent);
}

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

/* --------------------------------------------------------------------------
   Scroll-reveal — progressive enhancement.
   .reveal is only dimmed once JS confirms it can observe. Without JS the
   content is fully visible: the `js-reveal` class is added by the script.
   -------------------------------------------------------------------------- */
.js-reveal .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity var(--d-4) var(--ease-out),
    transform var(--d-4) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
.js-reveal .reveal.is-in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .js-reveal .reveal { opacity: 1; transform: none; transition: none; }
}

/* ===== Reveal stagger ================================================
   Delay is expressed as an index attribute rather than an inline style
   attribute, so the production CSP can keep `style-src 'self'` without
   `'unsafe-inline'`. Nine steps covers every list on the page.
   ===================================================================== */
[data-rd="0"] { --reveal-delay: 0ms; }
[data-rd="1"] { --reveal-delay: 70ms; }
[data-rd="2"] { --reveal-delay: 140ms; }
[data-rd="3"] { --reveal-delay: 210ms; }
[data-rd="4"] { --reveal-delay: 280ms; }
[data-rd="5"] { --reveal-delay: 350ms; }
[data-rd="6"] { --reveal-delay: 420ms; }
[data-rd="7"] { --reveal-delay: 490ms; }
[data-rd="8"] { --reveal-delay: 560ms; }
