/* Reset, type and layout primitives. Mobile first. */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  margin: 0; min-height: 100vh;
  background: var(--page); color: var(--ink);
  font-family: var(--font); font-size: var(--step-0); line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; letter-spacing: -.035em; line-height: 1.05; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol, dl, dd { margin: 0; padding: 0; list-style: none; }
button, input, textarea { font: inherit; color: inherit; }
mark { background: none; color: inherit; }
::selection { background: var(--ink); color: var(--page); }
:focus-visible { outline: 2px solid var(--signal-deep); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: 12px; top: -48px; z-index: 100; padding: 8px 14px; border-radius: var(--radius); background: var(--ink); color: var(--page); }
.skip:focus { top: 12px; }

.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.mono { font-family: var(--mono); }
.section { position: relative; padding-block: 96px; }

/* Black inset panel, the scale.com frame. */
.dark {
  position: relative; margin: 0 var(--inset); border-radius: var(--radius-panel); overflow: hidden;
  background: var(--panel); color: var(--on-panel);
}
.dark ::selection { background: var(--signal); color: var(--signal-ink); }
/* Soft grey inset panel. */
.soft { margin: 0 var(--inset); border-radius: var(--radius-panel); background: var(--page-2); }

/* Small label: strata glyph + mono caps. Used sparingly. */
.label {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 24px;
  font-family: var(--mono); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2);
}
.dark .label { color: var(--on-panel-2); }
.glyph { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.glyph i { display: block; height: 2px; border-radius: 1px; background: var(--ink); }
.glyph i:nth-child(1) { width: 4px; opacity: .45; }
.glyph i:nth-child(2) { width: 7px; opacity: .7; }
.glyph i:nth-child(3) { width: 10px; }
.dark .glyph i { background: var(--signal); }

.h2 { font-size: var(--step-3); letter-spacing: -.045em; line-height: 1.02; }
.h2 .tone { color: var(--ink-3); }
.dark .h2 .tone { color: var(--on-panel-2); }
.lede { margin-top: 20px; max-width: 54ch; color: var(--ink-2); font-size: var(--step-1); }
.dark .lede { color: var(--on-panel-2); }
.section-head { max-width: 900px; margin-bottom: 56px; }

/* Scroll-driven reveal for any block. Base is the final state, so browsers without
   scroll timelines (and reduced motion) simply show the content. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 5% entry 70%;
    }
  }
}
@keyframes reveal { from { opacity: 0; transform: translateY(32px); filter: blur(4px); } }

@media (min-width: 768px) {
  .section { padding-block: 152px; }
  .section-head { margin-bottom: 80px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
