/* ==========================================================================
   Quiz — کوییز | Landing Page Stylesheet
   Design language: Modern Neon Glass Gaming UI (mobile-first, RTL)
   ========================================================================== */

@font-face {
  font-family: 'IRANSansX';
  src: url('../fonts/IRANSansX-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IRANSansX';
  src: url('../fonts/IRANSansX-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* base */
  --qz-bg: #14102A;
  --qz-bg-alt: #1D1740;
  --qz-surface: #2A2158;
  --qz-surface-2: #221B45;
  --qz-text: #EFEAF6;
  --qz-muted: #A79ABF;
  --qz-muted-2: #7E7297;
  --qz-divider: rgba(239, 234, 246, .12);
  --qz-divider-soft: rgba(239, 234, 246, .08);

  /* accents */
  --qz-violet: #A06BD8;
  --qz-violet-300: #D9BEF4;
  --qz-violet-700: #663596;
  --qz-magenta: #C93AA0;
  --qz-magenta-300: #EC8FCC;
  --qz-gold: #E2A93B;
  --qz-cream: #F5F2EC;
  --qz-correct: #4FA37E;
  --qz-wrong: #D1555F;
  --qz-grad: linear-gradient(135deg, #A06BD8, #C93AA0);

  /* radii */
  --qz-r-sm: 10px;
  --qz-r-md: 16px;
  --qz-r-lg: 24px;
  --qz-r-pill: 999px;

  /* shadow / glow */
  --qz-shadow-sm: 0 0 0 1px rgba(239, 234, 246, .09);
  --qz-shadow-md: 0 0 0 1px rgba(239, 234, 246, .10), 0 10px 28px rgba(0, 0, 0, .45);
  --qz-shadow-lg: 0 0 0 1px rgba(160, 107, 216, .30), 0 26px 60px rgba(0, 0, 0, .60);
  --qz-glow: 0 0 42px rgba(201, 58, 160, .30);

  /* layout */
  --qz-max: 1120px;
  --qz-gutter: 20px;
  --qz-header-h: 64px;
  --qz-toolbar-h: 66px;

  color-scheme: dark;
}

@media (min-width: 720px) {
  :root { --qz-gutter: 40px; }
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { direction: rtl; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--qz-bg);
  color: var(--qz-text);
  font-family: 'IRANSansX', 'Vazirmatn', system-ui, sans-serif;
  font-size: 15.5px;
  line-height: 1.85;
  overflow-x: hidden;
}
/* ambient background: fixed so its glow stays consistent behind every
   section as the page scrolls, replacing hard alternating section colors
   with one continuous, softly-lit backdrop. */
.bg-decor {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(46vmax 46vmax at 10% 12%, rgba(160, 107, 216, .24), transparent 68%),
    radial-gradient(50vmax 50vmax at 92% 6%, rgba(201, 58, 160, .18), transparent 70%),
    radial-gradient(38vmax 38vmax at 86% 82%, rgba(226, 169, 59, .14), transparent 70%),
    radial-gradient(44vmax 44vmax at 6% 88%, rgba(160, 107, 216, .16), transparent 70%),
    var(--qz-bg);
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }
::selection { background: rgba(160, 107, 216, .34); }

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--qz-violet);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  right: 12px;
  top: -60px;
  z-index: 200;
  background: var(--qz-surface);
  color: var(--qz-text);
  padding: 12px 18px;
  border-radius: var(--qz-r-sm);
  box-shadow: var(--qz-shadow-md);
  transition: top .2s ease;
}
.skip-link:focus { top: 12px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- layout helpers ---------- */
.wrap {
  max-width: var(--qz-max);
  margin: 0 auto;
  padding: 0 var(--qz-gutter);
}
.section { padding: 64px 0; scroll-margin-top: 84px; position: relative; z-index: 1; }
.section--alt { background: rgba(29, 23, 64, .55); }
@media (min-width: 860px) { .section { padding: 96px 0; } }

.section__head { max-width: 60ch; margin: 0 0 32px; }
.section__kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--qz-violet-300);
  margin: 0 0 12px;
}
.section__title {
  font-size: clamp(26px, 4.4vw, 34px);
  font-weight: 700;
  line-height: 1.32;
  margin: 0 0 12px;
}
.section__lead {
  font-size: 16px;
  color: var(--qz-muted);
  line-height: 1.85;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0; padding: 0; margin: -1px;
}

.icon { width: 1em; height: 1em; fill: currentColor; flex: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  padding: 14px 26px;
  border-radius: var(--qz-r-pill);
  border: 1px solid transparent;
  transition: transform .16s ease, background .2s ease, box-shadow .2s ease, border-color .2s ease;
  white-space: nowrap;
  min-height: 48px;
}
.btn--primary {
  position: relative;
  overflow: hidden;
  background: var(--qz-grad);
  color: #fff;
  font-size: 16px;
  padding: 16px 30px;
  box-shadow: var(--qz-glow);
}
.btn--primary::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 -30%;
  width: 55px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .28), transparent);
  animation: qz-shine 4.2s ease-in-out infinite;
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 0 56px rgba(201, 58, 160, .46); }
.btn--primary:active { transform: translateY(0) scale(.97); }

.btn--outline { border-color: var(--qz-violet); color: var(--qz-violet-300); }
.btn--outline:hover { background: rgba(160, 107, 216, .14); }

.btn--quiet { border-color: var(--qz-divider); color: #CDC7DA; }
.btn--quiet:hover { background: rgba(239, 234, 246, .07); }

.btn--block { width: 100%; }
.btn--sm { padding: 11px 18px; min-height: 40px; font-size: 13.5px; }

/* store buttons */
.store-row { display: flex; flex-wrap: wrap; gap: 12px; }
.store-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-radius: var(--qz-r-md);
  background: var(--qz-surface);
  box-shadow: var(--qz-shadow-sm);
  border: 1px solid transparent;
  transition: transform .18s ease, border-color .2s ease, background .2s ease;
  min-height: 56px;
  flex: 1 1 200px;
}
.store-btn:hover { transform: translateY(-3px); border-color: rgba(160, 107, 216, .4); }
.store-btn__icon {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: rgba(160, 107, 216, .16);
  color: var(--qz-violet-300);
  font-size: 18px;
}
.store-btn__text { display: flex; flex-direction: column; gap: 1px; }
.store-btn__label { font-size: 11px; color: var(--qz-muted); }
.store-btn__name { font-size: 14.5px; font-weight: 700; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--qz-header-h);
  display: flex;
  align-items: center;
  background: rgba(20, 16, 42, 0);
  border-bottom: 1px solid transparent;
  transition: background .25s ease, border-color .25s ease, backdrop-filter .25s ease;
}
.site-header.is-scrolled {
  background: rgba(20, 16, 42, .86);
  border-color: var(--qz-divider-soft);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.site-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.brand__mark {
  width: 34px; height: 34px; border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(201, 58, 160, .42);
  flex: none;
  object-fit: cover;
}

.main-nav { display: none; align-items: center; gap: 28px; font-size: 14.5px; }
.main-nav a { color: #CDC7DA; transition: color .18s ease; padding: 4px 0; }
.main-nav a:hover { color: var(--qz-text); }
@media (min-width: 900px) { .main-nav { display: flex; } }

.header-cta { display: inline-flex; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  z-index: 1;
  padding: 40px 0 64px;
  overflow: hidden;
}
@media (min-width: 860px) { .hero { padding: 64px 0 96px; } }

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 560px at 85% -10%, #3A2076 0%, rgba(20, 16, 42, 0) 60%),
    radial-gradient(700px 460px at 0% 40%, #2A1A55 0%, rgba(20, 16, 42, 0) 60%);
}
.hero__float {
  position: absolute;
  border-radius: 28%;
  filter: blur(.5px);
  opacity: .5;
  animation: qz-float 9s ease-in-out infinite;
  z-index: -1;
}
.hero__grid { display: block; text-align: center; }
.hero__content { max-width: 640px; margin: 0 auto; }

.hero__kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: .14em;
  color: var(--qz-violet-300);
  padding: 7px 14px;
  border: 1px solid rgba(160, 107, 216, .35);
  border-radius: var(--qz-r-pill);
  margin: 0 0 22px;
}
.hero__title {
  font-size: clamp(32px, 7vw, 54px);
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -.01em;
  margin: 0 0 20px;
}
.hero__title em {
  font-style: normal;
  background: var(--qz-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__lead {
  font-size: 17.5px;
  color: var(--qz-muted);
  max-width: 54ch;
  margin: 0 auto 30px;
}
.hero__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-bottom: 26px; }

/* ---------- card grids ---------- */
.grid-3 { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.grid-2 { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }

.card {
  display: flex; flex-direction: column; gap: 12px;
  padding: 26px;
  border-radius: var(--qz-r-md);
  background: var(--qz-surface);
  box-shadow: var(--qz-shadow-md);
  transition: transform .22s ease, box-shadow .22s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 0 0 1px rgba(160,107,216,.36), 0 20px 44px rgba(0,0,0,.5); }
.card__icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(160, 107, 216, .16);
  color: var(--qz-violet-300);
  font-size: 22px;
}
.card__title { font-size: 19px; font-weight: 700; }
.card__text { font-size: 14.5px; color: var(--qz-muted); }

/* chips: generic pill-list for short examples (quiz topics, badge names, ...) */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0 0;
}
.chips li {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--qz-violet-300);
  padding: 9px 18px;
  border-radius: var(--qz-r-pill);
  background: var(--qz-surface);
  box-shadow: var(--qz-shadow-sm);
}

/* competition cards (media style) */
.compete-card {
  display: flex; flex-direction: column; gap: 16px;
  padding: 28px;
  border-radius: var(--qz-r-lg);
  background: linear-gradient(150deg, #2E2560, var(--qz-surface));
  box-shadow: var(--qz-shadow-md);
}
.compete-card__icon {
  width: 54px; height: 54px; border-radius: 14px;
  display: grid; place-items: center;
  background: rgba(201, 58, 160, .16);
  color: var(--qz-magenta-300);
  font-size: 26px;
}
.compete-card__title { font-size: 20px; font-weight: 700; }
.compete-card__text { font-size: 14.5px; color: var(--qz-muted); }

/* league cards */
.league-card {
  position: relative;
  overflow: hidden;
  padding: 30px 26px;
  border-radius: var(--qz-r-lg);
  color: #fff;
  box-shadow: var(--qz-shadow-lg);
  display: flex; flex-direction: column; gap: 14px;
  min-height: 220px;
}
.league-card--speed { background: linear-gradient(150deg, #3B2A6B 10%, #A06BD8 140%); }
.league-card--skill { background: linear-gradient(150deg, #5E1849 10%, #C93AA0 140%); }
.league-card__bg {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
}
.league-card--speed .league-card__bg { mix-blend-mode: screen; opacity: .55; }
.league-card--skill .league-card__bg { mix-blend-mode: luminosity; opacity: .5; }
.league-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20,16,42,.1) 0%, rgba(20,16,42,.78) 100%);
  z-index: 1;
}
.league-card__icon, .league-card__title, .league-card__text, .league-card__tag {
  position: relative;
  z-index: 2;
}
.league-card__icon { font-size: 30px; }
.league-card__title { font-size: 22px; font-weight: 700; }
.league-card__text { font-size: 14.5px; color: rgba(255,255,255,.82); max-width: 34ch; }
.league-card__tag {
  align-self: flex-start;
  font-size: 12px; font-weight: 700;
  padding: 6px 12px; border-radius: var(--qz-r-pill);
  background: rgba(255,255,255,.16);
  margin-top: auto;
}

/* events */
.event-card {
  padding: 24px;
  border-radius: var(--qz-r-md);
  background: var(--qz-bg-alt);
  box-shadow: var(--qz-shadow-sm);
  display: flex; flex-direction: column; gap: 10px;
}
.event-card .card__icon { background: rgba(226, 169, 59, .16); color: var(--qz-gold); }

/* baham */
.baham {
  display: grid; gap: 24px;
  align-items: center;
  padding: 30px;
  border-radius: var(--qz-r-lg);
  background: var(--qz-bg-alt);
  box-shadow: var(--qz-shadow-sm);
}
@media (min-width: 780px) { .baham { grid-template-columns: auto 1fr; padding: 40px; gap: 34px; } }
.baham__badge {
  width: 64px; height: 64px; border-radius: 18px;
  display: grid; place-items: center;
  background: var(--qz-grad);
  color: #fff; font-size: 30px;
  box-shadow: var(--qz-glow);
  flex: none;
}
.baham__title { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.baham__text { font-size: 14.5px; color: var(--qz-muted); max-width: 62ch; }

/* download section */
.download {
  position: relative;
  text-align: center;
  padding: 72px 0;
  border-radius: var(--qz-r-lg);
  overflow: hidden;
  background: radial-gradient(700px 340px at 50% -20%, rgba(201,58,160,.28), transparent 70%), var(--qz-bg-alt);
}
/* ambient glow that eases in once the section scrolls into view, and eases back
   out on the way to any other section — a smooth, one-spot accent instead of a
   per-section color change. z-index:-1 keeps it under the text within .download's
   own stacking context, no extra markup needed. */
.download::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  background:
    radial-gradient(900px 480px at 50% 8%, rgba(201, 58, 160, .55), transparent 65%),
    radial-gradient(560px 340px at 12% 95%, rgba(226, 169, 59, .28), transparent 62%),
    radial-gradient(560px 340px at 88% 95%, rgba(160, 107, 216, .32), transparent 62%);
  transition: opacity 1.3s ease;
}
.download.is-inview::before { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .download::before { transition: none; } }
.download__kicker {
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--qz-magenta-300);
  margin: 0 0 14px;
}
.download__title { font-size: clamp(26px, 5vw, 38px); font-weight: 700; margin: 0 0 14px; }
.download__lead { color: var(--qz-muted); max-width: 52ch; margin: 0 auto 30px; font-size: 16px; }
.download .store-row { justify-content: center; max-width: 620px; margin: 0 auto; }

/* footer */
.site-footer { position: relative; z-index: 1; padding: 48px 0 calc(48px + env(safe-area-inset-bottom)); border-top: 1px solid var(--qz-divider-soft); background: var(--qz-bg); }
.site-footer__top { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; margin-bottom: 28px; }
.site-footer__brand { display: flex; flex-direction: column; gap: 10px; max-width: 42ch; }
.site-footer__desc { font-size: 13.5px; color: var(--qz-muted); }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: 13.5px; }
.site-footer__links a { color: #CDC7DA; }
.site-footer__links a:hover { color: var(--qz-text); }
.site-footer__bottom {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between;
  padding-top: 22px; border-top: 1px solid var(--qz-divider-soft);
  font-size: 12.5px; color: var(--qz-muted-2);
}
@media (max-width: 899px) { .site-footer { padding-bottom: calc(var(--qz-toolbar-h) + 24px + env(safe-area-inset-bottom)); } }

/* ---------- bottom glass toolbar (mobile) ---------- */
.toolbar {
  position: fixed;
  left: 12px; right: 12px; bottom: 12px;
  z-index: 80;
  height: var(--qz-toolbar-h);
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(30, 24, 62, .82);
  border: 1px solid rgba(239, 234, 246, .12);
  border-radius: var(--qz-r-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 12px 30px rgba(0,0,0,.45);
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 900px) { .toolbar { display: none; } }
.toolbar a {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 11px; color: var(--qz-muted);
  padding: 6px 10px;
  min-width: 56px;
  border-radius: 12px;
}
.toolbar a .icon { font-size: 19px; }
.toolbar a.is-active { color: var(--qz-text); }
.toolbar a.is-active .icon { color: var(--qz-magenta-300); }

/* ---------- reveal-on-scroll ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .55s cubic-bezier(.22,.61,.36,1), transform .55s cubic-bezier(.22,.61,.36,1); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ---------- keyframes ---------- */
@keyframes qz-float { 0%, 100% { transform: translate3d(0,0,0) rotate(0deg); } 50% { transform: translate3d(10px,-16px,0) rotate(6deg); } }
@keyframes qz-shine { 0% { transform: translateX(-140%) skewX(-18deg); } 55%, 100% { transform: translateX(420%) skewX(-18deg); } }
