/* ============================================================
   Base — reset, typography, global rhythm
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: auto; /* Lenis owns scrolling; reduced-motion falls back to native */
  -webkit-text-size-adjust: 100%;
}

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: var(--fs-body);
  line-height: 1.7;
  transition: background-color var(--t-theme) ease, color var(--t-theme) ease;
  overflow-x: hidden;
  min-height: 100svh;
}

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

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }
i, em { font-style: italic; }

::selection { background: rgba(192, 164, 114, .35); color: var(--c-ink); }

:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }

/* ---- headings ---- */
h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.01em;
}
h1 { font-size: var(--fs-display1); line-height: .92; letter-spacing: -0.015em; }
h2 { font-size: var(--fs-display2); }
h3 { font-size: var(--fs-display3); line-height: 1.15; }

.measure { max-width: 34em; }

/* ---- layout primitives ---- */
.room {
  position: relative;
  padding: var(--pad-room) var(--pad-x);
}
.room-inner {
  max-width: var(--grid-max);
  margin: 0 auto;
}
.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: clamp(16px, 2.5vw, 40px);
}

/* content sits above fixed GL canvas; header hosts fixed chrome
   (nav bar, overlay menu, dot nav, mobile bar) and must beat .page-after */
main, footer { position: relative; z-index: 2; }
header { position: relative; z-index: 100; }

/* canvas floats above section backgrounds; planes exactly cover artwork
   windows and text never overlaps a GL-managed artwork */
#gl-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

/* skip link */
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 300;
  background: var(--c-ink);
  color: var(--c-ivory);
  padding: 10px 18px;
  font-size: .8125rem;
  letter-spacing: .1em;
  transition: top .3s ease;
}
.skip-link:focus { top: 16px; }

/* utility */
.caps { text-transform: uppercase; }
.hidden { display: none !important; }
.gold { color: var(--accent); font-style: inherit; }

/* reveal helpers (JS adds .is-inview) */
.line-mask { overflow: hidden; display: block; }
.line-mask > .line-inner { display: block; will-change: transform; }

/* clip reveal fallback for images (GL replaces when active) */
.reveal-clip { clip-path: inset(100% 0 0 0); }
.reveal-clip.is-revealed { clip-path: inset(0 0 0 0); transition: clip-path 1.4s cubic-bezier(0.76, 0, 0.24, 1); }

/* photos always wipe with clip-path (honesty cue) */
.reveal-wipe { clip-path: inset(0 100% 0 0); }
.reveal-wipe.is-revealed { clip-path: inset(0 0 0 0); transition: clip-path 1.2s cubic-bezier(0.76, 0, 0.24, 1); }

/* dark rooms get a 2% noise tile when GL is off */
html:not(.gl-on) [data-theme-zone="dark"]::after,
html:not(.gl-on) .noise-zone::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../assets/img/noise.png") repeat;
  opacity: .02;
  pointer-events: none;
}

/* no-JS: everything visible, no masks */
html.no-js .line-mask > .line-inner { transform: none !important; }
html.no-js .reveal-clip, html.no-js .reveal-wipe { clip-path: none; }

/* reduced motion base */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal-clip, .reveal-wipe { clip-path: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.15s !important;
  }
}
