/* DaneshDuel landing. Tokens are DESIGN.md's; hex values appear only in :root. */
:root {
  --lapis: #14244F;
  --lapis-deep: #0E1938;
  --surface: #1D3368;
  --raised: #27417F;
  --selected: #1E4A73;
  --you: #1FC7B6;
  --you-shadow: #12917F;
  --on-you: #0B1A3A;
  --opponent: #E5484D;
  --opponent-shadow: #9E2A2E;
  --opponent-text: #F59A9D;
  --saffron: #F5B82E;
  --saffron-shadow: #B9821A;
  --correct: #8FD14F;
  --silver: #CFD8E6;
  --silver-shadow: #8996AD;
  --text: #F4F1E8;
  --text-muted: #9DACCB;
  --disabled-fill: #4A6296;
  --you-tint: rgba(31, 199, 182, 0.14);
  --opponent-tint: rgba(229, 72, 77, 0.16);
  --saffron-tint: rgba(245, 184, 46, 0.12);

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-full: 9999px;
  --s-xs: 4px;
  --s-sm: 8px;
  --s-md: 16px;
  --s-lg: 24px;
  --s-xl: 32px;
  --s-2xl: 48px;
}

/* @font-face lives in App.razor so the font URLs are fingerprinted (@Assets) and cached long-term. */

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

html { background: var(--lapis); color: var(--text); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--lapis);
  color: var(--text);
  font-family: "Vazirmatn", Tahoma, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  font-variant-numeric: tabular-nums;
}

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

a { color: inherit; }

h1, h2, h3, p, ul, ol { margin: 0; }

.display { font-family: "Lalezar", "Vazirmatn", sans-serif; font-weight: 400; line-height: 1.1; }

.container { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: var(--s-md); }

.section { padding-block: var(--s-2xl); }

.section-title { font-size: 32px; margin-bottom: var(--s-md); }

.lead { font-size: 18px; font-weight: 700; }

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

.text-link { color: var(--you); font-weight: 700; text-underline-offset: 4px; }

/* Header and footer */
.site-header { padding-block: var(--s-md); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: var(--s-md); }
.brand { display: flex; align-items: center; gap: var(--s-sm); text-decoration: none; }
.brand img { width: 40px; height: 40px; border-radius: var(--r-sm); }
.brand span { font-family: "Lalezar", "Vazirmatn", sans-serif; font-size: 24px; line-height: 1; }
.site-nav { display: flex; gap: var(--s-md); font-size: 13px; font-weight: 700; }
.site-nav a { color: var(--text-muted); text-decoration: none; }
.site-footer { padding-block: var(--s-xl); border-top: 1px solid var(--surface); font-size: 13px; color: var(--text-muted); }
.site-footer .container { display: flex; flex-wrap: wrap; gap: var(--s-md); justify-content: space-between; }
.site-footer nav { display: flex; gap: var(--s-md); }
.site-footer a { color: var(--text-muted); }
/* DESIGN.md: touch targets of at least 48 px, also for small text links. */
.site-nav a, .site-footer nav a { display: inline-flex; align-items: center; min-height: 48px; padding-inline: var(--s-xs); }

/* Buttons: a hard 4px shadow with no blur that collapses when pressed (DESIGN.md Elevation). */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-sm);
  min-height: 60px;
  padding-inline: var(--s-lg);
  border-radius: var(--r-md);
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 80ms ease-out, box-shadow 80ms ease-out;
}
.btn-primary { background: var(--you); color: var(--on-you); box-shadow: 0 4px 0 var(--you-shadow); }
.btn:active { transform: translateY(4px); box-shadow: none; }
.btn:focus-visible, .text-link:focus-visible, .site-nav a:focus-visible, .site-footer a:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 3px;
}

/* Chips and cards */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-xs);
  padding: var(--s-xs) var(--s-md);
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 700;
  background: var(--surface);
}
.chip svg { width: 16px; height: 16px; }
.chip-silver { color: var(--silver); box-shadow: inset 0 0 0 2px var(--silver); }
.chip-gold { color: var(--saffron); box-shadow: inset 0 0 0 2px var(--saffron); }

.card { background: var(--surface); border-radius: var(--r-lg); padding: var(--s-lg); }
.card h3 { font-size: 18px; font-weight: 800; margin-bottom: var(--s-sm); }
.card p { color: var(--text-muted); }
.card svg { width: 32px; height: 32px; color: var(--you); margin-bottom: var(--s-md); }

/* Long-form pages */
.prose { max-width: 720px; }
.prose h1 { font-size: 40px; margin-bottom: var(--s-lg); }
.prose h2 { font-size: 20px; font-weight: 800; margin-top: var(--s-xl); margin-bottom: var(--s-sm); }
.prose p, .prose ul { margin-bottom: var(--s-md); }
.prose ul { padding-inline-start: var(--s-lg); }
.prose li + li { margin-top: var(--s-xs); }

.faq details { background: var(--surface); border-radius: var(--r-md); padding: var(--s-md); }
.faq details + details { margin-top: var(--s-sm); }
.faq summary { font-weight: 800; cursor: pointer; }
.faq details p { margin-top: var(--s-sm); color: var(--text-muted); }

.not-found { padding-block: var(--s-2xl); text-align: center; display: grid; gap: var(--s-md); justify-items: center; }
.not-found h1 { font-size: 40px; }

/* Hero */
.hero { position: relative; padding-block: var(--s-xl) var(--s-2xl); overflow: hidden; }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("img/khatam-tile.svg") repeat;
  background-size: 72px 72px;
  pointer-events: none;
}
.hero-grid { position: relative; display: grid; gap: var(--s-2xl); justify-items: center; text-align: center; }
.hero-copy { display: grid; gap: var(--s-md); justify-items: center; }
.hero-mark { width: 88px; height: 88px; border-radius: var(--r-lg); }
.hero-title { font-size: 72px; }
.hero-cta { display: grid; gap: var(--s-sm); justify-items: center; margin-top: var(--s-sm); }
.hero-note { font-size: 13px; font-weight: 700; }

/* Phone mockup */
.phone {
  width: min(100%, 320px);
  border-radius: 36px;
  background: var(--lapis-deep);
  padding: 10px;
  box-shadow: 0 6px 0 var(--lapis-deep);
}
.phone-screen { border-radius: 28px; background: var(--lapis); padding: var(--s-md); text-align: start; }

/* Duel bar */
.duel { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--s-sm); }
.duel-player { display: flex; align-items: center; gap: var(--s-xs); font-size: 13px; font-weight: 700; }
.duel-avatar { width: 28px; height: 28px; border-radius: var(--r-full); background: var(--raised); }
.duel-you .duel-avatar { box-shadow: 0 0 0 3px var(--you); }
.duel-opp .duel-avatar { box-shadow: 0 0 0 3px var(--opponent); }
.duel-score { font-size: 28px; }
.duel-you .duel-score { color: var(--you); }
.duel-opp .duel-score { color: var(--opponent); }
.duel-bar { display: flex; gap: 3px; height: 10px; padding: 0; border-radius: var(--r-full); background: var(--lapis-deep); overflow: hidden; }
.duel-bar-you { background: var(--you); }
.duel-bar-opp { background: var(--opponent); }

/* Question screen */
.q-screen { display: grid; gap: var(--s-md); }
.q-timer { display: flex; align-items: center; gap: var(--s-sm); font-size: 13px; font-weight: 700; color: var(--text-muted); }
.q-timer-track { flex: 1; height: 8px; border-radius: var(--r-full); background: var(--lapis-deep); overflow: hidden; display: flex; }
.q-timer-fill { width: 79%; background: var(--disabled-fill); }
.q-card { background: var(--surface); border-radius: var(--r-lg); padding: var(--s-md); display: grid; gap: var(--s-sm); }
.q-category { font-size: 13px; font-weight: 700; color: var(--text-muted); }
.q-text { font-size: 18px; font-weight: 800; line-height: 1.7; }
.q-options { list-style: none; padding: 0; display: grid; gap: var(--s-sm); }
.q-option {
  display: flex;
  align-items: center;
  gap: var(--s-sm);
  min-height: 48px;
  padding-inline: var(--s-md);
  border-radius: var(--r-md);
  font-size: 16px;
  font-weight: 700;
  background: var(--raised);
  box-shadow: 0 4px 0 var(--lapis-deep);
}
.q-option svg { width: 20px; height: 20px; }
.q-option-correct { background: var(--correct); color: var(--lapis); }
.q-option-dim { background: var(--surface); color: var(--text-muted); box-shadow: none; }

/* How it works */
.steps { list-style: none; padding: 0; display: grid; gap: var(--s-md); }
.step { position: relative; background: var(--surface); border-radius: var(--r-lg); padding: var(--s-lg); display: grid; gap: var(--s-sm); align-content: start; }
.step h3 { font-size: 18px; font-weight: 800; }
.step p { color: var(--text-muted); }
.step-num { font-size: 40px; color: var(--you); }
.step-seal { padding-bottom: 160px; }
.seal { position: absolute; inset-inline-start: var(--s-lg); bottom: var(--s-lg); width: 132px; height: 132px; transform: rotate(-9deg); }
.seal svg { width: 100%; height: 100%; }
.seal-ring { fill: none; stroke: var(--opponent-text); stroke-width: 1.5; }
.seal-star { fill: var(--opponent); }
.seal-text { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; font-weight: 800; color: var(--text); }

/* Format strip */
.format-grid { display: grid; gap: var(--s-xl); align-items: center; }
.format-grid .lead { margin-bottom: var(--s-sm); }
.rounds { background: var(--surface); border-radius: var(--r-lg); padding: var(--s-lg); display: grid; gap: var(--s-sm); justify-self: center; width: min(100%, 360px); }
.rounds-head, .rounds-row { display: grid; grid-template-columns: 64px 1fr 1fr; align-items: center; gap: var(--s-sm); }
.rounds-head { font-size: 13px; font-weight: 700; }
.rounds-head span:nth-child(2) { color: var(--you); }
.rounds-head span:nth-child(3) { color: var(--opponent-text); }
.rounds-label { font-size: 13px; font-weight: 700; color: var(--text-muted); }
.marks { display: flex; gap: var(--s-xs); }
.mark { width: 22px; height: 22px; border-radius: var(--r-sm); display: grid; place-items: center; }
.mark svg { width: 14px; height: 14px; }
.mark-correct { background: var(--correct); color: var(--lapis); }
.mark-wrong { background: var(--surface); box-shadow: inset 0 0 0 2px var(--opponent); color: var(--opponent-text); }
.mark-waiting { background: var(--raised); }

/* Features, tiers, closing */
.features { display: grid; gap: var(--s-md); }
.tiers .lead { margin-bottom: var(--s-xs); }
.tier-chips { display: flex; gap: var(--s-sm); margin-top: var(--s-md); }
.closing { text-align: center; }
.closing .container { display: grid; gap: var(--s-lg); justify-items: center; }
.closing-title { font-size: 48px; }

@media (min-width: 640px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1fr auto; justify-items: start; text-align: start; align-items: center; }
  .hero-copy, .hero-cta { justify-items: start; }
  .hero-title { font-size: 96px; }
  .format-grid { grid-template-columns: 1fr auto; }
  .features { grid-template-columns: repeat(4, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}
