/* Motion system — Apple (C1), Stripe (C2), Epic (C3) */

:root {
  --ease-apple: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-stripe: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-epic: cubic-bezier(0.77, 0, 0.175, 1);
  --motion-duration-apple: 1.1s;
  --motion-duration-stripe: 0.75s;
  --motion-duration-epic: 0.95s;
}

/* ── Apple (Executive Calm) ───────────────────────────── */

.motion-theme-apple .site-header {
  opacity: 0;
  transform: translateY(-12px);
  animation: apple-header-in 0.9s var(--ease-apple) 0.1s forwards;
}

@keyframes apple-header-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.motion-theme-apple .hero-calm .motion-hero-item {
  opacity: 0;
  transform: translateY(36px);
  transition:
    opacity var(--motion-duration-apple) var(--ease-apple),
    transform var(--motion-duration-apple) var(--ease-apple);
  transition-delay: var(--motion-delay, 0s);
}

.motion-theme-apple .hero-calm.is-hero-visible .motion-hero-item {
  opacity: 1;
  transform: translateY(0);
}

.motion-theme-apple .hero-calm .motion-hero-media {
  opacity: 0;
  transform: scale(1.06) translateY(24px);
  transition:
    opacity 1.3s var(--ease-apple) 0.35s,
    transform 1.4s var(--ease-apple) 0.35s;
  will-change: transform, opacity;
}

.motion-theme-apple .hero-calm.is-hero-visible .motion-hero-media {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.motion-theme-apple .hero-calm.is-hero-visible.is-scrolled .motion-hero-media {
  transform: scale(1) translateY(var(--parallax-y, 0px));
  transition: transform 0.1s linear;
}

@media (max-width: 860px) {
  .motion-theme-apple .hero-calm .motion-hero-media {
    transform: scale(1) translateY(0);
  }

  .motion-theme-apple .hero-calm.is-hero-visible .motion-hero-media,
  .motion-theme-apple .hero-calm.is-hero-visible.is-scrolled .motion-hero-media {
    transform: scale(1) translateY(0);
    transition:
      opacity 1.3s var(--ease-apple) 0.35s,
      transform 1.4s var(--ease-apple) 0.35s;
  }
}

html.motion-enabled.motion-theme-apple .motion-reveal:not(.is-inview) {
  opacity: 0;
  transform: translateY(48px);
}

.motion-theme-apple .motion-reveal {
  transition:
    opacity var(--motion-duration-apple) var(--ease-apple),
    transform var(--motion-duration-apple) var(--ease-apple);
  transition-delay: var(--reveal-delay, 0s);
}

.motion-theme-apple .motion-reveal.is-inview {
  opacity: 1;
  transform: translateY(0);
}

.motion-theme-apple .motion-section.is-inview .section-inner > .kicker,
.motion-theme-apple .motion-section.is-inview .section-inner > .section-heading,
.motion-theme-apple .motion-section.is-inview .section-inner > .lead,
.motion-theme-apple .motion-section.is-inview .section-inner > .reviews-note {
  animation: apple-fade-up 0.9s var(--ease-apple) both;
}

.motion-theme-apple .motion-section.is-inview .section-inner > .section-heading {
  animation-delay: 0.08s;
}

.motion-theme-apple .motion-section.is-inview .section-inner > .lead {
  animation-delay: 0.14s;
}

@keyframes apple-fade-up {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

html.motion-enabled.motion-theme-apple .metrics-strip:not(.is-inview) > div {
  opacity: 0;
  transform: translateY(20px);
}

.motion-theme-apple .metrics-strip > div {
  transition:
    opacity 0.8s var(--ease-apple),
    transform 0.8s var(--ease-apple);
  transition-delay: calc(var(--metric-index, 0) * 0.1s);
}

.motion-theme-apple .metrics-strip.is-inview > div {
  opacity: 1;
  transform: translateY(0);
}

/* ── Stripe (Wall Street Reset) ───────────────────────── */

.load-intro {
  display: none;
}

.motion-pending .load-intro,
.motion-enabled.motion-theme-stripe .load-intro {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  overflow: hidden;
  pointer-events: none;
  color: #f8f4ec;
  background: #071b32;
  animation: stripe-intro-exit 0.55s var(--ease-stripe) 1.1s forwards;
}

.load-intro::before,
.load-intro::after {
  content: "";
  position: absolute;
  inset: 0;
}

.load-intro::before {
  background:
    radial-gradient(circle at 75% 25%, rgba(184, 121, 62, 0.2), transparent 34%),
    linear-gradient(115deg, transparent 0 43%, rgba(255,255,255,.04) 43.1% 43.25%, transparent 43.35% 100%);
  transform: scale(1.08);
  animation: stripe-intro-field 2.2s var(--ease-stripe) both;
}

.load-intro-copy {
  position: relative;
  z-index: 2;
  width: min(820px, calc(100vw - 48px));
  text-align: center;
  perspective: 1000px;
}

.load-intro-logo {
  position: relative;
  width: clamp(156px, 18vw, 236px);
  aspect-ratio: 1;
  margin: 0 auto 20px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.9);
  animation: stripe-logo-arrive 0.55s var(--ease-stripe) 0.05s forwards;
}

.load-intro-logo::before,
.load-intro-logo::after {
  content: none;
}

.load-intro-logo video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  transform: scale(1.24);
  filter: contrast(1.08) saturate(1.04);
  box-shadow: 0 20px 55px rgba(0,0,0,.34);
}

@keyframes stripe-logo-arrive {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.load-intro-kicker {
  display: block;
  margin-bottom: 22px;
  color: #b8793e;
  font: 700 12px/1.2 "DM Sans", Arial, sans-serif;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(14px);
  animation: stripe-intro-copy 0.4s var(--ease-stripe) 0.3s forwards;
}

.load-intro-copy strong {
  display: block;
  font: 700 clamp(38px, 6vw, 64px)/0.98 Georgia, serif;
  letter-spacing: -0.045em;
  opacity: 0;
  filter: blur(10px);
  transform: translateY(38px) scale(0.97);
  animation: stripe-intro-title 0.5s var(--ease-stripe) 0.42s forwards;
}

@keyframes stripe-intro-copy {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes stripe-intro-title {
  to { opacity: 1; filter: blur(0); transform: translateY(0) scale(1); }
}

@keyframes stripe-intro-field {
  from { transform: scale(1.08); }
  to { transform: scale(1); }
}

@keyframes stripe-intro-exit {
  0% { clip-path: inset(0 0 0 0); visibility: visible; }
  100% { clip-path: inset(0 0 100% 0); visibility: hidden; }
}

.motion-theme-stripe .hero-dark {
  position: relative;
  overflow: hidden;
}

.motion-theme-stripe .stripe-mesh {
  position: absolute;
  inset: -40%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
  background:
    radial-gradient(ellipse 50% 40% at 20% 30%, rgba(76, 111, 154, 0.35), transparent 70%),
    radial-gradient(ellipse 45% 50% at 80% 20%, rgba(184, 121, 62, 0.28), transparent 65%),
    radial-gradient(ellipse 60% 45% at 60% 80%, rgba(11, 37, 69, 0.2), transparent 70%);
  animation: stripe-mesh-drift 18s ease-in-out infinite alternate;
}

@keyframes stripe-mesh-drift {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); }
  100% { transform: translate(3%, -2%) rotate(2deg) scale(1.05); }
}

.motion-theme-stripe .hero-dark .section-inner {
  position: relative;
  z-index: 1;
}

.motion-theme-stripe .hero-dark .motion-hero-item {
  opacity: 0;
  transform: translateY(52px) rotateX(8deg);
  filter: blur(10px);
  transition:
    opacity var(--motion-duration-stripe) var(--ease-stripe),
    transform var(--motion-duration-stripe) var(--ease-stripe),
    filter var(--motion-duration-stripe) var(--ease-stripe);
  transition-delay: var(--motion-delay, 0s);
}

.motion-theme-stripe .hero-dark.is-hero-visible .motion-hero-item {
  opacity: 1;
  transform: translateY(0) rotateX(0);
  filter: blur(0);
}

.motion-theme-stripe .hero-dark .panel-photo {
  opacity: 0;
  clip-path: inset(0 100% 0 0);
  transform: translateX(-48px) scale(1.08);
  transition:
    opacity 1s var(--ease-stripe) 0.05s,
    transform 1.15s var(--ease-stripe) 0.05s,
    clip-path 1.15s var(--ease-stripe) 0.05s;
}

.motion-theme-stripe .hero-dark.is-hero-visible .panel-photo {
  opacity: 1;
  clip-path: inset(0 0 0 0);
  transform: translateX(0) scale(1);
}

@media (max-width: 700px) {
  .load-intro-copy strong { font-size: clamp(38px, 12vw, 58px); }
  .load-intro-logo { width: 156px; margin-bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .load-intro { display: none !important; }
}

html.motion-enabled.motion-theme-stripe .motion-reveal:not(.is-inview) {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(8px);
}

.motion-theme-stripe .motion-reveal {
  transition:
    opacity var(--motion-duration-stripe) var(--ease-stripe),
    transform var(--motion-duration-stripe) var(--ease-stripe),
    filter var(--motion-duration-stripe) var(--ease-stripe);
  transition-delay: var(--reveal-delay, 0s);
  will-change: opacity, transform, filter;
}

.motion-theme-stripe .motion-reveal.is-inview {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

html.motion-enabled.motion-theme-stripe .metrics-strip:not(.is-inview) > div strong {
  opacity: 0;
  transform: translateY(8px);
}

.motion-theme-stripe .metrics-strip > div strong {
  display: inline-block;
  transition:
    opacity 0.5s var(--ease-stripe),
    transform 0.5s var(--ease-stripe);
  transition-delay: calc(var(--metric-index, 0) * 0.08s + 0.15s);
}

.motion-theme-stripe .metrics-strip.is-inview > div strong {
  opacity: 1;
  transform: translateY(0);
}

.motion-theme-stripe .card,
.motion-theme-stripe .review-card {
  transition:
    transform 0.35s var(--ease-stripe),
    box-shadow 0.35s var(--ease-stripe),
    border-color 0.35s var(--ease-stripe);
}

.motion-theme-stripe .card.is-inview:hover,
.motion-theme-stripe .review-card.is-inview:hover {
  transform: translateY(-6px) scale(1.01);
}

/* ── Epic (Verdant Perspective) ───────────────────────── */

.motion-theme-epic .site-header {
  opacity: 0;
  clip-path: inset(0 0 100% 0);
  animation: epic-header-reveal 0.8s var(--ease-epic) 0.1s forwards;
}

@keyframes epic-header-reveal {
  to {
    opacity: 1;
    clip-path: inset(0 0 0 0);
  }
}

.motion-theme-epic .hero-editorial {
  position: relative;
  overflow: hidden;
}

.motion-theme-epic .hero-editorial::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(157, 184, 212, 0.14) 50%, transparent 60%);
  transform: translateX(-120%);
  animation: epic-hero-shine 4.5s var(--ease-epic) 1.2s 1 forwards;
  pointer-events: none;
}

@keyframes epic-hero-shine {
  to { transform: translateX(120%); }
}

.motion-theme-epic .hero-editorial .motion-epic-hero-inner > * {
  opacity: 0;
  transform: translateY(56px);
  clip-path: inset(100% 0 0 0);
  transition:
    opacity var(--motion-duration-epic) var(--ease-epic),
    transform var(--motion-duration-epic) var(--ease-epic),
    clip-path var(--motion-duration-epic) var(--ease-epic);
  transition-delay: var(--motion-delay, 0s);
}

.motion-theme-epic .hero-editorial.is-hero-visible .motion-epic-hero-inner > * {
  opacity: 1;
  transform: translateY(0);
  clip-path: inset(0 0 0 0);
}

html.motion-enabled.motion-theme-epic .motion-reveal:not(.is-inview) {
  opacity: 0;
  transform: translateY(40px) rotate(-0.6deg);
  clip-path: inset(0 0 100% 0);
}

.motion-theme-epic .motion-reveal {
  transition:
    opacity var(--motion-duration-epic) var(--ease-epic),
    transform var(--motion-duration-epic) var(--ease-epic),
    clip-path var(--motion-duration-epic) var(--ease-epic);
  transition-delay: var(--reveal-delay, 0s);
}

.motion-theme-epic .motion-reveal.is-inview {
  opacity: 1;
  transform: translateY(0) rotate(0);
  clip-path: inset(0 0 0 0);
}

.motion-theme-epic .motion-section.is-inview .section-heading {
  position: relative;
}

.motion-theme-epic .motion-section.is-inview .section-heading::after {
  content: "";
  display: block;
  width: 0;
  height: 3px;
  margin-top: 14px;
  background: linear-gradient(90deg, var(--bronze), var(--sky));
  animation: epic-rule-grow 0.9s var(--ease-epic) 0.35s forwards;
}

@keyframes epic-rule-grow {
  to { width: 72px; }
}

.motion-theme-epic .section-heading {
  --sky: #9db8d4;
}

.motion-theme-epic .card.is-inview,
.motion-theme-epic .review-card.is-inview {
  transition: transform 0.5s var(--ease-epic);
}

.motion-theme-epic .card.is-inview:hover {
  transform: translateY(-4px) rotate(0.4deg);
}

/* ── Shared contact band entrance ─────────────────────── */

html.motion-enabled .contact-band:not(.is-inview) > div,
html.motion-enabled .contact-band:not(.is-inview) .form-preview {
  opacity: 0;
  transform: translateY(36px);
}

.motion-enabled .contact-band > div,
.motion-enabled .contact-band .form-preview {
  transition:
    opacity 0.9s var(--ease-apple),
    transform 0.9s var(--ease-apple);
}

.motion-theme-stripe .contact-band > div,
.motion-theme-stripe .contact-band .form-preview {
  transition-timing-function: var(--ease-stripe);
  transition-duration: var(--motion-duration-stripe);
}

.motion-theme-epic .contact-band > div,
.motion-theme-epic .contact-band .form-preview {
  transition-timing-function: var(--ease-epic);
  transition-duration: var(--motion-duration-epic);
}

.motion-enabled .contact-band.is-inview > div,
.motion-enabled .contact-band.is-inview .form-preview {
  opacity: 1;
  transform: translateY(0);
}

.motion-enabled .contact-band.is-inview .form-preview {
  transition-delay: 0.12s;
}

/* ── Reduced motion ───────────────────────────────────── */

html.motion-reduced .motion-reveal,
html.motion-reduced .motion-hero-item,
html.motion-reduced .motion-hero-media,
html.motion-reduced .metrics-strip > div,
html.motion-reduced .contact-band > div,
html.motion-reduced .contact-band .form-preview {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
  clip-path: none !important;
  animation: none !important;
}
