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

html {
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

body {
  font-family: var(--sans);
  font-size: var(--text-base);
  line-height: 1.6;
  background: var(--bg);
  overflow-x: hidden;
  min-height: 100%;
  max-width: 100vw;
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: touch;
}

/* Native mobile scroll — no smooth hijack fight */
html.is-touch,
html.is-touch body {
  scroll-behavior: auto;
}

body.has-cursor {
  cursor: none;
}

@media (pointer: coarse) {
  body.has-cursor {
    cursor: auto;
  }
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

::selection {
  background: rgba(167, 139, 250, 0.35);
  color: var(--fg);
}

.skip {
  position: absolute;
  left: var(--s-4);
  top: -100px;
  z-index: 200;
  padding: var(--s-3) var(--s-4);
  background: var(--fg);
  color: var(--bg);
  border-radius: var(--r-sm);
  font-family: var(--mono);
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  transition: top var(--dur-ui) var(--ease-out);
}

.skip:focus {
  top: var(--s-4);
}

/* film grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

#gl {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

main {
  position: relative;
  z-index: 3;
}

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

@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;
  }
}
