/* ==========================================================================
   Duckworth — Motion System v2
   Redesigned site-wide animation engine. Loaded on every page.
   Every rule respects prefers-reduced-motion.
   ========================================================================== */

:root {
  --ease-out:      cubic-bezier(.16, 1, .3, 1);
  --ease-standard: cubic-bezier(.4, 0, .2, 1);
  --ease-bounce:   cubic-bezier(.34, 1.56, .64, 1);
  --ease-spring:   cubic-bezier(.22, 1.2, .36, 1);
  --dw-red:        #C45C54;
  --dw-dark:       #262626;
  --dw-lime:       #BED496;

  /* Updated by JS for cursor spotlight */
  --cursor-x: 50%;
  --cursor-y: 50%;
}

/* Smooth in-page scrolling */
html {
  scroll-behavior: smooth;
}

[id] {
  scroll-margin-top: 104px;
}


/* -------------------------------------------------------------------------- */
/* Scroll progress bar — shimmer sweep                                        */
/* -------------------------------------------------------------------------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg,
    var(--dw-red) 0%,
    #e8847c      40%,
    var(--dw-red) 80%
  );
  background-size: 200% 100%;
  z-index: 60;
  transform-origin: left;
  transition: width .1s linear;
  pointer-events: none;
}

.scroll-progress.is-active {
  animation: progressShimmer 2.2s linear infinite;
}

@keyframes progressShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}


/* -------------------------------------------------------------------------- */
/* Sticky header                                                               */
/* -------------------------------------------------------------------------- */
header.sticky {
  transition:
    box-shadow       .4s var(--ease-standard),
    padding          .4s var(--ease-standard),
    background-color .4s var(--ease-standard);
  animation: headerSlideIn .6s var(--ease-out) both;
}

header.sticky.is-scrolled {
  padding-top: 0.625rem;
  padding-bottom: 0.625rem;
  box-shadow:
    0 1px 0 rgba(17, 17, 17, .06),
    0 12px 24px -18px rgba(17, 17, 17, .18);
  background-color: rgba(255, 255, 255, .96);
}

/* Header logo — smooth size transition on scroll */
.header-logo {
  height: 130px;
  margin-top: -45px;
  margin-bottom: -45px;
  transition:
    height        .4s var(--ease-out),
    margin-top    .4s var(--ease-out),
    margin-bottom .4s var(--ease-out);
}

header.sticky.is-scrolled .header-logo {
  height: 88px;
  margin-top: -28px;
  margin-bottom: -28px;
}

/* Header entrance animation */
@keyframes headerSlideIn {
  from {
    opacity: 0;
    transform: translateY(-100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Nav link underline sweep */
header nav a[href]:not(.bg-brand-red) {
  position: relative;
}

header nav a[href]:not(.bg-brand-red)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -2px;
  height: 2px;
  background: currentColor;
  opacity: 0;
  transition: right .3s var(--ease-out), opacity .3s var(--ease-out);
}

header nav a[href]:not(.bg-brand-red):hover::after {
  right: 0;
  opacity: .55;
}

header nav a.border-brand-red::after {
  content: none;
}


/* -------------------------------------------------------------------------- */
/* Cursor spotlight — JS sets --cursor-x/y via inline style on parent        */
/* -------------------------------------------------------------------------- */
.has-spotlight {
  position: relative;
  overflow: hidden;
}

.has-spotlight::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    560px circle at var(--cursor-x, 50%) var(--cursor-y, 50%),
    rgba(196, 92, 84, .07) 0%,
    rgba(190, 212, 150, .04) 38%,
    transparent 68%
  );
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity .55s var(--ease-standard);
}

.has-spotlight.spotlight-active::before {
  opacity: 1;
}


/* -------------------------------------------------------------------------- */
/* Scroll reveal — multi-directional                                          */
/* -------------------------------------------------------------------------- */

/* Slide up */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity .75s var(--ease-out),
    transform .75s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

/* Slide from left */
.reveal-left {
  opacity: 0;
  transform: translateX(-34px);
  transition:
    opacity .75s var(--ease-out),
    transform .75s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

/* Slide from right */
.reveal-right {
  opacity: 0;
  transform: translateX(34px);
  transition:
    opacity .75s var(--ease-out),
    transform .75s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

/* Pure fade */
.reveal-fade {
  opacity: 0;
  transition: opacity .8s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

/* Scale up */
.reveal-scale {
  opacity: 0;
  transform: scale(.93) translateY(12px);
  transition:
    opacity .65s var(--ease-out),
    transform .7s var(--ease-spring);
  transition-delay: var(--reveal-delay, 0ms);
}

/* Visible states */
.reveal.is-visible,
.reveal-left.is-visible,
.reveal-right.is-visible {
  opacity: 1;
  transform: translate(0, 0);
}

.reveal-fade.is-visible {
  opacity: 1;
}

.reveal-scale.is-visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}


/* -------------------------------------------------------------------------- */
/* Text reveal — word-by-word slide-up (opt-in: data-text-reveal attr)       */
/* -------------------------------------------------------------------------- */
[data-text-reveal] .dw-word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  line-height: inherit;
}

[data-text-reveal] .dw-word-inner {
  display: inline-block;
  transform: translateY(115%);
  opacity: 0;
  transition:
    transform .6s var(--ease-out),
    opacity   .35s var(--ease-standard);
  transition-delay: var(--word-delay, 0ms);
}

[data-text-reveal].is-visible .dw-word-inner {
  transform: translateY(0);
  opacity: 1;
}


/* -------------------------------------------------------------------------- */
/* Hero entrance — blur-clear wipe                                            */
/* -------------------------------------------------------------------------- */
.hero-blur-in {
  opacity: 0;
  filter: blur(8px);
  transform: translateY(18px);
  animation: heroBlurIn .95s var(--ease-out) forwards;
  animation-delay: var(--hero-delay, 0ms);
}

@keyframes heroBlurIn {
  to {
    opacity: 1;
    filter: blur(0px);
    transform: translateY(0);
  }
}

/* Legacy — kept for any page that uses hero-in directly */
.hero-in {
  opacity: 0;
  transform: translateY(16px);
  animation: heroIn .8s var(--ease-out) forwards;
  animation-delay: var(--hero-delay, 0ms);
}

@keyframes heroIn {
  to { opacity: 1; transform: translateY(0); }
}


/* -------------------------------------------------------------------------- */
/* Card hover — perspective tilt + glow bloom                                */
/* -------------------------------------------------------------------------- */
.rounded-xl.border,
.rounded-2xl.border,
a.rounded-xl,
a.rounded-2xl {
  transition:
    transform   .4s var(--ease-out),
    box-shadow  .4s var(--ease-out),
    border-color .35s var(--ease-out);
}

.rounded-xl.border:hover,
.rounded-2xl.border:hover {
  transform: translateY(-6px) rotateX(1.8deg);
  box-shadow:
    0 24px 50px -18px rgba(17, 17, 17, .2),
    0 0 0 1px rgba(196, 92, 84, .07);
}

/* Dark translucent cards */
.bg-white\/5.border {
  transition:
    transform        .4s var(--ease-out),
    background-color .4s var(--ease-out),
    border-color     .4s var(--ease-out),
    box-shadow       .4s var(--ease-out);
}

.bg-white\/5.border:hover {
  transform: translateY(-6px) rotateX(1.8deg);
  background-color: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .28);
  box-shadow:
    0 28px 52px -18px rgba(0, 0, 0, .3),
    0 0 0 1px rgba(190, 212, 150, .14);
}


/* -------------------------------------------------------------------------- */
/* Buttons & CTAs                                                             */
/* -------------------------------------------------------------------------- */
.rounded-full {
  transition:
    transform        .3s var(--ease-bounce),
    box-shadow       .3s var(--ease-out),
    background-color .2s var(--ease-standard),
    color            .2s var(--ease-standard),
    border-color     .2s var(--ease-standard);
}

a.rounded-full:hover,
button.rounded-full:hover {
  transform: translateY(-3px) scale(1.02);
}

.bg-brand-red.rounded-full:hover {
  box-shadow:
    0 18px 36px -10px rgba(196, 92, 84, .62),
    0 0 0 5px rgba(196, 92, 84, .1);
}

/* Arrow bounce overshoot */
.rounded-full span.leading-none {
  display: inline-block;
  transition: transform .4s var(--ease-bounce);
}

a.rounded-full:hover span.leading-none,
button.rounded-full:hover span.leading-none {
  transform: translateX(6px);
}

/* Press feedback */
a.rounded-full:active,
button.rounded-full:active {
  transform: translateY(0) scale(.97);
  transition-duration: .1s;
}


/* -------------------------------------------------------------------------- */
/* Magnetic buttons — JS controls the translate, CSS owns the transition     */
/* -------------------------------------------------------------------------- */
.btn-magnetic {
  will-change: transform;
}

.btn-magnetic {
  transition:
    transform  .45s var(--ease-out),
    box-shadow .3s  var(--ease-out);
}

.btn-magnetic:active {
  transition-duration: .08s;
}


/* -------------------------------------------------------------------------- */
/* Form fields                                                                */
/* -------------------------------------------------------------------------- */
input, select, textarea {
  transition:
    border-color .25s var(--ease-standard),
    box-shadow   .25s var(--ease-standard),
    transform    .2s  var(--ease-standard);
}

input:focus, select:focus, textarea:focus {
  transform: translateY(-1px);
}

button[disabled] {
  transition: opacity .25s var(--ease-standard);
}


/* -------------------------------------------------------------------------- */
/* Mobile menu — smooth open/close                                            */
/* -------------------------------------------------------------------------- */
#mobile-menu {
  display: block !important;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-6px);
  transition:
    max-height .38s var(--ease-standard),
    opacity    .28s var(--ease-standard),
    transform  .32s var(--ease-standard);
  pointer-events: none;
}

#mobile-menu.is-open {
  max-height: 480px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#menu-icon-open, #menu-icon-close {
  display: inline-block;
  transition: transform .3s var(--ease-out), opacity .3s var(--ease-out);
}


/* -------------------------------------------------------------------------- */
/* Counters                                                                   */
/* -------------------------------------------------------------------------- */
[data-counter] {
  font-variant-numeric: tabular-nums;
}

.counter-pop {
  animation: counterPop .5s var(--ease-bounce);
}

@keyframes counterPop {
  0%   { transform: scale(1); }
  42%  { transform: scale(1.24); }
  68%  { transform: scale(.94); }
  100% { transform: scale(1); }
}


/* -------------------------------------------------------------------------- */
/* Logo stage — enhanced                                                      */
/* -------------------------------------------------------------------------- */
.logo-stage {
  isolation: isolate;
  perspective: 900px;
}

.logo-stage__panel {
  position: absolute;
  inset: 6% 2%;
  border-radius: 28px;
  background:
    radial-gradient(circle at 44% 42%, rgba(196, 92, 84, .18), transparent 34%),
    linear-gradient(145deg, #262626 0%, #333333 46%, #f7f7f4 46.3%, #fff 100%);
  box-shadow: 0 30px 80px rgba(17, 17, 17, .12);
  overflow: hidden;
}

.logo-stage__panel::before,
.logo-stage__panel::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 22px;
  opacity: .75;
}

.logo-stage__panel::before {
  width: 45%; height: 35%;
  left: 8%;   top: 10%;
}

.logo-stage__panel::after {
  width: 34%; height: 28%;
  right: 8%;  bottom: 11%;
  border-color: rgba(196, 92, 84, .2);
}

/* Primary red glow */
.logo-stage__glow {
  position: absolute;
  width: 64%;
  aspect-ratio: 1;
  border-radius: 999px;
  background: rgba(196, 92, 84, .20);
  filter: blur(34px);
  transform: translate3d(-12%, -4%, 0);
  opacity: .82;
}

/* Secondary lime glow — injected by JS */
.logo-stage__glow-2 {
  position: absolute;
  width: 42%;
  aspect-ratio: 1;
  border-radius: 999px;
  background: rgba(190, 212, 150, .18);
  filter: blur(26px);
  right: 8%;
  bottom: 14%;
  opacity: .65;
}

.logo-stage__card {
  position: relative;
  z-index: 2;
  width: min(78%, 430px);
  aspect-ratio: 1;
  border-radius: 26px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 22px 58px rgba(0, 0, 0, .24);
  backdrop-filter: blur(10px);
  overflow: hidden;
}

/* Shimmer sweep over the card */
.logo-stage__card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 26px;
  background: linear-gradient(
    125deg,
    transparent          0%,
    rgba(255,255,255,.12) 42%,
    rgba(196, 92, 84,.14) 58%,
    transparent          100%
  );
  background-size: 300% 300%;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
}

.logo-stage.is-visible .logo-stage__card::after {
  animation: cardShimmer 5.5s ease-in-out infinite;
}

@keyframes cardShimmer {
  0%,  100% { background-position: 0% 0%;     opacity: 0;  }
  20%        { opacity: .9; }
  50%        { background-position: 100% 100%; opacity: .9; }
  80%        { opacity: .3; }
}

.logo-stage__mark {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .96;
  position: relative;
  z-index: 1;
}

.logo-stage__chip {
  position: absolute;
  z-index: 3;
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(196, 92, 84, .12);
  box-shadow: 0 14px 34px rgba(17, 17, 17, .11);
}

.logo-stage__chip--top {
  top: 13%; right: 13%;
}

/* Pulse ring on the top chip */
.logo-stage__chip--top::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 28px;
  border: 1.5px solid rgba(196, 92, 84, .32);
  opacity: 0;
}

.logo-stage.is-visible .logo-stage__chip--top::after {
  animation: chipPulseRing 3.2s ease-in-out infinite;
}

@keyframes chipPulseRing {
  0%,  100% { transform: scale(1);    opacity: 0;  }
  38%        {                          opacity: .75; }
  72%        { transform: scale(1.22); opacity: 0;  }
}

.logo-stage__chip--bottom {
  bottom: 13%; left: 10%;
  width: 94px; height: 10px;
  border-radius: 999px;
  background: rgba(190, 212, 150, .82);
}

/* Ambient float animations */
.logo-stage.is-visible .logo-stage__card {
  animation: logoFloat 7s ease-in-out infinite;
}

.logo-stage.is-visible .logo-stage__glow {
  animation: glowDrift 8s ease-in-out infinite;
}

.logo-stage.is-visible .logo-stage__glow-2 {
  animation: glowDrift2 11s ease-in-out infinite;
}

.logo-stage.is-visible .logo-stage__chip--top {
  animation: chipDriftTop 6.5s ease-in-out infinite;
}

.logo-stage.is-visible .logo-stage__chip--bottom {
  animation: chipDriftBottom 7.5s ease-in-out infinite;
}

@keyframes logoFloat {
  0%,  100% { transform: translate3d(0,    0,    0) rotateX(0deg)   rotateY(0deg);  }
  30%        { transform: translate3d(2px, -10px, 0) rotateX(1.6deg) rotateY(-2deg); }
  70%        { transform: translate3d(-2px,-14px, 0) rotateX(.8deg)  rotateY(1.4deg);}
}

@keyframes glowDrift {
  0%,  100% { transform: translate3d(-12%, -4%, 0) scale(1);    opacity: .76; }
  50%        { transform: translate3d(-6%,   2%, 0) scale(1.11); opacity: .95; }
}

@keyframes glowDrift2 {
  0%,  100% { transform: translate3d(0,    0,    0) scale(1);    opacity: .58; }
  35%        { transform: translate3d(-9%, -13%, 0) scale(1.14); opacity: .84; }
  70%        { transform: translate3d(7%,   5%,  0) scale(.9);   opacity: .45; }
}

@keyframes chipDriftTop {
  0%,  100% { transform: translate3d(0,    0,   0) rotate(0deg);  }
  50%        { transform: translate3d(-10px,14px,0) rotate(-5deg); }
}

@keyframes chipDriftBottom {
  0%,  100% { transform: translate3d(0,    0,    0); }
  50%        { transform: translate3d(18px,-10px, 0); }
}

/* Mouse-follow overrides */
.logo-stage__card,
.logo-stage__glow,
.logo-stage__glow-2,
.logo-stage__chip,
.logo-stage__panel {
  transition: transform .35s cubic-bezier(.22, .61, .36, 1);
  will-change: transform;
}

.logo-stage.is-interacting {
  cursor: pointer;
}

.logo-stage.is-interacting .logo-stage__card,
.logo-stage.is-interacting .logo-stage__glow,
.logo-stage.is-interacting .logo-stage__glow-2,
.logo-stage.is-interacting .logo-stage__chip {
  animation-play-state: paused;
  transition: transform .12s ease-out;
}

.logo-stage.is-interacting .logo-stage__card {
  box-shadow: 0 30px 70px rgba(0, 0, 0, .30);
}

.logo-stage.is-interacting .logo-stage__glow {
  filter: blur(30px);
}


/* -------------------------------------------------------------------------- */
/* Float orb — decorative background blobs (opt-in class)                    */
/* -------------------------------------------------------------------------- */
.float-orb {
  animation: floatOrb 14s ease-in-out infinite;
}
.float-orb:nth-child(2n) {
  animation-duration: 18s;
  animation-delay: -5s;
}
.float-orb:nth-child(3n) {
  animation-duration: 22s;
  animation-delay: -10s;
  animation-direction: reverse;
}

@keyframes floatOrb {
  0%,  100% { transform: translate(0,    0   ) scale(1);    }
  25%        { transform: translate(14px,-20px) scale(1.05); }
  50%        { transform: translate(-9px,-30px) scale(.95);  }
  75%        { transform: translate(18px,-12px) scale(1.03); }
}


/* -------------------------------------------------------------------------- */
/* Border pulse — featured CTA card accent (opt-in class)                    */
/* -------------------------------------------------------------------------- */
.border-pulse {
  animation: borderPulse 3.2s ease-in-out infinite;
}

@keyframes borderPulse {
  0%,  100% { box-shadow: 0 0 0 0   rgba(196, 92, 84, 0);    }
  50%        { box-shadow: 0 0 0 6px rgba(196, 92, 84, .09);  }
}


/* -------------------------------------------------------------------------- */
/* Footer link hover                                                          */
/* -------------------------------------------------------------------------- */
footer a[href]:not(.rounded-full) {
  position: relative;
  transition: color .2s var(--ease-standard);
}


/* -------------------------------------------------------------------------- */
/* Form submit spinner                                                        */
/* -------------------------------------------------------------------------- */
@keyframes btnSpin {
  to { transform: rotate(360deg); }
}

.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.82;
}

.btn-loading::before {
  content: "";
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btnSpin .65s linear infinite;
  margin-right: 7px;
  vertical-align: middle;
  flex-shrink: 0;
}


/* -------------------------------------------------------------------------- */
/* Reduced motion — strip everything back to instant, calm states            */
/* -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .reveal, .reveal-left, .reveal-right,
  .reveal-fade, .reveal-scale,
  .hero-in, .hero-blur-in {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    animation: none !important;
    transition: none !important;
  }

  [data-text-reveal] .dw-word-inner {
    transform: none !important;
    opacity: 1 !important;
    transition: none !important;
  }

  .rounded-xl.border:hover,
  .rounded-2xl.border:hover,
  .bg-white\/5.border:hover,
  a.rounded-full:hover,
  button.rounded-full:hover {
    transform: none !important;
  }

  #mobile-menu { transition: none !important; }
  .scroll-progress { display: none; }
  .has-spotlight::before { display: none; }

  .logo-stage.is-visible .logo-stage__card,
  .logo-stage.is-visible .logo-stage__glow,
  .logo-stage.is-visible .logo-stage__glow-2,
  .logo-stage.is-visible .logo-stage__chip,
  .logo-stage.is-visible .logo-stage__card::after,
  .logo-stage.is-visible .logo-stage__chip--top::after {
    animation: none;
  }

  .float-orb, .border-pulse, .counter-pop,
  .btn-magnetic, .btn-loading::before {
    animation: none !important;
  }

  * {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}


/* -------------------------------------------------------------------------- */
/* Focus visibility — keyboard navigation                                     */
/* -------------------------------------------------------------------------- */
:focus-visible {
  outline: 3px solid var(--dw-red);
  outline-offset: 3px;
  border-radius: 4px;
}

:focus:not(:focus-visible) {
  outline: none;
}
