/* CloudyERP prototype — hero (W5)
   Editorial split: copy + the operation chain on the start side; one flagship CloudyERP operations window on the end side,
   with the POS phone in the foreground and a ghost window behind it. A single signal trace runs from the till through
   every pane (sale lands → stock → ledger → management) and closes the loop.
   Compositions share one DOM: wide (≥1181px) · tablet (761–1180px, same canvas scaled) · mobile (≤760px). */

.hero {
  /* Light product surfaces inside the dark scene */
  --ui-bg: #f2f5fb;
  --ui-card: #ffffff;
  --ui-line: #e1e6f0;
  --ui-line-2: #cdd5e4;
  --ui-text: #0b1530;
  --ui-text-2: #33405f;
  --ui-text-3: #56627f;
  --ui-blue: #2259e0;
  --ui-blue-2: #1846bf;
  --ui-blue-tint: #e8efff;
  --ui-teal: #087a65;
  --ui-amber: #8a5000;
  --ui-amber-tint: #fff0d2;
  --ui-navy: #0b1735;
  --bead: 24px;

  /* canvas: wide composition */
  --cw: 880; --ch: 690; --kmax: 1;

  position: relative; z-index: 1; isolation: isolate; overflow: clip;
  display: grid; grid-template-rows: 1fr auto; align-items: center;
  min-height: calc(100svh - var(--header-h));
  padding-block: clamp(1rem, .2rem + 1.6vw, 2rem) 1rem;
  background: #040815;
}

/* ---------- Backdrop: one key light behind the product, a horizon it stands on ---------- */
.hero__backdrop { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero__key {
  position: absolute; left: -12%; top: -18%; width: 78%; height: 118%;
  background:
    radial-gradient(closest-side, rgb(52 108 255 / .34), rgb(40 90 230 / .12) 48%, transparent 78%);
}
.hero__key::after { /* cool counter-light on the copy side, very low */
  content: ""; position: absolute; left: 100%; top: 0; width: 60%; height: 70%;
  background: radial-gradient(closest-side, rgb(120 160 255 / .07), transparent 80%);
}
.hero__horizon {
  position: absolute; left: -34%; width: 128%; top: 80%; height: 140%; border-radius: 50%;
  background: radial-gradient(ellipse 46% 26% at 50% 0%, rgb(70 130 255 / .3), transparent 72%), #030611;
  box-shadow: 0 -1px 0 rgb(170 200 255 / .38), 0 -50px 140px -40px rgb(60 120 255 / .55);
}
.hero__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgb(140 170 230 / .05) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(140 170 230 / .05) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 40% 45% at 30% 45%, #000, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 40% 45% at 30% 45%, #000, transparent 75%);
}

/* ---------- Layout ---------- */
.hero__layout {
  display: grid; grid-template-columns: minmax(0, 456px) minmax(0, 1fr); align-items: center;
  gap: clamp(1.5rem, 3.4vw, 3.25rem);
}
.hero__copy { display: grid; gap: 1.1rem; justify-items: start; text-align: start; position: relative; z-index: 2; }
.hero__eyebrow { font-size: .9rem; color: var(--blue-200); }
.hero__title {
  /* W10: sized so each half of «أعمالك مترابطة. وقراراتك أوضح.» holds one line in the copy column */
  font-size: clamp(2.4rem, 1.05rem + 2.45vw, 3.4rem);
  font-weight: 600; line-height: var(--lh-display); letter-spacing: 0; color: #f4f7ff;
  text-wrap: initial;
}
.hero__line { display: block; }
.hero__line > span { display: inline-block; }
.hero__title em { font-style: normal; color: var(--blue-300); position: relative; white-space: nowrap; }
.hero__title em::after {
  content: ""; position: absolute; inset-inline: 0; bottom: .02em; height: .065em; border-radius: 1em;
  background: linear-gradient(270deg, var(--blue-400), rgb(82 148 255 / .1));
  transform-origin: right;
}
.hero__lead { font-size: 1.06rem; color: var(--text-2); line-height: 1.85; max-width: 31em; }
.hero__lead-short { display: none; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .2rem; }

/* ---------- The operation chain (copy side): the story in four words ---------- */
.chain {
  --p: 0;
  position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%; margin-top: .9rem; padding-top: 1rem; border-top: 1px solid var(--line-1);
}
.chain::before, .chain::after { /* rail through the four numbers; the fill follows the live signal */
  content: ""; position: absolute; top: calc(1rem + 12px); height: 2px; border-radius: 2px;
}
.chain::before { right: 12px; left: calc(25% - 12px); background: rgb(140 184 255 / .2); }
.chain::after {
  right: 12px; width: calc(var(--p) * 75%);
  background: linear-gradient(270deg, var(--blue-300), #9fd0ff); box-shadow: 0 0 10px rgb(120 170 255 / .7);
  opacity: var(--rail-on, 0); transition: opacity .6s;
}
.chain li { position: relative; z-index: 1; display: grid; justify-items: start; gap: .1rem; padding-inline-end: .5rem; }
.chain i {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; margin-bottom: .35rem;
  font-style: normal; font-size: 12px; font-weight: 700; font-family: var(--font-display); color: #fff;
  background: #0d1a3c; box-shadow: 0 0 0 1.5px rgb(140 184 255 / .55), 0 0 0 5px #040815;
  transition: background .35s, box-shadow .35s;
}
.chain b { font-size: .98rem; font-weight: 600; color: var(--text-1); font-family: var(--font-display); }
.chain small { font-size: .8rem; line-height: 1.5; color: var(--text-3); transition: color .4s; min-height: 3em; }
.chain li.is-on i { background: var(--blue-500); box-shadow: 0 0 0 1.5px #b3cfff, 0 0 0 5px #040815, 0 0 18px 3px rgb(47 123 255 / .6); }
.chain li.is-on small { color: var(--blue-200); }

/* ---------- Foot: disclaimer + motion control (visitor-facing, WCAG 2.2.2) ---------- */
.hero__foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; flex-wrap: wrap; margin-top: .5rem; position: relative; }
.hero__note { font-size: var(--fs-xs); color: var(--text-3); display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.hero__note-tag {
  flex: none; font-size: var(--fs-micro); font-weight: 600; color: var(--warn);
  border: 1px solid rgb(242 187 85 / .35); border-radius: 5px; padding: 0 .45rem; line-height: 1.7;
}
.live-toggle {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 36px; padding: 0 .8rem;
  border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-2); font-size: .8rem;
  background: rgb(4 8 21 / .6);
  transition: color var(--dur-1), border-color var(--dur-1);
}
.live-toggle:hover { color: var(--text-1); border-color: var(--line-3); }
.live-toggle svg { width: 14px; height: 14px; }

/* ---------- Stage + canvas ---------- */
.hero__stage {
  position: relative; min-width: 0;
  /* bleed toward the far edge of the screen: the product owns that side */
  margin-inline-end: calc(-1 * (max(0px, (100vw - var(--maxw)) / 2) + var(--gutter) - 2rem));
}
.stage__viewport { position: relative; width: 100%; height: calc(var(--ch) * var(--k, 1) * 1px); }
.stage__canvas {
  position: absolute; top: 0; left: 50%;
  width: calc(var(--cw) * 1px); height: calc(var(--ch) * 1px);
  transform: translateX(-50%) scale(var(--k, 1)); transform-origin: top center;
  direction: rtl;
}
.node { position: absolute; }
.ghost { position: absolute; z-index: 0; }
.node--app { z-index: 1; }
.thread { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; overflow: visible; pointer-events: none; }
.node--pos { z-index: 3; }

.ghost { left: 92px; top: 0; width: 600px; height: 240px; }
.node--app { left: 0; top: 46px; width: 720px; height: 560px; }
.node--pos { left: 668px; top: 250px; width: 212px; height: 428px; }

/* Back plane */
.ghost {
  border-radius: 14px; padding: 12px 16px; overflow: hidden;
  background: linear-gradient(180deg, rgb(30 48 98 / .78), rgb(13 24 52 / .5));
  box-shadow: 0 0 0 1px rgb(150 180 240 / .16), 0 30px 60px -30px rgb(0 0 0 / .8);
}
.ghost__bar { display: flex; align-items: center; gap: 6px; font-size: 12px; color: rgb(200 215 245 / .8); }
.ghost__bar i { width: 7px; height: 7px; border-radius: 50%; background: rgb(200 215 245 / .22); }
.ghost__bar span { margin-inline-start: 8px; }
.ghost__bars { display: flex; align-items: flex-end; gap: 14px; height: 120px; margin-top: 16px; padding-inline: 8px; }
.ghost__bars i { flex: 1; height: calc(var(--h) * 100%); border-radius: 5px 5px 0 0; background: linear-gradient(180deg, rgb(110 160 255 / .38), rgb(110 160 255 / .06)); }

/* ---------- Flagship window ---------- */
.node--app::after { /* light spill on the horizon under the window */
  content: ""; position: absolute; left: 6%; right: 6%; bottom: -46px; height: 70px; z-index: -1;
  background: radial-gradient(ellipse 50% 50% at 50% 50%, rgb(90 150 255 / .4), transparent 72%);
}
.app {
  position: relative; height: 100%; border-radius: 16px; overflow: hidden; display: flex; flex-direction: column;
  background: var(--ui-bg); color: var(--ui-text-2); font-size: 13.5px; line-height: 1.5;
  box-shadow:
    0 0 0 1px rgb(255 255 255 / .55),
    0 1px 0 rgb(255 255 255 / .9) inset,
    0 60px 110px -40px rgb(0 3 14 / .95),
    0 0 140px -30px rgb(56 116 255 / .55);
}
.app::after { /* glass sheen: travels once during the entrance */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(110deg, transparent 35%, rgb(255 255 255 / .55) 48%, transparent 60%);
}
.app__bar { flex: none; height: 46px; display: flex; align-items: center; gap: 12px; padding-inline: 16px; background: var(--ui-navy); color: #c9d4ee; }
.app__brand { display: inline-flex; align-items: center; gap: 7px; color: #fff; font-family: "Readex Pro", system-ui, sans-serif; font-weight: 600; font-size: 14px; direction: ltr; }
.app__brand i { width: 18px; height: 18px; flex: none; background: url("../../brand/favicon.svg") center / contain no-repeat; }
.app__crumb { font-size: 13.5px; color: #dbe3f6; white-space: nowrap; }
.app__crumb-sub { color: #8796bb; }
.app__branch {
  margin-inline-start: auto; font-size: 12.5px; color: #dbe3f6; white-space: nowrap;
  padding: 2px 10px; border-radius: 999px; background: rgb(255 255 255 / .08); box-shadow: 0 0 0 1px rgb(255 255 255 / .12);
}
.ui-tag { font-size: 12.5px; font-weight: 600; color: #ffd38a; border: 1px solid rgb(255 211 138 / .45); border-radius: 6px; padding: 0 7px; line-height: 1.7; white-space: nowrap; }
.app__body { flex: 1; min-height: 0; display: grid; grid-template-columns: 60px minmax(0, 1fr); }
.app__rail { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 16px; background: #e9eef8; border-inline-start: 0; box-shadow: -1px 0 0 var(--ui-line); }
.app__rail i { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: #6a7695; }
.app__rail i.is-on { background: #fff; color: var(--ui-blue); box-shadow: 0 1px 2px rgb(15 30 70 / .12); }
.app__rail svg { width: 19px; height: 19px; }
.app__grid {
  position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: 1fr 1fr;
  gap: 18px; padding: 18px;
}

/* Panes */
.pane {
  position: relative; min-width: 0; border-radius: 14px; padding: 13px 15px;
  background: var(--ui-card); box-shadow: 0 0 0 1px var(--ui-line), 0 1px 2px rgb(15 30 70 / .06);
  transition: box-shadow .5s var(--ease-out);
}
.pane__h { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; white-space: nowrap; }
.pane__h b { color: var(--ui-text); font-weight: 700; font-size: 14.5px; }
.pane__h small { margin-inline-start: auto; color: var(--ui-text-3); font-size: 12.5px; font-family: var(--font-num); }
.pane.is-pulse { box-shadow: 0 0 0 2px #6ea6ff, 0 0 0 7px rgb(64 120 255 / .16), 0 10px 30px -12px rgb(34 89 224 / .4); }
.card__icon { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--ui-blue-tint); color: var(--ui-blue); flex: none; }
.card__icon svg { width: 16px; height: 16px; }
.card__icon--warn { background: var(--ui-amber-tint); color: var(--ui-amber); }

/* Beads: the signal's stations, pinned in the gutters at each pane's start corner */
.bead {
  position: absolute; z-index: 3; top: calc(-9px - var(--bead) / 2); right: calc(-9px - var(--bead) / 2);
  display: grid; place-items: center; width: var(--bead); height: var(--bead); border-radius: 50%;
  background: #0d1a3c; color: #fff; font-size: 12px; font-weight: 700; font-family: var(--font-display);
  box-shadow: 0 0 0 1.5px #8cb8ff, 0 0 0 4px var(--ui-bg);
  transition: background .35s, box-shadow .35s;
}
.bead i { font-style: normal; line-height: 1; }
.bead--dot { --bead: 10px; background: #8cb8ff; box-shadow: 0 0 0 3px var(--ui-bg); }
.bead--pos { top: -38px; right: calc(50% - var(--bead) / 2); box-shadow: 0 0 0 1.5px #8cb8ff, 0 0 0 5px #040815; }
.bead.is-on { background: var(--blue-500); box-shadow: 0 0 0 1.5px #b3cfff, 0 0 0 4px var(--ui-bg), 0 0 18px 4px rgb(47 123 255 / .55); }
.bead--pos.is-on { box-shadow: 0 0 0 1.5px #b3cfff, 0 0 0 5px #040815, 0 0 22px 5px rgb(47 123 255 / .6); }

/* Feed: the sale lands */
.live-dot { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--ui-teal); }
.live-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #1fb487; box-shadow: 0 0 0 3px rgb(31 180 135 / .18); }
.feed { display: grid; }
.feed li {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; gap: 10px;
  padding: 7px 6px; margin-inline: -6px; border-radius: 8px; border-top: 1px solid #edf0f6; font-variant-numeric: tabular-nums;
}
.feed li:first-child { border-top-color: transparent; }
.feed__no { color: var(--ui-text); font-weight: 600; font-family: var(--font-num); }
.feed__at { color: var(--ui-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed li b { color: var(--ui-text); font-weight: 600; }
.feed li.is-new { animation: feedIn .7s var(--ease-out) both; background: var(--ui-blue-tint); transition: background 1.6s .9s; }
.feed li.is-new.is-settled { background: transparent; }
@keyframes feedIn { from { opacity: 0; transform: translateY(-10px); } }

/* Management */
.kpi-big { display: flex; align-items: baseline; gap: 6px; color: var(--ui-text); font-size: 33px; font-weight: 700; line-height: 1.15; font-family: var(--font-num); font-variant-numeric: tabular-nums; transition: color .4s; }
.kpi-big em { font-style: normal; font-size: 14px; color: var(--ui-text-3); font-weight: 500; }
.kpi-big.is-bump { color: var(--ui-blue); }
.kpi__sub { display: inline-flex; gap: 5px; margin-top: 2px; font-size: 13.5px; color: var(--ui-text-2); }
.kpi__sub b { color: var(--ui-text); font-variant-numeric: tabular-nums; transition: color .4s; }
.kpi__sub b.is-bump { color: var(--ui-blue); }
.spark { width: 100%; height: 36px; margin-top: 6px; overflow: visible; }
.spark__line { stroke: var(--ui-blue); stroke-width: 2.2; fill: none; vector-effect: non-scaling-stroke; }
.decision {
  display: flex; align-items: center; gap: 9px; margin-top: 8px; padding: 8px 10px; border-radius: 11px;
  background: #fff8ea; box-shadow: 0 0 0 1px #f1ddb2; transition: box-shadow .4s;
}
.decision .card__icon { width: 26px; height: 26px; }
.decision p { color: var(--ui-text); font-size: 13px; line-height: 1.45; }
.decision.is-bump { box-shadow: 0 0 0 1.5px #e9b450, 0 0 0 5px rgb(240 192 105 / .22); }

/* Stock */
.card__item { color: var(--ui-text); font-size: 14.5px; font-weight: 600; }
.card__item small { font-weight: 400; color: var(--ui-text-3); font-size: 12.5px; margin-inline-start: 4px; }
.stock-flow { display: flex; align-items: baseline; gap: 8px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stock-flow s { font-size: 18px; color: var(--ui-text-3); text-decoration-thickness: 1.5px; text-decoration-color: rgb(86 98 127 / .6); }
.stock-flow svg { width: 15px; height: 15px; color: var(--ui-text-3); align-self: center; }
.stock-flow strong { font-size: 32px; line-height: 1.2; font-weight: 700; color: var(--ui-text); transition: color .4s; }
.stock-flow strong.is-warn { color: var(--ui-amber); }
.stock-flow em { font-style: normal; font-size: 13.5px; color: var(--ui-text-3); }
.gauge { margin-top: 10px; }
.gauge small { font-size: 12.5px; color: var(--ui-text-3); }
.stock-also { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid #edf0f6; font-size: 13px; color: var(--ui-text-2); }
.stock-also b { color: var(--ui-text); font-weight: 600; font-variant-numeric: tabular-nums; }
.gauge__bar { position: relative; display: block; height: 8px; border-radius: 8px; background: #e6ebf4; margin-bottom: 6px; }
.gauge__bar i { position: absolute; inset-block: 0; right: 0; width: calc(var(--v) * 100%); border-radius: inherit; background: linear-gradient(270deg, var(--ui-blue), #5b9bff); transition: width .8s var(--ease-out); }
.gauge__bar s { position: absolute; top: -4px; bottom: -4px; right: calc(var(--t) * 100%); width: 2px; border-radius: 2px; background: #d48a0c; }

/* Ledger */
.mini-ledger { font-size: 13.5px; font-variant-numeric: tabular-nums; }
.mini-ledger th { text-align: start; font-weight: 500; color: var(--ui-text-3); font-size: 12.5px; padding: 0 0 4px; }
.mini-ledger th + th, .mini-ledger td + td { text-align: end; width: 58px; }
.mini-ledger td { padding: 5px 0; color: var(--ui-text); border-top: 1px solid #edf0f6; transition: color .4s; }
.mini-ledger.is-bump td[data-live] { color: var(--ui-blue); }
.card__foot { display: flex; align-items: center; gap: 5px; margin-top: 8px; color: var(--ui-teal); font-size: 12.5px; font-weight: 600; }
.card__foot svg { width: 15px; height: 15px; }

/* ---------- Signal trace ---------- */
.thread__path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.thread__path--base { stroke: rgb(110 160 255 / .45); stroke-width: 1.6; stroke-dasharray: 2 5; }
.thread__path--lit {
  stroke: #4d8dff; stroke-width: 3; opacity: 0;
  stroke-dasharray: var(--comet, 150) var(--len, 2400); stroke-dashoffset: var(--comet, 150);
  filter: drop-shadow(0 0 4px rgb(80 140 255 / .9)); transition: opacity .5s;
}
.thread.is-running .thread__path--lit { opacity: 1; }
.thread__spark { fill: #fff; stroke: #2f7bff; stroke-width: 2; filter: drop-shadow(0 0 6px rgb(80 140 255 / 1)); opacity: 0; transition: opacity .3s; }
.thread.is-running .thread__spark { opacity: 1; }

/* ---------- 1 · POS phone (foreground) ---------- */
.phone {
  height: 100%; border-radius: 38px; padding: 8px;
  background: linear-gradient(160deg, #46526f, #121a2e 36%, #232d48);
  box-shadow: 0 0 0 1px rgb(190 205 240 / .4), 0 50px 90px -24px rgb(0 0 0 / .95), 0 20px 34px -16px rgb(0 0 0 / .75), -30px 0 80px -40px rgb(60 120 255 / .5);
  transition: box-shadow .5s var(--ease-out);
}
.phone.is-pulse { box-shadow: 0 0 0 2px #6ea6ff, 0 50px 90px -24px rgb(0 0 0 / .95), 0 0 0 10px rgb(64 120 255 / .18); }
.phone__screen {
  position: relative; height: 100%; border-radius: 31px; overflow: hidden;
  background: #f6f8fc; padding: 38px 16px 16px; display: flex; flex-direction: column; gap: 11px;
  font-size: 14px; line-height: 1.5; color: var(--ui-text-2);
}
.phone__notch { position: absolute; top: 10px; left: 50%; width: 66px; height: 18px; border-radius: 10px; background: #0b0f1a; transform: translateX(-50%); }
.phone__top { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.phone__top b { color: var(--ui-text); font-size: 17px; font-weight: 700; }
.phone__top small { font-size: 13px; color: var(--ui-text-3); }
.cart { display: grid; gap: 7px; }
.cart li { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; padding: 9px 12px; border-radius: 12px; background: #fff; border: 1px solid #e8ecf4; }
.cart li span { color: var(--ui-text); }
.cart li i { font-style: normal; color: var(--ui-text-3); font-size: 13px; margin-inline-start: 2px; }
.cart li b { color: var(--ui-text); font-weight: 600; }
.cart.is-swap li { animation: rowIn .6s var(--ease-out) both; }
.cart.is-swap li:nth-child(2) { animation-delay: .08s; }
.cart.is-swap li:nth-child(3) { animation-delay: .16s; }
@keyframes rowIn { from { opacity: 0; transform: translateY(-8px); } }
.phone__hint { flex: 1; min-height: 0; display: grid; place-items: center; border: 1px dashed var(--ui-line-2); border-radius: 12px; color: var(--ui-text-3); font-size: 13px; text-align: center; padding: 6px; }
.totals { display: grid; gap: 4px; }
.totals div { display: flex; justify-content: space-between; align-items: baseline; }
.totals b { color: var(--ui-text-2); font-weight: 500; }
.totals__grand { padding-top: 8px; border-top: 1px dashed var(--ui-line-2); color: var(--ui-text); font-weight: 600; font-size: 15px; }
.totals__grand b { color: var(--ui-text); font-size: 26px; font-weight: 700; line-height: 1.2; }
.totals__grand em { font-style: normal; font-size: 13px; color: var(--ui-text-3); font-weight: 500; }
.pay-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; font-size: 13px; }
.pay-methods span { text-align: center; padding: 6px 0; border-radius: 10px; border: 1px solid var(--ui-line); background: #fff; color: var(--ui-text-2); }
.pay-methods .is-on { border-color: var(--ui-blue); color: var(--ui-blue-2); background: var(--ui-blue-tint); font-weight: 600; }
.pay-btn {
  display: block; text-align: center; padding: 13px; border-radius: 14px;
  background: var(--ui-blue); color: #fff; font-weight: 700; font-size: 16px;
  box-shadow: 0 10px 20px -10px rgb(34 89 224 / .9);
  transition: transform .2s, background .2s;
}
.pay-btn.is-press { transform: scale(.95); background: var(--ui-blue-2); }
.phone__toast {
  position: absolute; inset-inline: 12px; bottom: 76px; display: flex; align-items: center; gap: 8px;
  padding: 11px 13px; border-radius: 14px; background: #0d2e28; color: #fff; font-size: 14px;
  box-shadow: 0 14px 26px -10px rgb(0 0 0 / .5);
  opacity: 0; transform: translateY(10px) scale(.97); transition: opacity .35s, transform .45s var(--ease-out);
}
.phone__toast svg { width: 18px; height: 18px; color: #34d8a5; flex: none; }
.phone__toast.is-on { opacity: 1; transform: none; }
/* document numbers stay LTR inside Arabic sentences ("#1045", not "1045#") */
.phone__toast b, .chain bdi { unicode-bidi: isolate; direction: ltr; }

/* ---------- Internal preview settings (only with ?preview=1 / ?hero=) ---------- */
.preview-kit { position: fixed; z-index: 40; bottom: 16px; inset-inline-end: 16px; direction: rtl; }
.preview-kit__toggle {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: rgb(9 15 32 / .9); border: 1px solid var(--line-2); color: var(--text-3);
  box-shadow: 0 12px 30px -14px rgb(0 0 0 / .8); transition: color var(--dur-1), border-color var(--dur-1);
}
.preview-kit__toggle:hover, .preview-kit__toggle[aria-expanded="true"] { color: var(--text-1); border-color: var(--line-3); }
.preview-kit__toggle svg { width: 18px; height: 18px; }
.preview-kit__toggle:focus-visible { border-radius: 50%; }
.preview-kit__panel {
  position: absolute; bottom: 50px; inset-inline-end: 0; width: 240px;
  display: grid; gap: 4px; padding: 10px; border-radius: 14px;
  background: rgb(9 15 32 / .97); border: 1px solid var(--line-2); box-shadow: 0 24px 50px -20px rgb(0 0 0 / .9);
  font-size: .82rem; color: var(--text-2);
}
.preview-kit__title { font-size: .74rem; color: var(--text-3); padding: 2px 6px 6px; }
.preview-kit__opt, .preview-kit__replay {
  display: flex; align-items: center; gap: .55rem; min-height: 38px; padding: 0 .55rem; border-radius: 9px; text-align: start;
  color: var(--text-2); transition: background var(--dur-1), color var(--dur-1);
}
.preview-kit__opt:hover, .preview-kit__replay:hover { background: rgb(255 255 255 / .05); color: var(--text-1); }
.preview-kit__opt b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-3); font-family: var(--font-display); font-weight: 600; font-size: .78rem; }
.preview-kit__opt small { margin-inline-start: auto; color: var(--text-3); font-size: .72rem; }
.preview-kit__opt[aria-pressed="true"] { background: var(--surface-3); color: var(--text-1); }
.preview-kit__opt[aria-pressed="true"] b { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.preview-kit__replay { border-top: 1px solid var(--line-1); border-radius: 0 0 9px 9px; margin-top: 4px; }
.preview-kit__replay svg { width: 16px; height: 16px; }

/* ======================================================
   ENTRANCE B — "كشف المنتج" (default): the headline rises line by line while the window
   tilts up out of the dark, a sheen crosses its glass, then the till slides in and the trace is laid.
   ====================================================== */
@keyframes e-rise { from { opacity: 0; transform: translateY(.5em); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes e-soft { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes e-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes e-under { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes e-tilt {
  from { opacity: 0; transform: translateX(-50%) scale(var(--k, 1)) perspective(1800px) rotateX(14deg) rotateY(-9deg) translateY(50px) scale(.94); }
  30% { opacity: 1; }
  to { opacity: 1; transform: translateX(-50%) scale(var(--k, 1)); }
}
@keyframes e-sheen { from { opacity: 1; transform: translateX(-110%); } to { opacity: 1; transform: translateX(110%); } }
@keyframes e-till { from { opacity: 0; transform: translate(-46px, 60px) rotate(2deg); } to { opacity: 1; transform: none; } }
@keyframes e-pane { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes e-draw { from { stroke-dashoffset: var(--len, 2400); stroke-dasharray: var(--len, 2400); } to { stroke-dashoffset: 0; stroke-dasharray: var(--len, 2400); } }
@keyframes e-pop { from { opacity: 0; scale: .4; } to { opacity: 1; scale: 1; } }
@keyframes e-light { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }

.hero.is-entering .hero__key { animation: e-light 2.2s var(--ease-out) both; }
.hero.is-entering .hero__horizon { animation: e-soft 1.8s .1s var(--ease-out) both; }
.hero.is-entering .hero__eyebrow { animation: e-soft .7s 0s var(--ease-out) both; }
.hero.is-entering .hero__line > span { animation: e-rise .95s var(--ease-out) both; }
.hero.is-entering .hero__line:nth-child(1) > span { animation-delay: .1s; }
.hero.is-entering .hero__line:nth-child(2) > span { animation-delay: .22s; }
.hero.is-entering .hero__line:nth-child(3) > span { animation-delay: .34s; }
.hero.is-entering .hero__title em::after { animation: e-under .8s 1.1s var(--ease-out) both; }
.hero.is-entering .hero__lead { animation: e-soft .8s .55s var(--ease-out) both; }
.hero.is-entering .hero__ctas { animation: e-soft .8s .7s var(--ease-out) both; }
.hero.is-entering .chain { animation: e-soft .8s .9s var(--ease-out) both; }

.hero[data-concept="b"].is-entering .stage__canvas { animation: e-tilt 1.7s .15s var(--ease-out) both; }
.hero[data-concept="b"].is-entering .ghost { animation: e-soft 1.2s .7s var(--ease-out) both; }
.hero[data-concept="b"].is-entering .app::after { animation: e-sheen 1.3s 1s var(--ease-io) both; }
.hero[data-concept="b"].is-entering .node--pos { animation: e-till 1.1s .95s var(--ease-out) both; }
.hero[data-concept="b"].is-entering .thread__path--base { animation: e-draw 1.2s 1.5s var(--ease-io) both; }
.hero[data-concept="b"].is-entering .bead { animation: e-pop .45s var(--ease-out) both; }
.hero[data-concept="b"].is-entering .bead--pos { animation-delay: 1.5s; }
.hero[data-concept="b"].is-entering [data-st="feed"] { animation-delay: 1.75s; }
.hero[data-concept="b"].is-entering [data-st="stock"] { animation-delay: 1.95s; }
.hero[data-concept="b"].is-entering [data-st="ledger"] { animation-delay: 2.15s; }
.hero[data-concept="b"].is-entering [data-st="desk"] { animation-delay: 2.35s; }

/* ======================================================
   ENTRANCE A — "الإشارة أولًا" (preview only): the till appears alone, the trace is laid from it,
   and each pane of the window materialises as the signal reaches it.
   ====================================================== */
.hero[data-concept="a"].is-entering .node--pos { animation: e-soft .8s .1s var(--ease-out) both; }
.hero[data-concept="a"].is-entering .thread__path--base { animation: e-draw 1.8s .6s var(--ease-io) both; }
.hero[data-concept="a"].is-entering .app { animation: e-fade 1s .5s both; }
.hero[data-concept="a"].is-entering .app__grid > .pane { animation: e-pane .7s var(--ease-out) both; }
.hero[data-concept="a"].is-entering .app__grid > .pane--feed { animation-delay: .9s; }
.hero[data-concept="a"].is-entering .app__grid > .pane--stock { animation-delay: 1.3s; }
.hero[data-concept="a"].is-entering .app__grid > .pane--ledger { animation-delay: 1.65s; }
.hero[data-concept="a"].is-entering .app__grid > .pane--desk { animation-delay: 2s; }
.hero[data-concept="a"].is-entering .ghost { animation: e-fade 1s 2s both; }
.hero[data-concept="a"].is-entering .node--app::after { animation: e-fade 1s 1.8s both; }

/* ======================================================
   Tablet (761–1180px): copy above, the same wide canvas scaled below
   ====================================================== */
@media (max-width: 1180px) {
  .hero__layout { grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }
  .hero__copy { max-width: 680px; }
  .hero__title { font-size: clamp(2.3rem, 1.2rem + 3vw, 3.2rem); }
  .hero__line:nth-child(2), .hero__line:nth-child(3) { display: inline; }
  .hero__line:nth-child(3)::before { content: " "; }
  .hero__stage { margin-inline: calc(var(--gutter) * -1 + .75rem); max-width: 900px; justify-self: stretch; }
  .hero__key { left: -20%; top: 10%; width: 140%; height: 100%; }
  .hero__horizon { left: -40%; width: 180%; top: 84%; }
  .hero__grid { mask-image: radial-gradient(ellipse 60% 40% at 50% 70%, #000, transparent 75%); -webkit-mask-image: radial-gradient(ellipse 60% 40% at 50% 70%, #000, transparent 75%); }
}

/* ======================================================
   Mobile (≤760px): purpose-built scene. The window holds stock → ledger → management in one column,
   the till stands beside it, and the trace runs down the gutter between them.
   ====================================================== */
@media (max-width: 760px) {
  .hero { --cw: 360; --ch: 436; --kmax: 1.1; --bead: 22px; padding-block: .85rem .75rem; }
  .hero__layout { gap: .9rem; }
  .hero__copy { gap: .55rem; }
  .hero__eyebrow { display: none; }
  .hero__title { font-size: clamp(1.7rem, 1.1rem + 2.6vw, 2rem); line-height: 1.32; }
  .hero__lead { font-size: .98rem; line-height: 1.65; }
  .hero__lead-full { display: none; }
  .hero__lead-short { display: inline; }
  .hero__ctas { width: 100%; margin-top: .25rem; }
  .hero__ctas .btn--primary { flex: 1; }
  .hero__cta-2 { display: none; }

  .chain { margin-top: .35rem; padding-top: .7rem; }
  .chain::before, .chain::after { top: calc(.7rem + 11px); }
  .chain i { width: 22px; height: 22px; font-size: 11.5px; margin-bottom: .2rem; }
  .chain b { font-size: .86rem; }
  .chain small { display: none; }

  .hero__stage { margin-inline: calc(var(--gutter) * -1); width: auto; max-width: none; justify-self: stretch; }
  .hero__key { left: -40%; top: 30%; width: 180%; height: 80%; }
  .hero__horizon { top: 88%; }
  .hero__foot { margin-top: .6rem; }
  .hero__note { font-size: var(--fs-tag); line-height: 1.65; }
  .hero__note-tag { display: none; }

  .ghost { display: none; }
  .node--app { left: 6px; top: 0; width: 196px; height: 436px; }
  .node--app::after { bottom: -30px; }
  .node--pos { left: 214px; top: 26px; width: 142px; height: 384px; }

  .app { font-size: 12.5px; border-radius: 14px; }
  .app__bar { height: 34px; padding-inline: 10px; gap: 6px; }
  .app__brand, .app__branch, .app__rail, .spark, .pane--feed, .mini-ledger thead { display: none; }
  .app__crumb { font-size: 12px; }
  .app__crumb-sub { display: none; }
  .ui-tag { margin-inline-start: auto; font-size: 11.5px; padding: 0 5px; }
  .app__body { grid-template-columns: minmax(0, 1fr); }
  .app__grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; gap: 14px; padding: 14px 18px 12px 10px; align-content: start; }
  .pane { padding: 9px 10px; border-radius: 12px; }
  .pane--stock { order: 1; } .pane--ledger { order: 2; } .pane--desk { order: 3; }
  /* beads sit mid-height on the gutter rail between the panes and the till */
  .bead { top: calc(50% - var(--bead) / 2); }
  .bead--pos { top: 12px; right: auto; left: calc(-7px - var(--bead) / 2); }
  .pane__h { margin-bottom: 4px; gap: 6px; }
  .pane__h b { font-size: 13px; }
  .pane__h small { display: none; }
  .card__icon { width: 22px; height: 22px; border-radius: 7px; }
  .card__icon svg { width: 13px; height: 13px; }
  .card__item { font-size: 12.5px; }
  .card__item small { display: none; }
  .stock-flow { gap: 5px; }
  .stock-flow s { font-size: 14px; }
  .stock-flow svg { width: 12px; height: 12px; }
  .stock-flow strong { font-size: 23px; }
  .stock-flow em { font-size: 12px; }
  .gauge { margin-top: 4px; }
  .gauge small { font-size: 12px; }
  .mini-ledger { font-size: 12.5px; }
  .mini-ledger td { padding: 3px 0; }
  .mini-ledger td:empty { display: none; }
  .mini-ledger tr:first-child td { border-top: 0; }
  .mini-ledger td + td { width: auto; }
  .mini-ledger td:nth-child(2):not(:empty)::before { content: "مدين "; color: var(--ui-text-3); font-size: 12px; }
  .mini-ledger td:nth-child(3):not(:empty)::before { content: "دائن "; color: var(--ui-text-3); font-size: 12px; }
  .card__foot { font-size: 12px; margin-top: 3px; }
  .kpi-big { font-size: 22px; gap: 4px; }
  .kpi-big em { font-size: 12px; }
  .kpi__sub { font-size: 12px; margin-top: 0; }
  .decision { display: none; }

  .phone { border-radius: 28px; padding: 6px; }
  .phone__screen { border-radius: 23px; padding: 28px 10px 10px; gap: 8px; font-size: 12.5px; }
  .phone__notch { width: 48px; height: 14px; top: 8px; }
  .phone__top { flex-direction: column; gap: 0; }
  .phone__top b { font-size: 14.5px; }
  .phone__top small { font-size: 12px; }
  .cart li { padding: 6px 8px; flex-wrap: wrap; gap: 0 4px; border-radius: 10px; }
  .cart li i { font-size: 12px; }
  .phone__hint span, .stock-also { display: none; }
  .totals { gap: 2px; }
  .totals__grand { font-size: 12.5px; padding-top: 5px; flex-direction: column; align-items: flex-start !important; }
  .totals__grand b { font-size: 20px; }
  .totals__grand em { font-size: 12px; }
  .pay-methods { display: none; }
  .pay-btn { padding: 9px; font-size: 13.5px; border-radius: 11px; }
  .phone__toast { inset-inline: 7px; bottom: 54px; font-size: 12px; padding: 7px 9px; gap: 5px; }
  .phone__toast svg { width: 14px; height: 14px; }

  .preview-kit { inset-inline-end: auto; inset-inline-start: 10px; bottom: 10px; }
  .preview-kit__panel { inset-inline-end: auto; inset-inline-start: 0; }
}
