/* ─────────────────────────────────────────────────────────────
   Qandeel help centre. Same clay-warm language as the site and the app:
   cream paper, amber, terracotta, palm; Shuala whole and reacting; short text.
   No inline styles anywhere (the page CSP forbids them).
   ───────────────────────────────────────────────────────────── */
:root {
  --paper: #fbf7f0;
  --cream: #fff9ef;
  --ink: #1b1645;
  --ink-2: #3a3463;
  --muted: #655e82;
  --line: #e9dfcf;
  --sand-2: #f7e6d1;
  --sand-3: #fbefe0;
  --clay: #c8683a;
  --palm: #2f7a4e;
  --amber-200: #ffe6a8;
  --amber-300: #ffc85a;
  --amber-400: #f9b13a;
  --amber-edge: #d9850f;
  --on-amber: #2a1a05;
  --display: "Kufam", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --body: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 28px;
  --ease-land: cubic-bezier(.1, .75, .15, 1);
  --ease-pop: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: light;
}
:root[lang="en"] {
  --display: "Parkinsans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Parkinsans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
/* tints for the topic cards, one per topic */
.t1 { --tint: #ffefc4; --tint-2: #ffe2a0; }
.t2 { --tint: #e1f0de; --tint-2: #c9e4c4; }
.t3 { --tint: #dcebf7; --tint-2: #c3dcf0; }
.t4 { --tint: #fde6d6; --tint-2: #f9d2b8; }
.t5 { --tint: #fbe3e5; --tint-2: #f6cdd2; }
.t6 { --tint: #f1e6fb; --tint-2: #e3d2f5; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--paper); scroll-padding-top: 90px; }
body {
  margin: 0; min-height: 100svh; display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink);
  font: 400 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
main { flex: 1; }
img, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--amber-400); outline-offset: 3px; border-radius: 12px; }
.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 { position: absolute; inset-inline-start: 12px; top: -80px; z-index: 20; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: #fff; }
.skip:focus { top: 12px; }
.ico { width: 22px; height: 22px; flex: none; }
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }

/* one language at a time */
html[lang="ar"] [data-l="en"], html[lang="en"] [data-l="ar"] { display: none !important; }

.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: clamp(16px, 4vw, 40px); }

/* ═════════ top bar ═════════ */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 1320px; margin-inline: auto; width: 100%;
  padding: 14px clamp(16px, 4vw, 40px);
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; min-height: 44px; }
.brand img { height: 32px; width: auto; }
.brand__help {
  padding: 3px 12px; border-radius: 999px; background: var(--amber-200); color: var(--on-amber);
  font: 600 14px/1.5 var(--body);
}
.top__end { display: flex; align-items: center; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--cream); color: var(--ink-2);
  font-size: 15px; font-weight: 500;
  transition: background .15s, transform .12s;
}
.chip:hover { background: #fff; }
.chip:active { transform: translateY(2px); }
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 10px 24px;
  border-radius: 999px; text-decoration: none; font-weight: 600;
  background: var(--amber-300); color: var(--on-amber);
  box-shadow: 0 4px 0 var(--amber-edge), 0 14px 24px -14px rgba(180, 100, 0, .6);
  transition: transform .12s, box-shadow .12s;
}
.pill:active { transform: translateY(4px); box-shadow: 0 0 0 var(--amber-edge); }
.pill--sm { min-height: 44px; padding: 6px 20px; font-size: 15px; box-shadow: 0 3px 0 var(--amber-edge); }
.pill--sm:active { transform: translateY(3px); }

/* ═════════ home hero ═════════ */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  max-width: 1320px; width: calc(100% - 20px); margin: 4px auto 0;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); align-items: end; gap: 12px;
  padding: clamp(28px, 5vw, 64px) clamp(20px, 5vw, 72px) 0;
  border-radius: var(--r);
  background:
    radial-gradient(60% 80% at 82% 60%, rgba(255, 214, 120, .75), rgba(255, 214, 120, 0) 70%),
    linear-gradient(180deg, var(--sand-3), var(--sand-2));
  min-height: clamp(340px, 50svh, 520px);
}
[dir="rtl"] .hero { background:
    radial-gradient(60% 80% at 18% 60%, rgba(255, 214, 120, .75), rgba(255, 214, 120, 0) 70%),
    linear-gradient(180deg, var(--sand-3), var(--sand-2)); }
.hero__text { align-self: center; padding-bottom: clamp(28px, 5vw, 64px); min-width: 0; }
h1 {
  margin: 0 0 22px; font: 600 clamp(38px, 6vw, 80px)/1.12 var(--display); color: var(--ink); text-wrap: balance;
}
[dir="ltr"] h1 { font-weight: 400; letter-spacing: -.02em; line-height: 1.04; }
.hero__shu { align-self: end; justify-self: center; }
.hero__shu .shu { width: auto; max-width: 100%; height: clamp(230px, 44svh, 420px); animation: bob 4.2s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-8px) rotate(1.2deg); } }

.search {
  position: relative; display: flex; align-items: center; gap: 12px; max-width: 640px;
  padding-inline: 22px; min-height: 68px; border-radius: 999px;
  background: #fff; border: 2px solid var(--line);
  box-shadow: 0 4px 0 var(--line), 0 18px 30px -20px rgba(80, 40, 0, .5);
  color: var(--muted);
  transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: var(--amber-400); box-shadow: 0 4px 0 var(--amber-300), 0 18px 30px -20px rgba(180, 100, 0, .5); color: var(--amber-edge); }
.search input {
  flex: 1; min-width: 0; height: 64px; border: 0; background: transparent; outline: none;
  font-size: 18px; color: var(--ink); text-overflow: ellipsis;
}
.search input::placeholder { color: #8a83a3; }
.search input::-webkit-search-cancel-button { appearance: none; }
.results {
  max-width: 640px; margin-top: 14px; padding: 8px; border-radius: 24px;
  background: #fff; border: 1px solid var(--line); box-shadow: 0 18px 40px -24px rgba(60, 30, 0, .5);
}
.hits { list-style: none; margin: 0; padding: 0; }
.hits a { display: grid; gap: 2px; padding: 12px 16px; border-radius: 18px; text-decoration: none; }
.hits a:hover, .hits a:focus-visible { background: var(--sand-3); }
.hit__g { font-size: 13px; font-weight: 600; color: var(--clay); }
.hit__q { font: 600 18px/1.35 var(--display); }
:root[lang="en"] .hit__q { font-weight: 400; }
.hit__a { color: var(--muted); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hits__none { margin: 0; padding: 14px 16px; color: var(--muted); }

/* ═════════ topic cards ═════════ */
.topics {
  list-style: none; margin: clamp(28px, 4vw, 48px) 0 clamp(40px, 6vw, 80px); padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 20px);
}
.topic {
  position: relative; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "t shu" "b shu"; align-content: center; gap: 2px 8px;
  min-height: 170px; height: 100%; padding: 22px 24px; overflow: hidden;
  border-radius: var(--r); text-decoration: none;
  background: linear-gradient(160deg, var(--tint), var(--tint-2));
  box-shadow: 0 5px 0 rgba(0, 0, 0, .06), 0 20px 30px -24px rgba(60, 30, 0, .55);
  transition: transform .35s var(--ease-pop), box-shadow .2s;
}
.topic:hover { transform: translateY(-6px) rotate(-.4deg); box-shadow: 0 9px 0 rgba(0, 0, 0, .06), 0 28px 34px -24px rgba(60, 30, 0, .55); }
.topic:active { transform: translateY(1px); }
.topic__t { grid-area: t; align-self: end; font: 600 clamp(21px, 2vw, 26px)/1.25 var(--display); color: var(--ink); }
:root[lang="en"] .topic__t { font-weight: 400; }
.topic__b { grid-area: b; align-self: start; color: var(--ink-2); font-size: 15.5px; line-height: 1.45; }
.topic__shu { grid-area: shu; width: 112px; height: auto; align-self: end; margin-block: -8px -22px; transition: transform .45s var(--ease-pop); }
.topic:hover .topic__shu { transform: translateY(-6px) scale(1.06) rotate(3deg); }
.topic__go { display: none; }

/* ═════════ sub pages ═════════ */
.skip + .top + main, main > .wrap { padding-bottom: clamp(32px, 5vw, 64px); }
.crumb { padding-block: 6px 0; }
.crumb a { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; color: var(--muted); font-weight: 500; text-decoration: none; }
.crumb a:hover { color: var(--ink); }
.crumb .ico { width: 18px; height: 18px; transform: scaleX(-1); }
[dir="rtl"] .crumb .ico { transform: none; }
.subhead {
  position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  margin-block: 6px 28px; padding: clamp(22px, 4vw, 44px) clamp(22px, 4vw, 48px) 0; overflow: hidden;
  border-radius: var(--r); min-height: 200px;
  background: linear-gradient(160deg, var(--tint), var(--tint-2));
}
.subhead__text { padding-bottom: clamp(22px, 4vw, 44px); min-width: 0; align-self: center; }
.subhead h1 { margin: 0 0 6px; font-size: clamp(32px, 4.6vw, 56px); }
.subhead__blurb { margin: 0; color: var(--ink-2); font-size: clamp(16px, 1.5vw, 19px); }
.subhead__shu { width: clamp(120px, 20vw, 220px); height: auto; flex: none; margin-bottom: -6px; animation: bob 4.6s ease-in-out infinite; transform-origin: 50% 100%; }

.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 20px); }
.card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 22px 26px 24px;
  border-radius: 24px; background: #fff; border: 1px solid var(--line);
  box-shadow: 0 3px 0 var(--line), 0 16px 26px -22px rgba(60, 30, 0, .45);
  scroll-margin-top: 90px;
}
.card:target { border-color: var(--amber-400); box-shadow: 0 0 0 4px rgba(249, 177, 58, .35), 0 16px 26px -22px rgba(60, 30, 0, .45); }
.card h2 { margin: 0; font: 600 clamp(19px, 1.7vw, 22px)/1.35 var(--display); }
:root[lang="en"] .card h2 { font-weight: 400; }
.card p { margin: 0; color: var(--ink-2); font-size: 16.5px; line-height: 1.65; }
.more {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; min-height: 44px; padding-block: 4px;
  color: var(--clay); font-weight: 600; text-decoration: none;
}
.more:hover { text-decoration: underline; text-underline-offset: 4px; }
.more .ico { width: 18px; height: 18px; }

/* getting started: three big steps */
.steps { list-style: none; margin: 0 0 22px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 1.6vw, 20px); }
.step {
  display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 14px 20px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); font: 600 clamp(16px, 1.6vw, 20px)/1.3 var(--display);
  box-shadow: 0 3px 0 var(--line);
}
:root[lang="en"] .step { font-weight: 400; }
.step__n {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%;
  background: var(--amber-300); color: var(--on-amber); font: 700 20px/1 var(--display);
  box-shadow: 0 3px 0 var(--amber-edge);
}

/* lessons: the five steps */
.flow { list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(8px, 1.4vw, 16px); counter-reset: n; }
.flow__s {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px;
  padding: 16px 12px 18px; border-radius: 24px; text-align: center; background: #fff; border: 1px solid var(--line);
  box-shadow: 0 3px 0 var(--line);
}
.flow__s.is-lamp { background: linear-gradient(180deg, #fff4d0, #ffe6a8); border-color: #f3cf7c; }
.flow__n {
  position: absolute; top: 10px; inset-inline-start: 10px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--amber-300); color: var(--on-amber); font: 700 15px/1 var(--display);
}
.flow__shu { width: 100%; max-width: 124px; height: auto; }
.flow .lamp { --lw: 74px; margin-block: 14px 4px; }
.flow__t { font: 600 clamp(16px, 1.5vw, 19px)/1.3 var(--display); }
:root[lang="en"] .flow__t { font-weight: 400; }
.flow__sub { color: var(--muted); font-size: 14.5px; line-height: 1.4; }
.flow__s.is-lamp .flow__sub { color: #6a4a0f; font-weight: 500; }

.lamp { position: relative; display: inline-block; width: var(--lw, 60px); aspect-ratio: 260 / 342; flex: none; }
.lamp > img { position: absolute; inset: 0; width: 100%; height: 100%; }
.lamp::before { content: ""; position: absolute; left: 50%; top: 14%; width: 150%; aspect-ratio: 1; translate: -50% -50%;
  background: radial-gradient(closest-side, rgba(255, 196, 80, .6), rgba(255, 196, 80, 0)); }
.lamp__flame { transform-origin: 50% 37%; animation: flicker 2.6s ease-in-out infinite alternate; }
@keyframes flicker { from { transform: scale(1, 1); } to { transform: scale(.96, 1.05); } }

/* grades */
.grades { list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 20px); align-items: start; }
.grade { border-radius: 24px; background: #fff; border: 1px solid var(--line); box-shadow: 0 3px 0 var(--line), 0 16px 26px -22px rgba(60, 30, 0, .45); }
.grade summary {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "t go" "n go"; gap: 0 12px; align-items: center;
  padding: 18px 24px; min-height: 84px; list-style: none; cursor: pointer; border-radius: 24px;
}
.grade summary::-webkit-details-marker { display: none; }
.grade__t { grid-area: t; font: 600 clamp(22px, 2vw, 28px)/1.25 var(--display); }
:root[lang="en"] .grade__t { font-weight: 400; }
.grade__n { grid-area: n; color: var(--muted); font-size: 15.5px; }
.grade__open { grid-area: go; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--sand-3); color: var(--clay); transition: transform .3s var(--ease-pop); }
.grade__open .ico { transform: rotate(90deg); }
[dir="rtl"] .grade__open .ico { transform: rotate(90deg); }
.grade details[open] .grade__open { transform: rotate(180deg); }
.units { margin: 0; padding: 0 24px 20px; padding-inline-start: 46px; display: grid; gap: 6px; color: var(--ink-2); font-size: 16px; }
.units li::marker { color: var(--amber-edge); font-weight: 600; }
.star { color: var(--amber-edge); }

/* contact */
.mails { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 20px); }
.mail {
  position: relative; display: flex; flex-direction: column; gap: 4px; height: 100%; min-height: 220px; padding: 24px 24px 20px; overflow: hidden;
  border-radius: var(--r); text-decoration: none; background: linear-gradient(160deg, var(--tint), var(--tint-2));
  box-shadow: 0 5px 0 rgba(0, 0, 0, .06), 0 20px 30px -24px rgba(60, 30, 0, .55);
  transition: transform .35s var(--ease-pop);
}
.mail:hover { transform: translateY(-6px); }
.mail__shu { position: absolute; inset-inline-end: 8px; top: 6px; width: 110px; height: auto; }
.mail__t { margin-top: 44px; font: 600 24px/1.25 var(--display); }
:root[lang="en"] .mail__t { font-weight: 400; }
.mail__l { color: var(--ink-2); font-size: 15.5px; }
.mail__a {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; margin-top: auto; padding: 8px 16px; min-height: 44px;
  border-radius: 999px; background: #fff; font-weight: 600; font-size: 15.5px; word-break: break-all;
}
.mail__a .ico { width: 20px; height: 20px; color: var(--clay); }
.note { margin: 0; color: var(--muted); }

/* ═════════ footer ═════════ */
.foot { border-top: 1px solid var(--line); background: var(--cream); }
.foot__in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-block: 22px; }
.foot p { margin: 0; }
.foot__line a { font-weight: 600; color: var(--clay); }
.foot__small { color: var(--muted); font-size: 15px; }
.foot__small a { display: inline-block; padding: 8px 2px; text-decoration: none; }
.foot__small a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ═════════ sizes ═════════ */
@media (max-width: 960px) {
  .topics, .mails { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .brand__help { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 28px; min-height: 0; gap: 0; }
  .hero__text { padding-bottom: 8px; }
  .hero__shu { width: min(62%, 260px); margin-top: 0; }
  .hero__shu .shu { width: 100%; height: auto; }
  .search { min-height: 60px; padding-inline: 18px; }
  .search input { height: 56px; font-size: 17px; }
  .cards, .grades { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .step { min-height: 64px; }
  .subhead { min-height: 0; }
}
@media (max-width: 560px) {
  .topics, .mails { grid-template-columns: 1fr; }
  .topic { min-height: 132px; }
  .topic__shu { width: 96px; }
  .mail { min-height: 190px; }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow__s.is-lamp { grid-column: span 2; flex-direction: row; justify-content: center; gap: 14px; flex-wrap: wrap; }
  .subhead__shu { width: 112px; }
  .pill--sm { padding-inline: 16px; }
  .top { padding-block: 10px; }
}
@media (max-width: 400px) {
  .brand img { height: 28px; }
  .chip span { font-size: 14px; }
  .pill--sm { font-size: 14px; padding-inline: 12px; }
  .top__end { gap: 6px; }
}
@media (min-width: 1500px) {
  body { font-size: 18px; }
  .wrap { max-width: 1240px; }
  .hero, .top { max-width: 1440px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* home: the cards line up with the hero plate */
.home .wrap { max-width: 1320px; width: calc(100% - 20px); padding-inline: 0; }

/* phones: the five steps become a tidy list */
@media (max-width: 560px) {
  .flow { grid-template-columns: 1fr; gap: 10px; }
  .flow__s, .flow__s.is-lamp {
    grid-column: auto; position: relative; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "t pic" "sub pic"; align-content: center; justify-items: start; text-align: start;
    gap: 2px 12px; min-height: 96px; padding: 10px 16px; padding-inline-start: 62px;
  }
  .flow__n { top: 50%; translate: 0 -50%; inset-inline-start: 16px; }
  .flow__shu, .flow .lamp { grid-area: pic; align-self: end; }
  .flow__shu { width: 84px; max-width: 84px; margin-block: -2px -12px; }
  .flow .lamp { --lw: 52px; margin: 6px 14px 6px 14px; align-self: center; }
  .flow__t { grid-area: t; align-self: end; }
  .flow__sub { grid-area: sub; align-self: start; }
}
@media (max-width: 560px) { .subhead h1 { font-size: 30px; } }
