/* Maqraa v7 home: the landing page pieces (design/v7/landing/css), joined for the site. Loaded on the home page only. */

/* Plain resets, home only */
.v7home { color: var(--color-ink); }
.v7home :is(h1, h2, h3, h4, p, ol, ul, figure) { margin: 0; }
/* :where keeps this at the lowest weight, so the heading ladder below sets its own line height (fix 5, L1: two-line headings were stuck at the body 1.6) */
.v7home :where(h1, h2, h3, h4) { color: inherit; line-height: inherit; }
.v7home :is(ol, ul) { padding: 0; list-style: none; }
.v7home :is(img, svg) { display: block; }
:where(.v7home) :where(button, input) { font: inherit; color: inherit; }
:where(.v7home) a { color: inherit; }
:where(.v7home) a:hover { color: inherit; }
.v7home { --font-quran: 'Scheherazade New', 'Noto Naskh Arabic', serif; }
/* the section class "hero" also exists in the site stylesheet: undo that look */
.v7home .hero { background: none; color: inherit; padding: 0; text-align: inherit; overflow: visible; }
.v7home .hero::before { content: none; }
.v7home .hero h1 { color: inherit; margin: 0; font-size: var(--hero-title-size); line-height: var(--hero-title-lh); text-wrap: balance; }
.v7home .hero-logo { margin: 0; filter: none; }
.v7home .hero .lead { color: inherit; font-size: var(--text-lead); max-width: var(--measure); margin-inline: 0; }

/* Heading ladder */
.h-display { font-family: var(--font-display); font-weight: 400; font-size: var(--text-display); line-height: var(--text-display-lh); letter-spacing: var(--tracking-display); text-wrap: balance; }
.h-statement { font-family: var(--font-display); font-weight: 400; font-size: var(--text-statement); line-height: var(--text-statement-lh); letter-spacing: var(--tracking-heading); text-wrap: pretty; }
.h2 { font-family: var(--font-display); font-weight: 400; font-size: var(--text-h2); line-height: var(--text-h2-lh); letter-spacing: var(--tracking-heading); text-wrap: balance; }
.h3 { font-family: var(--font-display); font-weight: 400; font-size: var(--text-h3); line-height: var(--text-h3-lh); letter-spacing: var(--tracking-heading); }
.lead { font-size: var(--text-lead); line-height: var(--text-lead-lh); max-width: var(--measure); text-wrap: pretty; }
.label { font-size: var(--text-label); font-weight: 600; letter-spacing: var(--tracking-label); }
.soft { color: var(--color-ink-soft); }
.on-ground .soft, .on-ground.soft { color: var(--color-on-ground-soft); }

.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* ---------- Split heading and text ---------- */
.split { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--grid-gap); align-items: end; margin-block-end: var(--space-8); }
.split__title { grid-column: 1 / span 6; }
.split__text { grid-column: 8 / span 5; }
.split--one { margin-block-end: var(--space-5); } /* fix 5, L3: a one-line heading sits close to its content (its text column is empty) */
@media (max-width: 859px) {
  .v7home .section { padding-block: var(--space-6); } /* fix 5, L3: 32px above and below a section on tablets and phones, 64px between two (KIT A spacing scale) */
  .split { margin-block-end: var(--space-6); }
  .split--one { margin-block-end: var(--space-5); }
  .split__title, .split__text { grid-column: 1 / -1; }
}

/* ---------- Cards and panels ---------- */
.card {
  display: flex; flex-direction: column; gap: var(--space-4);
  border-radius: var(--radius-card); padding: var(--space-6);
  background: var(--color-card); color: var(--color-ink);
}
.card { border: 0; box-shadow: none; }
.card--ground { background: var(--color-ground-2); color: var(--color-on-ground); }
.card--tint { background: var(--color-tint); }
.card--panel { background: var(--color-panel); }
.card--raised { box-shadow: 0 1px 2px rgba(var(--color-shadow), 0.06), 0 18px 40px -24px rgba(var(--color-shadow), 0.36); }
.panel { border-radius: var(--radius-panel); padding: clamp(32px, 6vw, 80px) clamp(24px, 5vw, 72px); }
.panel--ground { background: var(--color-ground); color: var(--color-on-ground); }
.panel--tint { background: var(--color-tint); }
.panel--sheet { background: var(--color-panel); }

/* ---------- Certificate drawing (plain: paper, rules, a solid seal, a QR-like block) ---------- */
.cert { width: 100%; height: auto; color: var(--color-green); }
.cert .paper { fill: var(--color-card); stroke: var(--color-green); stroke-width: 2; }
.cert .rule { stroke: var(--color-green); stroke-opacity: 0.5; stroke-width: 3; stroke-linecap: round; }
.cert .seal { fill: var(--color-ground); }
.cert .seal-in { fill: none; stroke: var(--color-gold); stroke-width: 3; }
.cert .seal-dot { fill: var(--color-gold); }
.cert .qr rect { fill: var(--color-green); }
:root[data-theme='dark'] .cert { color: var(--color-ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .cert { color: var(--color-ink); } }

/* ---------- Reveal: blocks rise and fade in once. Reduced motion: a short fade only ---------- */
html.js [data-reveal] { opacity: 0; transform: translateY(var(--rise)); }
html.js [data-reveal].is-in {
  opacity: 1; transform: none;
  transition: opacity var(--dur-reveal) var(--ease-out) var(--delay, 0ms), transform var(--dur-reveal) var(--ease-out) var(--delay, 0ms);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js [data-reveal] { transform: none; }
  html.js [data-reveal].is-in { transition: opacity var(--dur-fast) linear; }
  .more:hover svg { transform: scaleX(var(--dir)); }
  .more svg, .menu-btn span::before, .menu-btn span::after { transition: none; }
}
@media (max-width: 520px) { .btn-row .btn { flex: 1 1 auto; } }

/*
 * Maqraa landing: the Arabic page (index.html: lang="ar" dir="rtl").
 * The Arabic type ladder and the fonts are in tokens.css. This file holds the rules that are not numbers.
 * - No letter-spacing on Arabic: it breaks the joined letters.
 * - No italics: Arabic has none.
 * - Quran text (.qw) uses the Quran face at line-height 1.95.
 */
html[lang='ar'] * { letter-spacing: 0; }
html[lang='ar'] :is(em, i, cite, blockquote) { font-style: normal; }
html[lang='ar'] :is(.label, .btn, .more, .q-seg a) { font-weight: 600; }

/*
 * Maqraa v5: the hero stage (style pattern only; the mark is logo 8a, templates/partials/brand_mark.html).
 * One swappable block: this file, hero() and hero_logo() in tools/build.py, js/hero.js.
 * Rules (RULES.md): T1 values live in tokens.css; P1 no patterns or arches; P2 no gradients, no glass;
 * P4 reduced motion and a pause for anything that keeps moving; Design decision 27 (the final mark is filled).
 * The strokes only draw the shape in, then fade out once the gold fill is in (so the finished mark is solid, no outline seams).
 * Motion: transform and opacity, plus stroke-dashoffset for the one-time draw of the strokes.
 * Nothing waits for script: rising and drawing are plain CSS, so nothing flashes first.
 * Every animation uses "backwards" fill, so the plain style IS the finished picture (reduced motion = no animation).
 */
.hero { position: relative; }
.hero__stage {
  position: relative; isolation: isolate; overflow: clip;
  min-height: 100vh; min-height: max(100svh, var(--hero-stage-min));
  display: grid; align-content: end;
  padding-block: var(--bar-height) var(--hero-pad-bottom);
  background: var(--color-ground); color: var(--color-on-ground);
}

/* the logo: large, on the end side, vertically a little below middle */
.hero__logo {
  position: absolute; z-index: 0;
  top: var(--hero-logo-top); inset-inline-end: var(--hero-logo-inset);
  width: var(--hero-logo-size); aspect-ratio: 1; translate: 0 -50%;
}
.hero-logo { position: relative; display: grid; place-items: center; width: 100%; height: 100%; color: var(--color-on-ground); overflow: visible;
  animation: hero-logo-rise var(--hero-rise-dur) var(--ease-showpiece) backwards; }
.hero-logo .breath { transform-box: view-box; transform-origin: 0 0;
  animation: hero-breath var(--hero-breath-dur) var(--ease-soft) var(--hero-breath-delay) infinite; }
.hero-logo .stroke { fill: none; stroke: currentColor; stroke-width: var(--hero-stroke-width); vector-effect: non-scaling-stroke; stroke-dasharray: 1 1;
  animation: hero-draw var(--hero-draw-dur) var(--ease-out) calc(var(--hero-draw-delay) + var(--i) * var(--hero-draw-step)) backwards,
             hero-stroke-out var(--hero-stroke-out-dur) var(--ease-soft) calc(var(--hero-fill-delay) + var(--i) * var(--hero-fill-step) + var(--hero-stroke-out-wait)) forwards; }
.hero-logo .fill { fill: currentColor; stroke: none;
  animation: hero-fill var(--hero-fill-dur) var(--ease-soft) calc(var(--hero-fill-delay) + var(--i) * var(--hero-fill-step)) backwards; }
.hero-logo .glint { fill: var(--hero-glint); stroke: none; opacity: 0;
  animation: hero-glint var(--hero-glint-cycle) linear calc(var(--hero-glint-delay) + var(--i) * var(--hero-glint-step)) infinite; }

/* the words: low, on the start side, no buttons */
.hero__inner { position: relative; z-index: 1; }
/* fix 5, M13: the words must be there the moment the page opens, so they no longer wait for the mark to draw.
   They start at once with a short, small fade (opacity plus a 10px rise) and a 50ms stagger; reduced motion switches it all off below.
   Rule: KIT A (motion), v5 RULES P4. */
.hero__words { --hero-t0: 0ms; --hero-title-dur: 380ms; --hero-line-dur: 380ms; max-width: var(--hero-words-max); display: grid; gap: var(--space-5); }
.hero__title { animation: hero-words-in var(--hero-title-dur) var(--ease-out) var(--hero-t0) backwards; }
.hero__cta { margin-block-start: var(--space-3); animation: hero-words-in var(--hero-line-dur) var(--ease-out) calc(var(--hero-t0) + 150ms) backwards; }
.hero__line { margin: 0; animation: hero-words-in var(--hero-line-dur) var(--ease-out) calc(var(--hero-t0) + 50ms) backwards; }
.hero__ayah { margin: 0; max-width: 40rem; font-size: var(--text-body); line-height: 1.9; color: var(--color-on-ground-soft); animation: hero-words-in var(--hero-line-dur) var(--ease-out) calc(var(--hero-t0) + 100ms) backwards; }
.hero__cite { font-size: var(--text-small); color: var(--color-gold); white-space: nowrap; }
.v1__ijaza { margin: 0; font-size: var(--text-small); }

.hero__stage :focus-visible { outline: 2px solid var(--color-focus-on-ground); outline-offset: 3px; }

/* away: everything on the stage holds still when it is off screen */
.hero.is-away .hero__stage * { animation-play-state: paused; }

/* phone and tablet (up to 900):  logo on top, words below, nothing overlaps (the stage grows if it must) */
@media (max-width: 900px) {
  /* fix 5, L3: on a phone the stage is as tall as its content (wordmark, space-6, words, space-7), not stretched to the screen,
     so there is no empty band between the wordmark and the title. Rule: KIT A spacing scale. */
  .hero__stage { min-height: 0; align-content: start; padding-block: calc(var(--bar-height) + var(--bar-float) + var(--space-5)) var(--space-7); }
  .hero__logo { position: relative; top: auto; inset-inline-end: auto; translate: none; width: var(--hero-logo-size-phone); margin-inline: auto; margin-block-end: var(--space-6); }
  .hero__words { max-width: none; }
}

@keyframes hero-rise-up { from { opacity: 0; transform: translateY(var(--rise)); } }
@keyframes hero-words-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes hero-logo-rise { from { opacity: 0; transform: translateY(var(--hero-rise-from)) rotate(var(--hero-rise-turn)) scale(0.86); } }
@keyframes hero-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes hero-stroke-out { to { opacity: 0; } }
@keyframes hero-fill { from { opacity: 0; } }
@keyframes hero-breath { 50% { transform: scale(var(--hero-breath-grow)) rotate(var(--hero-breath-turn)); } }
@keyframes hero-glint { 0% { opacity: 0; } 5% { opacity: 0.9; } 14% { opacity: 0; } 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .hero__stage, .hero__stage * { animation: none !important; transition: none !important; }
  .hero-logo .stroke { opacity: 0; }
}

/*
 * Maqraa landing (v7): shared pieces, the Musnad panel (M1) and the verify box (V1).
 * The branches, the how-it-works ring, the four cards and the non-negotiables are in blocks.css.
 * Reads tokens.css only. No patterns and no arches (RULES.md, P1).
 */

/* ---------- Small shared pieces ---------- */
.musnad__tag { color: var(--color-gold); font-size: var(--text-label); font-weight: 600; }
.finds { display: grid; gap: var(--space-3); }
.finds li { display: flex; gap: var(--space-4); align-items: flex-start; }
.finds__n {
  flex: none; display: grid; place-items: center; inline-size: 32px; block-size: 32px; border-radius: 50%;
  background: var(--color-gold); color: var(--color-on-gold); font-size: var(--text-small); font-weight: 600;
}
.bd { display: block; inline-size: 6px; block-size: 44px; border-radius: 3px; background: var(--color-gold); flex: none; transform-origin: top; }
.nt { display: block; font-family: var(--font-display); font-size: var(--text-h3); line-height: var(--text-h3-lh); }
.nm { display: block; font-size: var(--text-small); color: var(--color-on-ground-soft); }

/* The medal: one solid disc and one solid core (no rings, no stars, no dots) */
.medal { --md: 96px; --md-bg: var(--color-ground-2); --md-fg: var(--color-gold); inline-size: var(--md); block-size: var(--md); flex: none; }
.medal .m-disc { fill: var(--md-bg); }
.medal .m-core { fill: var(--md-fg); }


/* =====================================================================
   M1  Musnad: the medallion chain
   ===================================================================== */
.m1 { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--space-7) var(--grid-gap); }
.m1__copy { grid-column: 1 / span 7; display: grid; gap: var(--space-5); align-content: start; }
.m1__chain { grid-column: 9 / span 4; align-self: center; display: grid; justify-items: start; }
.m1__node { display: grid; grid-template-columns: var(--md-w, 96px) 1fr; gap: var(--space-4); align-items: center; }
.m1__node--end .medal { --md-bg: var(--color-gold); --md-fg: var(--color-gold); }  /* the end of the chain: one solid gold disc */
.m1__node--end .nt { color: var(--color-gold); }
.m1__link { display: flex; justify-content: center; inline-size: 96px; padding-block: 14px; }  /* 21 Nov, fix 6 (L2): the bars sit clear of the discs */
.m1__link--gap .bd { opacity: 0.45; }
@media (max-width: 999px) {
  .m1__copy, .m1__chain { grid-column: 1 / -1; }
  .m1__chain { max-inline-size: 420px; }
}

/* =====================================================================
   V1  Verify: code cells and a seal that presses on
   ===================================================================== */
.v1 { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--space-7) var(--grid-gap); align-items: center; }
.v1__copy { grid-column: 1 / span 6; display: grid; gap: var(--space-5); align-content: start; }
.v1__doc { grid-column: 8 / span 5; transform: rotate(-2deg); filter: drop-shadow(0 24px 30px rgba(var(--color-shadow), 0.22)); }
.v1__form { display: grid; gap: var(--space-5); justify-items: start; }
.v1__code { direction: ltr; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); border: 0; padding: 0; margin: 0; min-inline-size: 0; }
.v1__pre { display: grid; place-items: center; inline-size: 52px; block-size: 56px; border-radius: 14px; background: var(--color-green); color: var(--color-on-green); font-weight: 600; letter-spacing: 0.06em; }
.v1__grp { display: flex; gap: 6px; }
.v1__sep { inline-size: 10px; block-size: 10px; border-radius: 50%; background: var(--color-green); margin-inline: var(--space-2); }
.cell {
  inline-size: 46px; block-size: 56px; padding: 0; border-radius: 14px; border: 2px solid var(--color-edge); background: var(--color-card); color: var(--color-ink);
  text-align: center; text-transform: uppercase; font-family: var(--font-mono); font-size: 1.5rem; font-weight: 600;
  transition: transform var(--dur-fast) var(--ease-out);
}
.cell:focus { border-color: var(--color-green); }
.cell:focus-visible { outline-offset: 2px; }
.cell[data-filled] { border-color: var(--color-green); }
.cell--code { inline-size: min(100%, 22rem); padding-inline: var(--space-4); font-size: 1.15rem; letter-spacing: 0.06em; text-transform: uppercase; }
.verify__note { min-block-size: 1.6em; font-size: var(--text-small); }
.cert .codetext { direction: ltr; unicode-bidi: plaintext; fill: var(--color-ink); font-family: var(--font-mono); font-size: 15px; letter-spacing: 0.14em; }
.seal-press { transform-box: fill-box; transform-origin: center; }
@media (max-width: 999px) {
  .v1__copy, .v1__doc { grid-column: 1 / -1; }
  .v1__doc { max-inline-size: 460px; }
}
@media (max-width: 560px) {
  .cell { inline-size: 46px; block-size: 52px; }
  .v1__pre { inline-size: 46px; block-size: 52px; }
  .v1__sep { display: none; }
  .v1__grp:last-of-type { margin-block-start: var(--space-1); }
}

/*
 * Maqraa landing (v7): the four sections Esslam picked on 19 Nov 2026 from the v6 options.
 *   b3  three branches ..... branches A (lanes)        .lane
 *   c1  four cards ......... cards A (a lesson)        .mosaic, .kc, .mush, .chk, .roles
 *   n1  non-negotiables .... promises P1 (stack)       .nstack, .sc, .ui, .row
 *   h2  how it works ....... six-step grid             .how
 * Reads tokens.css only (RULES.md, T1). Motion is transform and opacity only (animation-performance card).
 * No gradient, no pattern, no arch, no glass (RULES.md, P1 and P2); shapes are solid (DD27).
 * Every state the JS animates also ships finished in the markup, so reduced motion and no-script both show the whole thing.
 */

/* ---------- Shared: container, Quran word, stretched link, pause button ---------- */
.cq, .lanes { container: blk / inline-size; }
.qw { font-family: var(--font-quran); font-weight: 400; line-height: var(--lh-quran); white-space: nowrap; }

/* A text link that makes its whole tile the hit area (::after stretches to the nearest positioned ancestor). */
.go::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.go { color: inherit; justify-self: start; }
:is(.lane, .kc):hover .go svg { transform: translateX(calc(var(--dir) * 4px)) scaleX(var(--dir)); }

/* The pause button of a section (WCAG 2.2.2). JS un-hides it; with reduced motion it stays hidden because nothing moves. */
.pausebar { display: flex; margin-block-start: var(--space-4); }
.pausebar--solo { justify-content: flex-end; margin-block: 0 var(--space-4); }
.secpause {
  display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--tap); padding-inline: 16px;
  border-radius: var(--radius-pill); border: 1px solid var(--color-edge); background: var(--color-card); color: var(--color-ink);
  font-size: var(--text-small); font-weight: 600; cursor: pointer; transition: transform var(--dur-fast) var(--ease-out);
}
.secpause[hidden] { display: none; }
.secpause:active { transform: scale(var(--press)); }
.secpause .i { width: 12px; height: 12px; position: relative; flex: none; }
.secpause .i::before, .secpause .i::after { content: ''; position: absolute; inset-block: 0; width: 4px; border-radius: 1px; background: currentColor; }
.secpause .i::before { inset-inline-start: 0; }
.secpause .i::after { inset-inline-end: 0; }
.secpause[aria-pressed='true'] .i::before { inset-inline: 1px; width: auto; clip-path: polygon(0 0, 100% 50%, 0 100%); }
html[dir='rtl'] .secpause[aria-pressed='true'] .i::before { clip-path: polygon(100% 0, 0 50%, 100% 100%); }
.secpause[aria-pressed='true'] .i::after { display: none; }

/* Every loop stops with the button, off screen and in a hidden tab (JS sets data-paused and .is-off on the section). */
[data-paused] *, [data-paused] *::before, [data-paused] *::after,
.is-off *, .is-off *::before, .is-off *::after { animation-play-state: paused !important; }

/* =====================================================================
   B3  branches A: three lanes, each with its five stages on one rail
   ===================================================================== */
.lanes { display: grid; gap: var(--space-4); }
.lane {
  position: relative; isolation: isolate; overflow: hidden; display: grid; gap: var(--space-5);
  padding: clamp(20px, 3.6cqi, 40px); border-radius: var(--radius-card);
  background: var(--color-ground); color: var(--color-on-ground); transition: transform var(--dur-base) var(--ease-out);
}
.lane__top { display: grid; gap: var(--space-5); align-items: center; }
@container blk (min-width: 760px) { .lane__top { grid-template-columns: minmax(220px, 300px) minmax(0, 1fr) auto; gap: var(--space-6); } }
/* batch4 C, fix 5: the picture fills the card edge to edge (phone: across the top; wide: the whole start side), the card's own overflow gives it the same corners.
   Rules: Design decision 27 (flat, no empty dark area), P1 (one image, one job), KIT 4. */
.lane { --lp: clamp(20px, 3.6cqi, 40px); }
.lane__plate { position: relative; overflow: hidden; margin: calc(-1 * var(--lp)) calc(-1 * var(--lp)) 0; aspect-ratio: 4 / 3; background: var(--color-ground-2); }
.lane__plate img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; display: block; transition: transform var(--dur-slow) var(--spring); }
@container blk (min-width: 760px) {
  .lane__top { align-items: stretch; column-gap: var(--space-6); }
  .lane__plate { margin-block: calc(-1 * var(--lp)); margin-inline: calc(-1 * var(--lp)) 0; aspect-ratio: auto; min-block-size: 15rem; }
  .lane__top > :not(.lane__plate) { align-self: center; }
}
.lane__txt { display: grid; gap: var(--space-2); }
.lane__txt p { color: var(--color-on-ground-soft); max-width: 58ch; }

@media (hover: hover) and (pointer: fine) {
  .lane:hover { transform: translateY(-3px); }
  .lane:hover .lane__plate img { transform: scale(1.04); }
}
.lane:has(.go:focus-visible) { outline: 3px solid var(--color-focus-on-ground); outline-offset: 3px; }
.lane .go:focus-visible { outline: none; }
.lane:active { transform: scale(0.99); }

/* =====================================================================
   C1  cards A: four cards, each with a small working piece
   ===================================================================== */
.mosaic { display: grid; gap: var(--space-4); }
@container blk (min-width: 760px) {
  .mosaic { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .m-live { grid-column: span 7; }
  .m-safe { grid-column: span 5; }
  .m-talent { grid-column: span 12; }
}
.mosaic > [data-reveal] { display: grid; }
.kc--ground { --k-bg: var(--color-ground); --k-ink: var(--color-on-ground); --k-soft: var(--color-on-ground-soft); --k-chip: var(--color-ground-2); --k-accent: var(--color-gold); --k-on-accent: var(--color-on-gold); --k-focus: var(--color-focus-on-ground); --k-edge: transparent; }
.kc--light { --k-bg: var(--color-card); --k-ink: var(--color-ink); --k-soft: var(--color-ink-soft); --k-chip: var(--color-tint); --k-accent: var(--color-green); --k-on-accent: var(--color-on-green); --k-focus: var(--color-focus); --k-edge: var(--color-edge); }
.kc {
  position: relative; display: grid; align-content: start; gap: var(--space-5); padding: clamp(22px, 3.2cqi, 34px);
  background: var(--k-bg); color: var(--k-ink); border: 1px solid var(--k-edge); border-radius: var(--radius-card);
  transition: transform var(--dur-base) var(--ease-out);
}
.kc :focus-visible { outline-color: var(--k-focus); }
.kc p { color: var(--k-soft); }
.kc__txt { display: grid; gap: var(--space-2); }
.kc__piece { display: grid; gap: var(--space-4); align-content: start; }
.kc .go { margin-block-start: auto; }
.kc:has(.go:focus-visible) { outline: 3px solid var(--k-focus); outline-offset: 3px; }
.kc .go:focus-visible { outline: none; }
@media (hover: hover) and (pointer: fine) { .kc:hover { transform: translateY(-3px); } }
.kc:active { transform: scale(0.99); }

/* the mushaf line */
.mush { display: grid; gap: var(--space-3); padding: 14px 18px 18px; border-radius: calc(var(--radius-card) - 8px); background: var(--k-chip); }
.mush__bar { display: flex; justify-content: space-between; align-items: center; font-size: var(--text-small); color: var(--k-soft); font-weight: 600; }
.mush__lines { display: grid; place-items: center; min-height: 4.2em; }
.ay { grid-area: 1 / 1; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; font-size: clamp(1.9rem, 5.2cqi, 2.4rem); opacity: 0; }
.ay.cur { opacity: 1; }
.w { position: relative; display: inline-block; padding: 0 8px; border-radius: 10px; isolation: isolate; }
.w .qw { display: inline-block; }
.w::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--k-accent); opacity: var(--hl, 0); }
.w::after { content: ''; position: absolute; inset: 0; border-radius: inherit; border: 2px solid var(--k-accent); opacity: var(--er, 0); }
.w.on { --hl: 0.32; }
.w.err { --er: 1; }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chips .chip { position: relative; isolation: isolate; padding: 6px 14px; border-radius: var(--radius-pill); background: var(--k-chip); font-size: var(--text-small); font-weight: 600; }
.chips .chip::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--k-accent); opacity: var(--hl, 0); }
.chips .chip.on { --hl: 0.32; }

/* the tick: a round box with a check made of two borders */
.tick { position: relative; flex: none; inline-size: 26px; block-size: 26px; border-radius: 50%; border: 2px solid var(--k-accent); isolation: isolate; }
.tick::before { content: ''; position: absolute; inset: -2px; border-radius: 50%; background: var(--k-accent); opacity: var(--hl, 0); z-index: -1; }
.tick::after { content: ''; position: absolute; left: 7px; top: 3px; width: 6px; height: 11px; border: solid var(--k-on-accent); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) scale(0); }
.tick { --hl: 1; }
.tick::after { transform: rotate(45deg) scale(1); } /* filled by default (audit 21) */
.chk, .roles { display: grid; gap: var(--space-2); }
.chk li, .roles li { display: flex; align-items: center; gap: var(--space-3); min-height: 48px; padding: 8px 14px; border-radius: var(--radius-pill); background: var(--k-chip); font-size: var(--text-small); font-weight: 600; }
.role__v { margin-inline-start: auto; color: var(--k-soft); font-size: 0.875em; font-weight: 400; }

.w::before, .w::after, .chips .chip::before, .tick::before, .ay { transition: opacity var(--dur-base) var(--ease-out); }
.tick::after { transition: transform var(--dur-base) var(--spring); }

/* =====================================================================
   N1  promises P1: four cards stack and sink a little as the next one arrives
   ===================================================================== */
.nstack { display: grid; gap: 28px; padding-block-end: 14vh; }
.sc {
  position: sticky; top: calc(var(--bar-height) + var(--bar-float) + var(--space-3) + var(--n) * 14px);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(16px, 3vw, 44px); align-items: center;
  min-height: 320px; overflow: hidden; border-radius: var(--radius-panel); padding: clamp(20px, 3.5vw, 40px);
  transform-origin: 50% 0; transform: scale(calc(1 - var(--p, 0) * 0.05));
}
.sc::after { content: ''; position: absolute; inset: 0; background: var(--color-paper); opacity: calc(var(--p, 0) * 0.5); pointer-events: none; }
.sc1, .sc2, .sc3, .sc4 { background: var(--color-panel); color: var(--color-ink); border: 1px solid var(--color-edge); } /* one card surface (audit 22) */
.sc p { color: var(--color-ink-soft); }
.sc .no { font-family: var(--font-display); font-size: clamp(2.4rem, 1.6rem + 2.4vw, 4rem); line-height: 1.1; opacity: 0.85; }
.sc h3 { margin-block: 10px 12px; }
.sc > div > p { max-width: 34ch; }
.ui { position: relative; padding: clamp(14px, 2.2vw, 22px); border-radius: var(--radius-card); background: var(--color-card); color: var(--color-ink); border: 1px solid var(--color-edge); }
.rows { position: relative; }
.row { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 12px 14px; background: var(--color-tint); border-radius: 14px; }  /* 21 Nov, fix 6 (M10): soft tinted rows, no thin divider lines (5-anti-ai hard ban) */
/* fix 5, L14: every row of the integrity card carries the same tint (the old highlight walked down one row at a time and rested on the first) */
.rows { display: grid; gap: var(--space-2); }
.rows3 .sweep { display: none; }
.row__k { color: var(--color-ink-soft); font-size: var(--text-small); }
.row__v { font-weight: 600; transition: color var(--dur-fast) var(--ease-out); }
.row:hover .row__v { color: var(--color-green); }
.big { font-family: var(--font-display); font-size: clamp(1.8rem, 1.3rem + 1.6vw, 2.6rem); line-height: 1.2; font-variant-numeric: lining-nums tabular-nums; }
html[lang='ar'] .big { font-family: var(--font-arabic); font-size: clamp(2rem, 1.5rem + 1.6vw, 2.8rem); }
html[lang='ar'] :is(.sc .no, .mid__a) { font-family: var(--font-arabic); }
.tag { display: inline-flex; flex: none; white-space: nowrap; align-items: center; min-height: 32px; padding: 2px 14px; border-radius: var(--radius-pill); background: var(--color-tint); color: var(--color-ink); font-size: var(--text-small); font-weight: 600; }
.tag--ok { background: var(--color-green); color: var(--color-on-green); }
.ui__foot { margin-block-start: 12px; }
.sweep { position: absolute; inset-inline: 0; top: 0; block-size: calc(100% / 3); background: var(--color-tint); border-radius: 14px; transform: translateY(calc(var(--k, 0) * 100%)); transition: transform 0.6s var(--ease-out); z-index: 0; }
.ai-text { margin-block-start: 12px; }
.ai-state { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-block-start: 12px; }
.pop { animation: pop 0.5s var(--ease-out); }
@keyframes pop { 0% { transform: scale(0.9); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
@media (max-width: 760px) {
  .sc { grid-template-columns: 1fr; min-height: 0; top: calc(var(--bar-height) + var(--bar-float) + var(--space-2) + var(--n) * 10px); }
  .sc > div > p { max-width: none; }
}

/* =====================================================================
   H2  how it works: six steps, one number each, an even grid (3 x 2, then 2, then 1)
   Rules: KIT 4 (Design decisions 27: filled shapes, no thin line art), layout (one grid, equal cards), motion (transform and opacity only)
   ===================================================================== */
.how { display: grid; gap: var(--grid-gap); grid-template-columns: repeat(3, minmax(0, 1fr)); counter-reset: none; }
.how__step { display: grid; grid-template-rows: auto auto 1fr; gap: var(--space-3); align-content: start; padding: clamp(20px, 2.4vw, 32px); border-radius: var(--radius-card); background: var(--color-panel); }
.how__n { display: grid; place-items: center; inline-size: 44px; block-size: 44px; border-radius: 50%; background: var(--color-green); color: var(--color-on-green); font-weight: 600; font-variant-numeric: lining-nums tabular-nums; }
html[lang='ar'] .how__n { font-size: 1.25rem; }
.how__t { margin-block-start: var(--space-2); }
.how__d { color: var(--color-ink-soft); max-width: 40ch; }
.how__cta { margin-block-start: var(--space-6); }
@media (max-width: 900px) { .how { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .how { grid-template-columns: 1fr; } .how__step { grid-template-columns: auto 1fr; column-gap: var(--space-4); row-gap: var(--space-2); } .how__n { grid-row: 1 / span 2; } .how__t { margin-block-start: 0; align-self: end; } .how__d { grid-column: 2; } }
/* long ru, ta and ml words may break on a phone, so a card never pushes the page sideways */
@media (max-width: 560px) { .mosaic, .m1, .how { overflow-wrap: anywhere; } .roles li { flex-wrap: wrap; } }

/* ---------- Reduced motion: nothing moves, the finished state stays ---------- */
@media (prefers-reduced-motion: reduce) {
  .lane, .lane__plate img, .kc, .secpause, .w::before, .w::after, .chips .chip::before, .tick::before, .tick::after, .ay,
  .sweep, .row__v { transition: none; }
  .lane:hover, .kc:hover { transform: none; }
  .sc { transform: none; position: static; }
  .sc::after { display: none; }
  .pop { animation: none; }
  .secpause { display: none; }
}


/* the hero holds the name alone (no disc behind it), big: the drawn name is 3.33em wide, so 0.27 of the box size fills 90% of the box.
   Esslam, 21 Nov 2026: "get rid of the circle behind maqraah ... just have the name there bigger and looking good". Same size for Arabic and English (one drawing). */
.hero__logo { aspect-ratio: auto; }
.hero-logo { height: auto; }
.hero-logo .wordmark { font-size: calc(var(--hero-logo-size) * 0.27); text-align: center; }
@media (max-width: 900px) {
  .hero-logo .wordmark { font-size: calc(var(--hero-logo-size-phone) * 0.3); }
}

/* 21 Nov, fix 6 (check 4, H1): from 901 up the logo and the words share one row, so the logo is sized from what the words leave:
   page width, minus the left space (gutter, or the centred margin), minus the words column, minus the logo's own inset, minus a 48px gap.
   Words never go under the logo at any width from 901 to 1440 and beyond. Rule: design-basics 1-layout (nothing overlaps), KIT A (phone and desktop equal). */
.v7home {
  --hero-words-max: min(40vw, 34rem);
  --hero-logo-size: min(78svh, 760px, calc(100vw - max(var(--gutter), (100vw - var(--page-max)) / 2) - min(40vw, 34rem) - var(--hero-logo-inset) - var(--space-7)));
}

/* audit 17: one pause control on home (the hero button drives all, see home.html) */
.pausebar, .secpause { display: none !important; }

/* fix 5, L16: in the dark theme the tint panel is a dark green, so its Verify button (also dark green) vanished. It takes the light Ground-button pair, solid, no glow. Rule: v5 RULES P2, KIT A (contrast). */
:root[data-theme='dark'] .v1 .btn { --bg: var(--color-btn-ground-bg); --ink: var(--color-btn-ground-ink); --chipbg: var(--color-ground); --chipink: var(--color-on-ground); }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .v1 .btn { --bg: var(--color-btn-ground-bg); --ink: var(--color-btn-ground-ink); --chipbg: var(--color-ground); --chipink: var(--color-on-ground); } }

/* L4 (21 Nov): the home certificate is a labelled sample with real words, not grey lines. Rules: KIT type scale, solid fills only. */
.cert text { fill: var(--color-ink); font-family: var(--font-body); }
.cert .c-small { font-size: 13px; fill: var(--color-ink-soft); }
.cert .c-strong { font-size: 14px; font-weight: 700; }
.cert .c-name { font-family: var(--font-display); font-size: 23px; font-weight: 700; fill: var(--color-green); }
.cert .c-tag { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; fill: var(--color-gold-ink, var(--color-ink-soft)); }
:root[data-theme='dark'] .cert .c-name { fill: var(--color-ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .cert .c-name { fill: var(--color-ink); } }
