/* ============================================================
   DRAGONY V67 — Bronze & Time cinematic stage
   Layered on top of styles.20260930-v66.css (home pages only).
   Logical properties everywhere so the same rules serve AR (rtl) and EN (ltr).
   No inline styles are needed (site CSP: style-src 'self').
   ============================================================ */

:root{
  --stage-ember:#ff4a63;
  --stage-sapphire:#4aa3ff;
  --stage-ink:#fff6ed;
  --stage-desc:#d1d5db;
  --stage-pad:60px;
  --stage-nav:78px;
  --stage-ease:cubic-bezier(.25,1,.5,1);
  --stage-wipe:cubic-bezier(.16,1,.3,1);
}

/* ---------- WebGL canvas (fixed, behind the whole site) ---------- */
.stage-canvas{
  position:fixed;inset:0;
  width:100%;height:100vh;height:100lvh;
  z-index:0;display:none;pointer-events:none;
  background:#000;opacity:0;transition:opacity 1.4s ease;outline:none;
}
html.stage-live .stage-canvas{display:block;opacity:1}
/* the legacy fixed grid/vignette decoration would double up with the stage */
html.stage-live body::before,
html.stage-live body::after{display:none!important}
html.stage-live,html.stage-live body{background:#000}

/* ---------- Chapter shell ---------- */
.stage-chapter{position:relative;z-index:2;color:#fff}
.stage-pin{position:relative}

/* LIVE: tall scroll runway + sticky viewport */
html.stage-pending .stage-chapter,
html.stage-live .stage-chapter{height:460vh}
html.stage-pending .stage-pin,
html.stage-live .stage-pin{
  position:sticky;top:0;
  height:100vh;height:100svh;
  overflow:hidden;
}

/* legibility scrim behind the bottom-aligned text */
html.stage-pending .stage-pin::before,
html.stage-live .stage-pin::before{
  content:"";position:absolute;inset:0;z-index:1;pointer-events:none;
  background:linear-gradient(to top,rgba(0,0,0,0) 0%,rgba(0,0,0,.50) 14%,rgba(0,0,0,.36) 32%,rgba(0,0,0,0) 62%);
}

/* ---------- Typography ---------- */
.stage-title{
  font-family:'Italiana',Georgia,'Times New Roman',serif;
  font-weight:400;
  font-size:clamp(46px,min(7.4vw,13.5vh),116px);
  line-height:1;letter-spacing:2px;
  margin:0 0 20px;
  color:var(--stage-ink);
  text-shadow:0 2px 36px rgba(0,0,0,.55);
  text-transform:none;
}
html[lang="ar"] .stage-title{
  font-family:Cairo,'Segoe UI',Tahoma,sans-serif;
  font-weight:800;
  font-size:clamp(40px,min(6.2vw,12vh),104px);
  line-height:1.2;
  letter-spacing:0!important;   /* letter-spacing breaks Arabic joining */
}
html[lang="ar"] .stage-desc,
html[lang="ar"] .stage-kicker,
html[lang="ar"] .stage-index{letter-spacing:0!important}
.stage-title .line{display:block}
.stage-title .word{display:inline-block;white-space:nowrap}
.stage-title .is-accent .unit{color:#7db8ff;color:color-mix(in srgb,var(--stage-sapphire) calc((1 - var(--mix,.5)) * 100%),var(--stage-ember))}

.stage-title .unit{
  display:inline-block;
  opacity:0;transform:translateY(50px);filter:blur(12px);
  transition:opacity .8s var(--stage-ease),transform .8s var(--stage-ease),filter .8s var(--stage-ease);
  will-change:opacity,transform,filter;
}
.stage-slide.active .stage-title .unit{opacity:1;transform:none;filter:blur(0)}

.stage-desc{
  font-family:Inter,Cairo,sans-serif;
  font-size:16px;line-height:1.7;font-weight:300;
  color:#e4e7ec;letter-spacing:.5px;
  margin:0;
  opacity:0;transform:translateY(30px);
  transition:opacity .8s var(--stage-ease) .4s,transform .8s var(--stage-ease) .4s;
  text-shadow:0 0 22px rgba(0,0,0,.95),0 1px 4px rgba(0,0,0,.85);
}
html[lang="ar"] .stage-desc{font-family:Cairo,Inter,sans-serif;font-weight:400;line-height:1.95;font-size:16px}
.stage-slide.active .stage-desc{opacity:1;transform:none}

.stage-kicker{
  display:inline-flex;align-items:center;gap:10px;
  margin:0 0 22px;padding:9px 16px;
  border:1px solid rgba(255,255,255,.14);border-radius:999px;
  background:rgba(8,9,13,.5);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);
  font:600 10px Inter,Cairo,sans-serif;letter-spacing:.14em;text-transform:uppercase;color:#d9dee8;
  opacity:0;transform:translateY(20px);
  transition:opacity .8s var(--stage-ease),transform .8s var(--stage-ease);
}
html[lang="ar"] .stage-kicker{font-family:Cairo,Inter,sans-serif;font-size:12px;font-weight:600;text-transform:none}
.stage-slide.active .stage-kicker{opacity:1;transform:none}

.stage-index{
  display:block;margin:0 0 14px;
  font:600 10px Inter,sans-serif;letter-spacing:.22em;text-transform:uppercase;color:rgba(255,255,255,.55);
  opacity:0;transition:opacity .8s var(--stage-ease) .2s;
}
.stage-slide.active .stage-index{opacity:1}

/* ---------- Slides (live layout) ---------- */
.stage-slide{
  position:absolute;inset-block-end:12%;z-index:3;
  pointer-events:none;
  visibility:hidden;
  transition:visibility 0s linear .9s;
}
.stage-slide.active{visibility:visible;pointer-events:auto;transition-delay:0s}

#chapter-1{inset-inline:0;width:100%}
#chapter-1 .stage-kicker,
#chapter-1 .stage-title{margin-inline-start:var(--stage-pad)}
#chapter-1 .desc-row{position:relative;display:flex;width:100%;align-items:flex-start}
#chapter-1 .col-1{
  margin-inline-start:var(--stage-pad);
  width:calc(25vw - var(--stage-pad));max-width:calc(25vw - var(--stage-pad));min-width:260px;
}
#chapter-1 .col-2{
  position:absolute;inset-inline-start:calc(25vw + 40px);
  width:calc(25vw - var(--stage-pad));max-width:calc(25vw - var(--stage-pad));min-width:240px;
}

#chapter-2{inset-inline:0;width:100%}
#chapter-2 .stage-title{margin-inline-start:calc(25vw + 40px)}
#chapter-2 .stage-desc{
  margin-inline-start:calc(50vw + 20px);
  width:calc(25vw - var(--stage-pad));max-width:calc(25vw - var(--stage-pad));min-width:240px;
}
#chapter-2 .stage-index{margin-inline-start:calc(25vw + 40px)}

#chapter-3{
  inset-inline-start:calc(50vw + 20px);
  width:calc(25vw - var(--stage-pad));max-width:calc(25vw - var(--stage-pad));min-width:240px;
}
#chapter-3 .stage-title{white-space:nowrap}

#chapter-4{inset-inline-start:calc(25% + 40px);max-width:600px}

/* slide-1 call-to-actions */
.stage-actions{display:flex;flex-wrap:wrap;gap:10px;margin:0 0 22px}
.stage-actions .btn{text-shadow:none;min-height:46px;padding:0 20px;font-size:10px;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}
html[lang="ar"] .stage-actions .btn{font-family:Cairo,Inter,sans-serif;font-size:13px;letter-spacing:0}
.stage-steps{
  display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:0 0 14px;
  font:600 9px Inter,sans-serif;letter-spacing:.16em;text-transform:uppercase;color:rgba(255,255,255,.62);
}
html[lang="ar"] .stage-steps{font-family:Cairo,Inter,sans-serif;font-size:12px;letter-spacing:0;text-transform:none}
.stage-steps b{font-weight:700;color:#fff;margin-inline-start:4px}
.stage-steps i{width:18px;height:1px;background:rgba(255,255,255,.22)}
.stage-tags{display:none;gap:14px;flex-wrap:wrap;font:600 8px Inter,sans-serif;letter-spacing:.2em;color:rgba(255,255,255,.4)}
.stage-tags span::before{content:"";display:inline-block;width:4px;height:4px;margin-inline-end:8px;border-radius:50%;background:var(--stage-ember);vertical-align:middle}

/* ---------- Editorial image (clip-path wipe + parallax zoom) ---------- */
.stage-image{
  position:absolute;inset-block-start:calc(var(--stage-nav) + 22px);inset-inline-start:var(--stage-pad);
  width:calc(25vw - var(--stage-pad));min-width:200px;aspect-ratio:1/1;margin:0;
  overflow:hidden;z-index:2;pointer-events:none;
  border:1px solid rgba(255,255,255,.10);
  background:radial-gradient(circle at 50% 40%,rgba(20,24,36,.92),rgba(5,6,10,.96));
  clip-path:inset(0 0 100% 0);opacity:0;
  transition:clip-path 1.8s var(--stage-wipe),opacity .8s ease;
}
.stage-image img{
  width:100%;height:100%;object-fit:contain;padding:7%;
  transform:scale(1.15);transition:transform 1.8s var(--stage-wipe);
}
.stage-image.active{clip-path:inset(0 0 0 0);opacity:1}
.stage-image.active img{transform:scale(1)}

/* ---------- Grid overlay ---------- */
.stage-grid{position:absolute;inset:0;pointer-events:none;z-index:1;contain:layout paint}
.stage-hline{position:absolute;top:var(--stage-nav);left:0;right:0;height:1px;background:rgba(255,255,255,.12)}
.stage-vlines{
  position:absolute;top:0;left:40px;right:40px;height:100%;
  display:flex;justify-content:space-between;
}
.stage-vline{position:relative;width:1px;height:100%;background:rgba(255,255,255,.12)}
.stage-vline:nth-child(3){margin-top:var(--stage-nav);height:calc(100% - var(--stage-nav))}
.stage-dot{
  position:absolute;inset-inline-start:50%;transform:translate(-50%,-50%);
  width:6px;height:6px;border-radius:50%;
  background:rgba(255,255,255,.35);box-shadow:0 0 4px rgba(255,255,255,.15);
}
.stage-dot.top{top:20%}.stage-dot.bottom{top:70%}

/* stories-style progress (clickable) — sits on the last grid line (inline-end) */
.stage-progress{
  position:absolute;inset-block-start:50%;inset-inline-end:28px;
  transform:translateY(-50%);z-index:4;
  display:flex;flex-direction:column;gap:12px;pointer-events:auto;
}
.stage-dash{
  appearance:none;border:0;padding:0 11px;margin:0;background:transparent;
  height:40px;display:block;position:relative;
}
.stage-dash::before{
  content:"";position:absolute;inset-block:0;inset-inline-start:50%;width:2px;margin-inline-start:-1px;
  background:rgba(255,255,255,.15);border-radius:2px;
}
.stage-dash-fill{
  position:absolute;inset-block-start:0;inset-inline-start:50%;width:2px;margin-inline-start:-1px;height:0;
  background:#fff;border-radius:2px;
}
.stage-dash:focus-visible{outline:2px solid #fff;outline-offset:2px;border-radius:6px}
.stage-dash[aria-current="true"]::before{background:rgba(255,255,255,.3)}

/* scroll hint */
.stage-hint{
  position:absolute;inset-block-end:22px;inset-inline-start:var(--stage-pad);
  display:flex;flex-direction:column;align-items:flex-start;gap:8px;z-index:3;pointer-events:none;
  font:600 9px Inter,Cairo,sans-serif;letter-spacing:.3em;text-transform:uppercase;color:rgba(255,255,255,.55);
  transition:opacity .6s ease;
}
html[lang="ar"] .stage-hint{letter-spacing:0;font-size:11px;text-transform:none}
.stage-hint::after{content:"";width:1px;height:34px;background:linear-gradient(#fff,transparent);animation:stageHint 2.2s ease-in-out infinite}
@keyframes stageHint{0%{transform:scaleY(0);transform-origin:top}50%{transform:scaleY(1);transform-origin:top}51%{transform-origin:bottom}100%{transform:scaleY(0);transform-origin:bottom}}
.stage-chapter.is-scrolled .stage-hint{opacity:0}

/* ---------- Custom double-ring cursor (fine pointers, inside the chapter only) ---------- */
.stage-cursor-inner,.stage-cursor-outer{
  position:fixed;top:0;left:0;pointer-events:none;border-radius:50%;opacity:0;
  transition:opacity .25s ease,width .3s,height .3s,background .3s,border-color .3s;
}
.stage-cursor-inner{width:6px;height:6px;border:2px solid #fff;z-index:9999}
.stage-cursor-outer{width:40px;height:40px;border:1.5px solid rgba(255,255,255,.7);z-index:9998}
.stage-cursor-inner.is-visible,.stage-cursor-outer.is-visible{opacity:1}
.stage-cursor-outer.is-link{width:64px;height:64px;background:rgba(255,255,255,.08);border-color:#fff}
html.stage-cursor-on .stage-chapter,
html.stage-cursor-on .stage-chapter *{cursor:none!important}
@media (hover:none),(pointer:coarse){.stage-cursor-inner,.stage-cursor-outer{display:none}}

/* focus visibility inside the pinned hero */
.stage-chapter a:focus-visible,.stage-chapter button:focus-visible{outline:2px solid #fff;outline-offset:3px}

/* ---------- Static fallback visual (CSS-only, keeps the brand logo motion) ---------- */
.stage-static-visual{display:none}

/* ============================================================
   STATIC MODE — reduced motion / no WebGL / no JS
   Calm, fully readable layout; every chapter visible.
   ============================================================ */
html:not(.stage-live):not(.stage-pending) .stage-chapter{height:auto}
html:not(.stage-live):not(.stage-pending) .stage-pin{
  position:relative;height:auto;overflow:visible;
  max-width:var(--max,1240px);margin:0 auto;
  padding:calc(var(--stage-nav) + 56px) 34px 70px;
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:34px 28px;
}
html:not(.stage-live):not(.stage-pending) .stage-grid,
html:not(.stage-live):not(.stage-pending) .stage-progress,
html:not(.stage-live):not(.stage-pending) .stage-hint,
html:not(.stage-live):not(.stage-pending) .stage-image{display:none}
html:not(.stage-live):not(.stage-pending) .stage-tags{display:flex}
html:not(.stage-live):not(.stage-pending) .stage-slide{
  position:static;visibility:visible;pointer-events:auto;width:auto!important;max-width:none!important;
  inset:auto;transition:none;
}
html:not(.stage-live):not(.stage-pending) #chapter-1{grid-column:1 / span 2;grid-row:1}
html:not(.stage-live):not(.stage-pending) .stage-static-visual{
  display:flex;grid-column:3;grid-row:1;align-items:center;justify-content:center;
}
html:not(.stage-live):not(.stage-pending) .stage-static-mark{width:min(100%,340px);aspect-ratio:1/1}
html:not(.stage-live):not(.stage-pending) .stage-slide .stage-title,
html:not(.stage-live):not(.stage-pending) .stage-slide .stage-desc,
html:not(.stage-live):not(.stage-pending) .stage-slide .stage-kicker,
html:not(.stage-live):not(.stage-pending) .stage-slide .stage-index{
  opacity:1;transform:none;filter:none;transition:none;margin-inline:0!important;width:auto!important;max-width:none!important;
}
html:not(.stage-live):not(.stage-pending) .stage-title .unit{opacity:1;transform:none;filter:none;transition:none}
html:not(.stage-live):not(.stage-pending) .stage-desc{text-shadow:none}
html:not(.stage-live):not(.stage-pending) .stage-title .line.is-accent{
  display:block;width:fit-content;
  background:linear-gradient(90deg,var(--stage-sapphire),var(--stage-ember));
  -webkit-background-clip:text;background-clip:text;color:transparent;
}
html[dir="rtl"]:not(.stage-live):not(.stage-pending) .stage-title .line.is-accent{background-image:linear-gradient(270deg,var(--stage-sapphire),var(--stage-ember))}
html:not(.stage-live):not(.stage-pending) #chapter-1 .stage-title{font-size:clamp(40px,6.4vw,92px)}
html[lang="ar"]:not(.stage-live):not(.stage-pending) #chapter-1 .stage-title{font-size:clamp(38px,5.6vw,84px)}
html:not(.stage-live):not(.stage-pending) #chapter-2 .stage-title,
html:not(.stage-live):not(.stage-pending) #chapter-3 .stage-title,
html:not(.stage-live):not(.stage-pending) #chapter-4 .stage-title{font-size:clamp(30px,3.3vw,44px);line-height:1.15;margin-bottom:14px}
html:not(.stage-live):not(.stage-pending) #chapter-3 .stage-title{white-space:normal}
html:not(.stage-live):not(.stage-pending) #chapter-1 .desc-row{display:grid;grid-template-columns:1fr 1fr;gap:26px}
html:not(.stage-live):not(.stage-pending) #chapter-1 .col-1,
html:not(.stage-live):not(.stage-pending) #chapter-1 .col-2{position:static;margin:0!important;min-width:0}
html:not(.stage-live):not(.stage-pending) #chapter-2,
html:not(.stage-live):not(.stage-pending) #chapter-3,
html:not(.stage-live):not(.stage-pending) #chapter-4{
  grid-row:2;padding:26px;border:1px solid rgba(255,255,255,.1);border-radius:22px;
  background:linear-gradient(145deg,rgba(18,22,33,.8),rgba(8,10,15,.9));
}
html:not(.stage-live):not(.stage-pending) #chapter-2{grid-column:1}
html:not(.stage-live):not(.stage-pending) #chapter-3{grid-column:2}
html:not(.stage-live):not(.stage-pending) #chapter-4{grid-column:3}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width:1000px){
  :root{--stage-pad:22px;--stage-nav:72px}
  html.stage-pending .stage-chapter,html.stage-live .stage-chapter{height:420vh}
  .stage-slide{inset-block-end:7%}
  .stage-title{font-size:clamp(38px,min(11.5vw,9vh),72px);margin-bottom:14px}
  html[lang="ar"] .stage-title{font-size:clamp(34px,min(10vw,8.6vh),66px)}
  .stage-desc{font-size:14.5px;line-height:1.75}
  html[lang="ar"] .stage-desc{font-size:15px;line-height:1.9}
  #chapter-1,#chapter-2,#chapter-3,#chapter-4{inset-inline:0;width:auto;max-width:none}
  #chapter-1 .stage-kicker,#chapter-1 .stage-title,
  #chapter-2 .stage-title,#chapter-2 .stage-index,#chapter-3 .stage-title,#chapter-4 .stage-title{margin-inline-start:var(--stage-pad)}
  #chapter-3 .stage-title{white-space:normal}
  #chapter-1 .desc-row{display:block}
  #chapter-1 .col-1,#chapter-1 .col-2,#chapter-2 .stage-desc,#chapter-3 .stage-desc,#chapter-4 .stage-desc{
    position:static;margin-inline:var(--stage-pad);width:auto;max-width:min(520px,calc(100vw - 2 * var(--stage-pad) - 34px));min-width:0;
  }
  #chapter-3,#chapter-4{inset-inline-start:0;width:auto;max-width:none}
  #chapter-1 .col-2{margin-top:16px}
  .stage-steps,.stage-tags{display:none}
  .stage-actions{margin:0}
  .stage-image{width:34vw;min-width:0;inset-block-start:calc(var(--stage-nav) + 14px)}
  .stage-vline:nth-child(2),.stage-vline:nth-child(4){display:none}
  .stage-vlines{left:14px;right:14px}
  .stage-progress{inset-inline-end:2px}
  .stage-hint{display:none}

  html:not(.stage-live):not(.stage-pending) .stage-pin{grid-template-columns:1fr;padding:calc(var(--stage-nav) + 34px) 18px 56px}
  html:not(.stage-live):not(.stage-pending) #chapter-1,
  html:not(.stage-live):not(.stage-pending) .stage-static-visual,
  html:not(.stage-live):not(.stage-pending) #chapter-2,
  html:not(.stage-live):not(.stage-pending) #chapter-3,
  html:not(.stage-live):not(.stage-pending) #chapter-4{grid-column:1;grid-row:auto}
  html:not(.stage-live):not(.stage-pending) .stage-static-visual{order:2}
  html:not(.stage-live):not(.stage-pending) .stage-static-mark{width:min(72vw,300px)}
  html:not(.stage-live):not(.stage-pending) #chapter-1 .desc-row{grid-template-columns:1fr}
  html:not(.stage-live):not(.stage-pending) .stage-steps,
  html:not(.stage-live):not(.stage-pending) .stage-tags{display:flex}
}
@media (max-height:700px){.stage-hint{display:none}}
@media (max-height:620px) and (min-width:1001px){
  .stage-slide{inset-block-end:8%}
  .stage-desc{font-size:14px;line-height:1.6}
  .stage-steps,.stage-tags{display:none}
}
@media (max-width:650px){
  /* the site's fixed quick-action bar (WhatsApp / diagnostic) owns the bottom ~70px on phones */
  .stage-slide{inset-block-end:calc(92px + env(safe-area-inset-bottom,0px))}
  html.stage-pending .stage-actions,
  html.stage-live .stage-actions{display:none}
  .stage-kicker{font-size:9px;letter-spacing:.08em;padding:8px 13px;max-width:calc(100vw - 2 * var(--stage-pad))}
}
@media print{
  .stage-canvas,.stage-grid,.stage-progress,.stage-hint,.stage-image,.stage-cursor-inner,.stage-cursor-outer{display:none!important}
}
