/* Shared primitives. Each site defines its own tokens (brand-tokens.css) and look (site.css). */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus, currentColor); outline-offset: 3px; }
::selection { background: var(--selection-bg, #000); color: var(--selection-fg, #fff); }

.skip-link { position: fixed; left: 16px; top: -80px; z-index: 10000; padding: 12px 18px; background: var(--ink, #000); color: var(--paper, #fff); text-decoration: none; transition: top .2s; }
.skip-link:focus { top: 16px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Lenis */
html.lenis, html.lenis body { height: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-smooth iframe { pointer-events: none; }

/* Reveal start states: only when JS runs and motion is allowed */
html.js:not(.reduced-motion) [data-split]:not(.is-split) { visibility: hidden; }
html.js:not(.reduced-motion) [data-reveal]:not(.is-in) { opacity: 0; }
html.js:not(.reduced-motion) [data-img-reveal]:not(.is-in) { clip-path: inset(100% 0 0 0); }
.split-line { padding-bottom: .06em; margin-bottom: -.06em; }
/* Failsafe: if the engine never boots, show everything after 3 seconds */
html.js:not(.reduced-motion):not(.motion-ready) :is([data-split], [data-reveal], [data-img-reveal]) { animation: reveal-failsafe .5s ease 3s forwards; }
@keyframes reveal-failsafe { to { visibility: visible; opacity: 1; clip-path: none; } }

/* Page transition overlay: covers the page on arrival until the enter animation runs */
[data-pt-overlay] { position: fixed; inset: 0; z-index: 9000; pointer-events: none; visibility: hidden; }
html.pt-enter [data-pt-overlay] { visibility: visible; }
html.pt-enter:not(.motion-ready) [data-pt-overlay] { animation: pt-failsafe .4s ease 2.5s forwards; }
@keyframes pt-failsafe { to { visibility: hidden; opacity: 0; } }

/* Custom cursor base (fine pointers only; each site styles it) */
.cursor { position: fixed; left: 0; top: 0; z-index: 9500; pointer-events: none; opacity: 0; transition: opacity .3s; }
.cursor.is-visible { opacity: 1; }
html.coarse .cursor { display: none; }

/* Motion off */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
html.reduced-motion [data-split], html.reduced-motion [data-reveal], html.reduced-motion [data-img-reveal] { visibility: visible !important; opacity: 1 !important; clip-path: none !important; transform: none !important; }
