/* =============================================================================
   Base — reset, typography, global utilities
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: var(--fg-faint) transparent;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
}

::selection {
  background: var(--fg);
  color: var(--bg);
}

/* Scrollbar ---------------------------------------------------------------- */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: rgba(244, 242, 238, 0.18);
  border-radius: 999px;
  border: 3px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(244, 242, 238, 0.32);
}

/* Focus -------------------------------------------------------------------- */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Typography helpers ------------------------------------------------------- */

.display {
  font-size: var(--fs-display);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  font-weight: 500;
  text-wrap: balance;
}

.h1 {
  font-size: var(--fs-h1);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-tight);
  font-weight: 500;
}

.h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-tight);
  font-weight: 500;
}

.h3 {
  font-size: var(--fs-h3);
  line-height: var(--lh-snug);
  font-weight: 500;
}

.lead {
  font-size: clamp(1rem, 1.35vw, 1.25rem);
  line-height: var(--lh-relaxed);
  color: var(--fg-dim);
  max-width: 62ch;
}

.body-dim {
  color: var(--fg-dim);
}

.label {
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  font-weight: 500;
}

.label-wide {
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  font-weight: 500;
}

.mono {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--fg-mute);
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--accent);
}

/* Layout utilities --------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container-narrow {
  width: 100%;
  max-width: var(--container-narrow);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-y);
}

.section-sm {
  padding-block: clamp(3rem, 5vw, 5rem);
}

.stack {
  display: flex;
  flex-direction: column;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-6);
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
  flex-wrap: wrap;
}

.section-head__text {
  max-width: 60ch;
}

.section-head h2 {
  margin-bottom: var(--sp-4);
}

.section-head p {
  color: var(--fg-dim);
}

.u-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;
}

.u-hidden {
  display: none !important;
}

.divider {
  height: 1px;
  background: var(--line);
  width: 100%;
}

/* Scroll reveal ------------------------------------------------------------ */

.reveal {
  opacity: 0;
  transform: translate3d(0, 34px, 0);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.reveal-mask {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1s var(--ease);
}

.reveal-mask.is-visible {
  clip-path: inset(0 0 0 0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal,
  .reveal-mask {
    opacity: 1;
    transform: none;
    clip-path: none;
    transition: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Loading state ------------------------------------------------------------ */

.is-loading {
  opacity: 0;
}

.is-ready {
  opacity: 1;
  transition: opacity 0.5s var(--ease);
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-soft) 25%, var(--bg-elev) 37%, var(--bg-soft) 63%);
  background-size: 400% 100%;
  animation: skeleton 1.4s ease infinite;
}

@keyframes skeleton {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}
