/* CSS · motion.css · Gainboom motion polish · modern browsers · buildless */

@property --gb-border-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

/* A short, staggered arrival leaves every navigation item in its normal flow. */
.header .brand,
.header nav > a,
.header .nav-cta {
  animation: gb-nav-arrive .75s var(--ease, cubic-bezier(.16, 1, .3, 1)) both;
}
.header .brand { animation-delay: .05s; }
.header nav > a:nth-child(1) { animation-delay: .13s; }
.header nav > a:nth-child(2) { animation-delay: .2s; }
.header nav > a:nth-child(3) { animation-delay: .27s; }
.header .nav-cta { animation-delay: .34s; }

/* The small logo carries a breathing light; the surrounding text stays still. */
.header .brand img {
  animation: gb-logo-light 5.5s ease-in-out 1.3s infinite;
}
.header nav > a {
  position: relative;
  padding-block: 5px;
}
.header nav > a::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: var(--yellow, #ffda19);
  scale: 0 1;
  transform-origin: left;
  transition: scale .3s var(--ease, ease);
}
.header nav > a:focus-visible::after { scale: 1 1; }

/* A masked conic light traces only the perimeter, never the video or offer. */
@supports (background: conic-gradient(from 0deg, transparent, #ffda19)) and (mask-composite: exclude) {
  .video-frame::after,
  .offer-card::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 4;
    padding: 2px;
    border-radius: inherit;
    pointer-events: none;
    background: conic-gradient(
      from var(--gb-border-angle),
      transparent 0deg 260deg,
      #ffda1908 285deg,
      #ffda1980 305deg,
      #fffad9 318deg,
      #ffda19 330deg,
      transparent 350deg
    );
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: gb-perimeter-light 8s linear infinite;
    transition: opacity .35s ease;
  }
  .offer-card::after { animation-duration: 11s; animation-delay: -4s; }
  .video-frame.is-playing::after { opacity: .38; }
}

/* Directional feedback is attached to the icon, preserving existing card motion. */
.button > .icon,
.result-cta > .icon,
.text-link > .icon,
.decision-bridge a > .icon {
  transition: translate .32s var(--ease, ease);
}
.method-icon,
.choice-dot {
  transition: border-color .3s ease, background-color .3s ease, box-shadow .3s ease;
}
.method-icon > .icon {
  transition: translate .35s var(--ease, ease), rotate .35s var(--ease, ease);
}
.challenge-choice.active .choice-dot {
  box-shadow: 0 0 0 4px #ffda190d;
}
.button:focus-visible > .icon,
.result-cta:focus-visible > .icon,
.text-link:focus-visible > .icon,
.decision-bridge a:focus-visible > .icon { translate: 4px 0; }

@media (hover: hover) and (pointer: fine) {
  .header nav > a:hover::after { scale: 1 1; }
  .button:hover > .icon,
  .result-cta:hover > .icon,
  .text-link:hover > .icon,
  .decision-bridge a:hover > .icon { translate: 4px 0; }
  .method-card:hover .method-icon {
    border-color: #ffda1990;
    background-color: #ffda1914;
    box-shadow: 0 0 24px -8px #ffda1950;
  }
  .method-card:hover .method-icon > .icon { translate: 0 -2px; rotate: -6deg; }
  .challenge-choice:hover .choice-dot { border-color: var(--yellow, #ffda19); }
}

@keyframes gb-nav-arrive {
  from { opacity: 0; translate: 0 -10px; }
  to { opacity: 1; translate: 0 0; }
}
@keyframes gb-logo-light {
  0%, 100% { box-shadow: 0 0 0 1px #ffda1940, 0 0 0 #ffda1900; }
  50% { box-shadow: 0 0 0 1px #ffda1980, 0 0 24px -6px #ffda1970; }
}
@keyframes gb-perimeter-light {
  to { --gb-border-angle: 360deg; }
}

/* Motion can be paused in the existing footer, including animated pseudo elements. */
body[data-motion='off'] *,
body[data-motion='off'] *::before,
body[data-motion='off'] *::after {
  animation: none !important;
  transition: none !important;
}
body[data-motion='off'] .header .brand,
body[data-motion='off'] .header nav > a,
body[data-motion='off'] .header .nav-cta { opacity: 1; translate: none; }
body[data-motion='off'] .button > .icon,
body[data-motion='off'] .result-cta > .icon,
body[data-motion='off'] .text-link > .icon,
body[data-motion='off'] .decision-bridge a > .icon,
body[data-motion='off'] .method-icon > .icon { translate: none; rotate: none; }
body[data-motion='off'] .video-frame::after,
body[data-motion='off'] .offer-card::after { display: none; }

@media (prefers-reduced-motion: reduce) {
  body:not([data-motion='on']) *,
  body:not([data-motion='on']) *::before,
  body:not([data-motion='on']) *::after {
    animation: none !important;
    transition: none !important;
  }
  body:not([data-motion='on']) .header .brand,
  body:not([data-motion='on']) .header nav > a,
  body:not([data-motion='on']) .header .nav-cta { opacity: 1; translate: none; }
  body:not([data-motion='on']) .button > .icon,
  body:not([data-motion='on']) .result-cta > .icon,
  body:not([data-motion='on']) .text-link > .icon,
  body:not([data-motion='on']) .decision-bridge a > .icon,
  body:not([data-motion='on']) .method-icon > .icon { translate: none; rotate: none; }
  body:not([data-motion='on']) .video-frame::after,
  body:not([data-motion='on']) .offer-card::after { display: none; }
}
