/* ==========================================================
   Landing page (/ and /en/). Loaded after styles.css.
   Tokens come from styles.css (mirrors KalimaTheme.swift).
   ========================================================== */

:root {
  --btn: #0E1120;
  --btn-fg: #FFFFFF;
  --device: #0E1120;
  --bg: #F3F5FA;               /* KalimaTheme.background (Home, Progress) */
  --muted: #484C59;            /* darker than the app's #646A7C: >=7:1 (AAA) on white, page and trial */
  /* ~65 characters per line: Arabic glyphs average ~0.39em, Latin ~0.5em */
  --measure: 25.5em;
  --card-border: #E1DEF0;      /* subtle violet-grey edge (fact chips) */
  --outline: #1B1A4A;          /* navy outline, from the original site */
  --pop-border: 2px solid var(--outline);
  --pop-shadow: 3px 3px 0 var(--outline);
}

html[lang="en"] { --measure: 30em; }
html[lang="en"] body { font-family: var(--font-latin); }
html[lang="en"] h1, html[lang="en"] h2, html[lang="en"] h3 { font-family: var(--font-latin); letter-spacing: -.02em; }

/* ---------- Header extras ---------- */
.nav-lang {
  font-size: 14px; font-weight: 600; color: var(--ink); padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--border); margin-right: 4px;
}
html[dir="ltr"] .nav-lang { margin-right: 0; margin-left: 4px; }
html[dir="ltr"] .brand { margin-left: 0; margin-right: auto; }
html[dir="ltr"] .nav-cta { margin-right: 0; margin-left: 8px; }
.nav-lang:hover { text-decoration: none; background: var(--card); }
.nav-cta { background: var(--btn); color: var(--btn-fg); }

/* ---------- Shared pieces ---------- */
.l-section { padding: 112px 0 0; scroll-margin-top: 0; }
.l-head { max-width: 640px; margin: 0 auto 48px; text-align: center; }
.l-kicker {
  display: inline-block; font-size: 13.5px; font-weight: 600; color: var(--violet);
  background: var(--violet-soft); padding: 2px 14px; border-radius: 999px; margin-bottom: 14px;
}
.l-title { font-size: clamp(28px, 3.8vw, 44px); font-weight: 700; line-height: 1.3; margin-bottom: 14px; }
.l-lead { color: var(--muted); font-size: 17.5px; line-height: 1.8; }
/* Keep paragraphs to roughly 60–70 characters per line */
.l-head .l-lead { max-width: var(--measure); margin-inline: auto; }
.l-plan .l-head .l-lead { margin-inline: 0; }

.badge-link { display: inline-block; line-height: 0; border-radius: 10px; transition: transform .15s, opacity .15s; }
.badge-link:hover { transform: translateY(-1px); opacity: .9; }
.badge-link img { height: 54px; width: auto; }

/* Phone frame around a raw app screenshot (the screenshot carries its own status bar). */
.device {
  position: relative; width: 300px; max-width: 100%;
  border: 10px solid var(--device); border-radius: 48px; background: var(--device);
  box-shadow: var(--shadow-lg); overflow: hidden; flex: none;
}
.device::after {
  content: ""; position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 31%; height: 22px; border-radius: 999px; background: var(--device);
}
.device img { width: 100%; height: auto; aspect-ratio: 660 / 1434; border-radius: 38px; display: block; }

/* ---------- Hero ---------- */
.l-hero { position: relative; padding: 56px 0 0; }
.l-hero::before {
  content: ""; position: absolute; top: -140px; left: -20px; right: -20px; height: 900px; z-index: -1;
  background: radial-gradient(45% 50% at 50% 0%, color-mix(in srgb, var(--violet) 9%, transparent), transparent 75%);
  pointer-events: none;
}
.l-hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 48px; align-items: center; }
.l-hero h1 { font-size: clamp(38px, 5.4vw, 64px); line-height: 1.25; font-weight: 700; margin-bottom: 20px; }
.l-hero h1 em { font-style: normal; color: var(--violet); }
.l-devices { color: var(--muted); font-size: 15px; font-weight: 500; margin: -6px 0 16px; }
.l-hero .l-lead { max-width: var(--measure); margin-bottom: 32px; font-size: clamp(17px, 1.5vw, 19px); }
.l-cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.l-cta small { color: var(--muted); font-size: 14px; }
.l-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; list-style: none; }
.l-facts li {
  background: var(--card); border: 1px solid var(--card-border); box-shadow: var(--shadow-sm); border-radius: 999px; padding: 6px 14px;
  font-size: 14px; font-weight: 500; color: var(--ink);
}
.l-facts b { font-family: var(--font-num); font-weight: 700; }

.l-hero-art { position: relative; display: flex; justify-content: center; align-items: flex-start; min-height: 560px; }
.l-hero-art::before {
  content: ""; position: absolute; width: min(480px, 100%); aspect-ratio: 1; top: 50%; left: 50%; transform: translate(-50%, -50%);
  border-radius: 50%; background: radial-gradient(closest-side, var(--violet-soft), transparent); z-index: -1;
}
.l-hero-art .device { width: 290px; z-index: 1; }
.l-hero-art .device.back {
  position: absolute; width: 250px; top: 64px; z-index: 0; opacity: .97;
  inset-inline-end: calc(50% - 250px); transform: rotate(6deg);
}
html[dir="ltr"] .l-hero-art .device.back { transform: rotate(-6deg); }
.l-hero-art .device.front { margin-inline-end: 120px; }

/* ---------- How it works ---------- */
.l-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; list-style: none; counter-reset: st; }
.l-step {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 14px; align-items: center;
  background: var(--card); border: var(--pop-border); border-radius: var(--radius); padding: 26px 28px 28px; box-shadow: var(--pop-shadow); counter-increment: st;
}
.l-step::before {
  content: counter(st); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--violet-soft); color: var(--violet); font-family: var(--font-num); font-weight: 800; font-size: 18px;
}
.l-step h3 { font-size: 20px; font-weight: 700; line-height: 1.45; }
.l-step p { grid-column: 1 / -1; margin-top: 14px; color: var(--muted); font-size: 15.5px; line-height: 1.8; }
.l-step .meta { grid-column: 1 / -1; justify-self: start; margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--violet); }

/* ---------- Features ---------- */
.l-features { display: grid; gap: 24px; }
.l-feature {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center;
  background: var(--card); border: var(--pop-border); border-radius: 36px; padding: 48px 56px 0; box-shadow: var(--pop-shadow); overflow: hidden;
}
.l-feature:nth-child(even) .l-feature-text { order: 2; }
.l-feature-text { padding-bottom: 48px; }
.l-feature-text h3 { font-size: clamp(24px, 2.6vw, 32px); font-weight: 700; line-height: 1.35; margin-bottom: 12px; }
.l-feature-text p { max-width: var(--measure); color: var(--muted); font-size: 16.5px; line-height: 1.8; }
.l-feature-text ul { list-style: none; margin-top: 18px; display: grid; gap: 10px; }
.l-feature-text li { display: flex; gap: 12px; align-items: baseline; font-size: 15.5px; color: var(--text); line-height: 1.8; }
.l-feature-text li b { flex: none; font-weight: 600; color: var(--ink); }
.dot { flex: none; width: 10px; height: 10px; border-radius: 50%; display: inline-block; transform: translateY(-1px); }
.dot.est { background: var(--lavender-2); }
.dot.lrn { background: var(--violet-mid); }
.dot.mst { background: var(--violet); }
.l-feature-art { display: flex; justify-content: center; gap: 20px; align-self: end; }
/* Screenshots peek up from the card's bottom edge */
.l-feature-art .device { width: 280px; border-bottom: 0; border-radius: 46px 46px 0 0; margin-bottom: -150px; }
.l-feature-art .device img { border-radius: 36px 36px 0 0; }
.l-feature.games .l-feature-art .device { width: 240px; }
.l-feature.games .l-feature-art .device:nth-child(2) { margin-top: 48px; }

/* ---------- Exam plan ---------- */
.l-plan { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 56px; align-items: center; }
.l-plan .device { margin-inline: auto; }
.l-plan-list { list-style: none; display: grid; gap: 14px; margin-top: 28px; }
.l-plan-list li {
  display: grid; grid-template-columns: 52px 1fr; gap: 16px; align-items: start;
  background: var(--card); border: var(--pop-border); border-radius: var(--radius-compact); padding: 20px 22px; box-shadow: var(--pop-shadow);
}
.l-plan-list .ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--violet-soft); }
.l-plan-list .ic svg { width: 24px; height: 24px; stroke: var(--violet); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.l-plan-list li:nth-child(3) .ic { background: var(--amber-soft); }
.l-plan-list li:nth-child(3) .ic svg { stroke: var(--note-text); }
.l-plan-list h3 { font-size: 18px; font-weight: 700; margin-bottom: 2px; }
.l-plan-list p { max-width: var(--measure); color: var(--muted); font-size: 15px; line-height: 1.8; }
.l-plan .l-head { text-align: start; margin: 0; }

/* ---------- Word lists (reuses .hub-grid / .hub-card from styles.css) ---------- */
.l-words .hub-card { border: var(--pop-border); box-shadow: var(--pop-shadow); }
.l-words .hub-card h3 { font-size: 20px; font-weight: 700; line-height: 1.5; margin-top: 6px; flex: 1; color: var(--ink); }

/* ---------- Trial ---------- */
.l-trial {
  position: relative; overflow: hidden; margin-top: 112px; text-align: center;
  background: var(--violet-soft); border: var(--pop-border); border-radius: 40px; padding: 64px 28px; box-shadow: var(--pop-shadow);
}
.l-trial::before {
  content: ""; position: absolute; inset: auto -10% -60% -10%; height: 100%; pointer-events: none;
  background: radial-gradient(50% 50% at 50% 50%, color-mix(in srgb, var(--violet) 18%, transparent), transparent 70%);
}
.l-trial > * { position: relative; }
.l-trial img.icon { width: 84px; height: 84px; border-radius: 22px; margin: 0 auto 20px; box-shadow: var(--shadow-md); }
.l-trial h2 { font-size: clamp(28px, 4vw, 44px); font-weight: 700; line-height: 1.3; margin-bottom: 10px; }
.l-trial p { color: var(--muted); max-width: var(--measure); margin: 0 auto 28px; font-size: 17px; line-height: 1.8; }
.l-trial small { display: block; margin-top: 16px; color: var(--muted); font-size: 13.5px; }

/* ---------- FAQ ---------- */
.l-faq { max-width: 780px; margin: 0 auto; }
.l-faq .ans p { max-width: var(--measure); line-height: 1.8; }
.l-faq details { border: var(--pop-border); box-shadow: var(--pop-shadow); }
.l-faq summary::after { border: 1.5px solid var(--outline); background-color: var(--card); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .l-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; text-align: center; }
  .l-hero .l-lead { margin-inline: auto; }
  .l-cta, .l-facts { justify-content: center; }
  .l-hero-art { min-height: 0; }
  .l-steps { grid-template-columns: minmax(0, 1fr); }
  .l-feature { grid-template-columns: minmax(0, 1fr); padding: 36px 28px 0; gap: 28px; text-align: center; }
  .l-feature:nth-child(even) .l-feature-text { order: 0; }
  .l-feature-text { padding-bottom: 0; }
  .l-feature-text ul { justify-items: center; }
  .l-plan { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .l-plan .l-head { text-align: center; }
  .l-plan .l-head .l-lead, .l-feature-text p { margin-inline: auto; }
  .l-plan .device { order: 2; }
}
@media (max-width: 720px) {
  .l-section { padding-top: 88px; }
  .nav-link.hide-sm { display: none; }
  .l-hero { padding-top: 36px; }
  .l-hero-art .device.back { display: none; }
  .l-hero-art .device.front { margin-inline-end: 0; width: 270px; }
  .l-feature { border-radius: 30px; padding: 32px 20px 0; }
  .l-feature-art .device { width: 240px; margin-bottom: -120px; }
  .l-feature.games .l-feature-art { gap: 12px; }
  .l-feature.games .l-feature-art .device { width: calc(50% - 6px); border-width: 7px; border-radius: 30px 30px 0 0; margin-bottom: -60px; }
  .l-feature.games .l-feature-art .device img { border-radius: 23px 23px 0 0; }
  .l-feature.games .l-feature-art .device::after { height: 14px; top: 5px; }
  .l-plan-list li { grid-template-columns: 44px 1fr; padding: 18px; }
  .l-plan-list .ic { width: 44px; height: 44px; border-radius: 14px; }
  .l-trial { margin-top: 88px; border-radius: 30px; padding: 48px 20px; }
}
@media (max-width: 480px) {
  .nav-cta { display: none; }
  .badge-link img { height: 50px; }
}

/* ---------- Outline style: hover and press ---------- */
/* Scoped by parent so these outrank `.js .reveal.in` from styles.css; opacity keeps the scroll-in fade. */
.l-steps .l-step, .l-features .l-feature, .l-words .hub-card { transition: opacity .6s ease, transform .15s ease, box-shadow .15s ease; }
.l-steps .l-step:hover, .l-features .l-feature:hover, .l-words .hub-card:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--outline); }
.nav-cta, .nav-lang { border: var(--pop-border); box-shadow: 2px 2px 0 var(--outline); transition: transform .15s, box-shadow .15s; }
.nav-cta:hover, .nav-lang:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--outline); }
.nav-cta:active, .nav-lang:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--outline); }
