/* ============================================================
   BASE — reset, typography, noise overlay
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  hyphens: none;
  word-break: normal;
  overflow-wrap: normal;
}

html {
  scroll-behavior: smooth;
  /* Firefox */
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--color-stone-rgb), 0.5) transparent;
}

/* WebKit (Chrome / Safari / Edge) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(var(--color-stone-rgb), 0.45);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background-color 0.3s var(--ease-out);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--color-stone-rgb), 0.75);
  background-clip: padding-box;
}
::-webkit-scrollbar-corner {
  background: transparent;
}

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

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

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: clip;
}

/* Lock scroll while loader is visible */
html.is-loading,
html.is-loading body {
  overflow: hidden !important;
  height: 100vh;
}

body {
  background: var(--surface-default);
  color: var(--fg-primary);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Noise overlay — fixed, full-viewport, on top of everything except UI chrome */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: var(--z-noise);
  pointer-events: none;
  opacity: 0.045;
  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");
  background-size: 200px 200px;
  mix-blend-mode: overlay;
}

/* Typography defaults */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--fg-primary);
}

p {
  font-family: var(--font-body);
  color: var(--fg-primary);
}

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

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

input {
  font: inherit;
}

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

/* Section + container */
section {
  position: relative;
  overflow: hidden;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

@media (max-width: 768px) {
  .container {
    padding: 0 var(--container-pad-mobile);
  }
}

/* Section label — small uppercase eyebrow per section */
.section-label {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-secondary);
  display: block;
  margin-bottom: var(--space-7);
}

/* Reveal base state (set by JS via ScrollTrigger) */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  will-change: opacity, transform;
}

/* Skip-to-content for a11y */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--fg-brand);
  color: var(--color-pure-white);
  padding: 8px 16px;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  z-index: 10002;
  transition: top var(--duration-fast) var(--ease-out);
}

.skip-link:focus {
  top: 0;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}
