/* Loop Riot website — shared styles for the homepage and the store pages. */

:root {
  --navy: #13235b;
  --navy-deep: #0b1640;
  --sky: #7cc8f2;
  --sky-light: #c9ecff;
  --teal: #12c7c6;
  --coral: #ff4d5e;
  --lime: #9be34a;
  --lime-dark: #6fb52a;
  --sun: #ffc93c;
  --purple: #8f5bf0;
  --cream: #fffaf0;
  --ink: #1d2446;
  --muted: #5a6386;
  --radius: 22px;
  --heading: "Fredoka", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
/* the tilted strip and floating heroes may poke past the screen edge; never let the page scroll sideways */
main { overflow-x: clip; }
a { color: inherit; }

h1, h2, h3 {
  font-family: var(--heading);
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 .5em;
  color: var(--navy);
}

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--navy); color: #fff; padding: 8px 14px; border-radius: 10px; z-index: 100;
}
.skip:focus { left: 8px; }

/* ---------- Top bar ---------- */
.topbar {
  position: absolute; inset: 0 0 auto 0; z-index: 20;
  padding: 18px 0;
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar .brand img { height: 110px; width: auto; filter: drop-shadow(0 4px 0 rgba(11, 22, 64, .15)); }
.topbar nav { display: flex; gap: 22px; font-family: var(--heading); font-weight: 600; }
.topbar nav a { text-decoration: none; color: var(--navy); }
.topbar nav a:hover { color: var(--coral); }

/* ---------- Store badges ---------- */
/* Official Apple and Google badge artwork at exactly the same size (Apple's background is widened to match). */
.stores { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.badge { display: inline-block; line-height: 0; border-radius: 9px; transition: transform .15s ease; }
.badge img { height: 56px; width: auto; }
a.badge:not(.soon):hover { transform: translateY(-2px); }
/* Until the store links exist the badges are shown but not clickable, with a "Soon" sticker. */
.badge { position: relative; }
.badge.soon { cursor: default; }
.badge.soon::after {
  content: "Soon";
  position: absolute; top: -11px; right: -9px;
  background: var(--sun); color: var(--navy-deep);
  font: 700 12px/1 var(--heading); letter-spacing: .06em; text-transform: uppercase;
  padding: 6px 9px; border-radius: 999px;
  transform: rotate(6deg);
  box-shadow: 0 3px 0 #d69c0e;
  animation: soon 3.5s ease-in-out infinite;
}
@keyframes soon { 0%, 85%, 100% { transform: rotate(6deg) scale(1); } 90% { transform: rotate(-4deg) scale(1.15); } 95% { transform: rotate(10deg) scale(1.05); } }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 180px 0 110px;
  background:
    radial-gradient(ellipse at 20% 110%, rgba(18, 199, 198, .35), transparent 55%),
    linear-gradient(180deg, #5db8f0 0%, #9bd8fb 55%, #c9ecff 100%);
  overflow: hidden;
}
.hero::before, .hero::after {
  /* soft clouds */
  content: ""; position: absolute; border-radius: 999px; background: #fff; opacity: .85;
  filter: blur(2px);
}
.hero::before { width: 260px; height: 70px; top: 110px; left: -60px; box-shadow: 70px -30px 0 10px #fff; }
.hero::after { width: 220px; height: 60px; top: 70px; right: 8%; box-shadow: -60px -24px 0 6px #fff; opacity: .6; }

.hero .wrap {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 40px;
}
.hero h1 { font-size: clamp(44px, 7vw, 84px); line-height: 1; letter-spacing: -.01em; margin-bottom: .35em; text-shadow: 0 5px 0 rgba(11, 22, 64, .12); }
.hero h1 .loop { color: #0aa6a5; }
.hero h1 .riot { color: var(--coral); }
.hero .lead { font-size: 19px; max-width: 520px; color: #1f3170; margin: 0 0 28px; }
.coming {
  display: inline-block;
  font: 600 15px/1 var(--heading); letter-spacing: .08em; text-transform: uppercase;
  color: var(--navy-deep); background: rgba(255, 255, 255, .7);
  padding: 9px 14px; border-radius: 999px; margin-bottom: 16px;
}

.phone-stage { position: relative; display: flex; justify-content: center; }
.phone {
  position: relative; z-index: 2;
  width: min(300px, 70vw);
  aspect-ratio: 1170 / 2532;
  border-radius: 44px;
  padding: 10px;
  background: var(--navy-deep);
  box-shadow: 0 30px 60px rgba(11, 22, 64, .35), inset 0 0 0 2px #2b3c7c;
  transform: rotate(4deg);
}
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 34px; }
.phone-stage .buddy { position: absolute; z-index: 3; width: 150px; filter: drop-shadow(0 12px 12px rgba(11, 22, 64, .3)); }
.phone-stage .buddy.left { left: -10px; bottom: 40px; transform: rotate(-8deg); animation: bob 4s ease-in-out infinite; }
.phone-stage .buddy.right { right: -10px; top: 30px; width: 130px; transform: rotate(8deg); animation: bob 4.6s ease-in-out infinite reverse; }

@keyframes bob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -12px; }
}

/* wavy edge between sections */
.wave { display: block; width: 100%; height: 60px; margin-top: -59px; position: relative; z-index: 2; }

/* ---------- Sections ---------- */
section { padding: 80px 0; }
.eyebrow {
  font: 600 14px/1 var(--heading); letter-spacing: .12em; text-transform: uppercase; color: var(--coral);
  margin: 0 0 10px;
}
.section-title { font-size: clamp(30px, 4vw, 44px); max-width: 640px; }
.section-intro { color: var(--muted); max-width: 620px; margin: 0 0 40px; font-size: 18px; }

.how-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 40px; align-items: center; }
.steps { display: grid; gap: 16px; }
.step {
  display: flex; gap: 18px; align-items: flex-start;
  background: #fff; border-radius: var(--radius); padding: 22px 24px;
  box-shadow: 0 6px 0 rgba(19, 35, 91, .08), 0 18px 40px rgba(19, 35, 91, .06);
  border: 2px solid rgba(19, 35, 91, .06);
  transition: transform .35s ease, border-color .35s ease, box-shadow .35s ease;
}
.step .num {
  flex: none;
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px;
  font: 700 26px/1 var(--heading); color: #fff;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .15);
  transition: transform .35s cubic-bezier(.3, 1.6, .5, 1);
}
.step:nth-child(1) { --c: var(--teal); }
.step:nth-child(2) { --c: var(--coral); }
.step:nth-child(3) { --c: var(--lime-dark); }
.step .num { background: var(--c); }
.step h3 { font-size: 23px; margin-bottom: .25em; }
.step p { margin: 0; color: var(--muted); }
/* the step that matches the moment in the arena animation */
.step.active { border-color: var(--c); transform: translateX(8px); box-shadow: 0 6px 0 var(--c), 0 18px 40px rgba(19, 35, 91, .1); }
.step.active .num { transform: scale(1.12) rotate(-6deg); }

.arena {
  position: relative;
  background: #f3faff;
  border-radius: 32px;
  border: 6px solid #fff;
  box-shadow: 0 8px 0 rgba(19, 35, 91, .1), 0 30px 60px rgba(19, 35, 91, .15);
  overflow: hidden;
}
.arena svg { display: block; width: 100%; height: auto; }

.features {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #dfe6ff;
  position: relative; overflow: hidden;
}
.features h2, .features h3 { color: #fff; }
.features .section-intro { color: #b8c3ee; }
.features .eyebrow { color: var(--sun); }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature {
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--radius); padding: 24px;
}
.feature .icon {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 14px;
  font-size: 24px;
}
.feature h3 { font-size: 21px; margin-bottom: .35em; }
.feature p { margin: 0; color: #b8c3ee; font-size: 16px; }

.feature { transition: transform .25s ease, background .25s ease; }
.feature:hover { transform: translateY(-4px); background: rgba(255, 255, 255, .1); }
.feature:hover .icon { animation: wiggle .5s ease; }

/* ---------- Scrolling strip of heroes ---------- */
.marquee {
  position: relative; z-index: 3;
  margin: -34px 0 -10px;
  background: var(--coral);
  transform: rotate(-2deg);
  box-shadow: 0 6px 0 #d63646;
  overflow: hidden;
  padding: 10px 0;
}
.marquee-track { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.marquee-group { display: flex; align-items: center; gap: 22px; padding-right: 22px; }
.marquee img { height: 58px; width: auto; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .15)); }
.marquee span {
  font: 700 26px/1 var(--heading); color: #fff; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap;
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Heroes ---------- */
.heroes { background: #fff; position: relative; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin: -12px 0 30px; }
.filters button {
  font: 600 16px/1 var(--heading); color: var(--navy);
  background: #eef4fc; border: 2px solid transparent; border-radius: 999px;
  padding: 10px 16px; cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.filters button small { font-size: 13px; opacity: .6; margin-left: 4px; }
.filters button:hover { transform: translateY(-2px); }
.filters button[aria-pressed="true"] { background: var(--navy); color: #fff; }

.hero-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px;
}
/* 18 heroes fill three rows of six; the three legendaries share the last row at double width */
.hero-card[data-rarity="legendary"] { grid-column: span 2; }
.hero-card[data-rarity="legendary"] .hero-art { height: 170px; }
.hero-card[data-rarity="legendary"] .hero-art img { max-height: 170px; }
.hero-card {
  position: relative;
  background: #f5f8fc; /* fallback for browsers without color-mix() */
  text-align: center;
  padding: 18px 16px 20px;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--tint) 45%, #fff) 0%, color-mix(in srgb, var(--tint) 14%, #fff) 70%);
  border: 2px solid color-mix(in srgb, var(--tint) 35%, #fff);
  box-shadow: 0 6px 0 color-mix(in srgb, var(--tint) 40%, #fff);
  transition: transform .25s ease, box-shadow .25s ease;
}
.hero-card[hidden] { display: none; }
.hero-card:hover { transform: translateY(-6px) rotate(-1deg); box-shadow: 0 12px 0 color-mix(in srgb, var(--tint) 55%, #fff); }
.hero-art { height: 130px; display: flex; align-items: flex-end; justify-content: center; margin-bottom: 10px; }
.hero-art img {
  max-height: 130px; width: auto;
  filter: drop-shadow(0 8px 8px rgba(11, 22, 64, .2));
  transform-origin: 50% 100%;
}
.hero-card:hover .hero-art img { animation: hop .6s ease; }
.hero-card h3 { font-size: 21px; margin: 0 0 6px; }
.hero-card p { margin: 8px 0 0; font-size: 14px; line-height: 1.4; color: #3f4870; }
.rarity {
  display: inline-block; font: 700 11px/1 var(--heading); letter-spacing: .1em; text-transform: uppercase;
  padding: 5px 9px; border-radius: 999px; color: #fff;
}
.rarity.common { background: #7d8aa6; }
.rarity.rare { background: #2f8cf0; }
.rarity.epic { background: #8f5bf0; }
.rarity.legendary { background: linear-gradient(90deg, #f5a623, #ffcf3c); color: #5a3b00; }
.hero-card:has(.legendary)::after {
  /* a slow shine across the legendary cards */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .6) 50%, transparent 65%) -200% 0 / 250% 100% no-repeat;
  animation: shine 4s ease-in-out infinite;
}

@keyframes hop {
  0% { transform: translateY(0) scale(1, 1); }
  25% { transform: translateY(0) scale(1.08, .9); }
  55% { transform: translateY(-16px) scale(.95, 1.06); }
  80% { transform: translateY(0) scale(1.05, .95); }
  100% { transform: translateY(0) scale(1, 1); }
}
@keyframes shine { 0%, 60% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes wiggle { 25% { transform: rotate(-10deg); } 75% { transform: rotate(10deg); } }

/* ---------- Entrance animations ---------- */
.hero h1 .w { display: inline-block; animation: pop-in .7s cubic-bezier(.3, 1.6, .5, 1) backwards; }
.hero h1 .w:nth-child(2) { animation-delay: .1s; }
.hero h1 .riot .w:nth-child(1) { animation-delay: .25s; }
.hero h1 .riot .w:nth-child(2) { animation-delay: .35s; }
.hero .coming, .hero .lead, .hero .stores { animation: fade-up .7s ease backwards; }
.hero .coming { animation-delay: 0s; }
.hero .lead { animation-delay: .45s; }
.hero .stores { animation-delay: .6s; }
.phone { animation: phone-in 1s cubic-bezier(.2, 1.2, .4, 1) .2s backwards; }
.phone-stage { transition: transform .3s ease-out; }

@keyframes pop-in { from { opacity: 0; transform: translateY(30px) scale(.6) rotate(-6deg); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(20px); } }
@keyframes phone-in { from { opacity: 0; transform: translateY(60px) rotate(12deg); } }

/* Elements slide up as they scroll into view (only when JavaScript is on). */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .6s ease, transform .6s ease; transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }

.cta {
  background: linear-gradient(180deg, #c9ecff 0%, #9bd8fb 100%);
}
.cta-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 36px; align-items: center; }
.cta-card { text-align: center; }
.cta-art {
  /* 543px = half the art's real width, so it stays sharp on 2x screens */
  width: 100%; max-width: 543px; justify-self: center; border-radius: 30px;
  border: 6px solid #fff;
  box-shadow: 0 8px 0 rgba(11, 22, 64, .15), 0 30px 60px rgba(11, 22, 64, .25);
  transform: rotate(-1.5deg);
}
.cta h2 { font-size: clamp(30px, 4vw, 46px); }
.cta p { color: #1f3170; max-width: 520px; margin: 0 auto 28px; font-size: 18px; }
.cta .stores { justify-content: center; }

/* ---------- Footer ---------- */
.footer { background: var(--navy-deep); color: #b8c3ee; padding: 44px 0 36px; font-size: 15px; }
.footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; }
.footer img { height: 84px; width: auto; }
.footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer nav a { text-decoration: none; color: #dfe6ff; }
.footer nav a:hover { color: var(--sun); }
.footer .copy { width: 100%; margin: 6px 0 0; font-size: 14px; color: #8190c4; }

/* ---------- Legal / info pages ---------- */
.page-head {
  padding: 170px 0 50px;
  background: linear-gradient(180deg, #5db8f0 0%, #c9ecff 100%);
}
.page-head h1 { font-size: clamp(34px, 5vw, 52px); margin-bottom: .2em; }
.page-head p { margin: 0; color: #1f3170; }

.doc { padding: 50px 0 80px; }
.doc .wrap { max-width: 780px; }
.doc h2 { font-size: 26px; margin-top: 1.8em; }
.doc h3 { font-size: 20px; margin-top: 1.4em; }
.doc p, .doc li { color: #2c3458; }
.doc ul, .doc ol { padding-left: 1.3em; }
.doc li { margin-bottom: .4em; }
.doc a { color: #0b7f93; font-weight: 700; }
.doc table { width: 100%; border-collapse: collapse; margin: 1em 0 1.5em; font-size: 15px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid #e3e6f0; }
.doc th { font-family: var(--heading); font-weight: 600; color: var(--navy); background: #f2f5fc; }
.table-scroll { overflow-x: auto; }
.callout {
  background: #fff; border: 2px solid rgba(19, 35, 91, .08); border-left: 6px solid var(--teal);
  border-radius: 14px; padding: 18px 20px; margin: 1.5em 0;
}
.callout.coral { border-left-color: var(--coral); }
.callout p:last-child { margin-bottom: 0; }
.button {
  display: inline-block; padding: 13px 24px; border-radius: 14px;
  background: var(--lime); color: var(--navy-deep) !important; text-decoration: none;
  font: 600 18px/1 var(--heading); box-shadow: 0 4px 0 var(--lime-dark);
}
.button:hover { transform: translateY(-1px); }

.faq details {
  background: #fff; border-radius: 14px; border: 2px solid rgba(19, 35, 91, .07);
  padding: 16px 20px; margin-bottom: 12px;
}
.faq summary { cursor: pointer; font-family: var(--heading); font-weight: 600; font-size: 18px; color: var(--navy); }
.faq details p { margin: .8em 0 0; }

/* ---------- 404 ---------- */
.lost {
  min-height: 100vh; display: grid; place-items: center; text-align: center;
  padding: 160px 0 70px;
  background:
    radial-gradient(ellipse at 50% 120%, rgba(18, 199, 198, .35), transparent 60%),
    linear-gradient(180deg, #5db8f0 0%, #9bd8fb 55%, #c9ecff 100%);
}
.lost-code {
  display: flex; align-items: center; justify-content: center; gap: 4px; margin: 0;
  font: 700 clamp(110px, 22vw, 200px)/1 var(--heading);
}
.lost-code .d4 { color: #12c7c6; -webkit-text-stroke: 6px var(--navy-deep); paint-order: stroke fill; text-shadow: 0 10px 0 rgba(11, 22, 64, .2); }
.lost-code .d4.riot { color: var(--coral); }
.lost-zip { width: clamp(100px, 18vw, 160px); filter: drop-shadow(0 12px 10px rgba(11, 22, 64, .3)); animation: bob 2.6s ease-in-out infinite; }
.lost-loop { width: min(320px, 80%); height: auto; margin: 6px auto 18px; display: block; }
.lost-loop path { animation: lost-draw 3.2s ease-in-out infinite; }
.lost-cut { transform-origin: 94px 55px; animation: lost-cut 3.2s ease-in-out infinite; }
.lost h1 { font-size: clamp(30px, 5vw, 48px); color: var(--navy-deep); }
.lost-text { color: #1f3170; font-size: 18px; max-width: 460px; margin: 0 auto 26px; }
.lost-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.button.ghost { background: #fff; box-shadow: 0 4px 0 rgba(11, 22, 64, .15); }
.lost-crew { display: flex; justify-content: center; align-items: flex-end; gap: 18px; margin-top: 40px; }
.lost-crew img { height: 84px; width: auto; animation: bob 3s ease-in-out infinite; }
.lost-crew img:nth-child(2) { animation-delay: -1s; }
.lost-crew img:nth-child(3) { animation-delay: -2s; }
@keyframes lost-draw {
  0% { stroke-dashoffset: 1; opacity: 1; }
  55% { stroke-dashoffset: .12; opacity: 1; }
  80% { stroke-dashoffset: .12; opacity: 1; }
  100% { stroke-dashoffset: .12; opacity: 0; }
}
@keyframes lost-cut {
  0%, 52% { opacity: 0; transform: scale(.3); }
  60% { opacity: 1; transform: scale(1.2) rotate(12deg); }
  66%, 85% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1); }
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
  .hero { padding: 160px 0 90px; }
  .phone-stage { width: 100%; max-width: 440px; margin-inline: auto; }
  .hero .wrap { grid-template-columns: 1fr; text-align: center; }
  .hero .lead { margin-inline: auto; }
  .hero .stores { justify-content: center; }
  .how-grid, .feature-grid, .cta-grid { grid-template-columns: 1fr; }
  .arena { max-width: 520px; margin-inline: auto; width: 100%; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .topbar nav { display: none; }
  .topbar .brand img { height: 84px; }
  .hero { padding-top: 130px; }
  section { padding: 60px 0; }
  .feature-grid { grid-template-columns: 1fr; }
  .stores { justify-content: center; }
  .badge img { height: 50px; }
  .phone-stage .buddy { width: 110px; }
  .phone-stage .buddy.right { width: 96px; }
  .hero-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .hero-card { padding: 14px 10px 16px; }
  .hero-art { height: 104px; }
  .hero-art img { max-height: 104px; }
  .hero-card h3 { font-size: 18px; }
  .hero-card p { font-size: 13px; }
  .marquee img { height: 44px; }
  .marquee span { font-size: 20px; }
  .step.active { transform: translateY(-3px); }
  .footer .wrap { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 380px) {
  .coming { font-size: 12px; letter-spacing: .04em; padding: 8px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .marquee-track { flex-wrap: wrap; }
}
