/* Bullhead stage: the motion layer shared by every public page.
   Everything here uses individual transform properties (translate, rotate, scale) so it never fights the GSAP transforms in main.js. */

/* ---- page-to-page: the lights dim, the next room comes up. The nav stays put. ---- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .site-nav { view-transition-name: bh-nav; }
  ::view-transition-old(root) { animation: bhOut .26s cubic-bezier(.4, 0, 1, 1) both; }
  ::view-transition-new(root) { animation: bhIn .6s cubic-bezier(.16, 1, .3, 1) both; }
  @keyframes bhOut { to { opacity: 0; filter: brightness(.55) blur(3px); scale: .985; } }
  @keyframes bhIn { from { opacity: 0; filter: brightness(1.25); translate: 0 18px; } }
}

/* ---- hero depth: image, copy and badge sit at different distances from the pointer ---- */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .hero, .page-hero { --hx: 0; --hy: 0; }
  .hero-media img, .page-hero > img { scale: 1.05; translate: calc(var(--hx) * -16px) calc(var(--hy) * -10px); }
  .hero-content, .page-hero-content { translate: calc(var(--hx) * 9px) calc(var(--hy) * 6px); }
  .hero-logo { translate: calc(var(--hx) * 20px) calc(var(--hy) * 12px); }
  .hero-open-badge { translate: calc(var(--hx) * 14px) calc(var(--hy) * 9px); }
}

/* ---- cards that turn toward you; light follows the pointer across the face ---- */
.zones-grid, .explore-grid, .locations-grid { perspective: 1500px; }
.bh-glare { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .35s ease;
  background: radial-gradient(460px circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 238, 214, .26), transparent 58%); }
.bh-tilt:hover > .bh-glare { opacity: 1; }
.bh-tilt { transition: rotate .45s cubic-bezier(.16, 1, .3, 1); }
.bh-tilt.live { transition: rotate .08s linear; }

/* ---- photographs drift against the page as you scroll (cover scale keeps edges hidden) ---- */
.bh-drift { scale: 1.1; translate: 0 var(--dy, 0px); will-change: translate; }

/* ---- headings: clipped, then lifted into view once ---- */
@media (prefers-reduced-motion: no-preference) {
  .bh-rise { translate: 0 .5em; opacity: .01; }
  .bh-rise.in { translate: 0 0; opacity: 1; transition: translate 1s cubic-bezier(.16, 1, .3, 1), opacity .7s ease; }
}

/* ---- magnetic buttons ---- */
.bh-mag { transition: translate .35s cubic-bezier(.16, 1, .3, 1); }

/* ---- the ring: eight photographs on a turntable, driven by scroll ---- */
.ring { position: relative; height: 240vh; background: #1b110d; color: #f6efe6; }
.ring-pin { position: sticky; top: 0; height: 100vh; height: 100svh; display: grid; grid-template-rows: auto 1fr; overflow: hidden; isolation: isolate; }
.ring-pin::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(55% 60% at 50% 58%, rgba(199, 126, 63, .38), transparent 72%); }
.ring-copy { padding: clamp(86px, 12vh, 120px) var(--edge) 0; max-width: calc(560px + 2 * var(--edge)); }
.ring-copy h2 { color: #f6efe6; font-size: clamp(1.9rem, 4.4vw, 3.1rem); line-height: 1.06; margin-bottom: 10px; }
.ring-copy p { margin: 0 0 18px; color: rgba(246, 239, 230, .8); max-width: 44ch; }
.ring-stage { --w: clamp(170px, 21vw, 300px); position: relative; perspective: 1900px; perspective-origin: 50% 35%; display: grid; place-items: center; }
.ring-spin { position: relative; width: var(--w); aspect-ratio: 3 / 4; transform-style: preserve-3d; transform: rotateX(-7deg) rotateY(calc(var(--spin, 0) * 1deg)); }
.ring-pic { position: absolute; inset: 0; display: block; border-radius: 12px; overflow: hidden; backface-visibility: hidden; background: #3a2a22; box-shadow: 0 24px 50px rgba(0, 0, 0, .5); transform: rotateY(calc(var(--i) * 45deg)) translateZ(calc(var(--w) * 1.25)); }
.ring-pic img { width: 100%; height: 100%; object-fit: cover; }
.ring-pic:focus-visible { outline: 3px solid var(--cognac); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .ring { height: auto; } .ring-pin { position: relative; height: auto; min-height: 80vh; } .ring-spin { --spin: -22; } }
@media (max-width: 700px) { .ring-stage { --w: 46vw; } .ring-copy { padding-top: 84px; } }

/* ---- the order: a three-step ribbon and a send button that wakes up when it can ---- */
.flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 26px; padding: 0; list-style: none; }
.flow li { position: relative; padding: 12px 14px 14px; border-radius: 10px; background: var(--cream-deep); color: var(--ink-soft); font-weight: 600; font-size: .92rem; line-height: 1.25; overflow: hidden; transition: background .4s ease, color .4s ease; }
.flow li b { display: block; font: 600 .74rem/1 var(--font-body); font-variant-numeric: tabular-nums; opacity: .7; margin-bottom: 6px; }
.flow li::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--red); scale: 0 1; transform-origin: left; transition: scale .6s cubic-bezier(.16, 1, .3, 1); }
.flow li.done { background: var(--green); color: #f6efe6; }
.flow li.done::after { scale: 1 1; background: #f6efe6; }
.flow li.now { background: var(--ink); color: #f6efe6; }
.flow li.now::after { scale: 1 1; }
.order-type-btn { transition: border-color .25s ease, background .25s ease, color .25s ease, translate .25s ease, box-shadow .25s ease; }
.order-type-btn.active { translate: 0 -2px; box-shadow: 0 10px 22px rgba(36, 23, 18, .18); }
.order-form [type="submit"].is-ready { position: relative; overflow: hidden; }
.order-form [type="submit"].is-ready::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .38) 50%, transparent 65%); translate: -120% 0; animation: bhSheen 3.2s ease-in-out infinite; pointer-events: none; }
@keyframes bhSheen { 0%, 55% { translate: -120% 0; } 100% { translate: 120% 0; } }
.pop { animation: bhPop .42s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes bhPop { 40% { scale: 1.28; } }
.bh-dot { position: fixed; z-index: 400; width: 14px; height: 14px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 6px rgba(232, 51, 43, .25); pointer-events: none; }
@media (max-width: 520px) { .flow { grid-template-columns: 1fr; } .flow li { display: flex; gap: 10px; align-items: baseline; } .flow li b { margin: 0; } }
@media (prefers-reduced-motion: reduce) { .order-form [type="submit"].is-ready::after { animation: none; } .pop { animation: none; } }

/* ---- visit: three photographs that say what to look for ---- */
.arrive { width: min(1240px, 100% - 2 * var(--edge-narrow)); margin: 0 auto; padding: 56px 0 24px; }
.arrive h2 { margin-bottom: 22px; font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
.arrive-grid { display: grid; gap: 16px; grid-template-columns: 1fr; perspective: 1400px; }
.arrive-fig { margin: 0; border-radius: 12px; overflow: hidden; background: var(--cream-deep); box-shadow: 0 14px 34px rgba(36, 23, 18, .16); }
.arrive-fig img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.arrive-fig figcaption { padding: 14px 16px 16px; font-weight: 500; color: var(--ink-soft); line-height: 1.4; }
@media (min-width: 800px) {
  .arrive-grid { grid-template-columns: repeat(3, 1fr); align-items: start; }
  .arrive-fig:nth-child(1) { rotate: 0 1 0 5deg; } .arrive-fig:nth-child(3) { rotate: 0 1 0 -5deg; } .arrive-fig:nth-child(2) { margin-top: 26px; }
}

/* photographs that drift must stay inside their frames */
.story-media, .location-media { overflow: hidden; }

/* the ring on wide screens: copy on the left, the turntable centred on the right, nothing cropped */
@media (min-width: 1000px) and (min-height: 560px) {
  .ring-pin { grid-template-rows: 1fr; grid-template-columns: minmax(320px, 5fr) 7fr; align-items: center; }
  .ring-copy { padding: 0 0 0 var(--edge); align-self: center; max-width: none; }
  .ring-stage { --w: clamp(200px, min(17vw, 33vh), 330px); height: 100%; perspective-origin: 50% 40%; }
}

/* ---- hero reel: photos crossfade, each with a slow push ---- */
.hero-media .hero-slide { opacity: 0; transition: opacity 1.5s ease; }
.hero-media > img.hero-slide:not(#heroImg) { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 60%; transform: none; will-change: opacity, scale, translate; }
.hero-media .hero-slide.is-on { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .hero-media > img.hero-slide:not(#heroImg).is-on { animation: bhHeroPan 9.5s cubic-bezier(.3, .1, .3, 1) both; }
  @keyframes bhHeroPan { from { scale: 1.04; translate: calc(var(--dir, 1) * -1.2%) 0; } to { scale: 1.13; translate: calc(var(--dir, 1) * 1.2%) -1%; } }
}
