/* The Quiz Club — landing page (index.html only).
   Loaded AFTER styles.css: tokens, .card, .btn and .badge come from there
   verbatim; this file adds only what the landing needs on top.

   The page is a slide deck: the body never scrolls, the .track holds all
   slides stacked vertically and moves one viewport at a time. A slide whose
   content overflows scrolls INTERNALLY first — flipping only happens at its
   edge, so nothing is ever unreachable. prefers-reduced-motion (and no-JS)
   degrades to a plain scrolling page. */

body.landing {
  --cyan: #35e6ff;
  --dimmer: rgba(255,255,255,.4);
  font-size: 16px;
  line-height: 1.6;
}

body.landing.deck-mode { overflow: hidden; height: 100svh; }
.deck {
  /* The body's gradient sits behind fixed children just fine, but Safari
     repaints it per-scroll on `fixed` attachments — the deck carries the
     night-sky gradient itself so the projector surface is always covered. */
  background: linear-gradient(180deg, var(--bg-top), var(--bg));
}
.deck-mode .deck { position: fixed; inset: 0; overflow: hidden; }
.deck-mode .track {
  height: 100svh;
  transform: translateY(calc(var(--i, 0) * -100svh));
  transition: transform .68s cubic-bezier(.66, 0, .34, 1);
}

body.landing a { color: #c3a8ff; text-decoration: none; }
body.landing a:hover { color: #ddcbff; }
/* .btn / .storebtn are anchors here — win back their own text colours from
   the generic link rule above (body.landing a outweighs plain .btn). */
body.landing a.btn { color: var(--on-primary); }
body.landing a.btn.secondary { color: var(--on); }
body.landing a.btn.amber { color: var(--on-secondary); }
body.landing a:focus-visible, body.landing button:focus-visible, body.landing input:focus-visible {
  outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px;
}
.badge.green { color: var(--success); background: rgba(46,199,121,.16); }

/* ---- slides ---- */
.slide {
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding: 84px 24px 56px; position: relative;
}
.deck-mode .slide { height: 100svh; overflow-y: auto; overscroll-behavior: contain; }
/* justify-content:center would clip the top of overflowing content — auto
   margins centre short slides and let tall ones scroll instead. */
.slide-inner { margin: auto 0; width: 100%; max-width: 1080px; }
.hero.slide-inner, .closing.slide-inner { margin: auto; }

.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.slide.on .reveal { opacity: 1; transform: none; }
.slide.on .reveal:nth-child(2) { transition-delay: .1s; }
.slide.on .reveal:nth-child(3) { transition-delay: .2s; }
.slide.on .reveal:nth-child(4) { transition-delay: .3s; }
/* Reduced motion: the deck never engages (landing.js checks the same query),
   these rules are the belt to that suspenders. */
@media (prefers-reduced-motion: reduce) {
  body.landing.deck-mode { overflow: auto; height: auto; }
  .deck-mode .deck { position: static; }
  .deck-mode .track { transform: none !important; transition: none !important; height: auto; }
  .deck-mode .slide { height: auto; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* dot rail, like a deck's progress */
.rail {
  position: fixed; right: 18px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 10px; z-index: 30;
}
.rail a {
  width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.22);
  display: block; transition: background .2s, box-shadow .2s;
}
.rail a[aria-current="true"] { background: var(--cyan); box-shadow: 0 0 10px rgba(53,230,255,.6); }
@media (max-width: 720px) { .rail { display: none; } }

/* ---- fixed top bar ---- */
.topnav {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 24px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--outline);
}
.brand-link { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 16px; }
body.landing .brand-link { color: var(--on); }
.brand-owl { height: 40px; width: 40px; display: block; }
.nav-links { display: flex; gap: 22px; align-items: center; font-size: 14px; }
body.landing .nav-links a { color: var(--muted); }
body.landing .nav-links a:hover { color: var(--on); }
body.landing .nav-links .signin {
  color: var(--on); border: 1px solid var(--surface-hi); background: var(--surface);
  border-radius: 999px; padding: 7px 16px; font-weight: 600;
  /* A pill is one word-shape: at 390px the flex row squeezed it and
     "Sign in" broke onto two lines inside its own capsule. */
  white-space: nowrap;
}
@media (max-width: 720px) { .nav-links a:not(.signin) { display: none; } }

/* landing form fields (team/host pages style input[type=…]; these carry no
   type attribute, so they get their own look — dark wells, original radius) */
input.fld {
  background: rgba(0,0,0,.3); border: 1px solid var(--outline); border-radius: 14px;
  padding: 14px 16px; color: var(--on); font: inherit; font-size: 16px; width: 100%;
}
input.fld:focus { border-color: var(--primary); outline: none; }
input.fld.code {
  text-align: center; letter-spacing: .3em; font-weight: 800; text-transform: uppercase; color: var(--cyan);
}

/* ================= slide 1: hero ================= */
.hero { text-align: center; }
.hero .owl-hero { width: clamp(110px, 18vw, 170px); height: auto; margin: 0 auto 6px; display: block; }
.hero h1 {
  margin: 0; font-size: clamp(34px, 6.5vw, 56px); font-weight: 800; letter-spacing: .3px; line-height: 1.05;
  text-shadow: 0 0 10px rgba(0,240,255,.55), 0 0 28px rgba(0,240,255,.30);
}
.hero .tagline { margin: 14px auto 0; font-size: clamp(15px, 1.8vw, 18px); color: var(--muted); max-width: 46ch; text-wrap: balance; }
.hero .paths {
  margin: 30px auto 0; display: grid; gap: 12px; grid-template-columns: 1fr; max-width: 780px; text-align: left;
}
@media (min-width: 720px) { .hero .paths { grid-template-columns: 1fr 1fr; } }
.join-grid { display: grid; gap: 10px; grid-template-columns: 118px 1fr; }
.join-grid .btn { grid-column: 1 / -1; width: 100%; }
.join-err { margin: 8px 0 0; font-size: 13.5px; color: var(--danger); min-height: 1.2em; }
.path-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.path-h h2 { margin: 0; font-size: 17px; font-weight: 700; }
.path-copy { margin: 0 0 14px; font-size: 14.5px; }
.storebtn {
  display: flex; align-items: center; gap: 12px; border: 1px solid var(--surface-hi);
  background: rgba(0,0,0,.25); border-radius: 14px; padding: 12px 16px;
}
body.landing a.storebtn { color: var(--on); }
/* Apple mark as a currentColor mask (Simple Icons path) — U+F8FF only
   renders on Apple devices, this works everywhere. */
.storebtn .apple {
  width: 24px; height: 24px; flex: 0 0 auto; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701'/></svg>") no-repeat center / contain;
  mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701'/></svg>") no-repeat center / contain;
}
.storebtn .t { display: flex; flex-direction: column; line-height: 1.25; text-align: left; }
.storebtn .t small { font-size: 11px; color: var(--muted); }
.storebtn .t b { font-size: 15px; }
.store-note { margin: 8px 2px 0; font-size: 12.5px; }
/* Sticky, not absolute. `.slide` is a scroll container in deck mode, and an
   absolutely positioned child resolves `bottom` against the whole scrollable
   content box, not the visible part — so the hint drifted into the middle of
   the content instead of staying above the fold. Sticky pins it to the
   visible bottom edge; margin-top keeps it off the card above. */
.scrollhint {
  position: sticky; bottom: 22px; align-self: center;
  margin-top: 22px; padding-top: 6px;
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--dimmer);
}
/* …and gone entirely once the slide scrolls on its own: the hint promises a
   NEXT slide, but the first swipe would only move within this one, and it
   would sit on top of the join button while saying so (landing.js sets the
   class — CSS can't ask whether a box overflows). */
.slide.is-overflowing .scrollhint { display: none; }
/* …and also when the slide fits but only JUST: the sticky anchor would lift
   the hint into the cards above (landing.js measures the real gap). */
.scrollhint.is-cramped { display: none; }

/* ================= slide 2: the game ================= */
.sec-h { text-align: center; margin-bottom: 34px; }
.sec-h .badge { margin-bottom: 12px; display: inline-block; }
.sec-h h2 { margin: 0; font-size: clamp(26px, 3.6vw, 36px); font-weight: 800; letter-spacing: -.01em; text-wrap: balance; }
.sec-h p { margin: 10px auto 0; color: var(--muted); max-width: 56ch; }

.devices { position: relative; display: grid; place-items: center; }
.tv {
  width: min(760px, 82%); aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden;
  background: linear-gradient(180deg, #241a49, #14102a 70%);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 0 0 6px #06050c, 0 0 0 7px rgba(255,255,255,.08), 0 30px 70px rgba(0,0,0,.55);
  display: flex; flex-direction: column; padding: 2.6% 3%;
  container-type: inline-size;
}
.tv-top { display: flex; justify-content: space-between; font-size: clamp(9px, 1.3cqw, 13px); color: var(--muted); }
.tv-top .r { letter-spacing: .13em; text-transform: uppercase; font-weight: 700; color: #c3a8ff; }
.tv-top .t { color: var(--success); font-weight: 800; }
.tv-q { flex: 1; display: grid; place-content: center; text-align: center; padding: 0 5%; }
.tv-q p { margin: 0; font-size: clamp(14px, 3.2cqw, 30px); font-weight: 800; line-height: 1.22; text-wrap: balance; }
.tv-opts { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(5px, .8cqw, 10px); }
.tv-opt {
  background: var(--surface); border-radius: 10px;
  padding: clamp(6px, 1cqw, 12px) clamp(9px, 1.4cqw, 16px);
  font-size: clamp(9px, 1.4cqw, 15px); font-weight: 600; display: flex; gap: .6em;
}
.tv-opt b { color: #c3a8ff; }
.phone {
  position: absolute; right: max(0px, 6%); bottom: -8%;
  width: clamp(120px, 19%, 170px); border-radius: 22px; padding: 7px; background: #26232f;
  border: 1px solid rgba(255,255,255,.1); box-shadow: 0 22px 50px rgba(0,0,0,.6);
}
.phone-screen {
  border-radius: 16px; overflow: hidden; aspect-ratio: 9 / 18.5;
  background: linear-gradient(180deg, var(--bg-top), var(--bg) 70%);
  padding: 12px 10px; display: flex; flex-direction: column; gap: 7px;
  container-type: inline-size;
}
.phone-q { font-size: 8.5cqw; font-weight: 800; line-height: 1.25; margin: 2px 2px 4px; }
.phone-opt {
  background: var(--surface); border-radius: 9px; padding: 7px 9px; font-size: 7.5cqw; font-weight: 600;
}
.phone-opt.sel { border: 2px solid var(--primary); background: rgba(140,92,245,.18); }
.phone-send { margin-top: auto; background: var(--primary); color: var(--on-primary); border-radius: 9px; text-align: center; padding: 8px; font-weight: 800; font-size: 7.5cqw; }

.featurerow { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: clamp(40px, 8vh, 72px); }
.feat {
  display: flex; align-items: center; gap: 9px; background: var(--surface); border: 1px solid var(--outline);
  border-radius: 999px; padding: 9px 16px; font-size: 14px; font-weight: 600;
}
.feat span { font-size: 17px; }

/* ================= slide 3: library ================= */
.kpis { display: grid; gap: 14px; grid-template-columns: 1fr; margin-bottom: 26px; }
@media (min-width: 720px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
.kpi { text-align: center; padding: 22px 18px; }
.kpi .n { font-size: clamp(34px, 4.6vw, 46px); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; display: block; }
.kpi.official .n { color: var(--cyan); text-shadow: 0 0 20px rgba(53,230,255,.35); }
.kpi.community .n { color: var(--secondary); text-shadow: 0 0 20px rgba(250,158,74,.3); }
.kpi.fresh .n { color: var(--success); text-shadow: 0 0 20px rgba(46,199,121,.3); }
.kpi .t { display: block; margin-top: 8px; font-weight: 700; font-size: 15px; }
.kpi .s { display: block; margin-top: 3px; font-size: 13px; color: var(--muted); }

.toplist { padding: 6px 0; }
.top-h {
  display: grid; grid-template-columns: 44px 1fr 150px 92px 90px; gap: 14px; align-items: center;
  padding: 10px 20px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--dimmer); font-weight: 700;
}
.toprow {
  display: grid; grid-template-columns: 44px 1fr 150px 92px 90px; gap: 14px; align-items: center;
  padding: 13px 20px; border-top: 1px solid var(--outline); font-size: 15px;
}
.toprow .pos { font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.toprow .q { font-weight: 700; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.toprow .who { color: #c3a8ff; font-size: 13.5px; }
.toprow .who.us { color: var(--cyan); }
.toprow .plays { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; }
.toprow .stars { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--secondary); }
.toprow .stars span { color: var(--dimmer); font-weight: 400; font-size: 12.5px; }
@media (max-width: 720px) {
  .top-h { display: none; }
  .toprow { grid-template-columns: 30px 1fr auto; }
  .toprow .who, .toprow .plays { display: none; }
}

/* ================= slide 4: publish ================= */
.pub { display: grid; gap: 30px; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 860px) { .pub { grid-template-columns: 1.15fr .85fr; } }
.pub h2 { margin: 0 0 12px; font-size: clamp(26px, 3.4vw, 34px); font-weight: 800; letter-spacing: -.01em; text-wrap: balance; }
.pub p { margin: 0 0 18px; color: var(--muted); max-width: 50ch; }
.pub .actions { display: flex; gap: 12px; flex-wrap: wrap; }
/* styles.css .btn is width:100% (phone-first team client) — action rows on
   these slides want shelf buttons, not full-bleed bars. */
.pub .actions .btn, .closing .actions .btn { width: auto; min-width: 190px; padding-left: 26px; padding-right: 26px; text-decoration: none; }
.editor-mock { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.em-row { display: flex; gap: 8px; align-items: center; }
.em-title { font-weight: 800; font-size: 15px; flex: 1; }
.em-q {
  background: var(--surface-hi); border-radius: 12px; padding: 11px 14px; font-size: 13.5px;
  display: flex; justify-content: space-between; gap: 10px; align-items: center;
}
.em-q .muted { font-size: 12px; }
.em-add { border: 1px dashed var(--surface-hi); border-radius: 12px; padding: 10px; text-align: center; color: var(--muted); font-size: 13px; }
.em-publish { align-self: flex-end; min-height: 0; font-size: 14px; padding: 10px 18px; }

/* ================= slide 5: closing ================= */
.closing { text-align: center; }
.closing .owl-sm { width: 84px; margin: 0 auto 14px; display: block; }
.closing h2 { margin: 0 0 26px; font-size: clamp(28px, 4.4vw, 42px); font-weight: 800; }
.closing .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.closing footer { margin-top: clamp(46px, 9vh, 90px); font-size: 13px; color: var(--dimmer); }
.closing footer .links { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
body.landing .closing footer a { color: var(--dimmer); }
body.landing .closing footer a:hover { color: var(--on); }
