/* ==========================================================================
   BASE — reset, document rhythm, layout primitives
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + var(--sp-lg));
  tab-size: 4;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  min-height: 100svh;
  background: var(--base);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, video, canvas, iframe, picture {
  display: block;
  max-width: 100%;
  height: auto;
}

input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }

ul, ol { padding: 0; list-style: none; }

a { color: var(--copper); text-decoration: none; }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: var(--copper); color: #fff; }

hr {
  height: 1px;
  border: 0;
  background: var(--line);
}

/* ------------------------------------------------------------- typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-tight);
  text-wrap: balance;
}

h1 { font-size: var(--fs-4xl); line-height: var(--lh-tight); letter-spacing: var(--ls-display); }
h2 { font-size: var(--fs-3xl); line-height: var(--lh-tight); letter-spacing: var(--ls-display); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
h5 { font-size: var(--fs-md); }
h6 { font-size: var(--fs-sm); }

p { text-wrap: pretty; }

strong, b { font-weight: 600; }
small  { font-size: var(--fs-xs); }
code, kbd, samp { font-family: var(--font-mono); font-size: .92em; }

/* technical labels: uppercase, wide tracking, small */
.label {
  font-family: var(--font-body);
  font-size: var(--fs-3xs);
  font-weight: 700;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  line-height: 1;
}

/* ---------------------------------------------------------------- layout */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.shell--wide { max-width: var(--shell-wide); }
.shell--prose { max-width: var(--shell-prose); }

.section { padding-block: var(--section-y); }
.section--tight { padding-block: clamp(40px, 5vw, 72px); }
.section--void { background: var(--void); color: var(--on-dark); }
.section--graphite { background: var(--graphite); color: var(--on-dark); }
.section--plain { background: var(--base); }

/* grid helpers */
.grid { display: grid; gap: clamp(16px, 2vw, 28px); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1100px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
}

/* ------------------------------------------------------------- utilities */
.flow > * + *            { margin-top: var(--flow-gap, var(--sp-md)); }
.measure                 { max-width: var(--measure); }
.measure-tight           { max-width: var(--measure-tight); }
.text-copper              { color: var(--copper); }
.text-mute                { color: var(--ink-mute); }
.on-dark .text-mute       { color: var(--on-dark-mute); }
.text-center              { text-align: center; }
.nowrap                   { white-space: nowrap; }
.is-hidden                { display: none !important; }

.screen-reader-text, .sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px; left: var(--sp-sm);
  z-index: var(--z-top);
  padding: var(--sp-sm) var(--sp-lg);
  background: var(--copper);
  color: #fff;
  font-weight: 600;
  clip-path: var(--clip-sm);
  transition: top var(--t-base) var(--ease);
}
.skip-link:focus { top: var(--sp-sm); color: #fff; }

/* ------------------------------------------------------------- reveals */
/* Gated behind `.js`, which pcr.js sets synchronously on <html>.
   Ungated, `.reveal { opacity: 0 }` meant every section on every inner page was
   invisible when JavaScript was off - and invisible to anything that does not
   run scripts. The risk was hidden because the front page loads pcr.js and
   resolves the class immediately. */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; }
}
@media print {
  .reveal { opacity: 1 !important; transform: none !important; }
  .site-header, .site-footer, .no-print { display: none !important; }
}
