/* Site-Wide Luxury Visual Effects — Brushed Brass Scroll Rail, Chiaroscuro Parallax, Masked Reveals, Gallery Foil Tilt & Magnetic Craft (1.12.0). */

/* 1. Brushed 24k Gold Hairline Scroll Progress Rail */
.bl-scroll-rail {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  overflow: hidden;
  pointer-events: none;
  z-index: 4;
}

.bl-scroll-rail-bar {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: 0 50%;
  transform: scaleX(var(--scroll-progress, 0));
  background: linear-gradient(90deg, rgba(164, 129, 71, .68) 0%, #dfc18a 58%, #f8ebd0 92%, #fff6e1 100%);
  box-shadow: 0 0 8px rgba(223, 193, 138, .42);
  will-change: transform;
}

/* Active Section Navigation Halo */
.main-nav a.is-section-active {
  color: var(--gold-2, #dfc18a);
}

.main-nav a.is-section-active::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-2, #dfc18a), transparent);
}

/* 2. Hero Chiaroscuro Atmospheric Sunlight & Optical Parallax */
.hero.leather,
.services-hero,
.heritage-hero,
.research-hero,
.careers-hero,
.people-hero {
  overflow: hidden;
  overflow: clip;
}

.hero.leather::before,
.services-hero::before,
.heritage-hero::before,
.research-hero::before,
.careers-hero::before,
.people-hero::before {
  content: "";
  position: absolute;
  inset: -12% -10%;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 46% 52% at 78% 36%, rgba(227, 194, 132, .16) 0%, rgba(196, 158, 92, .05) 45%, transparent 74%),
    radial-gradient(ellipse 36% 44% at 24% 72%, rgba(173, 138, 82, .08) 0%, transparent 68%);
  animation: bl-ambient-breathe 14s ease-in-out infinite alternate;
  mix-blend-mode: screen;
}

@keyframes bl-ambient-breathe {
  0% {
    opacity: .68;
    transform: translate3d(-1.2%, -.6%, 0) scale(1);
  }
  100% {
    opacity: 1;
    transform: translate3d(1.2%, .8%, 0) scale(1.045);
  }
}

.hero-painting,
.services-hero > picture img,
.heritage-hero > img,
.heritage-hero-bg,
.research-hero > picture img,
.research-hero > img,
.careers-hero-painting,
.people-hero-painting {
  transform: translate3d(0, calc(var(--hero-parallax, 0) * 1px), 0) scale(var(--hero-scale, 1.03));
  transform-origin: center 42%;
  transition: transform .12s linear;
  will-change: transform;
}

.hero .hero-inner,
.services-hero-inner,
.heritage-hero-content,
.research-hero-inner,
.careers-hero-inner,
.people-hero-inner {
  position: relative;
  z-index: 2;
}

/* 3. Archival Cotton-Rag Texture Patina on Warm Parchment Surfaces */
.home-editorial > .section:not(.dark):not(.hongkong-pavilion-section),
.people-leadership-section,
.people-lineage-section,
.people-closing-section,
.monograph-page {
  position: relative;
}

.home-editorial > .section:not(.dark):not(.hongkong-pavilion-section)::before,
.people-leadership-section::before,
.people-lineage-section::before,
.monograph-page::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

/* Self-Drawing Antique-Gold Rule Divider */
.hero .line {
  transform-origin: 0 50%;
  animation: bl-rule-draw .9s cubic-bezier(.22, 1, .36, 1) .15s both;
}

@keyframes bl-rule-draw {
  from {
    transform: scaleX(0);
    opacity: 0;
  }
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

/* 4. Progressive Masked Editorial Reveal Choreography (Fail-Safe via .bl-motion-settled) */
[data-reveal] {
  transition:
    opacity .74s cubic-bezier(.22, 1, .36, 1) var(--reveal-delay, 0ms),
    transform .82s cubic-bezier(.22, 1, .36, 1) var(--reveal-delay, 0ms);
}

html.bl-motion-ready:not(.bl-motion-settled) [data-reveal]:not(.is-visible) {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
}

html.bl-motion-ready [data-reveal].is-visible,
html.bl-motion-settled [data-reveal] {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Painting Image-Mat Curtain Settle */
.image-mat > img,
.image-mat picture > img,
.history-painting img {
  transition: transform 1.05s cubic-bezier(.22, 1, .36, 1), filter .85s ease;
}

html.bl-motion-ready:not(.bl-motion-settled) .image-mat:not(.is-visible) > img,
html.bl-motion-ready:not(.bl-motion-settled) .image-mat:not(.is-visible) picture > img,
html.bl-motion-ready:not(.bl-motion-settled) .history-painting:not(.is-visible) img {
  transform: scale(1.045);
}

/* 5. Tactile 3D Gallery Tilt + Candlelight Champagne Specular Reflection (Fine Pointers Only) */
@media (hover: hover) and (pointer: fine) {
  [data-tilt] {
    position: relative;
    transform-style: preserve-3d;
    transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translate3d(0, var(--lift, 0px), 0);
    transition:
      transform .28s cubic-bezier(.22, 1, .36, 1),
      box-shadow .32s cubic-bezier(.22, 1, .36, 1),
      border-color .28s ease;
    will-change: transform;
  }

  [data-tilt]::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
    opacity: var(--glare-alpha, 0);
    background: radial-gradient(
      420px circle at var(--glare-x, 50%) var(--glare-y, 50%),
      rgba(246, 226, 178, .22) 0%,
      rgba(210, 174, 108, .08) 38%,
      transparent 70%
    );
    transition: opacity .3s ease;
  }

  [data-tilt]:hover {
    border-color: rgba(212, 176, 114, .72);
    box-shadow: 0 1.45rem 3.2rem rgba(4, 12, 22, .22);
  }

  /* Magnetic Button Micro-Spring & Diagonal Gold-Leaf Foil Sweep */
  .button {
    position: relative;
    overflow: hidden;
    transform: translate3d(var(--mx, 0px), var(--my, 0px), 0);
    transition:
      transform .25s cubic-bezier(.22, 1, .36, 1),
      background-color .22s ease,
      border-color .22s ease,
      color .22s ease,
      box-shadow .28s ease;
  }

  .button::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 -45%;
    width: 42%;
    background: linear-gradient(108deg, transparent 10%, rgba(255, 246, 219, .34) 48%, transparent 88%);
    transform: skewX(-18deg) translateX(-160%);
    pointer-events: none;
    transition: transform .62s cubic-bezier(.22, 1, .36, 1);
  }

  .button:hover::before,
  .button:focus-visible::before {
    transform: skewX(-18deg) translateX(430%);
  }
}

/* 6. Strict Accessibility & Reduced-Motion Reset */
@media (prefers-reduced-motion: reduce) {
  .bl-scroll-rail-bar {
    transition: none;
  }
  .hero.leather::before,
  .services-hero::before,
  .heritage-hero::before,
  .research-hero::before,
  .careers-hero::before,
  .people-hero::before,
  .hero .line {
    animation: none !important;
    transform: none !important;
  }
  .hero-painting,
  .services-hero > picture img,
  .heritage-hero > img,
  .heritage-hero-bg,
  .research-hero > picture img,
  .research-hero > img,
  .careers-hero-painting,
  .people-hero-painting,
  [data-reveal],
  [data-tilt],
  .button,
  .image-mat > img,
  .image-mat picture > img,
  .history-painting img {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  [data-tilt]::after,
  .button::before {
    display: none !important;
  }
}
