/* ===================================================================
   JARN 5.0 — CINEMA layer (site-wide)
   One motion language for the whole site: a page-transition veil,
   a quiet custom cursor, magnetic primary buttons, a signature
   image-hover treatment, smarter nav behaviour, and heavier
   editorial typography on the inner-page heroes.
   Prefixed .j5-* — supersedes, never fights, the j4/jm layers.
   Tiering: html.j5-lite (in-app browsers / low-power) and
   prefers-reduced-motion strip everything heavy.
   =================================================================== */

:root{
  --j5-ease: cubic-bezier(.22,1,.36,1);
  --j5-ease-io: cubic-bezier(.65,.05,.2,1);
  --j5-gold: var(--gold, #C4A165);
  --j5-terra: var(--terra, #B56B4E);
  --j5-ink: #0F0C08;
  --j5-paper: #FAF7F2;
}

::selection{ background: rgba(196,161,101,.32); color: inherit; }
a:focus-visible, button:focus-visible{ outline: 1px solid var(--j5-gold); outline-offset: 3px; }

/* ===================================================================
   1. PAGE-TRANSITION VEIL — seamless single cover
   Exit: ink panel sweeps up carrying the JARN logo.
   Entry: a critical inline <style> in each page's <head> (the "boot"
   snippet) paints the identical cover BEFORE first paint, so the two
   pages read as one continuous transition. jarn-5.js then swaps the
   boot cover for this element and lifts it away.
   =================================================================== */
#j5-veil{
  position: fixed; inset: 0; z-index: 99990;
  background: #FAF7F2;
  display: flex; align-items: center; justify-content: center;
  transform: translateY(101%);
  pointer-events: none;
  will-change: transform;
}
#j5-veil .j5-veil-mark{
  display: flex; flex-direction: column; align-items: center;
  opacity: 0; transform: translateY(10px);
  transition: opacity .3s ease .06s, transform .42s var(--j5-ease) .06s;
}
#j5-veil .j5-veil-logo{
  height: clamp(120px, 15vw, 190px); width: auto; display: block;
}
#j5-veil .j5-logo-dark-scheme{ display: none; }
@media (prefers-color-scheme: dark){
  #j5-veil{ background: #0F0C08; }
  #j5-veil .j5-logo-light-scheme{ display: none; }
  #j5-veil .j5-logo-dark-scheme{ display: block; }
}
html.j5-leaving #j5-veil{
  transform: translateY(0);
  transition: transform .42s var(--j5-ease-io);
}
html.j5-leaving #j5-veil .j5-veil-mark{ opacity: 1; transform: none; }
/* Entry — veil starts covering (matching the boot cover), lifts away */
html.j5-entering #j5-veil{
  transform: translateY(0);
  transition: none;
}
html.j5-entering #j5-veil .j5-veil-mark{ opacity: 1; transform: none; transition: none; }
html.j5-enter-go #j5-veil{
  transform: translateY(-101%);
  transition: transform .55s var(--j5-ease-io);
}
html.j5-enter-go #j5-veil .j5-veil-mark{
  opacity: 0; transform: translateY(-14px);
  transition: opacity .25s ease, transform .38s var(--j5-ease);
}
html.j5-lite #j5-veil{ display: none !important; }
@media (prefers-reduced-motion: reduce){ #j5-veil{ display: none !important; } }

/* ===================================================================
   1b. SOFT TRANSITION — for in-content navigation (studio cards,
   "Back to Bayté", explore CTAs). A quick page fade instead of the
   full logo veil: fast, clean, never repetitive.
   =================================================================== */
html.j5-softout body{ opacity: 0; transition: opacity .16s ease; }
html.j5-softin body{ opacity: 0; }
html.j5-softgo body{ opacity: 1; transition: opacity .34s ease; }
@media (prefers-reduced-motion: reduce){
  html.j5-softout body, html.j5-softin body{ opacity: 1 !important; transition: none !important; }
}
html.j5-lite.j5-softin body, html.j5-lite.j5-softout body{ opacity: 1 !important; }

/* ===================================================================
   2. CUSTOM CURSOR — gold dot + trailing ring (fine pointers only)
   Native cursor stays; this is an accent, not a replacement.
   =================================================================== */
#j5-cur, #j5-ring{
  position: fixed; top: 0; left: 0; z-index: 99980;
  pointer-events: none; border-radius: 50%;
  opacity: 0;
}
#j5-cur{
  width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px;
  background: var(--j5-gold);
  transition: opacity .3s ease, transform .15s ease;
}
#j5-ring{
  width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 1px solid rgba(196,161,101,.55);
  transition: opacity .3s ease, width .35s var(--j5-ease), height .35s var(--j5-ease),
              margin .35s var(--j5-ease), background .3s ease, border-color .3s ease;
}
html.j5-cursor-on #j5-cur, html.j5-cursor-on #j5-ring{ opacity: 1; }
html.j5-cur-hover #j5-ring{
  width: 52px; height: 52px; margin: -26px 0 0 -26px;
  background: rgba(196,161,101,.08);
  border-color: rgba(196,161,101,.85);
}
html.j5-cur-hover #j5-cur{ transform: scale(0); }
html.j5-cur-down #j5-ring{ width: 26px; height: 26px; margin: -13px 0 0 -13px; }
@media (hover: none), (pointer: coarse){
  #j5-cur, #j5-ring{ display: none !important; }
}
html.j5-lite #j5-cur, html.j5-lite #j5-ring{ display: none !important; }

/* ===================================================================
   3. NAV — hide on scroll-down, return on scroll-up (all pages)
   =================================================================== */
#nav, nav.nav{
  transition: transform .5s var(--j5-ease), background .5s var(--j5-ease),
              padding .35s var(--j5-ease), border-color .5s ease !important;
}
html.j5-nav-hide #nav,
html.j5-nav-hide nav.nav{ transform: translateY(-102%); }

/* ===================================================================
   4. SIGNATURE IMAGE HOVER — quiet zoom toward the cursor + a gold
   hairline that draws itself around the frame. Replaces the generic
   uniform scale() language.
   =================================================================== */
.gallery-item, .studio-img-wrap, .coll-card, .brand-img-wrap, .b-main{
  position: relative;
}
.gallery-item::after, .studio-img-wrap::after, .brand-img-wrap::after{
  content: ""; position: absolute; inset: 10px; z-index: 3;
  border: 1px solid rgba(196,161,101,0);
  transform: scale(1.035);
  transition: border-color .45s ease, transform .6s var(--j5-ease);
  pointer-events: none;
}
.gallery-item:hover::after, .studio-img-wrap:hover::after, .brand-img-wrap:hover::after{
  border-color: rgba(196,161,101,.55);
  transform: scale(1);
}
.gallery-item img, .studio-img-wrap img{
  transform-origin: var(--j5-ox, 50%) var(--j5-oy, 50%);
  transition: transform 1s var(--j5-ease), filter .6s ease, opacity .6s ease !important;
}
.gallery-item:hover img, .studio-img-wrap:hover img{
  transform: scale(1.045);
}
.gallery-item .gallery-item-tag{
  transition: opacity .4s ease, transform .5s var(--j5-ease);
}
@media (hover: hover) and (pointer: fine){
  .gallery-item .gallery-item-tag{ opacity: 0; transform: translateY(6px); }
  .gallery-item:hover .gallery-item-tag{ opacity: 1; transform: none; }
}

/* ===================================================================
   4b. IMAGE LOADING — no more black boxes.
   Lazy gallery tiles used to sit on an ink-black background while the
   photo fetched. Replace with a warm paper placeholder + soft shimmer,
   fade the photo in on load (JS marks .j5-ld / .j5-ready), and
   jarn-5.js promotes images to eager fetch well before they scroll in.
   =================================================================== */
.gallery-item, .studio-img-wrap{
  background: #EDE5D8 !important;
}
.gallery-item::before, .studio-img-wrap::before{
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(110deg, rgba(255,255,255,0) 30%, rgba(255,255,255,.55) 50%, rgba(255,255,255,0) 70%);
  background-size: 220% 100%;
  animation: j5shimmer 1.5s linear infinite;
  opacity: 0; pointer-events: none;
  transition: opacity .35s ease;
}
html.j5-imgfade .gallery-item:not(.j5-ready)::before,
html.j5-imgfade .studio-img-wrap:not(.j5-ready)::before{ opacity: 1; }
@keyframes j5shimmer{
  from{ background-position: 110% 0; }
  to{ background-position: -110% 0; }
}
html.j5-imgfade .gallery-item img:not(.j5-ld),
html.j5-imgfade .studio-img-wrap img:not(.j5-ld){ opacity: 0; }
.gallery-item img{ position: relative; z-index: 0; }
@media (prefers-reduced-motion: reduce){
  .gallery-item::before, .studio-img-wrap::before{ animation: none; }
}
/* the studio split-hero photo keeps its own hairline; restore its frame stack */
.hero-photo::before{ z-index: 3; }

/* ===================================================================
   4c. FOOTER WORDMARK — an editorial closing moment on every page
   (injected by jarn-5.js, decorative only)
   =================================================================== */
.j5-foot-mark{
  font-family: var(--serif, 'Cormorant Garamond', Georgia, serif);
  font-weight: 300;
  font-size: clamp(110px, 17vw, 280px);
  line-height: .9;
  text-align: center;
  letter-spacing: .1em; text-indent: .1em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(196,161,101,.17);
  user-select: none; pointer-events: none;
  margin: 0 0 4px;
  overflow: visible;
  padding-bottom: .04em;
}
@supports not (-webkit-text-stroke: 1px black){
  .j5-foot-mark{ color: rgba(196,161,101,.08); }
}

/* ===================================================================
   4d. FILM GRAIN — a whisper of texture over the whole experience
   =================================================================== */
body::after{
  content: ""; position: fixed; inset: 0; z-index: 9970;
  pointer-events: none;
  background: url("images/noise.png") repeat;
  background-size: 128px 128px;
  opacity: .05;
  mix-blend-mode: overlay;
}
html.j5-lite body::after{ display: none; }

/* ===================================================================
   4e. THE ARCH — the brand's architectural motif, applied to key
   editorial imagery (brand portrait, studio cards, studio hero photo)
   =================================================================== */
.brand-img-wrap, .studio-img-wrap, .hero-photo{
  border-radius: 999px 999px 4px 4px !important;
}
.brand-img-wrap::after, .studio-img-wrap::after,
.hero-photo::before, .hero-photo::after{
  border-radius: inherit;
}

/* ===================================================================
   4f. PRIMARY BUTTONS — ink sweep on hover
   =================================================================== */
.btn-primary, .nav-cta, .mm-cta, .mm-cta-primary, .booking-cta-primary{
  background-image: linear-gradient(105deg, rgba(15,12,8,.20) 0%, rgba(15,12,8,.20) 50%, rgba(15,12,8,0) 50.5%);
  background-size: 230% 100%;
  background-position: 103% 0;
  background-repeat: no-repeat;
  transition: all .45s var(--j5-ease) !important;
}
.btn-primary:hover, .nav-cta:hover, .mm-cta:hover,
.mm-cta-primary:hover, .booking-cta-primary:hover{
  background-position: 0 0;
}

/* dark-scheme variants for the j5 surfaces */
@media (prefers-color-scheme: dark){
  .gallery-item, .studio-img-wrap{ background: #241D15 !important; }
  .gallery-item::before, .studio-img-wrap::before{
    background: linear-gradient(110deg, rgba(255,255,255,0) 30%, rgba(255,255,255,.13) 50%, rgba(255,255,255,0) 70%);
    background-size: 220% 100%;
  }
}

/* ===================================================================
   5. SUBTLE 3D TILT — opt-in via .j5-tilt (JS drives the vars).
   Used on editorial cards that the jm layer doesn't own.
   =================================================================== */
.j5-tilt{
  transform: perspective(900px) rotateX(var(--j5-rx, 0deg)) rotateY(var(--j5-ry, 0deg));
  transition: transform .55s var(--j5-ease);
  will-change: transform;
}
.j5-tilt.j5-tilting{ transition: transform .12s linear; }
html.j5-lite .j5-tilt{ transform: none !important; }

/* ===================================================================
   6. MAGNETIC BUTTONS — JS writes --j5-mx / --j5-my
   =================================================================== */
.j5-mag{
  transform: translate(var(--j5-mx, 0px), var(--j5-my, 0px));
  transition: transform .4s var(--j5-ease);
  will-change: transform;
}

/* ===================================================================
   7. INNER-PAGE HEROES — heavier editorial type + cinematic settle.
   Covers: studio pages (.hero-frame/.hero-bg/.hero-photo),
   property pages (.hero-img/.hero-body).
   Text content untouched — scale and rhythm only.
   =================================================================== */
.hero .hero-content h1, .hero .hero-body h1{
  font-size: clamp(54px, 7.6vw, 116px) !important;
  line-height: .98 !important;
  letter-spacing: -.028em !important;
}
.hero .hero-eyebrow{ letter-spacing: .4em !important; }
/* slow cinematic settle on hero imagery, once, on load.
   IMPORTANT: jarn-motion owns the resting transform of [data-jm-parallax] > img
   (translate + scale 1.16), so these keyframes END on that exact value — no snap. */
html.j5-cinema .hero .hero-bg{
  animation: j5SettleBg 2.8s var(--j5-ease) backwards;
}
@keyframes j5SettleBg{
  from{ transform: scale(1.2); }
  to{ transform: scale(1.1); }
}
@media (min-width: 901px){
  html.j5-cinema .hero > img.hero-img,
  html.j5-cinema .hero .hero-photo > img{
    animation: j5SettleImg 2.8s var(--j5-ease) backwards;
  }
}
@keyframes j5SettleImg{
  from{ transform: translate3d(0,0,0) scale(1.16); }
  to{ transform: translate3d(0, var(--jm-par, 0px), 0) scale(1.08); }
}
html.j5-lite .hero .hero-bg, html.j5-lite .hero .hero-img,
html.j5-lite .hero .hero-photo img{ animation: none !important; }
@media (prefers-reduced-motion: reduce){
  .hero .hero-bg, .hero .hero-img, .hero .hero-photo img{ animation: none !important; }
}
/* Responsive fix: the action-button row's min-content width was crushing the
   photo column of the split hero between ~900–1150px. Let columns shrink. */
.hero-frame > *{ min-width: 0; }
.hero-content .hero-actions{ flex-wrap: wrap; }
/* Editorial hairline inside the hero photo frame (arch radius set in 4e) */
.hero-photo::before{
  content: ""; position: absolute; inset: 12px; z-index: 3;
  border: 1px solid rgba(196,161,101,.35); pointer-events: none;
}
@media (max-width: 900px){
  .hero .hero-content h1, .hero .hero-body h1{
    font-size: clamp(44px, 13vw, 76px) !important;
  }
}

/* ===================================================================
   8. UNIFIED EASING for the legacy reveal vocabulary
   =================================================================== */
.au, .al, .ar, .as{
  transition-timing-function: var(--j5-ease), var(--j5-ease) !important;
}

/* ===================================================================
   9. FOOTER — hairline + lift
   =================================================================== */
footer{ position: relative; }
footer::before{
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196,161,101,.45), transparent);
}

/* ===================================================================
   10. LITE MODE — strip residual weight for in-app browsers
   =================================================================== */
html.j5-lite [data-jm-parallax] img{ transform: none !important; }
html.j5-lite .jm-tilt{ transform: none !important; }

/* ===================================================================
   11. TOUCH PERFORMANCE TIER — mobile Safari smoothness.
   Same look, cheaper pipeline: no full-screen blend-mode grain, no
   scroll-linked transforms, lighter fixed-nav blur, fewer persistent
   GPU layers. All gated on coarse pointers so desktop keeps the full
   cinema.
   =================================================================== */
@media (hover: none), (pointer: coarse){
  /* film grain: fixed overlay + mix-blend-mode composites the whole
     viewport every frame while scrolling — the single biggest cost */
  body::after{ display: none; }
  /* hero slides: color filter forces offscreen rendering of 100vh
     images during crossfade + Ken-Burns; four persistent will-change
     layers eat iPhone GPU memory. The look barely changes. */
  .h-slide img{ filter: none !important; will-change: auto !important; }
  .h-slides{ will-change: auto !important; top: 0 !important; height: 100% !important; }
  #j5-veil{ will-change: auto; }
  /* fixed nav: 16–20px backdrop blur + saturate re-blurs on every
     scrolled frame; 8px reads the same at this size */
  #nav, .nav{ -webkit-backdrop-filter: blur(8px) !important; backdrop-filter: blur(8px) !important; }
  #nav.scrolled{ background: rgba(15,12,8,.9) !important; }
  /* the mobile drawer sits on a 97%-opaque ink — the blur is invisible */
  .mob-menu{ -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  /* lightbox: near-opaque ink instead of an 18px live blur */
  .lb.is-open{ -webkit-backdrop-filter: none !important; backdrop-filter: none !important; background: rgba(7,5,3,.96) !important; }
  /* no hover on touch — release the layers hover-zoom would have used */
  .gallery-item img, .studio-img-wrap img{ will-change: auto !important; }
  /* no parallax on touch either — drop the digital zoom entirely for
     maximum sharpness (images sit exactly framed) */
  [data-jm-parallax] > img, [data-jm-parallax] .jm-par-img,
  .hero [data-jm-parallax] > img{ transform: none !important; will-change: auto !important; }
}
html{ -webkit-tap-highlight-color: rgba(0,0,0,0); }
