/* Luxury motion layer. Animation only: no layout, colour or content changes.
   Hidden start states apply only when JS has flagged the page (html.anim-ready),
   so content is always visible without JS. Reveal classes are removed after each
   animation ends, handing control back to the site's own hover transitions. */

:root {
  --ease-lux: cubic-bezier(.22, .61, .36, 1);
  --ease-silk: cubic-bezier(.16, 1, .3, 1);
}

/* Slide-in effects must never cause a horizontal scrollbar (clip keeps sticky header working) */
.anim-ready body { overflow-x: clip; }

/* ---------- Scroll reveals: several distinct effects ---------- */
.anim-ready .rv { opacity: 0; will-change: opacity, transform; }
.anim-ready .rv.is-in {
  animation-duration: 1.3s; animation-timing-function: var(--ease-silk); animation-fill-mode: both;
  animation-delay: var(--rv-delay, 0s);
}
.anim-ready .rv.fx-rise.is-in  { animation-name: lux-rise; }
.anim-ready .rv.fx-left.is-in  { animation-name: lux-left; }
.anim-ready .rv.fx-right.is-in { animation-name: lux-right; }
.anim-ready .rv.fx-scale.is-in { animation-name: lux-scale; }
.anim-ready .rv.fx-fade.is-in  { animation-name: lux-fade; animation-duration: 1.6s; animation-timing-function: var(--ease-lux); }
@keyframes lux-rise  { from { opacity: 0; transform: translate3d(0, 26px, 0); } to { opacity: 1; transform: none; } }
@keyframes lux-left  { from { opacity: 0; transform: translate3d(-56px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes lux-right { from { opacity: 0; transform: translate3d(56px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes lux-scale { from { opacity: 0; transform: translate3d(0, 34px, 0) scale(.93); } to { opacity: 1; transform: none; } }
@keyframes lux-fade  { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Headlines: word by word (no clipping, no masks) ---------- */
.anim-ready .rv-words .w { display: inline-block; opacity: 0; transform-origin: 0 100%; will-change: opacity, transform; }
.anim-ready .rv-words.is-in .w {
  animation: lux-word 1.25s var(--ease-silk) both;
  animation-delay: calc(var(--rv-delay, 0s) + var(--i, 0) * .075s);
}
.anim-ready .rv-words.soft.is-in .w {
  animation-name: lux-word-soft; animation-duration: 1.6s;
  animation-delay: calc(var(--rv-delay, 0s) + var(--i, 0) * .06s);
}
@keyframes lux-word      { from { opacity: 0; transform: translate3d(0, .65em, 0) rotate(4deg); } to { opacity: 1; transform: none; } }
@keyframes lux-word-soft { from { opacity: 0; transform: translate3d(0, .25em, 0); } to { opacity: 1; transform: none; } }

/* ---------- Images: wipe open left to right while settling ---------- */
.anim-ready .rv.fx-wipe { opacity: 1; clip-path: inset(0 100% 0 0); }
.anim-ready .rv.fx-wipe.is-in { animation-name: lux-wipe; animation-duration: 1.8s; }
.anim-ready .rv.fx-wipe.is-in > img,
.anim-ready .rv.fx-wipe.is-in > video { animation: lux-settle 2.4s var(--ease-silk) both; animation-delay: var(--rv-delay, 0s); }
@keyframes lux-wipe   { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes lux-settle { from { scale: 1.22; } to { scale: 1; } }

/* ---------- Eyebrow rule draws itself ---------- */
.anim-ready .eyebrow.rv::before { transform: scaleX(0); transform-origin: left center; }
.anim-ready .eyebrow.rv.is-in::before { animation: lux-draw 1s var(--ease-silk) .25s both; }
@keyframes lux-draw { from { transform: scaleX(0); scale: 0 1; } to { transform: scaleX(1); scale: 1 1; } }

/* ---------- Gold rule + timeline line draw ---------- */
.anim-ready .old-site .rv-line { scale: 0 1; transform-origin: left center; }
.anim-ready .old-site .rv-line.is-in { animation: lux-draw 1.2s var(--ease-silk) both; animation-delay: var(--rv-delay, 0s); }

.anim-ready .old-site .timeline.rv-tl::before { scale: 1 0; transform-origin: top center; }
.anim-ready .old-site .timeline.rv-tl.is-in::before { animation: lux-line 2.4s var(--ease-lux) both; }
@keyframes lux-line { from { scale: 1 0; } to { scale: 1 1; } }

/* Timeline node pops in when its row appears */
.anim-ready .old-site .timeline-item.rv::after { opacity: 0; }
.anim-ready .old-site .timeline-item.rv.is-in::after { animation: lux-node 1s var(--ease-silk) .2s both; }
@keyframes lux-node { 0% { opacity: 0; scale: 0; } 60% { opacity: 1; scale: 1.5; } 100% { opacity: 1; scale: 1; } }

/* ---------- Hero entrance (on load) ---------- */
.anim-ready .site-header { animation: lux-header 1.2s var(--ease-silk) both; }
@keyframes lux-header { from { opacity: 0; transform: translate3d(0, -22px, 0); } to { opacity: 1; transform: none; } }

.anim-ready .hero-visual { animation: lux-hero-wipe 1.9s var(--ease-silk) .1s both; }
@keyframes lux-hero-wipe { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 0 0 0); } }
.anim-ready .hero-visual img { animation: lux-settle 2.8s var(--ease-silk) .1s both; }

/* Gentle shimmer sweeping across the hero portrait */
.hero-visual .lux-sheen { display: none; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 244, 214, .16) 50%, transparent 62%);
  transform: translateX(-120%); animation: lux-sheen 2.4s var(--ease-lux) 1.9s 1 both; }
@keyframes lux-sheen { to { transform: translateX(120%); } }

/* ---------- Refined hover micro-motion (additive) ---------- */
.button, .header-cta, .playbook-cta { position: relative; overflow: hidden; }
.button::after, .header-cta::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .22) 50%, transparent 65%);
  transform: translateX(-130%); transition: transform .9s var(--ease-lux);
}
.button:hover::after, .button:focus-visible::after,
.header-cta:hover::after, .header-cta:focus-visible::after { transform: translateX(130%); }

.text-link svg { transition: transform .45s var(--ease-silk); }
.text-link:hover svg, .text-link:focus-visible svg { transform: translate3d(3px, -3px, 0); }

.desktop-nav a { position: relative; }
.desktop-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right center; transition: transform .55s var(--ease-silk);
}
.desktop-nav a:hover::after, .desktop-nav a:focus-visible::after { transform: scaleX(1); transform-origin: left center; }

.wordmark { transition: letter-spacing .6s var(--ease-silk); }
.wordmark:hover { letter-spacing: .02em; }

.about-pillar:hover, .learning-card:hover, .old-site #media .media-item:hover { transition-timing-function: var(--ease-silk); }
.old-site .article-card { transition: background .4s var(--ease-lux), transform .6s var(--ease-silk); }
.old-site .article-card:hover { transform: translate3d(0, -4px, 0); }
.old-site .article-read { transition: color .3s, transform .5s var(--ease-silk); }
.old-site .article-card:hover .article-read { transform: translate3d(6px, 0, 0); }
.old-site .media-type { display: inline-block; transition: transform .5s var(--ease-silk); }
.old-site .media-item:hover .media-type { transform: translate3d(6px, 0, 0); }

/* Soft zoom on image blocks */
.case-note-image img { transition: transform 1.4s var(--ease-silk); }
.case-note-image:hover img { transform: scale(1.04); }
.case-note-image { overflow: hidden; }

/* Footer link glide */
.footer-links a { display: inline-block; transition: transform .45s var(--ease-silk), color .3s; }
.footer-links a:hover { transform: translate3d(4px, 0, 0); }

/* Back-to-top gentle float */
.back-to-top.is-visible { animation: lux-float 4.5s ease-in-out infinite; }
@keyframes lux-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -4px; } }

/* Large section numerals drift in */
.anim-ready .section-index.rv.is-in { animation-name: lux-numeral; animation-duration: 2.2s; }
@keyframes lux-numeral { from { opacity: 0; transform: translate3d(0, 50px, 0) scale(.96); } to { opacity: 1; transform: none; } }

/* Scroll progress hairline */
.lux-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 200; pointer-events: none;
  background: linear-gradient(90deg, #8c7240, #d9bf87); transform: scaleX(0); transform-origin: left center; }

/* ---------- Detail pages (media / article / case note) ---------- */
.media-page.active .mp-wrap { animation: lux-page 1s var(--ease-silk) both; }
@keyframes lux-page { from { opacity: 0; transform: translate3d(0, 28px, 0); } to { opacity: 1; transform: none; } }
.media-page.active .mp-rule { animation: lux-draw 1.2s var(--ease-silk) .35s both; transform-origin: left center; }

/* ---------- Mobile menu polish ---------- */
.mobile-sheet .mobile-nav a { opacity: 0; transform: translate3d(18px, 0, 0); transition: opacity .6s var(--ease-silk), transform .6s var(--ease-silk); }
.mobile-sheet.is-open .mobile-nav a { opacity: 1; transform: none; }
.mobile-sheet.is-open .mobile-nav a:nth-child(1) { transition-delay: .12s; }
.mobile-sheet.is-open .mobile-nav a:nth-child(2) { transition-delay: .18s; }
.mobile-sheet.is-open .mobile-nav a:nth-child(3) { transition-delay: .24s; }
.mobile-sheet.is-open .mobile-nav a:nth-child(4) { transition-delay: .30s; }
.mobile-sheet.is-open .mobile-nav a:nth-child(5) { transition-delay: .36s; }
.mobile-sheet.is-open .mobile-nav a:nth-child(6) { transition-delay: .42s; }
.mobile-sheet.is-open .mobile-nav a:nth-child(7) { transition-delay: .48s; }

/* ---------- Section transitions: each section opens like a panel as it scrolls into view ----------
   Scroll-linked (no JS). Only the entry is animated; fill-mode "backwards" means the section
   returns to its normal, untransformed state once it has fully arrived. */
@supports (animation-timeline: view()) {
  .anim-ready :is(.philosophy, .about-section, .craft-film, .advisory-preview, .case-note, .learning-section, #playbook, #journey, #journey-timeline, #media, .closing-cta) {
    transform-origin: 50% 0;
    animation: lux-sec-open linear backwards;
    animation-timeline: view();
    animation-range: entry 0% entry 55%;
  }
  .anim-ready :is(.philosophy, .about-section, .craft-film, .advisory-preview, .case-note, .learning-section, #playbook, #journey, #journey-timeline, #media, .closing-cta) {
    animation-name: lux-sec-open, lux-sec-leave;
    animation-timing-function: linear, linear;
    animation-fill-mode: backwards, forwards;
    animation-range: entry 0% entry 55%, exit 55% exit 100%;
  }
}
@keyframes lux-sec-open  { from { opacity: .15; scale: .9; translate: 0 70px; filter: blur(6px); } to { opacity: 1; scale: 1; translate: 0 0; filter: blur(0); } }
@keyframes lux-sec-leave { from { opacity: 1; scale: 1; } to { opacity: .35; scale: .96; } }
@media (max-width: 700px) {
  @keyframes lux-sec-open { from { opacity: .2; scale: .96; translate: 0 40px; filter: none; } to { opacity: 1; scale: 1; translate: 0 0; filter: none; } }
}

@keyframes lux-sec-gem { 0% { scale: 0; } 60% { scale: 1.6; } 100% { scale: 1; } }

/* Active nav link keeps its underline */
.desktop-nav a.is-active::after { transform: scaleX(1); }

/* ---------- More hover effects ---------- */
/* spotlight following the cursor */
.about-pillar:hover, .learning-card:hover, .old-site .article-card:hover, .old-site #media .media-item:hover, .advisory-list > div:hover {
  background-image: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgba(198, 169, 108, .16), transparent 65%);
}
/* buttons lift */
.button, .header-cta, .playbook-cta { transition: translate .5s var(--ease-silk), box-shadow .5s var(--ease-silk), background .3s, color .3s; }
.button:hover, .header-cta:hover, .playbook-cta:hover { translate: 0 -3px; box-shadow: 0 14px 28px -14px rgba(23, 20, 16, .45); }
.button:active, .header-cta:active { translate: 0 0; }
/* list rows glide */
.credentials-list li, .advisory-list > div { transition: translate .6s var(--ease-silk), color .3s; }
.credentials-list li:hover, .advisory-list > div:hover { translate: 8px 0; }
/* media zoom */
.craft-film-player, .about-portrait { overflow: hidden; }
/* Videos are not zoomed: scaling them pushes the native controls (fullscreen, volume) outside the clipped frame,
   and on touch screens a tap leaves :hover stuck on. Zoom only images, and only where a real hover exists. */
.craft-film-player img, .about-portrait img { transition: transform 1.4s var(--ease-silk); }
@media (hover: hover) {
  .craft-film-player:hover img, .about-portrait:hover img { transform: scale(1.05); }
}
/* headline words react */
main h2 .w { transition: translate .5s var(--ease-silk), color .4s; }
main h2 .w:hover { translate: 0 -4px; color: #8c7240; }
/* hero stats */
.hero-proof > div { transition: translate .6s var(--ease-silk); }
.hero-proof > div:hover { translate: 0 -4px; }
.hero-proof dt sup { font-size: .5em; }
/* timeline node pulse on row hover */
.old-site .timeline-item { transition: translate .6s var(--ease-silk); }
.old-site .timeline-item:hover { translate: 0 -3px; }

/* ---------- Respect reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .lux-sec-rule { opacity: .85 !important; scale: 1 1 !important; }
  .lux-sec-rule::after { scale: 1 !important; }
  .button:hover, .header-cta:hover, .playbook-cta:hover, .credentials-list li:hover, .advisory-list > div:hover, .hero-proof > div:hover, .old-site .timeline-item:hover { translate: none; }
}
@media (prefers-reduced-motion: reduce) {
  .anim-ready .rv, .anim-ready .rv-words .w { opacity: 1 !important; animation: none !important; }
  .anim-ready .rv.fx-wipe { clip-path: none !important; }
  .anim-ready *, .anim-ready *::before, .anim-ready *::after { animation: none !important; }
  .anim-ready .old-site .rv-line, .anim-ready .old-site .timeline.rv-tl::before { scale: none !important; }
  .anim-ready .eyebrow.rv::before { transform: none !important; }
  .anim-ready .old-site .timeline-item.rv::after { opacity: 1 !important; }
  .lux-progress, .hero-visual .lux-sheen { display: none; }
  .mobile-sheet .mobile-nav a { opacity: 1; transform: none; transition: none; }
}
