/*
  FXBALL marketing landing page (/)
  Builds on the app's existing token system (style.css) rather than
  inventing a second palette. Visual language: stadium floodlight at
  night — near-black pitch, one accent (the brand green) doing all the
  work, angled kit-collar cuts instead of rounded SaaS cards, scoreboard
  display type for headlines and numbers.

  Motion: one orchestrated hero entrance on load, a scroll-triggered
  reveal for everything below the fold (driven by landing.js toggling
  .is-visible on .mk-reveal elements via IntersectionObserver), and a
  small set of idle/ambient touches (floodlight glow breathing, the
  mini-card stack drifting) that only run under prefers-reduced-motion:
  no-preference.
*/

.marketing-body {
  background: var(--navy);
  overflow-x: hidden;
}

/* ---------- Hero entrance ---------- */
@media (prefers-reduced-motion: no-preference) {
  .marketing-body .mk-hero-logo,
  .marketing-body .mk-hero-headline,
  .marketing-body .mk-hero-sub,
  .marketing-body .mk-hero-cta {
    animation: mk-rise 0.7s var(--ease-out) both;
  }
  .marketing-body .mk-hero-headline { animation-delay: 0.08s; }
  .marketing-body .mk-hero-sub { animation-delay: 0.16s; }
  .marketing-body .mk-hero-cta { animation-delay: 0.24s; }
}
@keyframes mk-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Scroll reveal (below-the-fold sections) ---------- */
.mk-reveal {
  opacity: 0;
  transform: translateY(28px);
}
.mk-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: no-preference) {
  .mk-reveal {
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  }
  /* Staggered children inside a revealed group (strip items, step rows) */
  .mk-reveal-group.is-visible > * {
    transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-out);
  }
  .mk-reveal-group > *:nth-child(1) { transition-delay: 0.02s; }
  .mk-reveal-group > *:nth-child(2) { transition-delay: 0.09s; }
  .mk-reveal-group > *:nth-child(3) { transition-delay: 0.16s; }
  .mk-reveal-group > *:nth-child(4) { transition-delay: 0.23s; }
  .mk-reveal-group:not(.is-visible) > * { opacity: 0; transform: translateY(20px); }
}
@media (prefers-reduced-motion: reduce) {
  .mk-reveal, .mk-reveal-group > * { opacity: 1; transform: none; }
}

/* ---------- Topbar ---------- */
.mk-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px max(20px, env(safe-area-inset-left));
  position: sticky;
  top: 0;
  z-index: 20;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease, padding 0.3s ease;
}
.mk-topbar.is-scrolled {
  background: rgba(6, 10, 9, 0.78);
  border-bottom-color: var(--glass-border);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  padding-top: 11px;
  padding-bottom: 11px;
}
.mk-topbar-logo { height: 24px; width: auto; transition: height 0.3s ease; }
.mk-topbar-login {
  width: auto;
  padding: 9px 18px;
  font-size: 13px;
  transition: transform 0.15s var(--ease-spring), background 0.2s ease, box-shadow 0.2s ease;
}
.mk-topbar-login:active { transform: scale(0.95); }
@media (hover: hover) {
  .mk-topbar-login:hover { box-shadow: 0 0 0 1px var(--green); }
}

/* ---------- Hero ---------- */
.mk-hero {
  position: relative;
  padding: 20px 20px 48px;
  text-align: center;
  isolation: isolate;
}
.mk-hero-glow {
  position: absolute;
  inset: -10% -10% 30%;
  z-index: -1;
  background:
    radial-gradient(ellipse 60% 50% at 50% 8%, rgba(1,232,111,0.22), transparent 65%),
    radial-gradient(ellipse 45% 35% at 82% 30%, rgba(4,154,84,0.16), transparent 70%),
    radial-gradient(ellipse 45% 35% at 14% 34%, rgba(4,154,84,0.12), transparent 70%);
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .mk-hero-glow { animation: mk-glow-breathe 7s ease-in-out infinite; }
}
@keyframes mk-glow-breathe {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.82; transform: scale(1.04); }
}
.mk-hero-inner {
  max-width: 620px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.mk-hero-logo {
  width: min(70vw, 340px);
  height: auto;
  margin-bottom: 4px;
  filter: drop-shadow(0 12px 40px rgba(1,232,111,0.25));
}
@media (prefers-reduced-motion: no-preference) {
  .mk-hero-logo { animation: mk-rise 0.7s var(--ease-out) both, mk-logo-float 5.5s ease-in-out 0.9s infinite; }
}
@keyframes mk-logo-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
.mk-hero-headline {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.015em;
  font-weight: 400;
  font-size: clamp(28px, 8.4vw, 52px);
  line-height: 1.04;
  margin: 4px 0 14px;
  color: var(--chalk);
}
.mk-hero-sub {
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--chalk-dim);
  max-width: 46ch;
  margin: 0 0 26px;
}
.mk-hero-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}
.mk-cta-primary {
  width: auto;
  padding: 15px 36px;
  font-size: 16px;
  position: relative;
  transition: transform 0.15s var(--ease-spring), box-shadow 0.2s ease;
}
.mk-cta-primary:active { transform: scale(0.96); }
@media (hover: hover) {
  .mk-cta-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(1,232,111,0.35); }
}
.mk-cta-secondary {
  color: var(--chalk-dim);
  font-size: 14px;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding: 4px 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.mk-cta-secondary:hover, .mk-cta-secondary:active { color: var(--green); border-color: var(--green); }

/* Scroll cue beneath the hero CTA — quietly invites the next swipe */
.mk-scroll-cue {
  margin-top: 34px;
  width: 22px;
  height: 36px;
  border: 2px solid var(--line);
  border-radius: 999px;
  position: relative;
  opacity: 0.7;
}
.mk-scroll-cue::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 999px;
  background: var(--green);
}
@media (prefers-reduced-motion: no-preference) {
  .mk-scroll-cue::before { animation: mk-scroll-dot 1.8s ease-in-out infinite; }
}
@keyframes mk-scroll-dot {
  0% { transform: translateY(0); opacity: 1; }
  60% { transform: translateY(12px); opacity: 0; }
  61% { transform: translateY(0); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
@media (max-width: 380px) {
  .mk-scroll-cue { display: none; }
}

/* ---------- Stat strip ---------- */
.mk-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.mk-strip-item {
  padding: 20px 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transition: background 0.25s ease;
}
.mk-strip-item:nth-child(2n) { border-right: none; }
.mk-strip-item:nth-last-child(-n+2) { border-bottom: none; }
@media (hover: hover) {
  .mk-strip-item:hover { background: rgba(1,232,111,0.05); }
}
.mk-strip-kicker {
  display: block;
  font-family: var(--font-display);
  text-transform: uppercase;
  color: var(--green);
  font-size: 18px;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}
.mk-strip-item p {
  margin: 0;
  color: var(--chalk-dim);
  font-size: 13.5px;
  line-height: 1.5;
}

/* ---------- Feature rows ---------- */
.mk-feature {
  max-width: 1040px;
  margin: 0 auto;
  padding: 44px 20px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-items: center;
}
.mk-feature-copy { max-width: 440px; text-align: center; }
.mk-feature-copy h2 {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-weight: 400;
  font-size: clamp(22px, 6.4vw, 30px);
  letter-spacing: 0.015em;
  margin: 0 0 12px;
  color: var(--chalk);
}
.mk-feature-copy p {
  margin: 0;
  color: var(--chalk-dim);
  font-size: 15px;
  line-height: 1.6;
}
.mk-feature-media { width: 100%; display: flex; justify-content: center; }

/* Mini player-card stack (decorative, echoes the pack-reveal card) */
.mk-card-stack {
  position: relative;
  width: 260px;
  height: 190px;
}
.mk-mini-card {
  position: absolute;
  width: 108px;
  height: 152px;
  top: 14px;
  clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,0.14);
  transition: transform 0.35s var(--ease-spring), box-shadow 0.35s ease;
}
.mk-mini-card .mk-mini-ovr { font-family: var(--font-display); font-size: 30px; line-height: 1; }
.mk-mini-card .mk-mini-pos { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; opacity: 0.85; }
.mk-mini-card--bronze {
  left: 0; transform: rotate(-9deg); z-index: 1;
  background: linear-gradient(160deg, var(--tier-bronze_shiny), var(--tier-bronze) 75%);
  color: #2a1608;
}
.mk-mini-card--gold {
  left: 76px; transform: rotate(3deg); z-index: 2;
  background: linear-gradient(160deg, var(--tier-gold_shiny), var(--tier-gold) 75%);
  color: #2a2000;
}
.mk-mini-card--iri {
  left: 152px; transform: rotate(12deg); z-index: 3;
  background: linear-gradient(160deg, #e6c8ff, var(--tier-iridescent) 75%);
  color: #250936;
}
@media (prefers-reduced-motion: no-preference) {
  .mk-reveal.is-visible .mk-mini-card--bronze { animation: mk-card-float-a 4.5s ease-in-out 0.5s infinite; }
  .mk-reveal.is-visible .mk-mini-card--gold { animation: mk-card-float-b 4.5s ease-in-out 0.7s infinite; }
  .mk-reveal.is-visible .mk-mini-card--iri { animation: mk-card-float-c 4.5s ease-in-out 0.9s infinite; }
}
@keyframes mk-card-float-a {
  0%, 100% { transform: rotate(-9deg) translateY(0); }
  50% { transform: rotate(-9deg) translateY(-8px); }
}
@keyframes mk-card-float-b {
  0%, 100% { transform: rotate(3deg) translateY(0); }
  50% { transform: rotate(3deg) translateY(-11px); }
}
@keyframes mk-card-float-c {
  0%, 100% { transform: rotate(12deg) translateY(0); }
  50% { transform: rotate(12deg) translateY(-8px); }
}
@media (hover: hover) {
  .mk-card-stack:hover .mk-mini-card--bronze { transform: rotate(-14deg) translateX(-6px); }
  .mk-card-stack:hover .mk-mini-card--gold { transform: rotate(3deg) translateY(-10px); box-shadow: var(--shadow-glow-green); }
  .mk-card-stack:hover .mk-mini-card--iri { transform: rotate(17deg) translateX(6px); }
}

/* Trade mock (decorative) */
.mk-trade-mock {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px;
  background: var(--navy-raised);
  border: 1px solid var(--glass-border);
  clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px);
}
.mk-trade-side { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.mk-trade-tag { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--chalk-dim); }
.mk-trade-chip {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(1,232,111,0.10);
  border: 1px solid rgba(1,232,111,0.3);
  color: var(--chalk);
  white-space: nowrap;
}
.mk-trade-arrow { font-size: 22px; color: var(--green); display: inline-block; }
@media (prefers-reduced-motion: no-preference) {
  .mk-reveal.is-visible .mk-trade-arrow { animation: mk-arrow-swap 2.6s ease-in-out 0.6s infinite; }
}
@keyframes mk-arrow-swap {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.15); }
}

@media (min-width: 640px) {
  .mk-strip-kicker { font-size: 19px; }
  .mk-strip-item p { font-size: 14px; }
}
@media (min-width: 720px) {
  .mk-feature { flex-direction: row; text-align: left; gap: 56px; padding: 64px 20px; }
  .mk-feature-social { flex-direction: row-reverse; }
  .mk-feature-copy { text-align: left; }
}

/* ---------- Steps ---------- */
.mk-steps {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 20px 64px;
}
.mk-steps-title {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-weight: 400;
  text-align: center;
  font-size: clamp(22px, 6.4vw, 28px);
  letter-spacing: 0.015em;
  margin: 0 0 28px;
  color: var(--chalk);
}
.mk-steps-list {
  list-style: none;
  margin: 0 0 32px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.mk-steps-list li {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 18px;
  background: var(--navy-raised);
  border-left: 3px solid var(--green);
  transition: transform 0.2s var(--ease-out), background 0.2s ease;
}
@media (hover: hover) {
  .mk-steps-list li:hover { transform: translateX(4px); background: rgba(1,232,111,0.05); }
}
.mk-step-num {
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--green);
  min-width: 34px;
}
.mk-steps-list h3 {
  margin: 0 0 4px;
  font-size: 16px;
  color: var(--chalk);
}
.mk-steps-list p {
  margin: 0;
  font-size: 14px;
  color: var(--chalk-dim);
  line-height: 1.5;
}
.mk-steps-cta { display: flex; justify-content: center; }

/* ---------- Footer ---------- */
.mk-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 40px 20px calc(40px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.mk-footer-logo { height: 20px; width: auto; opacity: 0.75; }
.mk-footer p { margin: 0; font-size: 12px; color: var(--chalk-dim); }

/* ---------- Sticky mobile CTA bar ---------- */
/* Hidden by default (and whenever JS is unavailable); landing.js reveals
   it once the hero has scrolled out of view, and hides it again near the
   footer so it never competes with the in-flow CTAs. Desktop has plenty
   of room for the in-flow CTAs already, so this stays mobile-only. */
.mk-sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  padding: 12px max(16px, env(safe-area-inset-left)) calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(0deg, rgba(6,9,10,0.96) 55%, rgba(6,9,10,0));
  transform: translateY(100%);
  transition: transform 0.3s var(--ease-out);
  pointer-events: none;
}
.mk-sticky-cta.is-visible { transform: translateY(0); pointer-events: auto; }
.mk-sticky-cta a {
  width: 100%;
  max-width: 360px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
@media (min-width: 720px) {
  .mk-sticky-cta { display: none; }
}

/* ---------- Auth pages (login.html) reuse .landing from style.css ---------- */
.auth-back-link {
  display: inline-block;
  color: var(--chalk-dim);
  text-decoration: none;
  font-size: 13px;
  margin-bottom: 18px;
  transition: color 0.2s ease;
}
.auth-back-link:hover { color: var(--green); }
.auth-logo { width: min(70vw, 220px); height: auto; margin: 0 auto 6px; display: block; }

/* ---------- Small-screen tightening ---------- */
@media (max-width: 380px) {
  .mk-hero { padding: 16px 16px 40px; }
  .mk-hero-sub { font-size: 14.5px; }
  .mk-feature { padding: 36px 16px; gap: 22px; }
  .mk-steps { padding: 40px 16px 56px; }
  .mk-strip-item { padding: 16px 14px; }
}

/* Respect safe areas on notched phones for the fixed sticky bar and the
   topbar without doubling up padding on larger screens. */
@supports (padding: max(0px)) {
  .mk-topbar { padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
}
