/* ==========================================================================
   AUGVEX - motion.css
   Awwwards motion layer: preloader, cursor, transitions, split text,
   story scene, lifecycle journey, marquee, footer type
   ========================================================================== */

/* ---------- Preloader ---------- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  flex-direction: column;
  gap: 28px;
}
.preloader-word {
  font-family: var(--font-head);
  font-size: clamp(34px, 6vw, 64px);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--white);
  display: flex;
  overflow: hidden;
}
.preloader-word span { display: inline-block; transform: translateY(110%); }
.preloader-bar {
  width: min(280px, 60vw);
  height: 2px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  overflow: hidden;
}
.preloader-bar i {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--violet), var(--indigo));
  transform: scaleX(0);
  transform-origin: left;
}
.preloader-tag {
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}

/* ---------- Page transition veil ---------- */
.page-veil {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: var(--navy);
  transform: scaleY(0);
  transform-origin: top;
  pointer-events: none;
}
.page-veil .veil-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 28px;
  color: var(--white);
  opacity: 0;
}

/* ---------- Grain overlay ---------- */
.grain-overlay {
  position: fixed;
  inset: -100%;
  z-index: 9990;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 0.9s steps(4) infinite;
}
@keyframes grain-shift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 3%); }
  50% { transform: translate(3%, -2%); }
  75% { transform: translate(-3%, -3%); }
  100% { transform: translate(2%, 2%); }
}

/* ---------- Split text (GSAP SplitText masks) ---------- */
.split-lines .st-line {
  display: block;
  overflow: hidden;
}
.split-lines .st-line > div { will-change: transform; }
.hero-title .st-word { will-change: transform, opacity; }

/* SplitText wraps words in divs, which breaks background-clip:text on the
   parent span — re-apply the gradient to each split word instead */
.hero-title .text-gradient .st-word {
  background: linear-gradient(100deg, var(--indigo), var(--violet) 60%, #9C8FFF);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* the word "losing" gets its own drop treatment */
.word-losing {
  display: inline-block;
  position: relative;
  color: #FF6B6B;
}

/* ---------- Magnetic buttons ---------- */
.btn { position: relative; overflow: hidden; }
.btn .btn-fill {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  transform: scale(0);
  pointer-events: none;
}

/* ---------- The 9:47 PM story (pinned scene) ---------- */
.story-cinema {
  position: relative;
  background: #05060F;
  color: var(--white);
}
.story-stage {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.story-sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 500px at 75% 15%, rgba(90, 75, 231, 0.18), transparent 65%),
    linear-gradient(180deg, #04050D 0%, #0A0E22 100%);
  transition: none;
}
.story-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, rgba(255,255,255,0.55), transparent 100%),
    radial-gradient(1px 1px at 28% 64%, rgba(255,255,255,0.35), transparent 100%),
    radial-gradient(1.5px 1.5px at 44% 12%, rgba(255,255,255,0.4), transparent 100%),
    radial-gradient(1px 1px at 58% 42%, rgba(255,255,255,0.3), transparent 100%),
    radial-gradient(2px 2px at 71% 78%, rgba(255,255,255,0.35), transparent 100%),
    radial-gradient(1px 1px at 83% 28%, rgba(255,255,255,0.5), transparent 100%),
    radial-gradient(1.5px 1.5px at 92% 56%, rgba(255,255,255,0.3), transparent 100%),
    radial-gradient(1px 1px at 6% 82%, rgba(255,255,255,0.4), transparent 100%),
    radial-gradient(1px 1px at 37% 88%, rgba(255,255,255,0.28), transparent 100%),
    radial-gradient(1.5px 1.5px at 64% 8%, rgba(255,255,255,0.45), transparent 100%);
  animation: story-twinkle 6s ease-in-out infinite alternate;
}
@keyframes story-twinkle {
  from { opacity: 0.5; }
  to { opacity: 1; }
}
.story-orb {
  position: absolute;
  top: 10%;
  right: 12%;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle at 38% 35%, rgba(117, 103, 248, 0.32), rgba(90, 75, 231, 0.1) 45%, transparent 70%);
  filter: blur(6px);
  animation: story-orb-drift 14s ease-in-out infinite alternate;
}
@keyframes story-orb-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-36px, 28px, 0) scale(1.12); }
}
.story-cinema .story-inner {
  position: relative;
  width: 100%;
  max-width: 1200px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.story-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  margin-bottom: 22px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}
.story-tag .st-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--indigo);
  box-shadow: 0 0 10px 2px rgba(117, 103, 248, 0.7);
  animation: story-pulse 2s ease-in-out infinite;
}
@keyframes story-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.72); opacity: 0.6; }
}
.story-clock {
  font-family: var(--font-head);
  font-size: clamp(64px, 9vw, 128px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--white);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 80px rgba(117, 103, 248, 0.35);
}
.story-clock small {
  font-size: 0.32em;
  font-weight: 600;
  color: var(--indigo);
  letter-spacing: 0.08em;
  vertical-align: super;
}
.story-caption {
  margin-top: 20px;
  font-size: 18px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.72);
  max-width: 420px;
  min-height: 88px;
  border-left: 2px solid rgba(117, 103, 248, 0.5);
  padding-left: 18px;
}
.story-caption strong { color: var(--white); }

/* story beats: stacked panels, GSAP crossfades them */
.story-beats { position: relative; min-height: 340px; }
.story-beat {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  opacity: 0;
  visibility: hidden;
}
.story-beat.is-active { opacity: 1; visibility: visible; }

.story-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  backdrop-filter: blur(12px);
  max-width: 460px;
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}
.story-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--indigo), rgba(117, 103, 248, 0.15));
}
.story-card .sc-ico {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(117, 103, 248, 0.14);
  border: 1px solid rgba(117, 103, 248, 0.35);
  color: var(--indigo);
  box-shadow: 0 0 24px rgba(117, 103, 248, 0.25);
}
.story-card .sc-ico svg { width: 20px; height: 20px; }
.story-card .sc-body { flex: 1; min-width: 0; }
.story-card .sc-time {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.45);
  font-variant-numeric: tabular-nums;
  padding: 3px 9px;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}
.story-card strong { display: block; font-size: 15px; margin-bottom: 5px; letter-spacing: -0.01em; }
.story-card small { color: rgba(255, 255, 255, 0.58); font-size: 13.5px; line-height: 1.55; display: block; }

.story-card.is-missed { border-color: rgba(255, 107, 107, 0.35); }
.story-card.is-missed::before { background: linear-gradient(180deg, #FF6B6B, rgba(255, 107, 107, 0.15)); }
.story-card.is-missed strong { color: #FF6B6B; }
.story-card.is-missed .sc-ico {
  background: rgba(255, 107, 107, 0.12);
  border-color: rgba(255, 107, 107, 0.4);
  color: #FF6B6B;
  box-shadow: 0 0 24px rgba(255, 107, 107, 0.22);
}

.story-card.is-won { border-color: rgba(74, 222, 128, 0.35); }
.story-card.is-won::before { background: linear-gradient(180deg, #4ADE80, rgba(74, 222, 128, 0.15)); }
.story-card.is-won strong { color: #4ADE80; }
.story-card.is-won .sc-ico {
  background: rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.4);
  color: #4ADE80;
  box-shadow: 0 0 24px rgba(74, 222, 128, 0.22);
}

.story-progress {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}
.story-progress span {
  width: 32px;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
  position: relative;
}
.story-progress span i {
  position: absolute;
  inset: 0;
  background: var(--indigo);
  transform: scaleX(0);
  transform-origin: left;
}

/* ---------- Lifecycle journey (pinned particle path) ---------- */
.journey-pin { position: relative; }
.journey-svg-wrap {
  position: relative;
  margin: 24px auto 0;
  max-width: 1080px;
}
.journey-path-svg { width: 100%; height: auto; display: block; overflow: visible; }
.journey-path-svg .jp-track {
  fill: none;
  stroke: var(--border-light);
  stroke-width: 2;
  stroke-dasharray: 6 8;
}
.journey-path-svg .jp-fill {
  fill: none;
  stroke: url(#jpGradient);
  stroke-width: 3;
  stroke-linecap: round;
}
.journey-lead {
  position: absolute;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #B9AFFF, var(--violet));
  box-shadow: 0 0 18px 4px rgba(117, 103, 248, 0.55);
  top: 0;
  left: 0;
  will-change: transform;
}
.journey-stops {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  margin-top: 8px;
}
.journey-stop {
  text-align: center;
  padding: 22px 16px 20px;
  border-radius: var(--radius-md);
  background: var(--white);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
  opacity: 0.45;
  transform: translateY(8px);
}
.journey-stop.is-lit {
  opacity: 1;
  transform: translateY(0);
  border-color: rgba(90, 75, 231, 0.3);
  box-shadow: 0 14px 32px rgba(90, 75, 231, 0.12);
}
.journey-stop .js-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--border-light);
  background: var(--white);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 14px;
  color: var(--slate);
  margin-bottom: 12px;
  transition: background 0.35s var(--ease), color 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.journey-stop.is-lit .js-num {
  background: linear-gradient(135deg, var(--violet), var(--indigo));
  border-color: transparent;
  color: var(--white);
  box-shadow: 0 8px 20px rgba(90, 75, 231, 0.4);
}
.journey-stop h3 { font-size: 17px; color: var(--navy); margin-bottom: 6px; }
.journey-stop p { font-size: 13.5px; color: var(--slate); }

/* ---------- Money-lost marquee band ---------- */
.loss-band {
  background: var(--navy);
  padding: 26px 0;
  overflow: hidden;
  border-top: 1px solid var(--border-dark);
  border-bottom: 1px solid var(--border-dark);
}
.loss-track {
  display: flex;
  gap: 48px;
  width: max-content;
  will-change: transform;
}
.loss-track span {
  font-family: var(--font-head);
  font-size: clamp(18px, 2.4vw, 26px);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 48px;
}
.loss-track span::after {
  content: "\2726";
  color: var(--indigo);
  font-size: 0.7em;
}

/* ---------- Parallax helpers ---------- */
[data-parallax] { will-change: transform; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .preloader, .page-veil, .grain-overlay { display: none !important; }
  .story-beat { position: relative; opacity: 1; visibility: visible; margin-bottom: 24px; }
  .story-beats { min-height: 0; }
  .story-stars, .story-orb, .story-tag .st-dot { animation: none; }
  .journey-stop { opacity: 1; transform: none; }
}

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .story-cinema .story-inner { grid-template-columns: 1fr; gap: 36px; padding-top: 96px; padding-bottom: 96px; }
  .story-clock { font-size: 56px; }
  .story-caption { min-height: 0; }
  .story-beats { min-height: 340px; }
  .story-orb { width: 220px; height: 220px; right: -40px; top: 4%; }
  .story-card { padding: 16px 16px; gap: 12px; }
  .story-card .sc-ico { width: 36px; height: 36px; border-radius: 10px; }
  .story-card .sc-time { display: none; }
  .journey-stops { grid-template-columns: repeat(2, 1fr); }
  .journey-svg-wrap { display: none; }
  .journey-stop { opacity: 1; transform: none; text-align: left; padding: 14px; border: 1px solid var(--border-light); background: var(--white); }
}
