/* ============================================================
   Aqlly landing — design tokens straight from the app's
   design system (docs/04-design-system.md).
   ============================================================ */
:root {
  /* Indigo — brand */
  --indigo-400: #818CF8;
  --indigo-500: #6366F1;
  --indigo-600: #4F46E5;
  --indigo-700: #4338CA;
  --indigo-800: #3730A3;
  --indigo-900: #312E81;
  /* Amber — the single spark (reward / streak / CTA accent) */
  --amber-400: #FBBF24;
  --amber-500: #F59E0B;
  /* Semantic */
  --green-500: #10B981;
  /* Surfaces (light) */
  --bg: #FFFFFF;
  --surface-1: #F9FAFB;
  --surface-2: #F3F4F6;
  --outline: #E5E7EB;
  --ink: #111827;
  --ink-soft: #6B7280;
  /* Dark surfaces */
  --dark: #0F0F14;
  --dark-2: #1A1A23;

  --radius: 12px;
  --radius-lg: 16px;
  --radius-2xl: 24px;
  --shadow-1: 0 1px 2px rgba(17, 24, 39, .06);
  --shadow-2: 0 10px 30px rgba(17, 24, 39, .08);
  --shadow-glow: 0 20px 60px rgba(79, 70, 229, .35);
  --container: 1120px;
  --ease: cubic-bezier(.4, 0, .2, 1);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  font-feature-settings: 'tnum' 1, 'cv11' 1;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img, lottie-player { display: block; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }

/* ---------------- Buttons ---------------- */
.btn {
  --c: var(--indigo-600);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; font-size: 15px; line-height: 1;
  border-radius: var(--radius); border: 1.5px solid transparent;
  cursor: pointer; white-space: nowrap;
  transition: transform .14s var(--ease), box-shadow .2s var(--ease), background .2s, color .2s;
  will-change: transform;
}
.btn:active { transform: scale(.96); }
.btn--sm { padding: 10px 18px; }
.btn--lg { padding: 16px 26px; font-size: 16px; }
.btn--primary {
  background: var(--indigo-600); color: #fff;
  box-shadow: 0 8px 24px rgba(79, 70, 229, .35);
}
.btn--primary:hover { background: var(--indigo-700); box-shadow: 0 12px 30px rgba(79, 70, 229, .45); }
.btn--ghost {
  background: rgba(255, 255, 255, .06); color: #fff;
  border-color: rgba(255, 255, 255, .25);
}
.btn--ghost:hover { background: rgba(255, 255, 255, .14); }

.eyebrow, .kicker { font-weight: 700; }

/* ---------------- Nav ---------------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  padding: 14px 0;
  transition: background .3s, backdrop-filter .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(255, 255, 255, .8);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom-color: var(--outline);
}
.nav__inner { display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand__mark { border-radius: 9px; }
.brand__name { font-weight: 800; font-size: 19px; letter-spacing: -.02em; color: #fff; transition: color .3s; }
.nav.is-scrolled .brand__name { color: var(--ink); }
.nav__links { display: flex; gap: 26px; margin-left: auto; }
.nav__links a { font-weight: 600; font-size: 15px; color: rgba(255, 255, 255, .82); transition: color .2s; }
.nav.is-scrolled .nav__links a { color: var(--ink-soft); }
.nav__links a:hover { color: var(--indigo-500); }

/* ---------------- Hero ---------------- */
.hero {
  position: relative; isolation: isolate;
  padding: 150px 0 90px;
  background:
    radial-gradient(1200px 600px at 80% -10%, #4338CA 0%, transparent 60%),
    linear-gradient(170deg, #1E1B4B 0%, #0F0F14 70%);
  color: #fff; overflow: hidden;
}
.hero__glow {
  position: absolute; z-index: -1; width: 520px; height: 520px; left: -120px; top: 120px;
  background: radial-gradient(circle, rgba(245, 158, 11, .22), transparent 70%);
  filter: blur(20px);
}
.hero__inner {
  display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 40px;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14);
  font-size: 13px; color: rgba(255, 255, 255, .9);
}
.eyebrow__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green-500); box-shadow: 0 0 0 4px rgba(16, 185, 129, .25); }
.hero__title {
  margin: 20px 0 18px;
  font-weight: 900; letter-spacing: -.035em; line-height: .98;
  font-size: clamp(44px, 7vw, 86px);
}
.hero__title .line { display: block; }
.hero__title .accent {
  background: linear-gradient(100deg, var(--amber-400), var(--amber-500));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__sub { max-width: 30ch; font-size: clamp(16px, 2vw, 19px); color: rgba(255, 255, 255, .78); line-height: 1.55; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin: 30px 0 14px; }
.hero__trust { font-size: 13px; color: rgba(255, 255, 255, .55); }

/* Phone mockup */
.hero__device { position: relative; display: flex; justify-content: center; }
.phone {
  position: relative; width: 290px; aspect-ratio: 9 / 19; border-radius: 42px;
  background: #05050a; padding: 12px;
  box-shadow: var(--shadow-glow), 0 0 0 2px rgba(255, 255, 255, .06) inset;
  transform: rotate(3deg);
}
.phone__notch { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); width: 96px; height: 22px; background: #05050a; border-radius: 0 0 16px 16px; z-index: 3; }
.phone__screen {
  height: 100%; border-radius: 32px; overflow: hidden;
  background: linear-gradient(180deg, #1A1A23, #0F0F14);
  padding: 36px 14px 16px; display: flex; flex-direction: column; gap: 12px;
}
.appbar { display: flex; align-items: center; justify-content: space-between; }
.appbar__streak { display: flex; align-items: center; gap: 4px; font-size: 13px; color: #fff; }
.appbar__streak b { font-size: 16px; }
.appbar__streak .streak-flame { width: 28px; height: 28px; }
.appbar__xp { text-align: right; font-size: 11px; color: var(--indigo-400); font-weight: 600; }
.xpbar { width: 86px; height: 6px; border-radius: 4px; background: rgba(255, 255, 255, .12); margin-top: 5px; overflow: hidden; }
.xpbar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--indigo-500), var(--indigo-400)); }
.qcard { background: #252531; border-radius: 16px; padding: 14px; border: 1px solid rgba(255, 255, 255, .06); }
.qcard__meta { font-size: 11px; color: var(--indigo-400); font-weight: 700; margin-bottom: 8px; }
.qcard__q { font-size: 14px; font-weight: 700; color: #fff; line-height: 1.3; margin-bottom: 12px; }
.qcard__opts { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.qcard__opts li { font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, .8); background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .07); border-radius: 10px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; }
.qcard__opts .is-correct { color: #fff; background: rgba(16, 185, 129, .18); border-color: var(--green-500); }
.qcard--ghost { background: transparent; border: none; padding: 0; }
.reward { display: flex; align-items: center; gap: 8px; background: rgba(245, 158, 11, .14); border: 1px solid rgba(245, 158, 11, .4); border-radius: 12px; padding: 10px 12px; }
.reward__xp { font-weight: 800; color: var(--amber-400); font-size: 14px; }
.reward__txt { font-size: 12px; color: rgba(255, 255, 255, .85); }
.device-fox { position: absolute; right: -34px; bottom: -10px; width: 120px; height: 120px; }

/* ---------------- Sections ---------------- */
.section { padding: 88px 0; }
.section--tint { background: var(--surface-1); }
.section--dark { background: var(--dark); color: #fff; }
.section__head { max-width: 620px; margin: 0 auto 48px; text-align: center; }
.kicker { display: inline-block; color: var(--indigo-600); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 12px; }
.kicker--light { color: var(--amber-400); }
.section__head h2 { font-size: clamp(28px, 4vw, 42px); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.section__lead { margin-top: 14px; color: var(--ink-soft); font-size: 17px; }
.section--dark .section__lead { color: rgba(255, 255, 255, .7); }

/* Steps */
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; counter-reset: s; }
.step { background: var(--bg); border: 1px solid var(--outline); border-radius: var(--radius-lg); padding: 28px 24px; }
.step__num { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: var(--indigo-600); color: #fff; font-weight: 800; font-size: 18px; margin-bottom: 16px; }
.step h3 { font-size: 19px; font-weight: 700; margin-bottom: 8px; letter-spacing: -.01em; }
.step p { color: var(--ink-soft); font-size: 15px; }

/* Game grid */
.game-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; max-width: 880px; margin: 0 auto; }
.gcard { background: var(--bg); border: 1px solid var(--outline); border-radius: var(--radius-2xl); padding: 28px; box-shadow: var(--shadow-1); }
.gcard lottie-player { width: 72px; height: 72px; margin-bottom: 6px; }
.gcard__icon {
  width: 56px; height: 56px; border-radius: 16px; margin-bottom: 14px;
  background: linear-gradient(135deg, var(--indigo-600), var(--indigo-800));
  background-repeat: no-repeat; background-position: center; background-size: 28px;
}
.gcard__icon[data-ic="xp"] {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/></svg>'), linear-gradient(135deg, var(--indigo-600), var(--indigo-800));
  background-repeat: no-repeat, no-repeat; background-position: center, center; background-size: 28px, cover;
}
.gcard__icon[data-ic="medal"] {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="12 2 15 9 22 9 17 14 19 21 12 17 5 21 7 14 2 9 9 9"/></svg>'), linear-gradient(135deg, var(--amber-500), #B45309);
  background-repeat: no-repeat, no-repeat; background-position: center, center; background-size: 28px, cover;
}
.gcard h3 { font-size: 20px; font-weight: 700; margin-bottom: 8px; letter-spacing: -.01em; }
.gcard p { color: var(--ink-soft); font-size: 15px; }
.gcard--streak, .gcard--trophy { background: linear-gradient(180deg, var(--surface-1), var(--bg)); }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; max-width: 760px; margin: 0 auto; }
.chip { padding: 12px 20px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--outline); font-weight: 700; font-size: 15px; transition: transform .15s var(--ease), background .2s; }
.chip:hover { transform: translateY(-3px); background: var(--bg); }
.chip--accent { background: rgba(245, 158, 11, .12); border-color: rgba(245, 158, 11, .4); color: #B45309; }

/* Lessons — feature ticks under the reel gallery */
.ticks { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.ticks li { position: relative; padding-left: 30px; color: rgba(255, 255, 255, .88); font-weight: 500; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--green-500) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6L9 17l-5-5"/></svg>') center / 12px no-repeat; }
.ticks--row { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 14px 26px; margin-top: 40px; }
.ticks--row li { padding-left: 28px; font-size: 15px; }

/* Reels gallery — clean vertical thumbnail cards, tap → player modal */
.reelgrid {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 1fr);
  gap: 18px; max-width: 920px; margin: 0 auto; padding: 6px 4px 10px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.reelgrid::-webkit-scrollbar { display: none; }
@media (min-width: 921px) {
  /* On wide screens show all six without scrolling. */
  .reelgrid { grid-auto-flow: row; grid-template-columns: repeat(6, 1fr); grid-auto-columns: auto; }
}
.reelcard {
  position: relative; aspect-ratio: 9 / 16; border: 0; padding: 0; cursor: pointer;
  border-radius: 18px; overflow: hidden; background: #000; scroll-snap-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease);
}
.reelcard:hover, .reelcard:focus-visible {
  transform: translateY(-6px) scale(1.02); outline: none;
  box-shadow: 0 18px 44px rgba(79, 70, 229, .5), 0 0 0 2px var(--indigo-400);
}
.reelcard__img { position: absolute; top: 50%; left: 50%; width: 178%; height: 100%; transform: translate(-50%, -50%); object-fit: cover; }
.reelcard__shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.6), transparent 45%), linear-gradient(to bottom, rgba(0,0,0,.35), transparent 30%); }
.reelcard__play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 54px; height: 54px; border-radius: 50%;
  background: rgba(255, 255, 255, .92); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .4); transition: transform .2s var(--ease), background .2s;
}
.reelcard__play::before {
  content: ""; border-style: solid; border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent var(--indigo-700); margin-left: 4px;
}
.reelcard:hover .reelcard__play { transform: translate(-50%, -50%) scale(1.12); background: #fff; }
.reelcard__pill {
  position: absolute; top: 10px; left: 10px;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--indigo-500), var(--indigo-700));
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}
.reelcard__cap { position: absolute; left: 12px; bottom: 12px; color: #fff; font-weight: 700; font-size: 13px; text-shadow: 0 1px 4px rgba(0, 0, 0, .7); }

/* Reels player modal (lightbox) — native YouTube controls work here */
.reelmodal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.reelmodal[hidden] { display: none; }
.reelmodal__backdrop { position: absolute; inset: 0; background: rgba(7, 7, 12, .82); backdrop-filter: blur(8px); animation: fadeIn .2s var(--ease); }
.reelmodal__stage { position: relative; z-index: 1; animation: popIn .26s var(--ease); }
.reelmodal__frame {
  width: min(92vw, 380px); aspect-ratio: 9 / 16; max-height: 86vh;
  border-radius: 22px; overflow: hidden; background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .08);
}
.reelmodal__slot, .reelmodal__slot iframe { width: 100%; height: 100%; border: 0; display: block; }
.reelmodal__close {
  position: absolute; top: -6px; right: -6px; transform: translate(50%, -50%);
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer; color: #fff;
  background: rgba(0, 0, 0, .65); border: 1px solid rgba(255, 255, 255, .25);
  display: flex; align-items: center; justify-content: center; backdrop-filter: blur(6px);
  transition: background .2s, transform .14s var(--ease);
}
.reelmodal__close:hover { background: var(--indigo-600); }
.reelmodal__close:active { transform: translate(50%, -50%) scale(.9); }
@media (max-width: 520px) {
  .reelmodal__close { top: 10px; right: 10px; transform: none; }
  .reelmodal__close:active { transform: scale(.9); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center; }
.stat { padding: 24px 12px; }
.stat b { display: block; font-size: clamp(34px, 5vw, 52px); font-weight: 900; letter-spacing: -.03em; color: var(--indigo-600); line-height: 1; }
.stat span { color: var(--ink-soft); font-weight: 600; font-size: 14px; }

/* Final CTA */
.cta { position: relative; isolation: isolate; padding: 96px 0; text-align: center; color: #fff; overflow: hidden;
  background: radial-gradient(900px 500px at 50% 0%, #4338CA, transparent 60%), linear-gradient(180deg, #312E81, #1E1B4B); }
.cta__glow { position: absolute; z-index: -1; inset: 0; background: radial-gradient(400px 300px at 50% 110%, rgba(245, 158, 11, .25), transparent 70%); }
.cta__fox { width: 130px; height: 130px; margin: 0 auto 8px; }
.cta h2 { font-size: clamp(30px, 5vw, 52px); font-weight: 900; letter-spacing: -.03em; line-height: 1.05; }
.cta p { margin: 14px auto 30px; color: rgba(255, 255, 255, .8); font-size: 18px; max-width: 40ch; }
.cta__btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* Footer */
.footer { background: var(--dark); color: rgba(255, 255, 255, .7); padding: 40px 0; }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.footer__brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: #fff; }
.footer__brand img { border-radius: 8px; }
.footer__links { display: flex; flex-wrap: wrap; gap: 20px; margin-left: auto; }
.footer__links a { font-size: 14px; font-weight: 600; transition: color .2s; }
.footer__links a:hover { color: #fff; }
.footer__legal { flex-basis: 100%; font-size: 13px; color: rgba(255, 255, 255, .45); border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 18px; }

/* ---------------- Reveal animation ---------------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .hero { padding: 130px 0 70px; text-align: center; }
  .hero__inner { grid-template-columns: 1fr; gap: 50px; }
  .hero__copy { display: flex; flex-direction: column; align-items: center; }
  .hero__sub { max-width: 42ch; }
  .hero__cta { justify-content: center; }
  .nav__links { display: none; }
  .steps { grid-template-columns: 1fr; }
  .lessons { grid-template-columns: 1fr; text-align: center; }
  .ticks { align-items: center; }
  .ticks li { text-align: left; }
}
@media (max-width: 620px) {
  .container { padding: 0 18px; }
  .game-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .section { padding: 64px 0; }
  .btn--lg { padding: 15px 22px; }
  .footer__links { margin-left: 0; flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
