/* base.css — shared typography + layout primitives */
h1,h2,h3{font-family:var(--font-display);letter-spacing:-0.03em;line-height:1.1;text-wrap:balance}
p{line-height:1.55}
.prose{max-width:var(--reading-width)}
.prose p+p{margin-top:var(--space-4)}
main{display:block}

/* scroll reveal (driven by core/reveal.js IntersectionObserver) */
[data-reveal]{opacity:0;transform:translateY(22px);transition:opacity .7s var(--ease-out),transform .8s var(--ease-spring)}
[data-reveal].in-view{opacity:1;transform:none}
.no-js [data-reveal]{opacity:1;transform:none}
html.gsap-reveals [data-reveal]{transition:none}   /* GSAP owns the entrance; avoid double-animating */
/* line-mask reveal wrappers (headings rise from behind an invisible line) */
.rv-mask{display:block;overflow:hidden;padding-bottom:.06em}
.rv-inner{display:block;will-change:transform}
@media (prefers-reduced-motion:reduce){[data-reveal]{opacity:1!important;transform:none!important}}

/* ---- dot field (the signature background, site-wide) ---- */
html{background:var(--bg)}
body{background:transparent}
.dotfield{position:fixed;inset:0;z-index:0;pointer-events:none}
main{position:relative;z-index:1}
.site-footer{position:relative;z-index:1}

/* intro scroll lock + hero content gating */
html.intro-lock,html.intro-lock body{overflow:hidden}
.he-stage-layer{opacity:0;transition:opacity .9s var(--ease-out)}
html.intro-done .he-stage-layer{opacity:1}
.no-js .he-stage-layer{opacity:1}

/* ---- preloader owns the viewport (home only) ----
   Until the intro hands off (html.intro-done), the header, nav, theme toggle,
   page sections and footer stay hidden so only the dot field + RM + narrative
   are visible. State comes from the existing intro-lock/intro-done classes. */
body.page-home .topbar,
body.page-home .site-footer,
body.page-home main > :not(#home-experience):not(#preloader){
  opacity:0; visibility:hidden;
}
html.intro-done body.page-home .topbar,
html.intro-done body.page-home .site-footer,
html.intro-done body.page-home main > :not(#home-experience):not(#preloader){
  opacity:1; visibility:visible;
}
/* header arrives AFTER the hero (delayed fade-in) */
html.intro-done body.page-home .topbar{
  transition:opacity .6s var(--ease-out) .8s, visibility 0s linear .8s;
}
/* no-js / no-preloader: reveal everything */
html.no-js body.page-home .topbar,
html.no-js body.page-home .site-footer,
html.no-js body.page-home main > :not(#home-experience):not(#preloader){
  opacity:1; visibility:visible;
}
