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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

:root {
  /* Headings run the same grotesque as the body, but tight and heavy. The
     contrast comes from weight and tracking rather than from a second face. */
  --font-display: ui-sans-serif, system-ui, -apple-system,
    'Segoe UI Variable Display', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Mono', 'Segoe UI Mono', Menlo, Consolas,
    monospace;
}

body {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img,
svg,
iframe {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
  color: inherit;
}

a {
  color: hsl(var(--brand));
  text-underline-offset: 3px;
}

h1,
h2 {
  font-family: var(--font-display);
  line-height: 1.05;
  text-wrap: balance;
  font-weight: 750;
}

h3,
h4 {
  line-height: 1.25;
  text-wrap: balance;
  font-weight: 620;
}

h1 {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  letter-spacing: -0.04em;
}

h2 {
  font-size: clamp(1.875rem, 3.5vw, 2.5rem);
  letter-spacing: -0.032em;
}

h3 {
  font-size: 1.0625rem;
  letter-spacing: -0.005em;
}

p {
  text-wrap: pretty;
}

:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
  border-radius: calc(var(--radius) - 2px);
}

.container {
  width: min(100% - 2.5rem, 68rem);
  margin-inline: auto;
}

.section {
  padding-block: clamp(4rem, 10vw, 7rem);
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: hsl(var(--brand));
}

.section-title .eyebrow {
  /* Section numbers sit on the baseline as a quiet index, not a label. */
  color: hsl(var(--muted-foreground));
  font-size: 0.8125rem;
}

.muted {
  color: hsl(var(--muted-foreground));
}

.lead {
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
  color: hsl(var(--muted-foreground));
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -100%;
  z-index: 100;
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 0.5rem 0.875rem;
  transition: top 0.15s var(--ease);
}

.skip-link:focus {
  top: 0.5rem;
}

/* ---- Animation engine ----
   Every hidden-before-reveal state is scoped under html.js. Without
   JavaScript nothing is ever hidden. */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.js .reveal {
  opacity: 0;
  transform: translateY(1rem);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
  transition-delay: calc(var(--i, 0) * var(--stagger));
}

.js .enter {
  animation: fade-up 0.6s var(--ease) both;
  animation-delay: calc(var(--i, 0) * var(--stagger));
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal,
  .js .reveal.is-visible {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .js .enter {
    animation: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
