/* ── Home story: four scenes, one continuous visual ─────────────────────────
   The Challenge → Our Approach → The Result → Let's Talk. Loaded on the home page only. */
.story { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-rows: 1fr auto;
  height: clamp(680px, calc(100svh - var(--header-h)), 900px); }
.story::before { content: ""; position: absolute; inset: 0; z-index: -2;
  background: radial-gradient(55% 70% at 18% 24%, var(--glow-cool), transparent 70%), radial-gradient(45% 60% at 78% 60%, var(--glow-warm), transparent 72%); }
[dir="rtl"] .story::before { background: radial-gradient(55% 70% at 82% 24%, var(--glow-cool), transparent 70%), radial-gradient(45% 60% at 22% 60%, var(--glow-warm), transparent 72%); }
.st-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.st-grid { position: relative; min-height: 0; display: grid; grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr); gap: clamp(32px, 4vw, 64px); align-items: center; padding-top: 24px; }

/* copy: one scene at a time */
.st-copy { position: relative; z-index: 3; display: grid; }
.st-act { grid-area: 1 / 1; align-self: center; }
.js .st-act { opacity: 0; transform: translateY(14px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); pointer-events: none; }
.js .st-act.is-on { opacity: 1; transform: none; pointer-events: auto; }
html:not(.js) .st-act:not(.st-act-3) { display: none; }
.st-act h1 { font-size: clamp(2.4rem, 4.4vw, 4.3rem); margin: 14px 0 22px; }
.st-act h2 { font-size: clamp(2rem, 3.5vw, 3.2rem); margin: 14px 0 20px; }
[lang="ar"] .st-act h1 { font-size: clamp(2rem, 3.5vw, 3.3rem); }
[lang="ar"] .st-act h2 { font-size: clamp(1.8rem, 3vw, 2.7rem); }
.st-body { font-size: 1.06rem; line-height: 1.75; max-width: 46ch; color: var(--ink-2); margin: 0; }
.st-note { margin: 18px 0 0; max-width: 46ch; font-size: 0.86rem; line-height: 1.6; color: var(--ink-3); padding-inline-start: 12px; border-inline-start: 2px solid var(--line-strong); }
.st-act .button-row { margin-top: 30px; }
.st-act .micro { margin-top: 28px; }

/* the engagement process, with the written agreement as the hinge between scope and engineering */
.st-process { list-style: none; margin: 26px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); max-width: 500px; position: relative; }
.st-process::before { content: ""; position: absolute; top: 5px; inset-inline: 10% 10%; height: 1px; background: var(--line-strong); }
.st-process li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 9px; text-align: center; font-size: 12px; line-height: 1.3; color: var(--ink-3); }
.st-process li::before { content: ""; width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line-strong); position: relative; z-index: 1; }
.st-process li.is-key { color: var(--ink); font-weight: 500; }
.st-process li.is-key::before { width: 13px; height: 13px; margin-top: -1px; border: 0; background: linear-gradient(135deg, var(--blue), var(--pink)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--pink) 16%, transparent); }
.st-agree { display: flex; gap: 12px; align-items: flex-start; margin: 22px 0 0; max-width: 48ch; font-size: 0.9rem; line-height: 1.6; color: var(--ink-2); }
.st-agree svg { flex: none; width: 22px; height: 22px; margin-top: 1px; fill: none; stroke: var(--pink); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.st-act .text-link { margin-top: 18px; display: inline-flex; }

/* the artwork column */
.st-art { position: relative; height: min(84%, 620px); touch-action: pan-y; }
html:not(.js) .st-art { display: none; }
.st-tag { position: absolute; z-index: 3; transform: translate(-50%, -50%); white-space: nowrap; font: 12px/1 ui-monospace, Menlo, monospace; color: var(--pink); padding: 5px 9px;
  border: 1px solid color-mix(in srgb, var(--pink) 55%, transparent); border-radius: 99px; background: color-mix(in srgb, var(--bg) 82%, transparent); opacity: 0; pointer-events: none; }
[dir="rtl"] .st-tag { transform: translate(50%, -50%); }
[lang="ar"] .st-tag { font: 12px/1 var(--f-ar-body); }
.st-labels { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.st-labels > * { position: absolute; transform: translate(-50%, -50%); text-align: center; opacity: 0; margin: 0; }
.st-vlabel { width: 11em; }
.st-vlabel b { display: block; font: 400 1.12rem/1.2 var(--f-display); color: var(--ink); }
[lang="ar"] .st-vlabel b { font-family: var(--f-ar-head); font-size: 1.05rem; }
.st-vlabel span { display: block; margin-top: 4px; font-size: 0.8rem; color: var(--ink-3); }
.st-vlabel::before { content: ""; display: block; width: 6px; height: 6px; margin: 0 auto 7px; border-radius: 50%; }
.st-vlabel.v0::before { background: var(--blue); } .st-vlabel.v1::before { background: var(--pink); } .st-vlabel.v2::before { background: var(--orange); }
.st-pair { font: 500 11.5px var(--f-label); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
[lang="ar"] .st-pair { font: 500 12px var(--f-ar-body); letter-spacing: 0; }
.st-core { font: italic 400 1rem var(--f-em); color: var(--ink); white-space: nowrap; }
[lang="ar"] .st-core { font: 500 0.95rem var(--f-ar-head); }
.st-quar { font-size: 12px; color: var(--pink); white-space: nowrap; }

/* the illustrative dashboard the records land in */
.st-card { position: absolute; inset: 6% 2% 4%; z-index: 1; display: flex; flex-direction: column; padding: 22px 24px 16px; border-radius: 20px; opacity: 0;
  background: rgba(15, 24, 60, 0.92); border: 1px solid rgba(150, 175, 255, 0.2); box-shadow: 0 30px 70px rgba(2, 6, 20, 0.55); transform-origin: center; }
[data-theme="twilight"] .st-card { background: #fffdfb; border-color: rgba(22, 41, 106, 0.1); box-shadow: var(--card-shadow); }
.is-invite .st-card { box-shadow: 0 30px 80px rgba(2, 6, 20, 0.55), 0 0 0 1px color-mix(in srgb, var(--blue) 30%, transparent); }
.st-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.st-ctitle { margin: 0; font: 400 1.05rem/1.3 var(--f-display); color: var(--ink); }
[lang="ar"] .st-ctitle { font-family: var(--f-ar-head); }
.st-cdemo { margin: 4px 0 0; font: 500 11.5px var(--f-label); letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-3); }
[lang="ar"] .st-cdemo { font: 400 12px var(--f-ar-body); letter-spacing: 0; }
.st-chip { font: 500 11.5px var(--f-label); letter-spacing: 0.16em; text-transform: uppercase; padding: 5px 10px; border-radius: 99px; color: var(--blue); border: 1px solid currentColor;
  opacity: 0; transform: scale(0.9); transition: opacity 0.5s, transform 0.5s var(--ease); white-space: nowrap; }
[lang="ar"] .st-chip { font: 500 12px var(--f-ar-body); letter-spacing: 0; }
.is-verified .st-chip { opacity: 1; transform: none; }
.st-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0 6px; }
.st-kpis div { border-top: 1px solid var(--line); padding-top: 9px; }
.st-kpis small { display: block; font-size: 12px; color: var(--ink-3); }
.st-kpis b { display: block; margin-top: 4px; font: 400 1.45rem/1.1 var(--f-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.st-sar { display: inline-flex !important; align-items: baseline; gap: 5px; }
.st-sar-i { display: inline-block; width: 0.62em; height: 0.7em; }
.st-sar-i svg { width: 100%; height: 100%; fill: currentColor; }
.st-chart { flex: 1; margin: 14px 0 10px; border-bottom: 1px solid var(--line-strong); background: repeating-linear-gradient(to top, var(--line) 0 1px, transparent 1px 25%); }
.st-card footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding-top: 10px; font-size: 12px; color: var(--ink-3); }
.st-ringwrap { display: inline-flex; align-items: center; gap: 7px; }
.st-ring { width: 14px; height: 14px; display: inline-block; }
.st-card footer code { margin-inline-start: auto; font: 11.5px ui-monospace, Menlo, monospace; }

/* story controls: understated, like the page navigation of a presentation */
.st-navwrap { position: relative; z-index: 4; padding-bottom: 26px; }
html:not(.js) .st-navwrap, html:not(.js) .st-replay { display: none; }
.st-nav { display: flex; align-items: center; gap: 6px; }
.st-scenes { display: flex; list-style: none; margin: 0; padding: 0; gap: 2px; }
.st-scene, .st-arrow { font: inherit; background: none; border: 0; color: inherit; cursor: pointer; }
.st-scene { display: inline-flex; align-items: baseline; gap: 8px; padding: 10px 12px; border-radius: 10px; color: var(--ink-3); transition: color 0.3s, background 0.3s; }
.st-scene .st-num { font: 500 12px var(--f-label); letter-spacing: 0.16em; }
.st-scene .st-name { font: 500 12px var(--f-label); letter-spacing: 0.2em; text-transform: uppercase; }
[lang="ar"] .st-scene .st-name { font: 500 13px var(--f-ar-body); letter-spacing: 0; text-transform: none; }
.st-scene:hover { color: var(--ink); background: var(--surface); }
.st-scene[aria-current] { color: var(--ink); }
.st-scene[aria-current] .st-num { color: var(--accent); }
.st-arrow { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-strong); color: var(--ink-2); transition: border-color 0.3s, color 0.3s, opacity 0.3s; }
.st-arrow:hover:not(:disabled) { border-color: var(--accent); color: var(--ink); }
.st-arrow:disabled { opacity: 0.35; cursor: default; }
.st-arrow svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
[dir="rtl"] .st-arrow svg { transform: scaleX(-1); }
.st-scene:focus-visible, .st-arrow:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.st-progress { height: 2px; margin-top: 10px; max-width: 640px; background: var(--line); border-radius: 2px; overflow: hidden; }
.st-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--pink), var(--orange)); transform-origin: left; transform: scaleX(0); }
[dir="rtl"] .st-progress i { transform-origin: right; background: linear-gradient(270deg, var(--blue), var(--pink), var(--orange)); }
/* replay the cinematic introduction */
.st-replay { position: absolute; z-index: 5; bottom: 22px; inset-inline-end: var(--gutter);
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 99px; border: 1px solid var(--line-strong); background: none; color: var(--ink-2); cursor: pointer;
  font: 500 11px var(--f-label); letter-spacing: 0.2em; text-transform: uppercase; transition: color 0.3s, border-color 0.3s; }
[lang="ar"] .st-replay { font: 500 13px var(--f-ar-body); letter-spacing: 0; }
.st-replay svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.st-replay:hover { color: var(--ink); border-color: var(--accent); }
.st-replay:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.st-replay[hidden] { display: none; }

/* cinema: the introduction shows this same visual full screen, centred, without the hero copy and controls */
.story.is-cinema { position: fixed; inset: 0; z-index: 195; height: 100vh; height: 100svh; background: var(--bg); display: block; padding: 0; }
.story.is-cinema .st-copy, .story.is-cinema .st-navwrap { display: none; }
.story.is-cinema .st-grid { display: block; height: 100%; padding: 0; }
.story.is-cinema .st-art { position: absolute; left: 50%; top: 9vh; width: min(980px, 92vw); height: min(58vh, 620px); margin: 0; transform: translateX(-50%); }
@media (max-width: 760px) { .story.is-cinema .st-art { top: 10vh; height: min(52vh, 125vw); } }

@media (max-width: 1023px) {
  /* smaller screens: the visual first, then the controls, then the words of the current scene */
  .story { height: auto; display: flex; flex-direction: column; padding-bottom: 40px; }
  .st-grid { display: contents; }
  .st-art { order: 1; height: clamp(360px, 92vw, 560px); margin: 56px var(--gutter) 0; }
  .st-navwrap { order: 2; padding: 10px var(--gutter) 0; }
  .st-copy { order: 3; padding: 26px var(--gutter) 0; width: 100%; max-width: 680px; }
  .st-act { align-self: start; }
  .st-replay { position: static; margin-top: 14px; }
  .st-card { inset: 2% 0 4%; padding: 16px; }
  .st-kpis b { font-size: 1.15rem; }
  .st-card footer code { display: none; }
  .st-vlabel { width: 8em; } .st-vlabel b { font-size: 0.9rem; } .st-vlabel span { display: none; }
  .st-pair { font-size: 11.5px; letter-spacing: 0.1em; }
  [lang="ar"] .st-pair { font-size: 12px; }
  .st-tag { font-size: 11.5px; }
  [lang="ar"] .st-vlabel b { font-size: 0.8rem; }
  [lang="ar"] .st-core { font-size: 0.8rem; }
}
@media (max-width: 760px) {
  .st-act h1 { font-size: clamp(2rem, 9vw, 2.7rem); margin-bottom: 14px; }
  .st-act h2 { font-size: clamp(1.65rem, 7vw, 2.2rem); margin: 10px 0 12px; }
  [lang="ar"] .st-act h1 { font-size: clamp(1.9rem, 8.4vw, 2.5rem); }
  [lang="ar"] .st-act h2 { font-size: clamp(1.55rem, 6.6vw, 2rem); }
  .st-body { font-size: 0.98rem; line-height: 1.65; }
  .st-agree { font-size: 0.85rem; }
  .st-process li { font-size: 11.5px; }
  .st-pair { display: none; }
  .st-act .button-row { margin-top: 20px; }
  .st-act .micro { display: none; }
  .st-nav { justify-content: space-between; }
  .st-scene { padding: 10px 8px; }
  .st-scene:not([aria-current]) .st-name { display: none; }
  .st-progress { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .js .st-act { transition: none; transform: none; }
  .st-chip { transition: none; }
}
