/* hero «اصنع بطلك» — night rooftops + original hero; colours come from data.js via scene.js (--suit, --acc, --accent) */
:root {
  --bg: #0b0f2e; --bg-2: #161c52; --surface: #121741; --surface-2: #171e52;
  --text: #eef1ff; --muted: #aab2dc;
  --accent: #ffc531; --accent-2: #a9c4ff; --accent-ink: #140f2a;
  --line: rgba(255, 255, 255, .17); --line-soft: rgba(255, 255, 255, .08);
  --danger: #ff7a8a; --ok: #6ef0a0;
  --suit: #2f6fd6; --suit-l: #9fbcf0; --acc: #ffc531;
  --hw: min(46vw, 190px, 26dvh);
}
body.herox { background: radial-gradient(120% 60% at 50% -10%, #232a72 0%, var(--bg) 60%) no-repeat, var(--bg); }

/* ================= intro (rendered art layers in art/*.webp) ================= */
.h-intro { background: #070a24; color: var(--text); padding: 0; display: grid; place-items: center; }
.h-fill { position: absolute; inset: -30px; background: #070a24 url(art/bg.webp) center / cover; filter: blur(22px) brightness(.9); transform: scale(1.06); }
.h-stage { position: relative; width: min(100vw, 100dvh * .6); height: 100dvh; overflow: hidden; }
.h-world { position: absolute; inset: 0; }
.h-world.is-shake { animation: shake .42s ease; }
@keyframes shake { 20% { transform: translate(-4px, 3px); } 40% { transform: translate(4px, -2px); } 60% { transform: translate(-3px, 1px); } 80% { transform: translate(2px, 0); } }
.h-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 100%; }
.h-twinkle { position: absolute; inset: 0; pointer-events: none; }
.h-twinkle i { position: absolute; width: 8px; height: 8px; background: #fff; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: tw 3s ease-in-out infinite; }
@keyframes tw { 50% { opacity: .15; transform: scale(.5); } }
.h-lampbox { position: absolute; z-index: 2; right: 5%; bottom: calc(66px + env(safe-area-inset-bottom)); width: min(24%, 100px); aspect-ratio: 1; }
.h-lampbox img { display: block; width: 100%; height: auto; filter: drop-shadow(0 6px 5px rgba(0,0,0,.5)); }
.h-lampbox i { position: absolute; left: 26%; top: 24%; width: 2px; height: 2px; }
.h-beam { position: absolute; z-index: 3; width: 150px; margin-left: -75px; transform-origin: 50% 100%; pointer-events: none; background: linear-gradient(0deg, rgba(255, 246, 208, .55), rgba(255, 246, 208, .08) 85%, transparent); clip-path: polygon(46% 100%, 54% 100%, 100% 0, 0 0); filter: blur(2px); transition: opacity .5s; }

.h-head { position: absolute; z-index: 6; top: max(16px, env(safe-area-inset-top)); inset-inline: 58px; text-align: center; transition: opacity .4s; }
.h-kick { display: inline-block; margin: 0 0 6px; padding: 4px 14px; border-radius: 999px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); font: 700 13.5px/1.5 var(--f-ui); color: var(--accent); }
.h-title { margin: 0; font: 900 25px/1.4 var(--f-display); color: #fff; text-wrap: balance; text-shadow: 0 2px 14px rgba(0, 0, 0, .6); }
.h-hint { margin: 4px 0 0; min-height: 1.6em; font: 500 15px/1.6 var(--f-ui); color: #d5dbf7; text-wrap: balance; text-shadow: 0 1px 8px rgba(0,0,0,.6); }

/* hero signal */
.h-signal { position: absolute; z-index: 5; left: 50%; top: max(150px, 20dvh); width: 176px; height: 176px; margin-left: -88px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
  filter: drop-shadow(0 0 24px rgba(255, 240, 190, .75)); animation: bob 3s ease-in-out infinite; transition: transform .6s var(--ease), opacity .6s ease, filter .3s; touch-action: manipulation; }
.h-signal img { position: relative; width: 100%; height: 100%; display: block; }
.h-signal:active { transform: scale(.95); }
.h-signal:focus-visible { outline-offset: 6px; }
.h-ring { position: absolute; inset: 8px; border-radius: 50%; border: 3px solid rgba(255, 245, 205, .8); animation: ring 2s ease-out infinite; }
.h-ring-2 { animation-delay: 1s; }
@keyframes ring { from { transform: scale(.9); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }
@keyframes bob { 50% { transform: translateY(-8px); } }
.h-intro:not([data-phase="call"]) .h-signal { animation: none; transform: scale(1.5); opacity: 0; pointer-events: none; }
.h-intro:not([data-phase="call"]) .h-beam { opacity: 0; }

/* hero on stage: rendered poses, shown one at a time via data-pose */
.h-hero { position: absolute; z-index: 4; left: 50%; width: var(--hw); margin-left: calc(var(--hw) / -2); bottom: calc(70px + env(safe-area-inset-bottom)); visibility: hidden; pointer-events: none; }
.h-hero.is-on { visibility: visible; }
.h-hero.is-flip .h-hero-in { transform: scaleX(-1); }
.h-hero-in { transform-origin: 50% 90%; transition: transform .2s; }
.hx { position: relative; display: block; width: 100%; aspect-ratio: 4 / 5; }
.hx img { position: absolute; left: 0; bottom: 0; width: 100%; height: auto; display: none; filter: drop-shadow(0 10px 8px rgba(0,0,0,.45)); }
.hx[data-pose="hero"] .p-hero, .hx[data-pose="land"] .p-land, .hx[data-pose="point"] .p-point, .hx[data-pose="dive"] .p-dive,
.hx[data-pose="fly"] .p-fly, .hx[data-pose="run"] .p-run, .hx[data-pose="lift"] .p-lift { display: block; }
.hx[data-pose="hero"] { animation: hBreath 2.4s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes hBreath { 50% { transform: scale(1.012, 1.02); } }
.hx.is-catch { transform: scale(1.05, .93); }
.hx[data-pose="run"] .p-run { animation: hRun .18s linear infinite alternate; }
@keyframes hRun { to { transform: translateY(-5px) rotate(1.5deg); } }

/* big age reveal */
.h-age { position: absolute; z-index: 3; left: 0; right: 0; top: max(150px, 19dvh); display: grid; justify-items: center; pointer-events: none; opacity: 0; transform: scale(.4); transition: opacity .4s, transform .6s cubic-bezier(.34, 1.56, .64, 1); }
.h-age b { font: 900 min(150px, 19dvh)/1.05 var(--f-display); color: var(--accent); text-shadow: 0 0 30px var(--acc), 0 6px 0 rgba(0, 0, 0, .25); }
.h-age span { margin-top: -4px; padding: 4px 16px; border-radius: 999px; background: var(--suit); color: #fff; font: 800 18px/1.5 var(--f-display); border: 2px solid rgba(255, 255, 255, .5); }
.h-intro[data-phase="pose"] .h-age { opacity: 1; transform: none; }

/* date writers */
.h-sky-date, .h-streak, .h-block { display: none; }
.pw-fly .h-sky-date, .pw-speed .h-streak, .pw-strength .h-block { display: block; }
.h-dt { position: absolute; z-index: 3; left: 0; right: 0; top: max(160px, 21dvh); text-align: center; pointer-events: none; clip-path: inset(-40px 0 -40px 100%); }
.h-dt p { margin: 0; }
.h-intro[data-phase="final"] .h-dt { clip-path: none; }
.h-sky-date { padding: 18px 10px; }
.h-sky-date .h-d1, .h-sky-date .h-d2 { position: relative; font: 900 clamp(30px, 9vw, 40px)/1.35 var(--f-display); color: #fff; text-shadow: 0 0 3px #fff, 0 0 12px #f0f5ff, 0 0 26px rgba(205, 222, 255, .9), 0 5px 0 #c3cff0, 0 9px 18px rgba(0, 0, 0, .25); }
.h-sky-date .h-d2 { font-size: clamp(24px, 7vw, 31px); }
.h-cb { position: absolute; border-radius: 50%; background: radial-gradient(circle at 40% 35%, rgba(255, 255, 255, .55), rgba(220, 230, 255, .14) 60%, transparent 72%); }
.h-cb1 { width: 180px; height: 120px; right: 4%; top: -6px; }
.h-cb2 { width: 220px; height: 130px; left: 2%; top: 40px; }
.h-cb3 { width: 160px; height: 100px; left: 34%; top: 70px; }
.h-puff { position: absolute; z-index: 3; margin: -20px 0 0 -20px; width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fff, rgba(235, 242, 255, .8) 45%, transparent 70%); animation: puff 1.7s ease-out forwards; pointer-events: none; }
@keyframes puff { from { transform: scale(.35); opacity: 1; } to { transform: scale(1.6) translateY(-6px); opacity: 0; } }
.h-streak { padding: 8px 0; }
.h-streak-in { margin-inline: -20px; padding: 14px 30px 16px; transform: skewY(-3deg); background: linear-gradient(270deg, transparent 0%, var(--acc) 8%, var(--suit) 55%, rgba(255, 255, 255, .0) 100%); box-shadow: 0 0 40px color-mix(in srgb, var(--acc) 50%, transparent); }
.h-streak-in::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, transparent 0 9px, rgba(255, 255, 255, .16) 9px 11px); }
.h-streak .h-d1, .h-streak .h-d2 { position: relative; font: 900 clamp(28px, 8.6vw, 38px)/1.35 var(--f-display); color: #fff; font-style: italic; transform: skewX(-10deg); text-shadow: 0 0 14px rgba(255, 255, 255, .7), 0 3px 0 rgba(0, 0, 0, .3); }
.h-streak .h-d2 { font-size: clamp(22px, 6.6vw, 29px); }
.h-zip { position: absolute; z-index: 3; width: 70px; height: 3px; margin-top: -1px; border-radius: 3px; background: linear-gradient(90deg, rgba(255, 255, 255, .9), transparent); animation: zip .6s ease-out forwards; pointer-events: none; }
@keyframes zip { to { transform: translateX(60px) scaleX(1.6); opacity: 0; } }
/* strength: giant rendered stone block that cracks */
.h-block { position: absolute; z-index: 3; visibility: hidden; pointer-events: none; }
.h-block.is-in { visibility: visible; }
.h-half, .h-panel { position: absolute; inset: 0; border-radius: 16px; }
.h-half { background: url(art/block.webp) center / 100% 100% no-repeat; filter: drop-shadow(0 10px 8px rgba(0,0,0,.5)); display: grid; place-items: center; transition: transform .9s cubic-bezier(.4, 0, .6, 1), opacity .9s ease; }
.h-half-a { clip-path: polygon(0 0, 52% 0, 46% 25%, 54% 50%, 45% 75%, 51% 100%, 0 100%); }
.h-half-b { clip-path: polygon(52% 0, 100% 0, 100% 100%, 51% 100%, 45% 75%, 54% 50%, 46% 25%); }
.h-kg { font: 900 clamp(26px, 8vw, 36px)/1 var(--f-display); color: #2c2f52; text-shadow: 0 1px 0 rgba(255, 255, 255, .3); letter-spacing: .01em; }
.h-crack { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.h-crack path { fill: none; stroke: #1b1433; vector-effect: non-scaling-stroke; stroke-width: 4; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .6s ease; }
.h-block.is-crack .h-crack path { stroke-dashoffset: 0; }
.h-block.is-strain { animation: strain .12s linear infinite; }
@keyframes strain { 0% { transform: translate(-2px, 0); } 50% { transform: translate(2px, -1px); } 100% { transform: translate(-1px, 1px); } }
.h-block.is-open .h-half-a { transform: translate(-130px, 110px) rotate(-28deg); opacity: 0; }
.h-block.is-open .h-half-b { transform: translate(130px, 110px) rotate(28deg); opacity: 0; }
.h-block.is-open .h-crack { opacity: 0; transition: opacity .2s; }
.h-panel { display: grid; align-content: center; justify-items: center; gap: 2px; text-align: center; padding: 10px; background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--suit) 60%, #0b0f2e), #0b0f2e); border: 3px solid var(--accent); box-shadow: 0 0 0 4px rgba(0, 0, 0, .25), 0 0 46px var(--acc); }
.h-panel small { font: 700 13px/1.4 var(--f-ui); color: var(--accent); }
.h-panel .h-d1 { margin: 0; font: 900 clamp(24px, 7.4vw, 32px)/1.35 var(--f-display); color: #fff; }
.h-panel .h-d2 { margin: 0; font: 800 clamp(19px, 5.6vw, 24px)/1.4 var(--f-display); color: var(--accent); }
.h-burst { position: absolute; z-index: 5; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; background: radial-gradient(circle, #fff, var(--acc) 40%, transparent 70%); animation: burst 1.1s ease-out forwards; pointer-events: none; }
@keyframes burst { to { transform: scale(12); opacity: 0; } }

/* landing fx */
.h-fx { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.h-shock { position: absolute; width: 60px; height: 16px; margin: -8px 0 0 -30px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .85); box-shadow: 0 0 16px var(--acc); animation: shock .8s ease-out forwards; }
@keyframes shock { to { transform: scale(5); opacity: 0; } }
.h-dust { position: absolute; margin: -12px 0 0 -12px; border-radius: 50%; background: radial-gradient(circle, rgba(200, 205, 240, .8), transparent 70%); animation: dust 1.2s ease-out forwards; }
@keyframes dust { to { transform: translateY(-26px) scale(1.8); opacity: 0; } }
.h-intro[data-phase="final"] .h-title { font-size: 23px; }
@media (max-height: 700px) {
  .h-title { font-size: 21px; }
  .h-signal { width: 140px; height: 140px; margin-left: -70px; }
}

/* ================= details card ================= */
.herox .card-frame { border-radius: 26px; border: 1.5px solid var(--line); background: linear-gradient(180deg, #1b2160 0%, #121741 45%, #0e1236 100%); box-shadow: 0 0 0 5px rgba(255, 255, 255, .03), 0 24px 50px rgba(0, 0, 0, .5); overflow: hidden; }
.herox .card-hero { display: block; margin: -28px -20px 10px; }
.hc { position: relative; width: 100%; height: 270px; overflow: hidden; background: radial-gradient(90% 80% at 50% 100%, color-mix(in srgb, var(--suit) 45%, transparent), transparent 70%), linear-gradient(180deg, #0b0f2e, #1b2160); }
.hc-bg { position: absolute; left: 0; bottom: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 78%; opacity: .75; }
.hc-rays { position: absolute; left: 50%; top: 52%; width: 520px; height: 520px; margin: -260px 0 0 -260px; background: repeating-conic-gradient(rgba(255, 255, 255, .07) 0 8deg, transparent 8deg 22deg); border-radius: 50%; -webkit-mask: radial-gradient(closest-side, #000 30%, transparent 100%); mask: radial-gradient(closest-side, #000 30%, transparent 100%); }
.hc-hero { position: absolute; left: 50%; bottom: 34px; width: 170px; margin-left: -85px; }
.hc-hero img { display: block; width: 100%; height: auto; filter: drop-shadow(0 10px 8px rgba(0,0,0,.5)); }
.hc-name { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); margin: 0; padding: 4px 18px; white-space: nowrap; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: 900 16px/1.5 var(--f-display); box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.herox .card-kicker { color: var(--accent); }
.herox .kid { background: linear-gradient(180deg, #ffffff 20%, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 18px rgba(255, 255, 255, .18)); }
.herox .age-badge { background: var(--accent); color: var(--accent-ink); }
.herox .facts .fl { display: block; font: 600 12px/1.3 var(--f-ui); color: var(--accent); }
.herox .facts li { background: rgba(255, 255, 255, .05); border-radius: 14px; }
.herox .cd { background: #0d1238; box-shadow: inset 0 0 18px rgba(255, 255, 255, .04); }
.herox .cd b { color: var(--accent); }
.herox .btn { background: var(--surface); }
.herox .btn-main { background: var(--accent); color: var(--accent-ink); }
.herox .closing { color: var(--accent); }
.herox .skip { background: #fff; color: #140f2a; }
.herox .skip.is-cta { background: var(--accent); color: var(--accent-ink); }

@media (prefers-reduced-motion: reduce) {
  .h-signal, .h-ring, .h-twinkle i, .hx[data-pose="hero"], .hx[data-pose="run"] .p-run { animation: none !important; }
}
:root { --hw: min(58vw, 250px, 32dvh); }
