/* The page's frame: reset, type, buttons, the nav, section heads, the footer and the scroll reveal. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--sp-72); }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 var(--fs-body) / var(--lh-body) var(--ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.vh { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--sp-16); top: -100px; z-index: 50; padding: var(--sp-8) var(--sp-16); background: var(--ink); color: var(--surface); border-radius: var(--r-pill); text-decoration: none; }
.skip:focus { top: var(--sp-16); }

.wrap { width: min(100% - 2 * var(--gutter), var(--page)); margin-inline: auto; }
.fx { width: var(--ic-m); height: var(--ic-m); object-fit: contain; flex: none; user-select: none; -webkit-user-drag: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-8);
  min-height: var(--tap); padding: 0 var(--sp-20);
  border: var(--hair) solid transparent; border-radius: var(--r-pill);
  font-size: 15px; font-weight: 500; line-height: 1; text-decoration: none; white-space: nowrap;
  transition: background-color var(--d-fast) var(--ease-std), border-color var(--d-fast) var(--ease-std), transform var(--d-fast) var(--ease-std);
}
.btn:active { transform: scale(0.97); }
.btn-ink { background: var(--ink); color: var(--surface); }
.btn-ink:hover { background: var(--ink-hover); }
.btn-ghost { background: var(--surface); border-color: var(--sel); color: var(--ink); }
.btn-ghost:hover { background: var(--ground); }
.btn-l { min-height: var(--btn-l); padding: 0 var(--sp-24); font-size: var(--fs-body); }
.btn .fx { width: 20px; height: 20px; }

/* ---------- nav ---------- */
.nav-sentinel { position: absolute; top: 0; left: 0; width: 1px; height: 1px; }
.nav {
  position: sticky; top: 0; z-index: 20;
  background: var(--ground);
  border-bottom: var(--hair) solid transparent;
  transition: border-color var(--d-base) var(--ease-std);
}
.nav.is-stuck { border-bottom-color: var(--sel); }
.nav-in { display: flex; align-items: center; gap: var(--sp-24); height: 64px; }
.brand { display: inline-flex; align-items: center; gap: var(--sp-8); text-decoration: none; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.brand sb-mark { display: block; width: 32px; height: 32px; }
.brand sb-mark > * { width: 100%; height: 100%; }
.nav-links { display: flex; gap: var(--sp-4); margin-left: auto; }
.nav-links a {
  display: inline-flex; align-items: center; gap: var(--sp-8); min-height: 36px; padding: 0 var(--sp-12);
  border-radius: var(--r-pill); text-decoration: none; font-size: 15px; font-weight: 500; color: var(--ink);
  transition: background-color var(--d-fast) var(--ease-std);
}
.nav-links a:hover { background: var(--sel); }
.nav-links .fx { width: 18px; height: 18px; }
.nav .btn { min-height: 40px; }
@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav .btn { margin-left: auto; }
}

/* ---------- sections ---------- */
.sec { padding-block: var(--sp-96); }
.sec-head { display: grid; justify-items: center; gap: var(--sp-16); text-align: center; margin-bottom: var(--sp-48); }
.sec-head > .fx { width: var(--ic-xl); height: var(--ic-xl); }
.sec-head h2, .h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); letter-spacing: var(--tr-h2); font-weight: 700; }
.sec-head p, .lede { max-width: 60ch; font-size: var(--fs-lede); line-height: var(--lh-lede); color: var(--muted); }
.h3 { font-size: var(--fs-h3); line-height: var(--lh-h3); letter-spacing: var(--tr-h3); font-weight: 600; }
.card {
  background: var(--surface);
  border: var(--hair) solid var(--sel);
  border-radius: var(--r-surf);
}
@media (max-width: 640px) {
  .sec { padding-block: var(--sp-64); }
  .sec-head { margin-bottom: var(--sp-32); }
}

/* ---------- footer ---------- */
.foot { padding-block: var(--sp-48) var(--sp-64); border-top: var(--hair) solid var(--sel); }
.foot-in { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-24); }
.foot-links { display: flex; flex-wrap: wrap; gap: var(--sp-8) var(--sp-24); margin-left: auto; font-size: var(--fs-small); }
.foot-links a { text-decoration: none; color: var(--muted); min-height: var(--tap); display: inline-flex; align-items: center; }
.foot-links a:hover { color: var(--ink); }
.foot small { flex-basis: 100%; color: var(--muted); font-size: var(--fs-meta); }

/* ---------- scroll reveal: each block rises into place once, its siblings a beat apart ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--d-deliberate) var(--ease-out), transform var(--d-deliberate) var(--ease-out); /* deliberate */
  transition-delay: calc(var(--i, 0) * 70ms);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .btn, .btn:active { transition: none; transform: none; }
}
