/* ============================================================
   Mobile Axe — motion (Phase 2)
   Tokens, keyframes, cursor, magnet, reveal, hero entrance,
   and the bullseye scroll-progress rail. Vanilla. No GSAP.
   ============================================================ */

:root {
  --t-micro: 280ms;
  --t-component: 480ms;
  --t-section: 800ms;
  --t-hero: 1200ms;
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-quad: cubic-bezier(0.32, 0, 0.67, 0);
}

/* Reduced-motion guard */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .ma-cursor,
  .ma-bullseye { display: none !important; }
}

/* ============================================================
   Custom cursor
   ============================================================ */

html.ma-has-cursor,
html.ma-has-cursor body,
html.ma-has-cursor a,
html.ma-has-cursor button,
html.ma-has-cursor [role="button"] {
  cursor: none;
}

.ma-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 36px;
  height: 36px;
  pointer-events: none;
  z-index: 90;
  color: var(--ink);
  opacity: 0;
  transition: opacity 180ms ease;
  mix-blend-mode: difference;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.18));
  will-change: transform;
}

body[data-section-mode="dark"] .ma-cursor {
  mix-blend-mode: normal;
  color: var(--gold);
}

.ma-cursor[data-visible="true"] { opacity: 1; }

.ma-cursor-blade,
.ma-cursor-target {
  position: absolute;
  inset: 0;
  margin: auto;
  transition: transform 200ms var(--ease-out-quint), opacity 200ms ease;
}

.ma-cursor-target {
  opacity: 0;
  transform: scale(0.5);
}

.ma-cursor[data-over="interactive"] .ma-cursor-blade {
  transform: scale(0);
  opacity: 0;
}

.ma-cursor[data-over="interactive"] .ma-cursor-target {
  opacity: 1;
  transform: scale(1);
}

.ma-cursor[data-magnet="true"] .ma-cursor-target {
  transform: scale(1.2);
}

.ma-cursor[data-pressed="true"] .ma-cursor-target {
  transform: scale(0.85);
}

.ma-splat {
  position: fixed;
  width: 28px;
  height: 28px;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 89;
  border-radius: 50%;
  border: 2px solid var(--gold);
  opacity: 1;
  animation: ma-splat 600ms var(--ease-out-quint) forwards;
}

@keyframes ma-splat {
  0%   { transform: translate(-50%, -50%) scale(0.4); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; }
}

/* ============================================================
   Magnetic CTAs — visual cue (the JS adds the translate)
   ============================================================ */

[data-magnet] {
  transition: transform 220ms var(--ease-out-quint), background 160ms ease, box-shadow 160ms ease;
  will-change: transform;
}

[data-magnet]:hover {
  box-shadow: 0 8px 24px rgba(197, 140, 42, 0.35);
}

/* ============================================================
   Hero entrance
   ============================================================ */

.hero .ma-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 720ms var(--ease-out-quint), transform 720ms var(--ease-out-quint);
}

.hero .eyebrow,
.hero > .hero-content > p,
.hero .hero-actions,
.hero .hero-meta,
.hero .hero-proof,
.hero .proof-row {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 600ms var(--ease-out-quint), transform 600ms var(--ease-out-quint);
}

/* When the hero is "in", cascade the children. */
.hero.ma-hero-in .ma-word {
  opacity: 1;
  transform: none;
}
.hero.ma-hero-in .ma-word:nth-child(1)  { transition-delay: 320ms; }
.hero.ma-hero-in .ma-word:nth-child(2)  { transition-delay: 380ms; }
.hero.ma-hero-in .ma-word:nth-child(3)  { transition-delay: 440ms; }
.hero.ma-hero-in .ma-word:nth-child(4)  { transition-delay: 500ms; }
.hero.ma-hero-in .ma-word:nth-child(5)  { transition-delay: 560ms; }
.hero.ma-hero-in .ma-word:nth-child(6)  { transition-delay: 620ms; }
.hero.ma-hero-in .ma-word:nth-child(7)  { transition-delay: 680ms; }
.hero.ma-hero-in .ma-word:nth-child(8)  { transition-delay: 740ms; }
.hero.ma-hero-in .ma-word:nth-child(n+9) { transition-delay: 800ms; }

.hero.ma-hero-in .eyebrow              { opacity: 1; transform: none; transition-delay: 200ms; }
.hero.ma-hero-in > .hero-content > p   { opacity: 1; transform: none; transition-delay: 760ms; }
.hero.ma-hero-in .hero-actions          { opacity: 1; transform: none; transition-delay: 860ms; }
.hero.ma-hero-in .hero-meta             { opacity: 1; transform: none; transition-delay: 940ms; }
.hero.ma-hero-in .hero-proof,
.hero.ma-hero-in .proof-row             { opacity: 1; transform: none; transition-delay: 1020ms; }

/* If JS is disabled or the hero never gets the .ma-hero-in class for any
   reason, after 1.6s force everything visible so content isn't hidden. */
@keyframes ma-hero-fail-safe { to { opacity: 1; transform: none; } }
.hero .eyebrow,
.hero > .hero-content > p,
.hero .hero-actions,
.hero .hero-meta,
.hero .hero-proof,
.hero .proof-row,
.hero .ma-word {
  animation: ma-hero-fail-safe 0ms 1700ms forwards;
}

/* ============================================================
   Scroll reveal
   ============================================================ */

.ma-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 640ms var(--ease-out-quint),
    transform 640ms var(--ease-out-quint);
  will-change: opacity, transform;
}

.ma-reveal-heading {
  transform: translateY(12px);
}

.ma-revealed {
  opacity: 1;
  transform: none;
}

/* Fail-safe: reveal everything if JS fails to add .ma-revealed within 2s. */
@keyframes ma-reveal-failsafe { to { opacity: 1; transform: none; } }
.ma-reveal { animation: ma-reveal-failsafe 0ms 2200ms forwards; }

/* ============================================================
   Bullseye scroll progress (right-rail)
   ============================================================ */

.ma-bullseye {
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 80px;
  height: 80px;
  z-index: 25;
  pointer-events: none;
  color: var(--gold);
  filter: drop-shadow(0 4px 14px rgba(15, 26, 20, 0.18));
}

.ma-bullseye svg { display: block; }

.ma-bullseye .ring {
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dasharray 240ms ease;
}

body[data-section-mode="dark"] .ma-bullseye {
  color: var(--gold);
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.4));
}

@media (max-width: 980px) {
  .ma-bullseye { display: none; }
}

/* ============================================================
   Sound toggle
   ============================================================ */

.nav-sound {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 36px;
  height: 36px;
  border: 1px solid currentColor;
  border-radius: var(--r-pill);
  background: transparent;
  color: inherit;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 160ms ease, background 160ms ease;
}

.nav-sound:hover { opacity: 1; }

.nav-sound svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-sound .sound-on,
.nav-sound .sound-off { display: none; }
[data-sound="on"]  .nav-sound .sound-on,
[data-sound="off"] .nav-sound .sound-off { display: inline-flex; }
.nav-sound[aria-pressed="true"] {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
  opacity: 1;
}

@media (max-width: 900px) {
  .nav-sound { display: none; }
}

/* ============================================================
   Gallery lightbox
   ============================================================ */

.ma-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 26, 20, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
  opacity: 0;
  transition: opacity 220ms ease;
}
.ma-lightbox.open {
  display: flex;
  opacity: 1;
}
.ma-lightbox .ma-lb-img {
  max-width: min(1200px, 92vw);
  max-height: 85vh;
  border-radius: var(--r-card);
  box-shadow: var(--shadow-3);
  background: #000;
}
.ma-lightbox button {
  position: absolute;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.22);
  color: #fff;
  border-radius: 999px;
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ma-lightbox button:hover { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.ma-lb-close { top: 22px; right: 22px; }
.ma-lb-prev  { left: 22px; top: 50%; transform: translateY(-50%); }
.ma-lb-next  { right: 22px; top: 50%; transform: translateY(-50%); }

@media (max-width: 720px) {
  .ma-lb-prev, .ma-lb-next { width: 40px; height: 40px; font-size: 18px; }
  .ma-lightbox { padding: 12px; }
}

/* ============================================================
   Splinter mode (easter egg: triple-click the brand)
   ============================================================ */

body.ma-splinter-mode .ma-splat {
  animation: ma-splat 700ms var(--ease-out-quint) forwards, ma-splinter-persist 0ms 700ms forwards;
}
@keyframes ma-splinter-persist {
  to { opacity: 0.45; transform: translate(-50%, -50%) scale(1); }
}
body.ma-splinter-mode .ma-cursor {
  color: var(--gold);
}

/* ============================================================
   Easter egg: Konami axe drop
   ============================================================ */

.ma-easter-axe-drop {
  position: fixed;
  left: 50%;
  top: -100px;
  z-index: 220;
  pointer-events: none;
  transform: translateX(-50%) rotate(-12deg);
  animation: ma-axe-drop 1500ms cubic-bezier(0.6, 0.05, 0.4, 1) forwards;
}
@keyframes ma-axe-drop {
  0%   { top: -100px; transform: translateX(-50%) rotate(-360deg); }
  70%  { top: calc(50% - 36px); transform: translateX(-50%) rotate(-5deg); }
  78%  { top: calc(50% - 30px); transform: translateX(-50%) rotate(-7deg) scale(1.08); }
  100% { top: calc(50% - 36px); transform: translateX(-50%) rotate(-5deg); opacity: 1; }
}

.ma-easter-axe-corner {
  position: fixed;
  z-index: 220;
  pointer-events: none;
  transition: transform 380ms var(--ease-out-quint);
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.35));
}
