/* Bubble Merge landing page
   Style: Claymorphism on the app's navy + gold palette.
   Fonts: Nunito (headings, 800/900) + DM Sans (body). */

:root {
  --bg: #0B1020;
  --bg-2: #1E2A4A;
  --surface: #1A2240;
  --surface-2: #222C50;
  --border: rgba(255, 255, 255, 0.10);
  --text: #F4F6FB;
  --muted: #AEB6CC;            /* 8.6:1 on --bg */
  --gold: #FFD54A;
  --gold-deep: #E5A91A;
  --on-gold: #3B2600;          /* 9:1 on --gold */
  --focus: #FFD54A;

  --radius-sm: 14px;
  --radius: 24px;
  --radius-lg: 32px;

  --clay-shadow:
    0 18px 36px -12px rgba(0, 0, 0, 0.55),
    0 6px 0 0 rgba(0, 0, 0, 0.35),
    inset 0 2px 0 rgba(255, 255, 255, 0.08),
    inset 0 -6px 14px rgba(0, 0, 0, 0.25);

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 40px;
  --space-5: 64px;
  --space-6: 96px;

  --font-display: "Nunito", ui-rounded, system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(255, 213, 74, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(58, 142, 240, 0.12), transparent 60%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 45%);
  background-color: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0; }

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 8px;
}

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  padding: 10px 16px;
  background: var(--gold);
  color: var(--on-gold);
  font-weight: 700;
  border-radius: 10px;
  z-index: 100;
  transition: top 0.2s ease-out;
}
.skip-link:focus { top: 12px; }

.muted { color: var(--muted); }
.gold { color: var(--gold); }

.clay {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 3px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--clay-shadow);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 24px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 17px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease-out, box-shadow 0.18s ease-out, filter 0.18s ease-out;
}
.btn .icon { width: 20px; height: 20px; flex: none; }

.btn-gold {
  background: linear-gradient(180deg, #FFE27A, var(--gold) 55%, var(--gold-deep));
  color: var(--on-gold);
  box-shadow:
    0 5px 0 0 #A0720A,
    0 14px 24px -8px rgba(255, 213, 74, 0.45),
    inset 0 2px 0 rgba(255, 255, 255, 0.6);
}
.btn-gold:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-gold:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 0 #A0720A, 0 6px 12px -6px rgba(255, 213, 74, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.6);
}

.btn-sm { min-height: 44px; padding: 8px 18px; font-size: 15px; }
.btn-lg { min-height: 56px; padding: 14px 30px; font-size: 19px; }

/* ---------- Nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 16, 32, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  gap: var(--space-2);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 20px;
}
.brand img { border-radius: 10px; }
.brand-sm { font-size: 16px; }
.brand-sm img { border-radius: 7px; }

/* ---------- Hero ---------- */

.hero { padding: var(--space-5) 0 var(--space-6); }

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-5);
  align-items: center;
}

.eyebrow {
  display: inline-block;
  padding: 6px 14px;
  margin-bottom: var(--space-2);
  border-radius: 999px;
  background: rgba(255, 213, 74, 0.12);
  border: 1px solid rgba(255, 213, 74, 0.35);
  color: var(--gold);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
}

h1 {
  font-size: clamp(44px, 6.4vw, 76px);
  margin-bottom: var(--space-3);
}

.lede {
  font-size: 18px;
  color: var(--muted);
  max-width: 34em;
  margin-bottom: var(--space-4);
}

.get-it {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.qr-card {
  flex: none;
  padding: 14px;
  background: #FFFFFF;
  border: 4px solid var(--gold);
  border-radius: var(--radius);
  box-shadow:
    0 6px 0 0 #A0720A,
    0 20px 40px -12px rgba(0, 0, 0, 0.6);
}
.qr-card img { width: 132px; height: 132px; }
.qr-card-lg { padding: 18px; }
.qr-card-lg img { width: 200px; height: 200px; }

.get-it-text { display: grid; gap: 8px; justify-items: start; }
.get-it-title { font-family: var(--font-display); font-weight: 900; font-size: 22px; }
.get-it-text .muted { max-width: 22em; margin-bottom: 6px; }

/* ---------- Phone mockup ---------- */

.phone-wrap { display: flex; justify-content: center; }

.phone {
  position: relative;
  width: min(330px, 100%);
  aspect-ratio: 9 / 19;
  padding: 18px 14px 14px;
  border-radius: 48px;
  background: linear-gradient(180deg, #1E2A4A, #0B1020);
  border: 10px solid #05070F;
  box-shadow:
    0 0 0 2px #2A355A,
    0 40px 80px -20px rgba(0, 0, 0, 0.8),
    0 0 120px -20px rgba(255, 213, 74, 0.25);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transform: rotate(3deg);
}

.phone-notch {
  width: 34%;
  height: 22px;
  margin: 0 auto 4px;
  border-radius: 999px;
  background: #05070F;
}

.phone-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.hud-card {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 62px;
  padding: 6px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-family: var(--font-display);
}
.hud-card small { font-size: 9px; font-weight: 800; color: var(--muted); letter-spacing: 0.06em; }
.hud-card b { font-size: 13px; }
.hud-score { font-family: var(--font-display); font-weight: 900; font-size: 30px; color: var(--gold); }

.phone-box {
  position: relative;
  flex: 1;
  margin-top: 26px;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 6px 0 -1px #D9A93A;
}
.phone-box .coin { position: absolute; }
.phone-box .drop {
  left: 46%;
  top: -40px;
  animation: drop 3.2s cubic-bezier(.45, 0, .55, 1) infinite;
}

.phone-chain {
  display: flex;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.phone-chain .coin { font-size: 6px; width: 18px; height: 18px; border-width: 1px; }

@keyframes drop {
  0%, 15% { transform: translateY(0); opacity: 1; }
  55% { transform: translateY(120px); opacity: 1; }
  70%, 100% { transform: translateY(120px) scale(0.4); opacity: 0; }
}

/* ---------- Bubbles (match the in-game bubbles) ---------- */

.coin {
  --light: #B0E4FB; --base: #4FC3F7; --dark: #2F7594; --ink: #FFFFFF;
  --glint:
    radial-gradient(ellipse 31% 20% at 40% 25%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 100%),
    radial-gradient(circle at 69% 28%, rgba(255, 255, 255, 0.85) 0 5%, transparent 6%);
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.55);
  background:
    var(--glint),
    radial-gradient(circle at 42% 40%,
      color-mix(in srgb, var(--light) 55%, transparent),
      color-mix(in srgb, var(--base) 82%, transparent) 62%,
      color-mix(in srgb, var(--dark) 95%, transparent) 100%);
  box-shadow:
    inset -0.1em -0.16em 0.2em rgba(255, 255, 255, 0.22),
    0 6px 14px rgba(0, 0, 0, 0.4);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  line-height: 1;
  text-shadow: 0 2px 2px color-mix(in srgb, var(--dark) 60%, transparent);
  user-select: none;
}
.t0  { --light: #B0E4FB; --base: #4FC3F7; --dark: #2F7594; --ink: #FFFFFF; } /* sky */
.t1  { --light: #AFEAD5; --base: #4DD0A1; --dark: #2E7D61; --ink: #FFFFFF; } /* mint */
.t2  { --light: #D6F1AD; --base: #A3E048; --dark: #62862B; --ink: #1E2A4A; } /* lime */
.t3  { --light: #FFECAE; --base: #FFD54A; --dark: #99802C; --ink: #1E2A4A; } /* lemon */
.t4  { --light: #FFD8AF; --base: #FFA94D; --dark: #99652E; --ink: #FFFFFF; } /* orange */
.t5  { --light: #FFBCBC; --base: #FF6B6B; --dark: #994040; --ink: #FFFFFF; } /* coral */
.t6  { --light: #FFB7D5; --base: #FF5FA2; --dark: #993961; --ink: #FFFFFF; } /* pink */
.t7  { --light: #E6C5FF; --base: #C77DFF; --dark: #774B99; --ink: #FFFFFF; } /* violet */
.t8  { --light: #C4C7FF; --base: #7C83FF; --dark: #4A4F99; --ink: #FFFFFF; } /* indigo */
.t9  { --light: #A1E4DE; --base: #2EC4B6; --dark: #1C766D; --ink: #FFFFFF; } /* teal */
.t10 { --light: #A6C9FF; --base: #3A86FF; --dark: #235099; --ink: #FFFFFF; } /* royal blue */
.t11 { /* rainbow */
  --dark: #FFFFFF; --ink: #1E2A4A;
  background:
    var(--glint),
    radial-gradient(circle, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.15)),
    conic-gradient(from 135deg, #FF6B6B, #FFD54A, #4DD0A1, #4FC3F7, #C77DFF, #FF5FA2, #FF6B6B);
}

.c-xs { width: 34px; height: 34px; font-size: 13px; }
.c-sm { width: 44px; height: 44px; font-size: 16px; }
.c-md { width: 66px; height: 66px; font-size: 22px; }
.c-lg { width: 92px; height: 92px; font-size: 28px; }
.c-xl { width: 128px; height: 128px; font-size: 34px; }

/* ---------- Sections ---------- */

section { scroll-margin-top: 80px; }

.section-title {
  font-size: clamp(30px, 4vw, 44px);
  text-align: center;
  margin-bottom: 12px;
}
.section-sub {
  text-align: center;
  color: var(--muted);
  font-size: 18px;
  margin-bottom: var(--space-4);
}

.ladder { padding: var(--space-5) 0; }
.ladder-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-3) var(--space-2);
}
.ladder-list li {
  display: grid;
  justify-items: center;
  gap: 10px;
  font-weight: 500;
  color: var(--muted);
  font-size: 15px;
}
.ladder-list .coin { width: 72px; height: 72px; font-size: 22px; transition: transform 0.25s ease-out; }
.ladder-list li:hover .coin { transform: translateY(-4px) rotate(-8deg); }

.features { padding: var(--space-5) 0; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-4);
}
.feature { padding: var(--space-3); }
.feature h3 { font-size: 22px; margin: var(--space-2) 0 8px; }
.feature p { color: var(--muted); }
.feature-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: rgba(255, 213, 74, 0.14);
  border: 2px solid rgba(255, 213, 74, 0.35);
}
.feature-icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.how { padding: var(--space-5) 0; }
.steps {
  list-style: none;
  margin: var(--space-4) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}
.step { padding: var(--space-3); position: relative; }
.step h3 { font-size: 24px; margin: var(--space-2) 0 8px; }
.step p { color: var(--muted); }
.step-num {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(180deg, #FFE27A, var(--gold) 55%, var(--gold-deep));
  color: var(--on-gold);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  box-shadow: 0 4px 0 #A0720A;
}

.cta { padding: var(--space-5) 0 var(--space-6); }
.cta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(255, 213, 74, 0.16), transparent 60%),
    linear-gradient(180deg, var(--surface-2), var(--surface));
  border-color: rgba(255, 213, 74, 0.35);
}
.cta-copy { display: grid; gap: var(--space-2); justify-items: start; max-width: 30em; }
.cta-copy h2 { font-size: clamp(32px, 4.4vw, 48px); }
.cta-copy p { color: var(--muted); font-size: 18px; margin-bottom: 8px; }

.footer {
  border-top: 1px solid var(--border);
  padding: var(--space-3) 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
  font-size: 14px;
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .hero { padding-top: var(--space-4); }
  .hero-grid { grid-template-columns: 1fr; gap: var(--space-4); }
  .hero-copy { text-align: center; }
  .lede { margin-left: auto; margin-right: auto; }
  .get-it { justify-content: center; }
  .phone { transform: none; width: min(300px, 86vw); }
  .ladder-list { grid-template-columns: repeat(4, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .cta-card { flex-direction: column-reverse; text-align: center; padding: var(--space-4) var(--space-3); }
  .cta-copy { justify-items: center; }
}

@media (max-width: 560px) {
  .get-it { flex-direction: column; }
  .get-it-text { justify-items: center; text-align: center; }
  .feature-grid { grid-template-columns: 1fr; }
  .ladder-list { grid-template-columns: repeat(3, 1fr); }
  .ladder-list .coin { width: 64px; height: 64px; font-size: 20px; }
  .qr-card-lg img { width: 180px; height: 180px; }
  .footer-inner { justify-content: center; text-align: center; }
  .nav .btn-sm { padding: 8px 14px; }
}

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .phone-box .drop { animation: none; }
}

/* ---------- Legal and 404 pages ---------- */

.legal { max-width: 760px; padding-top: var(--space-5); padding-bottom: var(--space-6); }
.legal h1 { font-size: clamp(36px, 5vw, 52px); margin-bottom: 8px; }
.legal h2 { font-size: 24px; margin: var(--space-4) 0 var(--space-1); }
.legal p, .legal li { color: var(--muted); }
.legal ul { padding-left: 1.2em; display: grid; gap: var(--space-1); }
.legal strong { color: var(--text); }

.not-found {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--space-2);
  text-align: center;
}
.not-found h1 { font-size: clamp(32px, 5vw, 48px); }
.not-found .btn { margin-top: var(--space-2); }

/* Coin positions in the hero phone mockup (set here, not inline, because the CSP blocks inline styles). */
.phone-box .coin[data-pos="1"] { left: 2%; bottom: 0; }
.phone-box .coin[data-pos="2"] { right: 3%; bottom: 0; }
.phone-box .coin[data-pos="3"] { left: 6%; bottom: 122px; }

/* ---------- Merge animation in the hero phone ---------- */

/* Each .merge is a zero-size point at the merge centre; its pieces are centred on it. */
.phone-box .merge { position: absolute; width: 0; height: 0; --delay: 0s; --gap: 24px; }
.phone-box .merge > * {
  position: absolute;
  left: 0;
  top: 0;
  translate: -50% -50%;
  animation-duration: 4.8s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-fill-mode: both;
  animation-delay: var(--delay);
}
.phone-box .merge .m-a { animation-name: merge-a; }
.phone-box .merge .m-b { animation-name: merge-b; }
.phone-box .merge .m-c { animation-name: merge-c; }
.phone-box .merge .m-ring {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 3px solid var(--light);
  animation-name: merge-ring;
}
.phone-box .merge .m-plus {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 14px;
  color: var(--gold);
  white-space: nowrap;
  animation-name: merge-plus;
}

/* 16 + 16 → 32, resting on the 64 */
.phone-box .m1 { right: calc(3% + 46px); bottom: 126px; --gap: 25px; }
/* 4 + 4 → 8, in the gap between the 512 and the 64 */
.phone-box .m2 { left: 56%; bottom: 26px; --gap: 19px; --delay: 1.6s; }
/* 2 + 2 → 4, on the shoulder of the 512 */
.phone-box .m3 { left: 47%; bottom: 128px; --gap: 19px; --delay: 3.2s; }
.phone-box .m2 .m-ring, .phone-box .m3 .m-ring { width: 48px; height: 48px; }

@keyframes merge-a {
  0% { transform: translateX(calc(var(--gap) * -1.6)); opacity: 0; }
  8% { transform: translateX(calc(var(--gap) * -1)); opacity: 1; }
  32% { transform: translateX(-3px); opacity: 1; }
  40%, 100% { transform: translateX(0) scale(0.5); opacity: 0; }
}
@keyframes merge-b {
  0% { transform: translateX(calc(var(--gap) * 1.6)); opacity: 0; }
  8% { transform: translateX(var(--gap)); opacity: 1; }
  32% { transform: translateX(3px); opacity: 1; }
  40%, 100% { transform: translateX(0) scale(0.5); opacity: 0; }
}
@keyframes merge-c {
  0%, 36% { transform: scale(0.2); opacity: 0; }
  46% { transform: scale(1.15); opacity: 1; }
  54%, 86% { transform: scale(1); opacity: 1; }
  96%, 100% { transform: scale(1); opacity: 0; }
}
@keyframes merge-ring {
  0%, 36% { transform: scale(0.6); opacity: 0; }
  38% { transform: scale(0.7); opacity: 1; }
  58%, 100% { transform: scale(1.6); opacity: 0; }
}
@keyframes merge-plus {
  0%, 38% { transform: translateY(-40px); opacity: 0; }
  44% { transform: translateY(-48px); opacity: 1; }
  72%, 100% { transform: translateY(-78px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  /* No motion: show each merge's result bubble only. */
  .phone-box .merge .m-a, .phone-box .merge .m-b,
  .phone-box .merge .m-ring, .phone-box .merge .m-plus { display: none; }
  .phone-box .merge .m-c { animation: none; opacity: 1; transform: none; }
}
