/* Reset, typography and small reusable pieces. */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
html.is-locked { overflow: hidden; }

body {
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, svg, canvas { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
sub, sup { font-size: 0.68em; line-height: 0; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ---------- type ---------- */
.eyebrow,
.label {
  font: 500 11.5px/1.4 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.label { letter-spacing: 0.08em; }

.title {
  font: 400 clamp(40px, 6.2vw, 96px) / 0.98 var(--serif);
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.title--xl { font-size: clamp(72px, 15vw, 240px); line-height: 0.9; letter-spacing: -0.03em; }
em { font-style: italic; }

.inline {
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  transition: background-size 0.35s var(--ease), color 0.2s;
}
.inline:hover { color: var(--accent); background-size: 0 1px; background-position: 100% 100%; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font: 500 13px/1 var(--mono);
  letter-spacing: 0.02em;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s, transform 0.25s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn--sm { height: 32px; padding: 0 14px; font-size: 12px; }
.btn--ghost { border-color: var(--rule); }
.btn--ghost:hover { border-color: currentColor; }
.btn--accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--accent:hover { background: transparent; color: var(--accent); }

input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 20px;
  background: transparent;
  cursor: pointer;
}
input[type='range']::-webkit-slider-runnable-track { height: 1px; background: currentColor; opacity: 0.35; }
input[type='range']::-moz-range-track { height: 1px; background: currentColor; opacity: 0.35; }
input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  margin-top: -6.5px;
  border-radius: 50%;
  background: var(--accent);
  border: 0;
  box-shadow: 0 0 0 4px var(--accent-soft);
}
input[type='range']::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 0;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* ---------- reveal ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }
[data-scramble] { font-variant-ligatures: none; }

/* ---------- a11y ---------- */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip {
  position: fixed;
  left: 12px; top: -60px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 8px;
  font: 500 13px var(--mono);
}
.skip:focus { top: 12px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
