/* Qatfa landing page — modern pixel art.
   Square corners, hard ink borders, stepped shadows with no blur, frame-by-frame motion.
   Arabic text always uses Tajawal; Silkscreen is only for "Qatfa", numbers and short Latin labels.
   Colour pairs used for text all pass WCAG AA (ink on yellow / cream / white, cream on ink). */

:root {
  --yellow: #FFD23F;
  --ink: #1B1B1F;
  --cream: #FFF8E1;
  --leaf: #2E9E5B;
  --white: #FFFFFF;
  --muted: #4A4740;          /* secondary text: 8.6:1 on cream */
  --leaf-soft: #E3F3E8;

  --font-ar: "Tajawal", system-ui, "Segoe UI", Tahoma, sans-serif;
  --font-px: "Silkscreen", ui-monospace, monospace;

  --bw: 3px;
  --border: var(--bw) solid var(--ink);
  /* Stepped shadows: two hard layers make a staircase corner, never a blur. */
  --sh-sm: 2px 2px 0 var(--ink), 4px 4px 0 var(--ink);
  --sh: 4px 4px 0 var(--ink), 8px 8px 0 var(--ink);
  --sh-hover: 4px 4px 0 var(--ink), 8px 8px 0 var(--ink), 10px 10px 0 var(--ink);

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --frame: 80ms steps(2, end);
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
/* The hidden attribute always wins over display rules (.btn, .card, grids...). */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-ar);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.7;
  overflow-x: hidden;
}
img, svg { display: block; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 800; line-height: 1.3; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
section[id] { scroll-margin-top: calc(var(--header-h) + 8px); }

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

.num, .latin, .wordmark, .step-num, .ph, .compare-vs { font-family: var(--font-px); font-weight: 400; }
.num, .ph { font-variant-numeric: tabular-nums; }

.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; }

.skip-link {
  position: absolute; inset-inline-start: var(--s4); top: -100px; z-index: 100;
  padding: var(--s2) var(--s4); background: var(--yellow); border: var(--border); font-weight: 800;
}
.skip-link:focus { top: var(--s2); }

:focus-visible { outline: var(--bw) solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 6px var(--yellow); }

/* ---------- Pixel icons ---------- */
.px-ico { image-rendering: pixelated; flex: none; }
.btn-ico { width: 24px; height: 20px; }
.li-ico { width: 14px; height: 12px; margin-top: 0.5em; }

/* ---------- Logo ---------- */
.logo {
  width: 40px; height: 40px;
  border: var(--border);
  box-shadow: var(--sh-sm);
  overflow: visible;
}
.logo-sm { width: 32px; height: 32px; }
.leaf { transform-box: fill-box; }
.brand:hover .leaf, .brand:focus-visible .leaf { animation: leaf-wiggle 360ms steps(1, end) 2; }
@keyframes leaf-wiggle {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(1px, -1px); }
  50%  { transform: translate(0, 0); }
  75%  { transform: translate(-1px, 0); }
}

.brand { display: inline-flex; align-items: center; gap: var(--s3); text-decoration: none; }
.wordmark { font-size: 22px; letter-spacing: 0.02em; line-height: 1; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 48px; padding: 0 var(--s5);
  border: var(--border); border-radius: 0;
  background: var(--yellow); color: var(--ink);
  font: 800 17px/1.2 var(--font-ar);
  text-decoration: none; cursor: pointer;
  box-shadow: var(--sh-sm);
  transition: transform var(--frame), box-shadow var(--frame);
  touch-action: manipulation;
}
.btn:hover { box-shadow: var(--sh); transform: translate(-2px, -2px); }
.btn:active { transform: translateY(4px); box-shadow: none; }
.btn-sm { min-height: 44px; padding: 0 var(--s4); font-size: 15px; }
.btn-lg { min-height: 60px; padding: 0 var(--s6); font-size: 19px; box-shadow: var(--sh); }
.btn-lg:hover { box-shadow: var(--sh-hover); }
.btn-block { width: 100%; }
.btn-ghost { background: var(--white); }
.btn-ink { background: var(--ink); color: var(--cream); box-shadow: 4px 4px 0 var(--cream), 8px 8px 0 var(--ink); }
.btn-ink:hover { box-shadow: 4px 4px 0 var(--cream), 8px 8px 0 var(--ink), 10px 10px 0 var(--ink); }
.btn-ink .btn-ico path[fill="#1B1B1F"] { fill: var(--yellow); }

.link-arrow { font-weight: 800; text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; text-decoration-color: var(--yellow); min-height: 44px; display: inline-flex; align-items: center; }
.link-arrow::after { content: ""; width: 12px; height: 10px; margin-inline-start: var(--s2); background: var(--ink); clip-path: polygon(0 50%, 50% 0, 50% 30%, 100% 30%, 100% 70%, 50% 70%, 50% 100%); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--cream);
  border-bottom: var(--border);
}
.header-row { display: flex; align-items: center; gap: var(--s4); min-height: var(--header-h); }
.header-row .brand { margin-inline-end: auto; }
.site-nav ul { display: flex; gap: var(--s1); }
.site-nav a:not(.btn) {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s3);
  font-weight: 800; text-decoration: none;
  border-bottom: var(--bw) solid transparent;
}
.site-nav a:not(.btn):hover { border-bottom-color: var(--yellow); }
.nav-cta { display: none; }

.menu-btn {
  display: none;
  width: 44px; height: 44px; padding: 0;
  border: var(--border); background: var(--white); cursor: pointer;
  box-shadow: var(--sh-sm);
}
.menu-btn:active { transform: translateY(4px); box-shadow: none; }
/* Pixel burger / pixel X (7x7 grid at 3px). */
.menu-bars { display: block; width: 21px; height: 21px; margin-inline: auto; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 7' shape-rendering='crispEdges'%3E%3Cpath fill='%231B1B1F' d='M0 0h7v1h-7zM0 3h7v1h-7zM0 6h7v1h-7z'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.menu-btn[aria-expanded="true"] .menu-bars { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 7' shape-rendering='crispEdges'%3E%3Cpath fill='%231B1B1F' d='M0 0h1v1h-1zM6 0h1v1h-1zM1 1h1v1h-1zM5 1h1v1h-1zM2 2h1v1h-1zM4 2h1v1h-1zM3 3h1v1h-1zM2 4h1v1h-1zM4 4h1v1h-1zM1 5h1v1h-1zM5 5h1v1h-1zM0 6h1v1h-1zM6 6h1v1h-1z'/%3E%3C/svg%3E"); }

@media (max-width: 859px) {
  .js .menu-btn { display: block; }
  .js .site-nav {
    display: none;
    position: absolute; top: 100%; inset-inline: 0;
    padding: var(--s4); background: var(--cream); border-bottom: var(--border);
  }
  .js .site-nav.open { display: grid; gap: var(--s3); }
  .js .site-nav ul { flex-direction: column; }
  .site-nav { order: 3; }
}
@media (max-width: 479px) {
  .header-cta { display: none; }
  .js .site-nav .nav-cta { display: inline-flex; }
}
html:not(.js) .header-row { flex-wrap: wrap; padding-block: var(--s2); }
html:not(.js) .site-nav ul { flex-wrap: wrap; }

/* ---------- Sparkles ---------- */
.spark {
  position: absolute; width: 20px; height: 20px; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 5 5' shape-rendering='crispEdges'%3E%3Cpath fill='%231B1B1F' d='M2 0h1v1h-1zM1 1h1v1h-1zM3 1h1v1h-1zM0 2h1v1h-1zM4 2h1v1h-1zM1 3h1v1h-1zM3 3h1v1h-1zM2 4h1v1h-1z'/%3E%3Cpath fill='%23FFD23F' d='M2 1h1v1h-1zM1 2h3v1h-3zM2 3h1v1h-1z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  image-rendering: pixelated;
  animation: blink 1.6s steps(1, end) infinite;
}
@keyframes blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: 0; } }

/* ---------- Hero ---------- */
.hero { position: relative; padding-block: var(--s7) var(--s8); overflow: hidden; }
.hero-grid { display: grid; gap: var(--s7); align-items: center; }
.hero-copy { display: grid; gap: var(--s5); justify-items: start; }
.eyebrow {
  display: inline-block; padding: var(--s1) var(--s3);
  border: var(--border); background: var(--white);
  font-size: 14px; font-weight: 800;
}
.hero-title { font-size: clamp(30px, 7.6vw, 50px); line-height: 1.45; }
.hero-title .tw { display: block; }
.hl {
  background: var(--yellow); color: var(--ink);
  padding: 0 0.2em;
  border: var(--border);
  box-shadow: var(--sh-sm);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.hero-sub { font-size: clamp(17px, 2.6vw, 20px); color: var(--muted); max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4) var(--s5); }

/* Typewriter (first line only). The ghost holds the space so nothing jumps. */
.tw-wrap { position: relative; display: block; }
.tw-ghost { visibility: hidden; }
.tw-live { position: absolute; inset: 0; }
.tw-cursor {
  display: inline-block; width: 0.45em; height: 0.9em; margin-inline-start: 0.08em;
  background: var(--ink); vertical-align: -0.08em;
  animation: blink 0.8s steps(1, end) 5;
  animation-fill-mode: forwards;
}

.sp1 { top: 18%; inset-inline-start: 4%; }
.sp2 { top: 64%; inset-inline-start: 46%; animation-delay: -0.5s; }
.sp3 { top: 10%; inset-inline-end: 6%; animation-delay: -1.1s; width: 16px; height: 16px; }

/* ---------- Hero scene (one SVG, 160 x 112 units; every motion runs in steps) ---------- */
.scene { justify-self: center; width: min(100%, 480px); }
.scene-svg { width: 100%; height: auto; direction: ltr; overflow: visible; }
.sc-ar { font-family: var(--font-ar); font-weight: 800; fill: var(--ink); }
.sc-num { font-family: var(--font-px); fill: var(--ink); }

.sc-cursor { transform: translate(128px, 100px); }
.sc-fly { opacity: 0; transform: translate(125px, 30px); }
.sc-pop { transform-box: fill-box; transform-origin: center; }
.sc-spark { animation: blink 1.4s steps(1, end) infinite; }
.sc-spark.s2 { animation-delay: -0.4s; }
.sc-spark.s3 { animation-delay: -0.9s; }
.sc-spark.s4 { animation-delay: -1.2s; }
.scene.paused .sc-spark { animation-play-state: paused; }

.scene.play .sc-cursor      { animation: sc-cursor 4.4s steps(4, end) forwards; }
.scene.play .sc-btn         { animation: sc-press 4.4s steps(1, end) forwards; }
.scene.play .sc-btn-shadow  { animation: sc-shadow 4.4s steps(1, end) forwards; }
.scene.play .sc-fly         { animation: sc-fly 4.4s steps(3, end) forwards; }
.scene.play .sc-pop         { animation: sc-pop 4.4s steps(1, end) forwards; }
.scene.play .sc-basket      { animation: sc-bounce 4.4s steps(1, end) forwards; }
.scene.play .sc-count       { animation: sc-bump 4.4s steps(1, end) forwards; }

@keyframes sc-cursor {
  0%   { transform: translate(128px, 100px); }
  22%  { transform: translate(92px, 70px); }
  25%  { transform: translate(92px, 71px); }
  30%  { transform: translate(92px, 70px); }
  60%  { transform: translate(92px, 70px); }
  84%, 100% { transform: translate(128px, 100px); }
}
@keyframes sc-press {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(1px, 1px); }
  31%, 100% { transform: translate(0, 0); }
}
@keyframes sc-shadow {
  0%   { opacity: 1; }
  25%  { opacity: 0; }
  31%, 100% { opacity: 1; }
}
@keyframes sc-fly {
  0%, 27% { opacity: 0; transform: translate(125px, 30px); }
  28%  { opacity: 1; transform: translate(125px, 30px); }
  37%  { opacity: 1; transform: translate(125px, 22px); }
  45%  { transform: translate(102px, 14px); }
  53%  { transform: translate(78px, 24px); }
  59%  { transform: translate(58px, 28px); }
  65%  { transform: translate(38px, 34px); }
  69%  { transform: translate(22px, 44px); }
  73%  { transform: translate(22px, 60px); }
  76%  { opacity: 1; transform: translate(22px, 72px); }
  77%, 100% { opacity: 0; transform: translate(22px, 72px); }
}
/* "Pop" out of the product card in 4 frames. */
@keyframes sc-pop {
  0%, 28% { transform: scale(0.4); }
  30%  { transform: scale(0.7); }
  32%  { transform: scale(1.25); }
  35%, 100% { transform: scale(1); }
}
@keyframes sc-bounce {
  0%, 76% { transform: translate(0, 0); }
  78%  { transform: translate(0, -3px); }
  82%  { transform: translate(0, 1px); }
  85%  { transform: translate(0, -1px); }
  88%, 100% { transform: translate(0, 0); }
}
@keyframes sc-bump {
  0%, 76% { transform: translate(0, 0); }
  77%  { transform: translate(0, -2px); }
  84%, 100% { transform: translate(0, 0); }
}

/* ---------- Sections ---------- */
.section { padding-block: var(--s8); }
.section-title { font-size: clamp(26px, 5vw, 38px); margin-bottom: var(--s6); }
.section-sub { margin-top: calc(-1 * var(--s4)); margin-bottom: var(--s6); color: var(--muted); font-size: 18px; }
.title-note {
  display: inline-block; vertical-align: middle;
  margin-inline-start: var(--s2); padding: 0 var(--s2);
  border: var(--border); background: var(--yellow);
  font-size: 15px; font-weight: 800;
}

.card {
  background: var(--white);
  border: var(--border);
  box-shadow: var(--sh);
  padding: var(--s5);
}

/* How it works */
.how { background: var(--white); border-block: var(--border); }
.steps { display: grid; gap: var(--s6); counter-reset: none; }
.step {
  position: relative;
  display: grid; gap: var(--s3); justify-items: start;
  padding: var(--s5);
  border: var(--border); background: var(--cream);
  box-shadow: var(--sh-sm);
  transition: background-color 160ms steps(2, end), box-shadow 160ms steps(2, end), transform 160ms steps(2, end);
}
.step-num {
  display: inline-block; padding: var(--s1) var(--s2);
  border: var(--border); background: var(--white);
  font-size: 18px; line-height: 1;
  transition: background-color 160ms steps(2, end);
}
.step-ico { width: 48px; height: 40px; }
.step-logo { width: 48px; height: 48px; border: var(--border); }
.step h3 { font-size: 20px; }
.step p { color: var(--muted); }
/* Lit: the step the reader has reached. */
.step.lit { background: var(--white); box-shadow: var(--sh); transform: translate(-2px, -2px); }
.step.lit .step-num { background: var(--yellow); }

/* Features */
.feature-grid { display: grid; gap: var(--s5); }
.feature { display: grid; gap: var(--s3); align-content: start; }
.feat-ico { width: 48px; height: 48px; }
.feature h3 { font-size: 19px; }
.feature p { color: var(--muted); font-size: 16px; }

/* Before / after */
.compare { background: var(--white); border-block: var(--border); }
.compare-grid { display: grid; gap: var(--s5); align-items: center; }
.compare-card { display: grid; justify-items: center; gap: var(--s3); text-align: center; padding-block: var(--s6); }
.compare-ico { width: 40px; height: 36px; }
.compare-logo { width: 56px; height: 56px; border: var(--border); }
.compare-label { font-size: 19px; font-weight: 800; }
.compare-value { font-size: clamp(30px, 6vw, 42px); font-weight: 800; line-height: 1.2; }
.compare-card.before { background: var(--cream); box-shadow: var(--sh-sm); }
.compare-card.after { background: var(--yellow); }
.compare-vs { justify-self: center; font-size: 22px; padding: var(--s1) var(--s3); border: var(--border); background: var(--ink); color: var(--cream); }

/* Pricing */
.price-grid { display: grid; gap: var(--s6); align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; gap: var(--s4); }
/* Sits on the card's top border, so every card's price lines up. */
.plan-badge {
  position: absolute; top: -15px; inset-inline-start: var(--s4);
  padding: 0 var(--s2);
  border: var(--border); background: var(--leaf-soft);
  font-size: 14px; font-weight: 800;
}
.plan-name { font-size: 22px; }
.plan-price { font-size: 32px; font-weight: 800; line-height: 1.2; }
.plan-price .ph { font-size: 26px; }
.currency { font-size: 20px; }
.plan-list { display: grid; gap: var(--s2); margin-bottom: auto; padding-bottom: var(--s3); }
.plan-list li { display: flex; gap: var(--s2); align-items: flex-start; }
.plan-featured { background: var(--cream); box-shadow: 4px 4px 0 var(--ink), 8px 8px 0 var(--ink), 12px 12px 0 var(--yellow), 14px 14px 0 var(--ink); }
.ph { padding: 0 var(--s1); background: var(--cream); outline: 2px dashed var(--muted); outline-offset: 1px; font-size: 0.85em; }
.plan-featured .ph { background: var(--white); }

/* FAQ */
.faq-list { display: grid; gap: var(--s4); }
.faq-item { border: var(--border); background: var(--white); box-shadow: var(--sh-sm); }
.faq-item summary {
  display: flex; justify-content: space-between; align-items: center; gap: var(--s4);
  min-height: 56px; padding: var(--s3) var(--s4);
  font-size: 18px; font-weight: 800; cursor: pointer; list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
/* Pixel plus that turns into a minus. */
.faq-item summary::after {
  content: ""; flex: none; width: 20px; height: 20px;
  background:
    linear-gradient(var(--ink), var(--ink)) center / 20px 4px no-repeat,
    linear-gradient(var(--ink), var(--ink)) center / 4px 20px no-repeat;
}
.faq-item[open] summary { background: var(--yellow); border-bottom: var(--border); }
.faq-item[open] summary::after { background: linear-gradient(var(--ink), var(--ink)) center / 20px 4px no-repeat; }
.faq-body { padding: var(--s4); color: var(--muted); }

/* Final CTA */
.final { padding-bottom: var(--s8); }
.final-box {
  position: relative;
  display: grid; justify-items: center; gap: var(--s4); text-align: center;
  padding: var(--s7) var(--s5);
  background: var(--yellow);
  border: var(--border);
  box-shadow: var(--sh);
}
.final-logo { width: 72px; height: 72px; border: var(--border); box-shadow: var(--sh-sm); }
.final-title { font-size: clamp(26px, 5vw, 38px); }
.final-box p { font-size: 18px; }
.sp4 { top: 16px; inset-inline-start: 16px; }
.sp5 { bottom: 20px; inset-inline-end: 24px; animation-delay: -0.8s; }

/* Footer */
.site-footer { border-top: var(--border); background: var(--white); padding-block: var(--s6); }
.footer-row { display: grid; gap: var(--s4); justify-items: start; }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); }
.footer-links a { display: inline-flex; min-height: 44px; align-items: center; font-weight: 800; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.footer-note { color: var(--muted); font-size: 15px; }
.footer-copy { font-size: 14px; }

/* ---------- Legal pages (terms.html, privacy.html) ---------- */
.legal { padding-block: var(--s6) var(--s8); }
.legal .container { display: grid; gap: var(--s6); }
.legal-head { display: grid; gap: var(--s2); justify-items: start; }
.legal-back {
  display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px;
  font-weight: 800; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px;
}
/* Pixel arrow pointing back (to the right in RTL). */
.legal-back::before {
  content: ""; width: 12px; height: 10px; background: var(--ink);
  clip-path: polygon(100% 50%, 50% 0, 50% 30%, 0 30%, 0 70%, 50% 70%, 50% 100%);
}
.legal-title { font-size: clamp(30px, 7vw, 44px); }
.legal-date { color: var(--muted); }

.legal-summary {
  display: grid; gap: var(--s3);
  padding: var(--s5); background: var(--yellow);
  border: var(--border); box-shadow: var(--sh);
}
.legal-summary-title, .legal-toc-title { font-size: 20px; }
.legal-summary ul { display: grid; gap: var(--s2); }
.legal-summary li { display: flex; gap: var(--s3); align-items: baseline; font-weight: 800; }
.legal-summary li::before { content: ""; flex: none; width: 10px; height: 10px; background: var(--ink); translate: 0 -2px; }

.legal-toc { display: grid; gap: var(--s3); padding: var(--s5); background: var(--white); border: var(--border); box-shadow: var(--sh-sm); }
.legal-toc ol { display: grid; gap: 0 var(--s5); counter-reset: toc; }
.legal-toc li { counter-increment: toc; }
.legal-toc a {
  display: flex; gap: var(--s3); align-items: center; min-height: 44px;
  font-weight: 800; text-decoration: none; border-bottom: 2px solid transparent;
}
.legal-toc a::before { content: counter(toc, decimal-leading-zero); font-family: var(--font-px); font-weight: 400; color: var(--muted); min-width: 2ch; }
.legal-toc a:hover { text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--yellow); text-underline-offset: 6px; }

.legal-doc { display: grid; padding: var(--s5); background: var(--white); border: var(--border); box-shadow: var(--sh); }
.legal-sec { display: grid; gap: var(--s3); padding-block: var(--s5); border-bottom: 2px dashed var(--muted); }
.legal-sec:first-child { padding-top: 0; }
.legal-sec:last-child { padding-bottom: 0; border-bottom: 0; }
.legal-sec h2 { display: flex; gap: var(--s3); align-items: center; font-size: 21px; }
.legal-n {
  flex: none; display: inline-grid; place-items: center; min-width: 40px; height: 32px; padding-inline: var(--s1);
  background: var(--yellow); border: var(--border); font-size: 14px; line-height: 1;
}
.legal-sec p, .legal-sec li { line-height: 1.9; }
.legal-sec ul { display: grid; gap: var(--s2); }
.legal-sec li { position: relative; padding-inline-start: var(--s5); }
.legal-sec li::before { content: ""; position: absolute; inset-inline-start: 4px; top: 0.75em; width: 8px; height: 8px; background: var(--ink); }
.legal-also { font-weight: 800; }
.legal-also a { text-decoration-thickness: 2px; text-underline-offset: 5px; }
.footer-links a[aria-current="page"] { text-decoration-color: var(--yellow); text-decoration-thickness: 4px; }

@media (min-width: 600px) {
  .legal-doc { padding: var(--s6); }
  .legal-toc ol { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Buy page ---------- */
.buy-page .container { gap: var(--s5); }
.test-banner { padding: var(--s3) var(--s4); border: var(--bw) dashed var(--ink); background: var(--leaf-soft); }
.test-banner a { font-weight: 800; }
.acct-box { padding: var(--s3) var(--s4); border: var(--border); background: var(--white); box-shadow: var(--sh-sm); }
.acct-box.ok { background: var(--leaf-soft); }
.acct-id { margin-inline-start: var(--s1); font-size: 14px; }
.buy-grid { margin-top: var(--s4); }
.plan-picked { outline: var(--bw) dashed var(--ink); outline-offset: 6px; }
.buy-msg { padding: var(--s3) var(--s4); border: var(--border); background: #FDE9DA; font-weight: 800; }
.buy-note { color: var(--muted); }
.buy-note a { font-weight: 800; color: var(--ink); }

/* ---------- Success page ---------- */
.success-page .container { gap: var(--s5); }
/* Confetti flies outside the column: never let it widen the page. */
.success-page { overflow-x: clip; }
.success-wait { display: grid; gap: var(--s4); justify-items: center; text-align: center; padding: var(--s6) var(--s5); }
.success-title { font-size: clamp(24px, 5.5vw, 34px); text-align: center; }
/* Pixel loading bar: blocks fill in steps, then start again. */
.px-bar { width: min(320px, 100%); height: 24px; padding: 3px; border: var(--border); background: var(--white); }
.px-bar span { display: block; height: 100%; width: 100%; background: repeating-linear-gradient(90deg, var(--yellow) 0 14px, transparent 14px 18px); animation: px-fill 1.6s steps(10, end) infinite; }
@keyframes px-fill { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
[dir="rtl"] .px-bar span { animation-name: px-fill-rtl; }
@keyframes px-fill-rtl { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 0 0 0); } }

.success-done { display: grid; gap: var(--s4); justify-items: center; text-align: center; }
/* Celebration stage (about 10 s, all stepped). success.js adds .play, and .done at the end or on skip. */
.stage {
  position: relative; width: min(560px, 100%); height: 320px; margin-top: var(--s4);
  border: var(--border); background: var(--white); box-shadow: var(--sh); overflow: hidden;
}
.stamp {
  position: absolute; top: 18px; left: 50%; translate: -50% 0; z-index: 3;
  padding: var(--s1) var(--s4); border: var(--border); background: var(--leaf); color: var(--white);
  font-weight: 800; font-size: 20px; box-shadow: var(--sh-sm); white-space: nowrap;
}
.play .stamp { animation: stamp 600ms steps(4, end) 200ms both; }
@keyframes stamp { 0% { transform: translateY(-90px); } 75% { transform: translateY(6px); } 100% { transform: translateY(0); } }
.stage .spark { position: absolute; z-index: 1; }
.cel-basket {
  position: absolute; left: 50%; bottom: 20px; translate: -50% 0; z-index: 2;
  width: 168px; height: 168px; border: var(--border); box-shadow: var(--sh-sm); overflow: visible;
}
.cel-basket.bump { transform: translateY(4px); }
.cel-basket .bx { transform-box: fill-box; transform: translateY(var(--to)); }
.bx0 { --to: 6px; --d: 1.2s; }
.bx1 { --to: 6px; --d: 1.7s; }
.bx2 { --to: 6px; --d: 2.2s; }
.bx3 { --to: 6px; --d: 2.7s; }
.bx4 { --to: 4px; --d: 3.2s; }
.bx5 { --to: 4px; --d: 3.7s; }
.bx6 { --to: 4px; --d: 4.2s; }
.bx7 { --to: 2px; --d: 4.7s; }
.play .cel-basket .bx { opacity: 0; animation: drop 560ms steps(7, end) var(--d) forwards; }
@keyframes drop { 0% { opacity: 1; transform: translateY(-6px); } 100% { opacity: 1; transform: translateY(var(--to)); } }
.play .cel-basket .leaf { transform-box: fill-box; transform-origin: 0 100%; animation: leaf 900ms steps(3, end) 5.4s 2; }
@keyframes leaf { 50% { transform: rotate(-25deg); } }
.rain { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.rn { position: absolute; top: -12px; opacity: 0; }
.play .rn { animation: rain var(--dur) steps(12, end) var(--dl) 2; }
@keyframes rain { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 1; transform: translateY(340px); } }
.fw { position: absolute; z-index: 3; width: 0; height: 0; }
.fw .p { position: absolute; width: 8px; height: 8px; margin: -4px; opacity: 0; }
.play .fw .p { animation: burst 900ms steps(6, end) var(--fd) forwards; }
@keyframes burst { 0% { opacity: 1; transform: translate(0, 0); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)); } }
.rn:nth-child(1) { left: 59%; width: 10px; height: 10px; background: var(--yellow); --dur: 2.5s; --dl: 7.36s; }
.rn:nth-child(2) { left: 77%; width: 6px; height: 6px; background: var(--leaf); --dur: 1.9s; --dl: 8.41s; }
.rn:nth-child(3) { left: 62%; width: 10px; height: 10px; background: var(--ink); --dur: 1.9s; --dl: 6.28s; }
.rn:nth-child(4) { left: 40%; width: 6px; height: 6px; background: var(--leaf); --dur: 1.6s; --dl: 7.62s; }
.rn:nth-child(5) { left: 90%; width: 10px; height: 10px; background: var(--yellow); --dur: 1.6s; --dl: 7.79s; }
.rn:nth-child(6) { left: 52%; width: 8px; height: 8px; background: var(--yellow); --dur: 1.9s; --dl: 7.87s; }
.rn:nth-child(7) { left: 69%; width: 6px; height: 6px; background: var(--leaf); --dur: 1.6s; --dl: 6.11s; }
.rn:nth-child(8) { left: 32%; width: 10px; height: 10px; background: var(--ink); --dur: 1.6s; --dl: 8.33s; }
.rn:nth-child(9) { left: 43%; width: 8px; height: 8px; background: var(--leaf); --dur: 1.9s; --dl: 7.56s; }
.rn:nth-child(10) { left: 83%; width: 8px; height: 8px; background: var(--yellow); --dur: 2.5s; --dl: 6.01s; }
.rn:nth-child(11) { left: 12%; width: 8px; height: 8px; background: var(--yellow); --dur: 2.2s; --dl: 7.22s; }
.rn:nth-child(12) { left: 72%; width: 6px; height: 6px; background: var(--leaf); --dur: 2.2s; --dl: 6.95s; }
.rn:nth-child(13) { left: 31%; width: 10px; height: 10px; background: var(--ink); --dur: 2.2s; --dl: 6.09s; }
.rn:nth-child(14) { left: 74%; width: 6px; height: 6px; background: var(--leaf); --dur: 2.5s; --dl: 6.32s; }
.rn:nth-child(15) { left: 39%; width: 8px; height: 8px; background: var(--yellow); --dur: 1.6s; --dl: 8.87s; }
.rn:nth-child(16) { left: 89%; width: 6px; height: 6px; background: var(--yellow); --dur: 1.9s; --dl: 6.63s; }
.rn:nth-child(17) { left: 8%; width: 8px; height: 8px; background: var(--leaf); --dur: 2.5s; --dl: 8.94s; }
.rn:nth-child(18) { left: 52%; width: 8px; height: 8px; background: var(--ink); --dur: 1.6s; --dl: 7.70s; }
.rn:nth-child(19) { left: 27%; width: 10px; height: 10px; background: var(--leaf); --dur: 2.2s; --dl: 7.01s; }
.rn:nth-child(20) { left: 41%; width: 8px; height: 8px; background: var(--yellow); --dur: 1.6s; --dl: 8.89s; }
.rn:nth-child(21) { left: 17%; width: 6px; height: 6px; background: var(--yellow); --dur: 1.9s; --dl: 8.12s; }
.rn:nth-child(22) { left: 3%; width: 6px; height: 6px; background: var(--leaf); --dur: 2.5s; --dl: 8.39s; }
.rn:nth-child(23) { left: 24%; width: 10px; height: 10px; background: var(--ink); --dur: 1.9s; --dl: 7.34s; }
.rn:nth-child(24) { left: 26%; width: 10px; height: 10px; background: var(--leaf); --dur: 1.9s; --dl: 7.26s; }
.rn:nth-child(25) { left: 51%; width: 6px; height: 6px; background: var(--yellow); --dur: 2.5s; --dl: 7.26s; }
.rn:nth-child(26) { left: 29%; width: 6px; height: 6px; background: var(--yellow); --dur: 2.2s; --dl: 8.59s; }
.rn:nth-child(27) { left: 77%; width: 8px; height: 8px; background: var(--leaf); --dur: 1.6s; --dl: 6.63s; }
.rn:nth-child(28) { left: 52%; width: 10px; height: 10px; background: var(--ink); --dur: 1.6s; --dl: 6.13s; }
.rn:nth-child(29) { left: 20%; width: 6px; height: 6px; background: var(--leaf); --dur: 2.5s; --dl: 6.77s; }
.rn:nth-child(30) { left: 80%; width: 8px; height: 8px; background: var(--yellow); --dur: 2.2s; --dl: 7.16s; }
.rn:nth-child(31) { left: 11%; width: 6px; height: 6px; background: var(--yellow); --dur: 1.9s; --dl: 7.75s; }
.rn:nth-child(32) { left: 33%; width: 6px; height: 6px; background: var(--leaf); --dur: 2.2s; --dl: 7.12s; }
.fw .p:nth-child(1) { --dx: 54px; --dy: 0px; }
.fw .p:nth-child(2) { --dx: 38px; --dy: 38px; }
.fw .p:nth-child(3) { --dx: 0px; --dy: 54px; }
.fw .p:nth-child(4) { --dx: -38px; --dy: 38px; }
.fw .p:nth-child(5) { --dx: -54px; --dy: 0px; }
.fw .p:nth-child(6) { --dx: -38px; --dy: -38px; }
.fw .p:nth-child(7) { --dx: 0px; --dy: -54px; }
.fw .p:nth-child(8) { --dx: 38px; --dy: -38px; }
.fw0 { left: 18%; top: 28%; --fd: 5.8s; } .fw0 .p { background: var(--leaf); }
.fw1 { left: 78%; top: 22%; --fd: 6.5s; } .fw1 .p { background: var(--yellow); }
.fw2 { left: 80%; top: 70%; --fd: 7.2s; } .fw2 .p { background: var(--ink); }
.sk0 { left: 6%; top: 18%; animation-delay: -0.00s; }
.sk1 { left: 88%; top: 12%; animation-delay: -0.27s; }
.sk2 { left: 14%; top: 70%; animation-delay: -0.54s; }
.sk3 { left: 84%; top: 64%; animation-delay: -0.81s; }
.sk4 { left: 30%; top: 8%; animation-delay: -1.08s; }
.sk5 { left: 66%; top: 40%; animation-delay: -1.35s; }
.cel-count.pop .num { animation: pop 400ms steps(3, end); }
@keyframes pop { 50% { transform: scale(1.25); } }
.cel-count .num { display: inline-block; }
.skip-anim { min-height: 44px; padding: 0 var(--s3); border: 0; background: none; color: var(--muted); font: 800 15px var(--font-ar); text-decoration: underline; cursor: pointer; }
.after { display: grid; gap: var(--s4); justify-items: center; width: 100%; }
.play .after:not(.in) { opacity: 0; pointer-events: none; }
.after.in { animation: dissolve 360ms steps(4, end) both; }
/* Done (end of the show, skip, or reduced motion): final picture, nothing moving. */
.done .stamp, .done .cel-basket .bx, .done .cel-basket .leaf { animation: none; opacity: 1; }
.done .rain, .done .fw, .done ~ .skip-anim { display: none; }
@media (prefers-reduced-motion: reduce) { .rain, .fw, .skip-anim { display: none; } }
.cel-count { font-size: 22px; font-weight: 800; }
.cel-count .num { font-size: 44px; padding: 0 var(--s2); background: var(--yellow); border: var(--border); }
.test-badge { padding: 0 var(--s2); border: var(--bw) dashed var(--ink); background: var(--leaf-soft); font-weight: 800; font-size: 14px; }
.done-sub { font-size: 18px; color: var(--muted); }

.code-box { display: grid; gap: var(--s3); width: 100%; padding: var(--s5); border: var(--border); background: var(--white); box-shadow: var(--sh); text-align: start; }
.code-label { font-weight: 800; }
.code-row { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: stretch; }
.code { flex: 1 1 260px; display: flex; align-items: center; justify-content: center; min-height: 56px; padding: 0 var(--s3); border: var(--bw) dashed var(--ink); background: var(--cream); font-family: var(--font-px); font-size: clamp(15px, 4.2vw, 26px); letter-spacing: .04em; white-space: nowrap; user-select: all; }
.field { flex: 1 1 240px; min-height: 48px; padding: 0 var(--s3); border: var(--border); background: var(--white); font: 500 16px/1 ui-monospace, Menlo, monospace; color: var(--ink); }
.field:focus-visible { outline-offset: 2px; }
.choices { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s2); }
.acct-form { display: grid; gap: var(--s2); margin-top: var(--s3); padding-top: var(--s4); border-top: 2px dashed var(--muted); }
.acct-form label { font-weight: 800; }
.small-msg { font-weight: 800; }
.small-msg.ok { color: #1D6B3E; }
.small-msg.bad { color: #A9410A; }
.step h2 { font-size: 20px; }
@media (min-width: 860px) { .price-grid.buy-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Pixel dissolve reveal (only when JS is on) ---------- */
.js .reveal { opacity: 0; transform: translateY(4px); }
.js .reveal.in { animation: dissolve 360ms steps(4, end) forwards; }
@keyframes dissolve {
  0%   { opacity: 0; transform: translateY(4px); }
  50%  { opacity: 0.5; transform: translateY(4px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ---------- Larger screens ---------- */
@media (min-width: 600px) {
  .container { padding-inline: var(--s5); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .compare-grid { grid-template-columns: 1fr auto 1fr; }
  .price-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 860px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: var(--s7); }
  /* Pixel arrow between steps, pointing to the next one (left in RTL). */
  .step:not(:last-child)::after {
    content: ""; position: absolute; top: 50%; inset-inline-end: calc(-1 * var(--s7) + 8px);
    width: 32px; height: 20px; translate: 0 -50%;
    background: var(--ink);
    clip-path: polygon(0 50%, 40% 0, 40% 30%, 100% 30%, 100% 70%, 40% 70%, 40% 100%);
  }
  .feature-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-row { grid-template-columns: auto 1fr auto; align-items: center; }
  .footer-note { grid-column: 1 / -1; }
}
@media (min-width: 1080px) {
  .price-grid { grid-template-columns: repeat(4, 1fr); gap: var(--s5); }
}
@media (min-width: 960px) {
  .hero { padding-block: var(--s8) 96px; }
  .hero-grid { grid-template-columns: 1.2fr 1fr; }
}

/* ---------- Reduced motion: no animation, final state shown ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .sc-cursor { transform: translate(92px, 70px); }
  .btn:hover, .step.lit { transform: none; }
}

/* ---------- Paddle review pages: header link, English versions, pricing page ---------- */
.header-link {
  display: inline-flex; align-items: center; min-height: 44px; padding-inline: var(--s2);
  font-weight: 800; text-decoration: underline; text-decoration-thickness: 3px;
  text-underline-offset: 6px; text-decoration-color: var(--yellow);
}
.header-link:hover, .header-link[aria-current="page"] { text-decoration-color: var(--ink); }
.lang-jump {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s3);
  font-family: var(--font-px); font-size: 14px; text-decoration: none;
  background: var(--white); border: var(--border); box-shadow: var(--sh-sm);
}
.lang-jump[lang="ar"] { font-family: var(--font-ar); font-weight: 800; font-size: 16px; }
.lang-jump:hover { background: var(--yellow); }

/* English blocks: Tajawal's Latin glyphs for reading, Silkscreen for headings and numbers. */
.legal-en { display: grid; gap: var(--s6); margin-top: var(--s8); padding-top: var(--s7); border-top: var(--bw) dashed var(--ink); }
.legal-en .legal-title, .legal-en .legal-sec h2, .legal-en .legal-summary-title, .legal-en .legal-toc-title,
.about-en .section-title { font-family: var(--font-px); font-weight: 400; letter-spacing: 0.01em; }
.legal-en .legal-title { font-size: clamp(24px, 5vw, 34px); }
.legal-en .legal-sec h2 { font-size: 18px; line-height: 1.4; }
.legal-en .legal-summary-title, .legal-en .legal-toc-title { font-size: 17px; }
.legal-en .legal-toc a { font-weight: 500; }
.en-label { font-family: var(--font-px); font-size: 14px; padding: var(--s1) var(--s2); background: var(--ink); color: var(--cream); }
.legal-en .legal-back::before { transform: scaleX(-1); }
.en-quote { display: block; padding: var(--s3) var(--s4); background: var(--cream); border-inline-start: 6px solid var(--yellow); font-weight: 800; text-align: left; }
.legal-sec .anchor { position: relative; top: calc(-1 * var(--header-h)); }
.legal-sec { scroll-margin-top: calc(var(--header-h) + var(--s3)); }
.legal-en, #en { scroll-margin-top: var(--header-h); }

.footer-links a { gap: var(--s2); }
.fl-en { font-family: var(--font-px); font-weight: 400; font-size: 12px; color: var(--muted); }
.footer-seller { font-size: 14px; color: var(--muted); }
.footer-copy .ph, .footer-seller .ph { font-size: 12px; }
.legal .ph, .site-footer .ph, .about-en .ph { margin-inline: 4px; }

.pricing-page .price-grid { margin-top: var(--s2); }
.price-notes ul { display: grid; gap: var(--s2); }
.price-notes li { position: relative; padding-inline-start: var(--s5); }
.price-notes li::before { content: ""; position: absolute; inset-inline-start: 4px; top: 0.75em; width: 8px; height: 8px; background: var(--ink); }
.price-table { width: 100%; border-collapse: collapse; }
.price-table caption { text-align: start; font-weight: 800; padding-bottom: var(--s3); }
.price-table th, .price-table td { padding: var(--s3) var(--s2); border-bottom: 2px dashed var(--muted); text-align: start; }
.price-table thead th { border-bottom: var(--border); font-family: var(--font-px); font-weight: 400; font-size: 14px; }
.price-table td:nth-child(2), .price-table td:nth-child(3) { font-family: var(--font-px); font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-table tbody tr:last-child th, .price-table tbody tr:last-child td { border-bottom: 0; }

.about-en { background: var(--white); border-block: var(--border); }
.about-en .container { display: grid; gap: var(--s4); }
.about-en .section-title { margin-bottom: 0; }
.about-en p { color: var(--muted); }
.about-en a { font-weight: 800; }

.site-header .header-row > .btn-sm { white-space: nowrap; }
@media (max-width: 479px) {
  .site-header .header-row { gap: var(--s2); }
  .site-header .header-row > .btn-sm { padding: 0 var(--s3); font-size: 14px; }
  .header-link { padding-inline: var(--s1); }
}
