/* ==========================================================================
   Fluencyverse / UrduVerse — site stylesheet
   Tokens are lifted directly from the app's design system (DESIGN.md).
   Do not invent colours, radii or spacing here. If something is missing,
   add it to DESIGN.md first, then use it in both places.
   ========================================================================== */

/* --- 1. Tokens ---------------------------------------------------------- */
:root {
  /* Brand — emerald (primary) + gold (reward). Nothing else. */
  --primary:      #10B981;
  --primary-deep: #059669;
  --primary-dark: #047857;
  --primary-tint: #D1FAE5;
  --primary-soft: #ECFDF5;
  --gold:         #FFC83D;
  --gold-deep:    #E0A100;
  --gold-tint:    #FFF3D4;
  --gold-soft:    #FFF6DC;

  /* Neutrals */
  --ink:        #172A22;
  --ink-soft:   #2C3B34;
  --muted:      #6A7B73;
  --cream:      #F1F7F4;
  --paper:      #FFFFFF;
  --mint:       #F2FAF6;
  --mint-border:#DCEAE2;
  --line:       #E4EBE7;
  --line-deep:  #D4DED8;

  /* Errors only. Never decorative. */
  --danger:      #EF4444;
  --danger-deep: #DC2626;
  --danger-tint: #FEE2E2;

  /* Hero gradient — HERO_GRADIENT in colors.ts */
  --hero-1: #12B886;
  --hero-2: #0DA372;
  --hero-3: #0A8A60;

  /* Radii */
  --r-pill: 999px;
  --r-hero: 32px;
  --r-card: 28px;
  --r-modal: 24px;
  --r-inner: 20px;
  --r-chip: 16px;
  --r-tag: 14px;
  --r-sm: 10px;

  /* Spacing scale: xs sm md lg xl xxl */
  --s-xs: 6px;
  --s-sm: 10px;
  --s-md: 16px;
  --s-lg: 24px;
  --s-xl: 32px;
  --s-xxl: 40px;

  /* Depth */
  --shadow-soft: 0 2px 10px rgba(23, 42, 34, .05);
  --shadow-card: 0 10px 30px rgba(23, 42, 34, .07), 0 2px 6px rgba(23, 42, 34, .04);
  --shadow-lift: 0 22px 50px rgba(23, 42, 34, .12), 0 4px 12px rgba(23, 42, 34, .06);
  --shadow-hero: 0 30px 70px rgba(10, 138, 96, .22);

  /* Type */
  --font: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-urdu: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Noto Naskh Arabic", serif;

  --maxw: 1120px;
}

/* --- 2. Reset & base ---------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

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

img { max-width: 100%; display: block; }
a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }

h1, h2, h3, h4 { margin: 0; line-height: 1.15; font-weight: 800; letter-spacing: -0.015em; }
p { margin: 0; }

/* No widowed last words in headings; no orphans in running text. Browsers
   without text-wrap support simply ignore both — safe progressive polish. */
h1, h2, h3, .title { text-wrap: balance; }
.lead, .feature p, .unit p, .done p, .signup p { text-wrap: pretty; }

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--paper); color: var(--ink);
  padding: 12px 18px; border-radius: 0 0 var(--r-chip) 0; font-weight: 800;
}
.skip-link:focus { left: 0; }

/* --- 3. Layout ---------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

section { position: relative; }
section[id] { scroll-margin-top: 84px; }   /* anchors clear the sticky header */
.section { padding: 96px 0; }
.section--tight { padding: 72px 0; }
.section--mint { background: var(--mint); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.head { max-width: 660px; margin-bottom: 48px; }
.head--center { margin-left: auto; margin-right: auto; text-align: center; }

.kicker {
  font-size: 12px; font-weight: 800; letter-spacing: .09em;
  text-transform: uppercase; color: var(--primary-dark);
  margin: 0 0 12px;
}
.kicker--muted { color: var(--muted); }

h2.title { font-size: clamp(28px, 3.6vw, 40px); }
h3.title { font-size: clamp(22px, 2.6vw, 28px); }

.lead {
  font-size: clamp(17px, 1.6vw, 19px);
  color: var(--muted);
  margin-top: 16px;
  line-height: 1.65;
}
.lead strong { color: var(--ink); font-weight: 700; }

/* --- 4. Buttons — the 3D lip is the signature interaction ---------------- */
.btn {
  --lip: var(--primary-deep);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  position: relative;
  padding: 0 0 4px;                 /* the lip */
  background: var(--lip);
  border: 0; border-radius: var(--r-inner);
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s ease, filter .12s ease;
}
.btn:hover { text-decoration: none; }
.btn > span {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  padding: 14px 26px;
  background: var(--primary);
  border-radius: var(--r-inner);
  color: #fff; font-weight: 800; font-size: 16px; letter-spacing: .01em;
  transition: transform .08s ease;
}
.btn:hover > span { filter: brightness(1.04); }
.btn:active > span { transform: translateY(4px); }
.btn:active { padding-bottom: 0; }

.btn--secondary { --lip: var(--line-deep); }
.btn--secondary > span { background: var(--paper); color: var(--ink); }

.btn--ghost { --lip: transparent; background: transparent; }
.btn--ghost > span { background: transparent; color: var(--primary-dark); padding: 14px 18px; }

.btn--lg > span { padding: 17px 32px; font-size: 17px; }
.btn--block { display: flex; width: 100%; }

/* Store badge — a placeholder until the app is live */
.store {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 12px 20px 12px 16px;
  border: 1.5px dashed var(--line-deep);
  border-radius: var(--r-inner);
  background: var(--paper);
  color: var(--muted);
}
.store svg { flex: none; opacity: .55; }
.store b { display: block; color: var(--ink-soft); font-size: 15px; font-weight: 800; line-height: 1.2; }
.store small { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }

/* --- 5. Cards, chips, pills --------------------------------------------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: var(--s-lg);
  box-shadow: var(--shadow-card);
}

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px;
  background: var(--mint); border: 1px solid var(--mint-border);
  border-radius: var(--r-pill);
  font-size: 13px; font-weight: 700; color: var(--ink-soft);
}
.chip svg { flex: none; }
.chip--gold { background: var(--gold-soft); border-color: #F2E3BC; color: var(--gold-deep); }
.chip--emerald { background: var(--primary-soft); border-color: var(--primary-tint); color: var(--primary-dark); }

.tag {
  display: inline-block; padding: 4px 10px;
  border-radius: var(--r-tag);
  font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
}
.tag--free { background: var(--primary-tint); color: var(--primary-dark); }
.tag--pack { background: var(--gold-tint); color: var(--gold-deep); }

/* --- 6. Urdu type ------------------------------------------------------- */
.ur {
  font-family: var(--font-urdu);
  direction: rtl;
  font-weight: 400;
  line-height: 2.1;          /* Nastaliq cascades; it needs the room */
  color: var(--ink);
}
.roman {
  font-size: 15px; font-weight: 700; color: var(--primary-dark);
  letter-spacing: .01em;
}
.gloss { font-size: 15px; font-weight: 600; color: var(--muted); }

/* --- 7. Header ---------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(241, 247, 244, .82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, background .2s ease;
}
.site-header.is-stuck { border-bottom-color: var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 72px; }

.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: linear-gradient(145deg, var(--hero-1), var(--hero-3));
  display: grid; place-items: center;
  box-shadow: 0 3px 8px rgba(10, 138, 96, .28);
}
.brand .mark span { color: #fff; font-weight: 900; font-size: 15px; line-height: 1; }
.brand b { font-size: 17px; font-weight: 800; color: var(--ink); letter-spacing: -0.01em; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: 9px 14px; border-radius: var(--r-chip);
  font-size: 15px; font-weight: 700; color: var(--muted);
  transition: color .15s ease, background .15s ease;
}
.nav a:hover { color: var(--ink); background: var(--mint); text-decoration: none; }
@media (max-width: 860px) { .nav { display: none; } }
@media (max-width: 520px) { .site-header .btn { display: none; } }

/* --- 8. Hero ------------------------------------------------------------ */
.hero { position: relative; padding: 80px 0 96px; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.hero-bg::before, .hero-bg::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(70px);
}
.hero-bg::before {
  width: 620px; height: 620px; top: -280px; right: -180px;
  background: radial-gradient(circle, rgba(16,185,129,.20), transparent 68%);
}
.hero-bg::after {
  width: 520px; height: 520px; bottom: -260px; left: -200px;
  background: radial-gradient(circle, rgba(255,200,61,.20), transparent 68%);
}
/* Nastaliq as wallpaper. Decorative only, hidden from screen readers. */
.hero-script {
  position: absolute; top: 4%; right: -2%;
  font-family: var(--font-urdu); direction: rtl;
  font-size: clamp(120px, 20vw, 300px); line-height: 1.6;
  color: var(--primary); opacity: .045;
  pointer-events: none; user-select: none; white-space: nowrap;
}

.hero-grid {
  position: relative;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 64px; align-items: center;
}
@media (max-width: 940px) { .hero-grid { grid-template-columns: 1fr; gap: 48px; } }

.hero h1 {
  font-size: clamp(38px, 5.6vw, 62px);
  line-height: 1.04;
  letter-spacing: -0.03em;
}
.hero h1 .em {
  background: linear-gradient(100deg, var(--hero-1), var(--hero-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lead { font-size: clamp(17px, 1.8vw, 20px); max-width: 30em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 36px; }
.hero-note { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 28px; }
.hero-note span { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--muted); }
.hero-note svg { color: var(--primary); flex: none; }

/* --- 9. Phone ----------------------------------------------------------- */
.phone-stage { position: relative; display: grid; place-items: center; }
.phone {
  position: relative; width: 300px; max-width: 100%;
  background: #12211B;
  border-radius: 46px;
  padding: 10px;
  box-shadow: var(--shadow-lift), 0 0 0 1.5px rgba(23,42,34,.14);
}
.phone-screen {
  position: relative; overflow: hidden;
  border-radius: 37px;
  background: var(--cream);
  min-height: 540px;
  display: flex; flex-direction: column;
}
.phone-notch {
  position: absolute; top: 9px; left: 50%; transform: translateX(-50%);
  width: 96px; height: 26px; background: #12211B; border-radius: var(--r-pill); z-index: 5;
}
.phone-hero {
  background: linear-gradient(150deg, var(--hero-1), var(--hero-2) 52%, var(--hero-3));
  padding: 46px 20px 22px;
  color: #fff;
}
.phone-hero .kicker { color: rgba(255,255,255,.78); margin-bottom: 6px; }
.phone-hero h4 { font-size: 21px; color: #fff; }
.phone-body { flex: 1; padding: 18px 18px 22px; display: flex; flex-direction: column; gap: 14px; }

.mano-float {
  position: absolute; right: -26px; bottom: -18px; width: 132px; z-index: 6;
  filter: drop-shadow(0 14px 26px rgba(23,42,34,.18));
  animation: bob 5s ease-in-out infinite;
}
@media (max-width: 940px) { .mano-float { width: 108px; right: -6px; } }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-9px) rotate(1.5deg); } }
@media (prefers-reduced-motion: reduce) { .mano-float { animation: none; } }

/* --- 10. Word card (hero player) ---------------------------------------- */
.wordcard {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-modal); padding: 20px 18px;
  box-shadow: var(--shadow-soft);
  text-align: center;
}
.wordcard .ur { font-size: 40px; margin-bottom: 2px; }
.wordcard .roman { font-size: 16px; }
.wordcard .gloss { margin-top: 8px; font-size: 15px; }
.wordcard.is-swapping { opacity: 0; transform: translateY(6px); }
.wordcard { transition: opacity .22s ease, transform .22s ease; }

.play {
  margin-top: 14px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px 9px 13px;
  background: var(--primary-soft); border: 1px solid var(--primary-tint);
  color: var(--primary-dark); border-radius: var(--r-pill);
  font-size: 13px; font-weight: 800; cursor: pointer;
  transition: background .15s ease, transform .1s ease;
}
.play:hover { background: var(--primary-tint); }
.play:active { transform: scale(.96); }
.play.is-playing { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Round speaker button used inline next to words */
.spk {
  display: inline-grid; place-items: center; flex: none;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary-soft); border: 1px solid var(--primary-tint);
  color: var(--primary-dark); cursor: pointer;
  transition: background .15s ease, transform .1s ease, color .15s ease;
}
.spk:hover { background: var(--primary-tint); }
.spk:active { transform: scale(.92); }
.spk.is-playing { background: var(--primary); border-color: var(--primary); color: #fff; }
.spk--sm { width: 28px; height: 28px; }

/* --- 11. Stats ---------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 24px 22px; box-shadow: var(--shadow-soft);
}
.stat b { display: block; font-size: clamp(28px, 3.4vw, 38px); font-weight: 800; line-height: 1.1; color: var(--ink); letter-spacing: -0.02em; }
.stat span { display: block; margin-top: 6px; font-size: 12px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }

/* --- 12. Reveal on scroll ----------------------------------------------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s cubic-bezier(.2,.7,.3,1), transform .6s cubic-bezier(.2,.7,.3,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* --- 13. Footer --------------------------------------------------------- */
.site-footer { background: var(--paper); border-top: 1px solid var(--line); padding: 64px 0 40px; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }
@media (max-width: 440px) { .foot-grid { grid-template-columns: 1fr; gap: 28px; } }
.foot-brand p { color: var(--muted); font-size: 15px; max-width: 32em; margin-top: 14px; }
.foot-col h4 { font-size: 12px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.foot-col a { display: block; padding: 5px 0; font-size: 15px; font-weight: 700; color: var(--ink-soft); overflow-wrap: anywhere; }
.foot-col a:hover { color: var(--primary-dark); }
.foot-base {
  margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  font-size: 14px; color: var(--muted); font-weight: 600;
}

/* --- 14. Utility -------------------------------------------------------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.center { text-align: center; }
.stack-sm > * + * { margin-top: 10px; }
.stack-md > * + * { margin-top: 16px; }
.stack-lg > * + * { margin-top: 24px; }

/* ==========================================================================
   15. Try a lesson — the interactive mini lesson
   ========================================================================== */
.lesson {
  max-width: 720px; margin: 0 auto;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-hero); box-shadow: var(--shadow-card);
  overflow: hidden;
}
.lesson-top {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 24px; border-bottom: 1px solid var(--line); background: var(--mint);
}
.lesson-top .label { font-size: 13px; font-weight: 800; color: var(--muted); flex: none; }
.progress { flex: 1; height: 10px; border-radius: var(--r-pill); background: var(--mint-border); overflow: hidden; }
.progress i {
  display: block; height: 100%; width: 0%;
  border-radius: var(--r-pill);
  background: linear-gradient(180deg, #34D399, var(--primary) 55%, var(--primary-deep));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5);
  transition: width .45s cubic-bezier(.2,.8,.3,1);
}
.lesson-body { padding: 32px 24px 28px; }
@media (max-width: 560px) { .lesson-body { padding: 24px 18px 22px; } }

.step { display: none; }
.step.is-active { display: block; animation: stepIn .32s cubic-bezier(.2,.7,.3,1); }
@keyframes stepIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .step.is-active { animation: none; } }

.step-prompt { font-size: 15px; font-weight: 700; color: var(--muted); margin-bottom: 20px; }

/* Teach card */
.teach {
  background: var(--mint); border: 1px solid var(--mint-border);
  border-radius: var(--r-modal); padding: 28px 20px 22px; text-align: center;
}
.teach .ur { font-size: clamp(40px, 8vw, 58px); }
.teach .roman { font-size: 17px; margin-top: 2px; }
.teach .divider { width: 44px; height: 3px; border-radius: var(--r-pill); background: var(--mint-border); margin: 16px auto; }
.teach .en { font-size: 19px; font-weight: 700; color: var(--ink); }
.teach .note { margin-top: 12px; font-size: 14px; color: var(--muted); font-weight: 600; }

/* Answer options */
.opts { display: grid; gap: 12px; margin-top: 4px; }
.opt {
  display: flex; align-items: center; gap: 16px; width: 100%; text-align: left;
  padding: 16px 18px;
  background: var(--paper); border: 2px solid var(--line);
  border-radius: var(--r-inner); cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.opt:hover:not(:disabled) { border-color: var(--primary-tint); background: var(--primary-soft); }
.opt:active:not(:disabled) { transform: scale(.99); }
.opt:disabled { cursor: default; }
.opt .ur { font-size: 27px; line-height: 2; flex: 1; }
.opt .roman { font-size: 14px; display: block; margin-top: 4px; }
.opt .opt-text { flex: 1; min-width: 0; }
.opt .opt-en { font-size: 17px; font-weight: 700; }
.opt-key {
  flex: none; width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--mint); color: var(--muted);
  font-size: 13px; font-weight: 800;
}
.opt.is-right { border-color: var(--primary); background: var(--primary-soft); }
.opt.is-right .opt-key { background: var(--primary); color: #fff; }
.opt.is-wrong { border-color: var(--danger); background: var(--danger-tint); }
.opt.is-wrong .opt-key { background: var(--danger); color: #fff; }
.opt.is-dim { opacity: .45; }

/* Feedback panel */
.feedback {
  display: none; gap: 16px; align-items: flex-start;
  margin-top: 20px; padding: 18px;
  border-radius: var(--r-inner);
}
.feedback.is-shown { display: flex; animation: stepIn .28s cubic-bezier(.2,.7,.3,1); }
.feedback img { width: 62px; flex: none; margin-top: -4px; }
.feedback h4 { font-size: 17px; margin-bottom: 4px; }
.feedback p { font-size: 15px; font-weight: 600; line-height: 1.55; }
.feedback--right { background: var(--primary-soft); border: 1px solid var(--primary-tint); }
.feedback--right h4 { color: var(--primary-dark); }
.feedback--right p { color: var(--ink-soft); }
.feedback--wrong { background: var(--danger-tint); border: 1px solid #FBC5C5; }
.feedback--wrong h4 { color: var(--danger-deep); }
.feedback--wrong p { color: var(--ink-soft); }

.lesson-foot { display: flex; align-items: center; gap: 14px; margin-top: 24px; }
.lesson-foot .spacer { flex: 1; }
.lesson-foot .hint { font-size: 14px; font-weight: 600; color: var(--muted); }

/* Done step */
.done { text-align: center; padding: 8px 0; }
.done img { width: 130px; margin: 0 auto 16px; }
.done h3 { font-size: 26px; margin-bottom: 10px; }
.done p { color: var(--muted); font-size: 16px; max-width: 34em; margin: 0 auto; }
.done-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 22px 0 8px; }

/* ==========================================================================
   16. Every word comes back — sentence breakdown
   ========================================================================== */
.sentence-panel {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-hero); box-shadow: var(--shadow-card);
  padding: 32px 28px 28px;
}
@media (max-width: 560px) { .sentence-panel { padding: 24px 18px 22px; } }

.sentence-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding-bottom: 20px; margin-bottom: 24px; border-bottom: 1px solid var(--line);
}
.sentence-meta .grow { flex: 1; }

.sentence {
  display: flex; flex-wrap: wrap-reverse; justify-content: center;
  gap: 10px; direction: rtl;
}
.word {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 12px 16px 10px;
  border: 2px solid var(--line); border-radius: var(--r-inner);
  background: var(--paper); cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.word .ur { font-size: clamp(28px, 5vw, 38px); }
.word .roman { direction: ltr; font-size: 13px; font-weight: 700; }
.word:hover { transform: translateY(-3px); box-shadow: var(--shadow-soft); }
.word.known { border-color: var(--primary-tint); background: var(--primary-soft); }
.word.known .roman { color: var(--primary-dark); }
.word.fresh { border-color: var(--gold-tint); background: var(--gold-soft); }
.word.fresh .roman { color: var(--gold-deep); }
.word.is-open { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.word.fresh.is-open { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }

.word-out {
  margin-top: 24px; min-height: 96px;
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px;
  background: var(--mint); border: 1px solid var(--mint-border);
  border-radius: var(--r-inner);
  transition: background .2s ease, border-color .2s ease;
}
.word-out.fresh { background: var(--gold-soft); border-color: #F2E3BC; }
.word-out .ur { font-size: 34px; flex: none; }
.word-out .body { flex: 1; min-width: 0; }
.word-out .en { font-size: 18px; font-weight: 800; }
.word-out .src { font-size: 14px; font-weight: 600; color: var(--muted); margin-top: 3px; }
.word-out .placeholder { color: var(--muted); font-weight: 600; font-size: 15px; }

.legend { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; margin-top: 22px; }
.legend span { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: block; }
.legend .k { background: var(--primary-tint); border: 1.5px solid var(--primary); }
.legend .f { background: var(--gold-tint); border: 1.5px solid var(--gold); }

/* ==========================================================================
   17. Script explorer
   ========================================================================== */
.script-grid { display: grid; grid-template-columns: 1fr 380px; gap: 32px; align-items: start; }
@media (max-width: 940px) { .script-grid { grid-template-columns: 1fr; } }

.batches { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.batch-btn {
  padding: 9px 16px; border-radius: var(--r-pill);
  border: 1.5px solid var(--line); background: var(--paper);
  font-size: 13px; font-weight: 800; color: var(--muted); cursor: pointer;
  transition: all .15s ease;
}
.batch-btn:hover { border-color: var(--primary-tint); color: var(--primary-dark); }
.batch-btn.is-on { background: var(--primary); border-color: var(--primary); color: #fff; }

.letters { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 10px; }
.letter {
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 4px 9px;
  border: 1.5px solid var(--line); border-radius: var(--r-inner);
  background: var(--paper); cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.letter:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-soft); }
/* A fixed glyph box: Nastaliq dots and descenders stay inside it, so they can
   never land on the roman label below (پ's three below-dots were doing that). */
.letter .ur {
  font-size: 30px; line-height: 1;
  height: 62px; display: flex; align-items: center; justify-content: center;
}
.letter small {
  font-size: 10px; font-weight: 800; letter-spacing: .04em; color: var(--muted);
  text-transform: uppercase; margin-top: 7px;
}
.letter.is-on { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px var(--primary-soft); }
.letter.is-on small { color: var(--primary-dark); }

.letter-panel {
  position: sticky; top: 96px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-card); box-shadow: var(--shadow-card); overflow: hidden;
}
@media (max-width: 940px) { .letter-panel { position: static; } }
.letter-panel .top {
  background: linear-gradient(150deg, var(--hero-1), var(--hero-2) 55%, var(--hero-3));
  padding: 24px 24px 20px; color: #fff; text-align: center;
}
.letter-panel .top .ur { font-size: 76px; color: #fff; line-height: 1.5; }
.letter-panel .top .name { font-family: var(--font-urdu); font-size: 20px; line-height: 2.2; color: rgba(255,255,255,.9); direction: rtl; }
.letter-panel .top .rn { font-size: 14px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.85); margin-top: 12px; }
.letter-panel .inner { padding: 22px 24px 26px; }

.kv { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.kv:last-of-type { border-bottom: 0; }
.kv dt { flex: none; width: 92px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.kv dd { margin: 0; flex: 1; font-size: 15px; font-weight: 600; color: var(--ink-soft); line-height: 1.5; }

.forms { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 6px; }
.form-cell {
  text-align: center; padding: 12px 4px 8px;
  background: var(--mint); border: 1px solid var(--mint-border); border-radius: var(--r-chip);
}
.form-cell .ur { font-size: 30px; line-height: 1.6; }
.form-cell small { display: block; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.forms-note { font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 12px; line-height: 1.5; }

/* ==========================================================================
   18. Course units
   ========================================================================== */
.units { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.unit {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 22px; box-shadow: var(--shadow-soft);
  transition: transform .18s ease, box-shadow .18s ease;
}
.unit:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); }
.unit .row { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.unit .emoji { font-size: 26px; line-height: 1; flex: none; }
.unit .row .grow { flex: 1; min-width: 0; }
.unit h4 { font-size: 17px; margin-bottom: 3px; }
.unit p { font-size: 14px; color: var(--muted); font-weight: 600; line-height: 1.5; }
.unit .meta { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.unit .count { font-size: 13px; font-weight: 700; color: var(--muted); }

/* ==========================================================================
   19. Honest app / feature cards
   ========================================================================== */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.feature { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); padding: 26px; box-shadow: var(--shadow-soft); }
.feature .ico {
  width: 46px; height: 46px; border-radius: var(--r-chip); display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary-dark); margin-bottom: 16px;
}
.feature .ico--gold { background: var(--gold-soft); color: var(--gold-deep); }
.feature h4 { font-size: 18px; margin-bottom: 8px; }
.feature p { font-size: 15px; color: var(--muted); font-weight: 600; line-height: 1.6; }

/* ==========================================================================
   20. Signup
   ========================================================================== */
.signup {
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, var(--hero-1), var(--hero-2) 52%, var(--hero-3));
  border-radius: var(--r-hero);
  padding: 56px 48px;
  box-shadow: var(--shadow-hero);
  color: #fff;
}
@media (max-width: 640px) { .signup { padding: 36px 22px; border-radius: var(--r-card); } }
.signup::after {
  content: "اردو"; position: absolute; left: -10px; bottom: -70px;
  font-family: var(--font-urdu); font-size: 220px; color: #fff; opacity: .07;
  pointer-events: none; user-select: none; line-height: 1;
}
.signup-grid { position: relative; display: grid; grid-template-columns: 1fr 420px; gap: 48px; align-items: center; }
@media (max-width: 880px) { .signup-grid { grid-template-columns: 1fr; gap: 32px; } }
.signup .kicker { color: rgba(255,255,255,.8); }
.signup h2 { font-size: clamp(28px, 3.4vw, 38px); color: #fff; }
.signup p { color: rgba(255,255,255,.88); margin-top: 14px; font-size: 17px; line-height: 1.6; }

.form-card { background: var(--paper); border-radius: var(--r-card); padding: 26px; box-shadow: var(--shadow-card); }
.form-card label { display: block; font-size: 12px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.form-card input {
  width: 100%; padding: 15px 16px;
  border: 2px solid var(--line); border-radius: var(--r-chip);
  font-family: inherit; font-size: 16px; font-weight: 600; color: var(--ink);
  background: var(--paper);
  transition: border-color .15s ease;
}
.form-card input::placeholder { color: #A6B3AD; font-weight: 500; }
.form-card input:focus { outline: none; border-color: var(--primary); }
.form-card input.is-bad { border-color: var(--danger); }
.form-card .btn { margin-top: 14px; }
.form-note { margin-top: 14px; font-size: 13px; color: var(--muted); font-weight: 600; line-height: 1.5; text-align: center; }
.form-msg { margin-top: 12px; font-size: 14px; font-weight: 700; display: none; }
.form-msg.is-shown { display: block; }
.form-msg.bad { color: var(--danger-deep); }

.form-done { display: none; text-align: center; padding: 8px 0; }
.form-done.is-shown { display: block; animation: stepIn .35s cubic-bezier(.2,.7,.3,1); }
.form-done img { width: 96px; margin: 0 auto 14px; }
.form-done h4 { font-size: 20px; margin-bottom: 6px; }
.form-done p { color: var(--muted); font-size: 15px; font-weight: 600; }

/* ==========================================================================
   21. The Verse family
   ========================================================================== */
.family { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
/* Eight languages: cap at four columns so wide screens get a clean 4 + 4,
   never the ragged 5 + 3 that auto-fill produces at ~1100px. */
@media (min-width: 1000px) { .family { grid-template-columns: repeat(4, 1fr); } }
.lang {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-inner);
}
.lang .glyph {
  width: 52px; height: 52px; flex: none; border-radius: var(--r-chip);
  display: flex; align-items: center; justify-content: center;
  background: var(--mint); border: 1px solid var(--mint-border);
  font-family: var(--font-urdu); color: var(--muted);
  /* font-size comes per language from data.js — scripts differ wildly in
     width at the same size. line-height 1 + flex centering keeps ascenders
     and Nastaliq descenders optically centred instead of sagging. */
  line-height: 1; font-weight: 600; letter-spacing: 0;
  overflow: hidden; white-space: nowrap;
}
.lang b { letter-spacing: -0.01em; }
.lang .grow { min-width: 0; }
.lang b { display: block; font-size: 16px; font-weight: 800; }
.lang small { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.lang.is-first { border-color: var(--primary-tint); background: var(--primary-soft); }
.lang.is-first .glyph { background: var(--primary); border-color: var(--primary); color: #fff; }
.lang.is-first small { color: var(--primary-dark); }

/* ==========================================================================
   22. Doc pages (privacy / terms / support)
   ========================================================================== */
.doc { max-width: 760px; margin: 0 auto; padding: 64px 24px 96px; }
.doc h1 { font-size: clamp(30px, 4vw, 42px); margin-bottom: 6px; }
.doc .meta { color: var(--muted); font-weight: 700; font-size: 14px; margin-bottom: 36px; }
.doc h2 { font-size: 22px; margin: 44px 0 12px; }
.doc h3 { font-size: 18px; margin: 28px 0 8px; }
.doc p, .doc li { color: var(--ink-soft); font-size: 16.5px; line-height: 1.7; }
.doc p { margin: 14px 0; }
.doc ul, .doc ol { margin: 14px 0; padding-left: 22px; }
.doc li { margin: 8px 0; }
.doc strong { color: var(--ink); font-weight: 800; }
.doc code { background: var(--line); padding: 2px 6px; border-radius: 6px; font-size: 14px; }
.doc .callout {
  background: var(--mint); border: 1px solid var(--mint-border);
  border-radius: var(--r-inner); padding: 20px 22px; margin: 24px 0;
}
.doc .callout p { margin: 8px 0; }
.doc .callout p:first-child { margin-top: 0; }
.doc .callout p:last-child { margin-bottom: 0; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
.doc-back { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; color: var(--muted); margin-bottom: 28px; }
.doc-back:hover { color: var(--primary-dark); text-decoration: none; }

/* Honeypot: present in the DOM for bots, invisible and unreachable for people.
   Not display:none — some bots skip those. */
.hp {
  position: absolute; left: -9999px; top: auto;
  width: 1px; height: 1px; overflow: hidden;
}
