/* Premium motion layer — isolated from the core layout for easy tuning/removal. */
:root {
  --motion-ease: cubic-bezier(0.2, 0.75, 0.25, 1);
  --motion-spring: cubic-bezier(0.16, 1, 0.3, 1);
}

.page-progress {
  position: fixed;
  z-index: 220;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  pointer-events: none;
}

.page-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--gold-400);
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
}

/* Cursor glow — created by motion.js on fine pointers only */
.cursor-orb {
  position: fixed;
  z-index: 180;
  top: 0;
  left: 0;
  width: 26px;
  height: 26px;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle, rgba(var(--gold-rgb), 0.4), rgba(var(--gold-rgb), 0.1) 45%, transparent 72%);
  border: 1px solid rgba(var(--gold-rgb), 0.3);
  border-radius: 50%;
  transform: translate3d(-50%, -50%, 0);
  transition: width 0.28s var(--motion-spring), height 0.28s var(--motion-spring), opacity 0.25s ease;
  will-change: transform;
}

.cursor-orb.is-visible { opacity: 0.75; }

.cursor-orb.is-hovering {
  width: 54px;
  height: 54px;
  opacity: 0.45;
}

/* 光泉 fireflies inside the hero — dark themes only */
.hero-light-canvas {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

html[data-mode="light"] .hero-light-canvas {
  display: none;
}

/* Brand mark animation — the rays above the R shimmer like the logo
   is catching light; the whole mark lifts on hover. */
.site-logo .logo-mark path:last-of-type {
  animation: logo-rays 3.8s ease-in-out infinite;
  transform-origin: 42% 12%;
}

.site-logo .logo-mark {
  animation: logo-glow 3.8s ease-in-out infinite;
  transition: transform 0.35s var(--motion-spring);
}

.site-logo:hover .logo-mark {
  transform: rotate(-5deg) scale(1.08);
}

@keyframes logo-rays {
  0%, 100% { opacity: 0.35; transform: scale(0.94); }
  16% { opacity: 1; transform: scale(1.06); }
  32% { opacity: 0.55; transform: scale(1); }
}

@keyframes logo-glow {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(var(--gold-rgb), 0)); }
  16% { filter: drop-shadow(0 2px 7px rgba(var(--gold-rgb), 0.45)); }
}

@media (prefers-reduced-motion: reduce) {
  .site-logo .logo-mark,
  .site-logo .logo-mark path:last-of-type {
    animation: none;
  }
}

/* Pointer parallax on the hero showcase (vars set by motion.js) */
.hero-showcase {
  transform: translate3d(var(--par-x, 0), var(--par-y, 0), 0) rotate(var(--par-rot, 0deg));
  transition: transform 0.35s ease-out;
  will-change: transform;
}

@media (max-width: 920px), (pointer: coarse) {
  .cursor-orb { display: none; }
  .hero-showcase { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .cursor-orb,
  .hero-light-canvas { display: none; }
  .hero-showcase { transform: none; }
}

.page-transition {
  position: fixed;
  z-index: 500;
  inset: 0;
  display: none;
  place-items: center;
  color: var(--white);
  background:
    radial-gradient(circle at 60% 20%, rgba(214, 168, 79, 0.17), transparent 32%),
    radial-gradient(circle at 20% 90%, rgba(70, 184, 132, 0.12), transparent 34%),
    var(--navy-950);
  pointer-events: none;
  transform: translateY(-102%);
  transition: transform 0.72s var(--motion-ease);
  will-change: transform;
}

.motion-enhanced .page-transition {
  display: grid;
  transform: translateY(-102%);
}

.page-transition::before,
.page-transition::after {
  position: absolute;
  width: 340px;
  height: 340px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  content: "";
}

.page-transition::before {
  top: -210px;
  right: -90px;
  box-shadow: 0 0 0 70px rgba(255, 255, 255, 0.012), 0 0 0 140px rgba(255, 255, 255, 0.008);
}

.page-transition::after {
  bottom: -270px;
  left: -100px;
  box-shadow: 0 0 0 60px rgba(70, 184, 132, 0.018), 0 0 0 120px rgba(70, 184, 132, 0.012);
}

.page-transition__brand {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 16px;
  color: var(--white);
}

.page-transition__brand .logo-mark {
  width: 72px;
  height: 72px;
  color: var(--white);
  animation: transition-mark 1.7s ease-in-out infinite;
}

.page-transition__brand span {
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.motion-enhanced.is-ready .page-transition {
  transform: translateY(-102%);
}

.motion-enhanced.is-leaving .page-transition {
  transform: translateY(0);
  transition-duration: 0.38s;
}

.motion-enhanced main {
  animation: page-enter 0.4s var(--motion-spring) both;
}

.hero__grid,
.page-hero__inner {
  z-index: 3;
}

.hero__copy h1,
.page-hero h1 {
  text-wrap: balance;
}

.eyebrow {
  position: relative;
}

.eyebrow::after {
  position: absolute;
  bottom: -7px;
  left: 38px;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, currentColor, transparent);
  content: "";
  opacity: 0.5;
  transition: width 0.7s var(--motion-spring);
}

.is-visible .eyebrow::after,
.page-hero .eyebrow::after,
.hero .eyebrow::after {
  width: 72px;
}

.service-card__icon svg,
.contact-card__icon svg {
  transition: transform 0.4s var(--motion-spring);
}

.service-card:hover .service-card__icon svg,
.contact-card:hover .contact-card__icon svg {
  transform: rotate(-6deg) scale(1.12);
}

.button {
  position: relative;
  overflow: hidden;
  transform: translate3d(var(--magnetic-x, 0), calc(var(--magnetic-y, 0) - var(--button-lift, 0px)), 0);
  transition: transform 0.25s var(--motion-spring), box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
  will-change: transform;
}

.button:hover {
  --button-lift: 2px;
}

.text-link svg,
.button svg {
  transition: transform 0.3s var(--motion-spring);
}

.text-link:hover svg,
.button:hover svg {
  transform: translateX(4px);
}

.desktop-nav a {
  transition: color 0.25s ease, transform 0.25s var(--motion-spring);
}

.desktop-nav a:hover {
  transform: translateY(-2px);
}

.is-tiltable,
.service-card.is-tiltable,
.work-card.is-tiltable,
.pricing-card.is-tiltable,
.value-card.is-tiltable,
.maintenance-card.is-tiltable,
.contact-card.is-tiltable,
.belief-card.is-tiltable,
.ray-card.is-tiltable {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --tilt-lift: 0px;
  transform: perspective(1000px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translateY(var(--tilt-lift));
  transform-style: preserve-3d;
  transition: transform 0.42s var(--motion-spring), box-shadow 0.35s ease, border-color 0.35s ease;
  will-change: transform;
}

.is-tiltable:hover {
  --tilt-lift: -6px;
}

.service-card.is-tiltable::after,
.work-card.is-tiltable::after,
.pricing-card.is-tiltable::after,
.value-card.is-tiltable::after,
.maintenance-card.is-tiltable::after {
  position: absolute;
  z-index: 3;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(280px circle at var(--glow-x, 50%) var(--glow-y, 50%), rgba(245, 218, 160, 0.16), transparent 60%);
  border-radius: inherit;
  content: "";
  opacity: 0;
  transition: opacity 0.3s ease;
}

.service-card.is-tiltable:hover::after,
.work-card.is-tiltable:hover::after,
.pricing-card.is-tiltable:hover::after,
.value-card.is-tiltable:hover::after,
.maintenance-card.is-tiltable:hover::after {
  opacity: 1;
}

.service-card,
.work-card,
.pricing-card,
.value-card,
.maintenance-card {
  position: relative;
  isolation: isolate;
}

.service-card > *,
.work-card > *,
.pricing-card > *,
.value-card > *,
.maintenance-card > * {
  position: relative;
  z-index: 4;
}

/* The "popular" pill is an absolutely-positioned corner badge — the blanket
   rule above would otherwise pull it back into flow. Re-assert it (later,
   equal specificity) so it floats in the card's top corner. */
.pricing-card__popular {
  position: absolute;
  z-index: 5;
}

.tag {
  transition: color 0.25s ease, background 0.25s ease, border-color 0.25s ease, transform 0.25s var(--motion-spring);
}

.tag:hover {
  color: var(--navy-900);
  background: rgba(214, 168, 79, 0.13);
  border-color: rgba(214, 168, 79, 0.38);
  transform: translateY(-2px);
}

.project-window,
.case-shot {
  transition: transform 0.55s var(--motion-spring), box-shadow 0.45s ease;
}

.work-card:hover .project-window {
  box-shadow: 0 28px 56px rgba(0, 0, 0, 0.3);
  transform: rotate(0) translateY(-5px) scale(1.025);
}

.case-shot:hover {
  z-index: 5;
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.28);
  transform: translateY(-5px) scale(1.018);
}

.brand-symbol-large .logo-mark {
  animation: brand-float 5.5s ease-in-out infinite;
}

.form-status:not([hidden]) {
  animation: status-enter 0.45s var(--motion-spring) both;
}

.motion-ready .reveal:not(.reveal--delay) {
  transition-delay: var(--stagger-delay, 0ms);
}

@keyframes transition-mark {
  0%, 100% { transform: translateY(0) scale(1); filter: drop-shadow(0 0 0 rgba(214, 168, 79, 0)); }
  50% { transform: translateY(-6px) scale(1.04); filter: drop-shadow(0 12px 22px rgba(214, 168, 79, 0.22)); }
}

@keyframes page-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes brand-float {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-8px) rotate(1deg); }
}

@keyframes status-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 920px), (pointer: coarse) {
  .is-tiltable,
  .is-tiltable:hover {
    --tilt-x: 0deg !important;
    --tilt-y: 0deg !important;
  }
}

@media (max-width: 680px) {
  .page-transition__brand .logo-mark {
    width: 60px;
    height: 60px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-transition {
    display: none;
  }

  .brand-symbol-large .logo-mark {
    animation: none !important;
  }

  .is-tiltable,
  .button {
    transform: none !important;
  }
}
