/* Trilogy Reserve v2 motion layer (2026-10-18, Alex: "add sick motion and animations").
   Progressive enhancement: nothing here applies unless <html> has .m-on, which a tiny inline
   script adds only when the visitor has NOT asked for reduced motion. Without JS, or with
   reduced motion, every element renders exactly as before. Only transform and opacity animate. */

:root { --m-ease: cubic-bezier(.16, .84, .24, 1); --m-ease-soft: cubic-bezier(.25, .6, .25, 1); }

@media (prefers-reduced-motion: no-preference) {

/* ---------- 1. Hero intro (pure CSS, plays on load, ends fully visible) ---------- */
html.m-on .tr-v2 .hero .label,
html.m-on .tr-v2 .hero__italic,
html.m-on .tr-v2 .hero .body,
html.m-on .tr-v2 .hero__actions > *,
html.m-on .tr-v2 .hero__cap { animation: m-fade-up .9s var(--m-ease) both; }
html.m-on .tr-v2 .hero .label { animation-delay: .1s; }
html.m-on .tr-v2 .hero__italic { animation-delay: .62s; }
html.m-on .tr-v2 .hero .body { animation-delay: .74s; }
html.m-on .tr-v2 .hero__actions > :nth-child(1) { animation-delay: .88s; }
html.m-on .tr-v2 .hero__actions > :nth-child(2) { animation-delay: .98s; }
html.m-on .tr-v2 .hero__cap { animation-delay: 1.1s; animation-name: m-fade; }

/* Headline: each word slides up out of its own mask. */
.tr-v2 .hero__title .m-w { display: inline-block; vertical-align: top; }
html.m-on .tr-v2 .hero__title .m-w { overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
html.m-on .tr-v2 .hero__title .m-w > span { display: inline-block; animation: m-mask-up 1.1s var(--m-ease) both; }
html.m-on .tr-v2 .hero__title .m-w:nth-child(1) > span { animation-delay: .18s; }
html.m-on .tr-v2 .hero__title .m-w:nth-child(2) > span { animation-delay: .28s; }
html.m-on .tr-v2 .hero__title .m-w:nth-child(3) > span { animation-delay: .44s; }

/* Gate photo: slow settle from 1.08 to 1, plus one soft light sweep across the frame. */
html.m-on .tr-v2 .hero__media img { animation: m-settle 2.6s var(--m-ease-soft) both; }
html.m-on .tr-v2 .hero__media::after {
  content: ''; position: absolute; inset: -10% -60%; pointer-events: none; z-index: 1;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 236, 196, .16) 48%, rgba(255, 244, 222, .26) 50%, rgba(255, 236, 196, .16) 52%, transparent 62%);
  mix-blend-mode: screen;
  transform: translate3d(-70%, 0, 0); opacity: 0;
  animation: m-sweep 2.2s var(--m-ease-soft) .7s both;
}

/* In Motion feed and entry headers: same quiet intro. */
html.m-on .tr-v2 .im-hero > *,
html.m-on .tr-v2 .im-entry > .im-back,
html.m-on .tr-v2 .im-entry > .im-meta,
html.m-on .tr-v2 .im-entry > .im-entry__title,
html.m-on .tr-v2 .im-entry > .im-entry__by,
html.m-on .tr-v2 .im-entry__grid { animation: m-fade-up .9s var(--m-ease) both; }
html.m-on .tr-v2 .im-hero > :nth-child(2), html.m-on .tr-v2 .im-entry > :nth-child(2) { animation-delay: .1s; }
html.m-on .tr-v2 .im-hero > :nth-child(3), html.m-on .tr-v2 .im-entry > :nth-child(3) { animation-delay: .2s; }
html.m-on .tr-v2 .im-hero > :nth-child(4), html.m-on .tr-v2 .im-entry > :nth-child(4) { animation-delay: .3s; }
html.m-on .tr-v2 .im-entry__grid { animation-delay: .42s; }

/* ---------- 2. Scroll reveals (classes added by motion.js only to below-the-fold elements) ---------- */
html.m-on .m-rv { opacity: 0; transform: translate3d(0, 28px, 0); transition: opacity 1s var(--m-ease), transform 1.1s var(--m-ease); transition-delay: var(--m-d, 0s); }
html.m-on .m-rv.is-in { opacity: 1; transform: none; }
html.m-on .m-rv--line { transform: scaleX(0); transform-origin: left center; opacity: 1; transition: transform 1.4s var(--m-ease); transition-delay: var(--m-d, 0s); }
html.m-on .m-rv--line.is-in { transform: none; }

/* Image curtain: a panel in the section colour lifts away while the photo settles. */
html.m-on .m-cv { position: relative; overflow: hidden; }
html.m-on .m-cv::before {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: var(--m-cv, #0b0b0b); transform-origin: top center;
  transition: transform 1.3s var(--m-ease); transition-delay: var(--m-d, 0s);
}
html.m-on .m-cv.is-in::before { transform: scaleY(0); }
html.m-on .m-cv img { transform: scale(1.12); transition: transform 2s var(--m-ease); transition-delay: var(--m-d, 0s); }
html.m-on .m-cv.is-in img { transform: none; }
/* Parallax wrapper (desktop only; motion.js writes --m-py). */
html.m-on .m-px picture { display: block; height: 100%; transform: translate3d(0, var(--m-py, 0px), 0) scale(1.1); will-change: transform; }

/* ---------- 3. Hover polish (fine pointers only) ---------- */
@media (hover: hover) and (pointer: fine) {
  /* Magnetic pull uses the independent `translate` property so it never fights the reveal transform. */
  html.m-on .tr-v2 .btn { translate: var(--m-mx, 0px) var(--m-my, 0px); transition: background-color .25s ease, color .25s ease, translate .5s var(--m-ease), opacity 1s var(--m-ease), transform 1.1s var(--m-ease); transition-delay: 0s, 0s, 0s, var(--m-d, 0s), var(--m-d, 0s); }
  html.m-on .tr-v2 .btn .btn__arrow { transition: transform .45s var(--m-ease); }
  html.m-on .tr-v2 .btn:hover .btn__arrow { transform: translate3d(5px, 0, 0); }
  html.m-on .tr-v2 .estate .minimap { transition: transform .8s var(--m-ease); }
  html.m-on .tr-v2 .estate:hover .minimap { transform: scale(1.04); }
  html.m-on .tr-v2 .reel__btn,
  html.m-on .tr-v2 .im-card__media { transition: translate .6s var(--m-ease); }
  html.m-on .tr-v2 .reel:hover .reel__btn,
  html.m-on .tr-v2 .im-card:hover .im-card__media { translate: 0 -6px; }
  html.m-on .tr-v2 .reel__btn img { transition: transform 1.1s var(--m-ease); }
  html.m-on .tr-v2 .reel:hover .reel__btn img,
  html.m-on .tr-v2 .im-card:hover .im-card__media img { transform: scale(1.05); }
  html.m-on .tr-v2 .reel__play { transition: scale .5s var(--m-ease), background-color .25s ease, color .25s ease; }
  html.m-on .tr-v2 .reel:hover .reel__play { scale: 1.08; }
  html.m-on .tr-v2 .im-card__media .reel__play { transition: none; }
  html.m-on .tr-v2 .team__photo img { transition: transform .9s var(--m-ease); }
  html.m-on .tr-v2 .team-head:hover .team__photo img { transform: scale(1.06); }
  html.m-on .tr-v2 .team__photo { overflow: hidden; }
}

/* ---------- 4. Scroll progress line and glass header ---------- */
.tr-v2 .m-progress { display: none; }
html.m-on .tr-v2 .m-progress {
  display: block; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; pointer-events: none;
  background: linear-gradient(90deg, rgba(198, 168, 107, .55), var(--gold, #c6a86b));
  transform: scaleX(var(--m-p, 0)); transform-origin: left center; will-change: transform;
}
html.m-on .tr-v2 .site-header.is-compact .site-header__bar { background: rgba(11, 11, 11, .78); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2); }

/* ---------- 5. Mobile: lighter reveals, no parallax, no curtain zoom ---------- */
@media (max-width: 767px) {
  html.m-on .m-rv { transform: translate3d(0, 14px, 0); transition-duration: .7s, .8s; }
  html.m-on .m-cv img { transform: none; transition: none; }
  html.m-on .m-cv::before { transition-duration: 1s; }
  html.m-on .tr-v2 .hero__media::after { animation-duration: 1.6s; }
}

@keyframes m-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes m-fade-up { from { opacity: 0; transform: translate3d(0, 18px, 0); } to { opacity: 1; transform: none; } }
@keyframes m-mask-up { from { transform: translate3d(0, 108%, 0); } to { transform: none; } }
@keyframes m-settle { from { transform: scale(1.08); } to { transform: none; } }
@keyframes m-sweep { 0% { transform: translate3d(-70%, 0, 0); opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { transform: translate3d(70%, 0, 0); opacity: 0; } }
}
