/* Only 4Ever motion layer: page transitions, scroll reveals, cursor, tilt and smooth scroll.
   Loaded after site.css on every page. Everything is progressive: without JavaScript or with
   reduced motion the page renders exactly as before. */

@font-face {
  font-family: "Bodoni Moda";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/bodoni-moda-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Bodoni Moda";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/bodoni-moda-latin-italic.woff2") format("woff2");
}

:root {
  --display: "Bodoni 72", "Bodoni Moda", Didot, "Iowan Old Style", "Times New Roman", serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-ink: cubic-bezier(.7, 0, .2, 1);
}

/* Bodoni Moda's display optical size thins hairlines until they vanish on black; hold it at a sturdier cut.
   Fonts without an optical-size axis (Bodoni 72 on Apple devices, the sans) ignore this. */
body { font-variation-settings: "opsz" 12; }

@property --reveal { syntax: "<number>"; inherits: false; initial-value: 1; }
@property --zoom { syntax: "<number>"; inherits: false; initial-value: 1; }
@property --hover { syntax: "<number>"; inherits: false; initial-value: 1; }

/* ---- between pages: the studio logo holds the screen while the next page loads ----
   veil.js marks an arriving page before it paints, so the still logo is up from the first frame;
   loader.js then draws the same logo live in WebGL and burns the ink away to reveal the page. */
html.is-arriving::after, .page-loader.is-still {
  background: #050504 url("../images/official-studio-logo.webp") center top calc(46vh - min(64vw, 30rem) / 3) / min(64vw, 30rem) auto no-repeat;
}
html.is-arriving::after { position: fixed; z-index: 2000; inset: 0; content: ""; }
.page-loader { position: fixed; z-index: 2001; inset: 0; opacity: 0; pointer-events: none; transition: opacity .32s ease; }
.page-loader[hidden] { display: none; }
.page-loader.is-on { opacity: 1; pointer-events: auto; }
.page-loader.is-instant { transition: none; }
.page-loader canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.page-loader.is-still canvas { display: none; }
.page-loader.is-still.is-exiting { opacity: 0; transform: scale(1.03); transition: opacity .6s ease, transform .6s ease; }
@media (prefers-reduced-motion: reduce) { html.is-arriving::after { display: none; } }

/* ---- scroll progress ---- */
.scroll-progress {
  position: fixed;
  z-index: 120;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--bronze), var(--gold-bright));
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
  pointer-events: none;
}

/* ---- header that steps aside while reading and returns on the way back up ---- */
html.motion .site-header { transition: transform .55s var(--ease-out), height .35s ease, background .35s ease, box-shadow .35s ease; }
html.motion .site-header.is-tucked { transform: translateY(-110%); }

/* ---- reveals ---- */
html.motion [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 2.2rem, 0);
  transition: opacity .9s ease var(--d, 0ms), transform 1.15s var(--ease-out) var(--d, 0ms);
}
html.motion [data-reveal].is-in { opacity: 1; transform: none; }

/* headlines rise word by word from behind a mask */
html.motion [data-split] .w { display: inline-block; overflow: hidden; padding: 0 .12em .14em; margin: 0 -.12em -.14em; vertical-align: top; }
html.motion [data-split] .w > span { display: inline-block; transform: translate3d(0, 108%, 0); opacity: .15; filter: blur(10px);
  transition: transform 1.1s var(--ease-out) var(--wd, 0ms), opacity .9s ease var(--wd, 0ms), filter 1.1s ease var(--wd, 0ms); }
html.motion [data-split].is-in .w > span { transform: none; opacity: 1; filter: none; }
html.motion [data-split][data-reveal] { opacity: 1; transform: none; }

/* images unveil top-down and settle from a slight zoom; large ones drift with the scroll */
html.motion [data-unveil] {
  clip-path: inset(0 0 calc(var(--reveal) * 100%) 0);
  transform: translate3d(0, var(--drift, 0px), 0) scale(calc(var(--zoom) * var(--hover) * var(--base-zoom, 1)));
  transition: --reveal 1.3s var(--ease-ink) var(--d, 0ms), --zoom 1.8s var(--ease-out) var(--d, 0ms), --hover .8s var(--ease-out), filter .5s ease;
  --reveal: 1;
  --zoom: 1.14;
  will-change: transform;
}
html.motion [data-unveil].is-in { --reveal: 0; --zoom: 1; }
html.motion [data-drift] { --base-zoom: 1.1; }
/* keep the site's existing hover zooms, now driven through the same transform */
html.motion .work-tile:hover [data-unveil], html.motion .gallery-card:hover [data-unveil] { --hover: 1.05; transform: translate3d(0, var(--drift, 0px), 0) scale(calc(var(--zoom) * var(--hover) * var(--base-zoom, 1))); }
html.motion .team-card:hover [data-unveil], html.motion .award-pair figure:hover [data-unveil], html.motion .artist-profile:hover [data-unveil] { --hover: 1.03; transform: translate3d(0, var(--drift, 0px), 0) scale(calc(var(--zoom) * var(--hover) * var(--base-zoom, 1))); }

/* ---- cards that lean toward the pointer and catch a sheen ---- */
html.has-tilt [data-tilt] {
  transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .6s var(--ease-out), box-shadow .6s ease;
  transform-style: preserve-3d;
}
html.has-tilt [data-tilt].is-tilting { transition: transform .12s linear, box-shadow .6s ease; box-shadow: 0 2.4rem 4.5rem -1.5rem rgba(0, 0, 0, .7); }
html.has-tilt [data-tilt]::after {
  position: absolute;
  z-index: 3;
  inset: 0;
  background: radial-gradient(38rem circle at var(--mx, 50%) var(--my, 50%), rgba(242, 207, 136, .16), transparent 42%);
  content: "";
  opacity: 0;
  pointer-events: none;
  transition: opacity .5s ease;
}
html.has-tilt [data-tilt].is-tilting::after { opacity: 1; }

/* ---- magnetic buttons ---- */
html.has-cursor [data-magnetic] { transition: transform .5s var(--ease-out), background .3s, color .3s, border-color .3s, box-shadow .3s; transform: translate3d(var(--tx, 0px), var(--ty, 0px), 0); }
html.has-cursor [data-magnetic].is-pulled { transition: transform .15s linear, background .3s, color .3s, border-color .3s, box-shadow .3s; }

/* ---- cursor ---- */
/* While the gold cursor is on, it is the only pointer: the system one stays hidden everywhere
   except in fields that take typing and in pages from other sites (the map). It sits above every
   layer of the site, the cookie banner and the privacy panel included. */
html.has-cursor, html.has-cursor * { cursor: none !important; }
html.has-cursor input:not([type="checkbox"], [type="radio"], [type="range"], [type="button"], [type="submit"], [type="reset"]),
html.has-cursor textarea, html.has-cursor select, html.has-cursor iframe, html.has-cursor [contenteditable="true"] { cursor: auto !important; }
.cursor-dot, .cursor-ring { position: fixed; z-index: 2147483647; top: 0; left: 0; pointer-events: none; }
.cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--gold-bright); mix-blend-mode: difference; }
.cursor-ring {
  display: grid;
  width: 2.6rem;
  height: 2.6rem;
  margin: -1.3rem 0 0 -1.3rem;
  place-items: center;
  border: 1px solid rgba(242, 207, 136, .55);
  border-radius: 50%;
  color: #120c05;
  font: 600 .58rem/1 var(--sans);
  letter-spacing: .2em;
  text-transform: uppercase;
  transition: width .45s var(--ease-out), height .45s var(--ease-out), margin .45s var(--ease-out), background .3s ease, border-color .3s ease, opacity .3s ease;
}
.cursor-ring span { opacity: 0; transition: opacity .2s ease; }
.cursor-ring.is-link { width: 3.6rem; height: 3.6rem; margin: -1.8rem 0 0 -1.8rem; border-color: var(--gold-bright); }
.cursor-ring.is-view { width: 5.4rem; height: 5.4rem; margin: -2.7rem 0 0 -2.7rem; border-color: transparent; background: rgba(242, 207, 136, .92); }
.cursor-ring.is-view span { opacity: 1; }
.cursor-ring.is-hidden, .cursor-dot.is-hidden { opacity: 0; }

/* ---- marquee leans with scroll speed ---- */
html.motion .marquee-track { transform: skewX(var(--skew, 0deg)); transition: transform .5s var(--ease-out); }

/* ---- gold underline that draws in under text links ---- */
html.motion .arrow-link, html.motion .site-nav a:not(.nav-book) { background: linear-gradient(var(--gold-bright), var(--gold-bright)) 0 100% / 0 1px no-repeat; transition: background-size .5s var(--ease-out), color .3s; }
html.motion .arrow-link:hover, html.motion .site-nav a:not(.nav-book):hover { background-size: 100% 1px; }

/* ---- lightbox: opens like a print being laid down; swipe on touch ---- */
html.motion .lightbox { animation: lightbox-in .45s ease both; }
html.motion .lightbox figure { animation: print-in .7s var(--ease-out) both; }
@keyframes lightbox-in { from { opacity: 0; } }
@keyframes print-in { from { opacity: 0; transform: translate3d(0, 2rem, 0) scale(.96); } }

/* ---- other lazy images fade in as they finish loading ---- */
html.motion img[loading="lazy"]:not([data-unveil]) { transition: opacity .8s ease; }
html.motion img[loading="lazy"]:not([data-unveil]):not(.is-loaded) { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  body::after { display: none; }
  html.motion [data-reveal], html.motion [data-split] .w > span, html.motion [data-unveil] { opacity: 1 !important; transform: none !important; clip-path: none !important; }
  html.motion img[loading="lazy"]:not([data-unveil]):not(.is-loaded) { opacity: 1; }
}
@media (hover: none) {
  .cursor-dot, .cursor-ring { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html.motion [data-split] .w > span { filter: none; opacity: 1; }
}
