/* Homepage hero: "living impression" (static/js/graphics/hero-3d.js). Loaded only by home.html and the hero test pages.
   Everything is scoped under .hero-x. Logical properties so the layout mirrors in RTL. */

/* ---------- poster = first frame. No Ken Burns: the WebGL first frame matches it exactly, then takes over ---------- */
.hero-x .hero-poster { animation: none; object-fit: cover; object-position: 35% 50%; }
:root[dir="rtl"] .hero-x .hero-poster { object-position: 65% 50%; }
@media (max-width: 720px) { .hero-x .hero-poster, :root[dir="rtl"] .hero-x .hero-poster { object-position: 50% 50%; } }
.hero-x .hx-lost .hero-poster { opacity: 1 !important; }

.hero-x .hx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; display: block; opacity: 0; transition: opacity .6s ease; }
.hero-x .hx-ready > .hx-canvas { opacity: 1; }
.hero-x .hx-lost > .hx-canvas { display: none; }
.hero-x .hx-site3d { position: absolute; inset: 0; }

/* ---------- contrast scrim: photographic frames are brighter than the old stylised scene ---------- */
.hero-x .hero-shade {
  background:
    linear-gradient(180deg, rgba(10, 14, 26, .38) 0%, rgba(10, 14, 26, 0) 22%, rgba(10, 14, 26, 0) 42%, rgba(10, 14, 26, .5) 66%, rgba(10, 14, 26, .9) 100%),
    linear-gradient(90deg, rgba(10, 14, 26, .72) 0%, rgba(10, 14, 26, .42) 34%, rgba(10, 14, 26, 0) 66%);
}
:root[dir="rtl"] .hero-x .hero-shade {
  background:
    linear-gradient(180deg, rgba(10, 14, 26, .38) 0%, rgba(10, 14, 26, 0) 22%, rgba(10, 14, 26, 0) 42%, rgba(10, 14, 26, .5) 66%, rgba(10, 14, 26, .9) 100%),
    linear-gradient(-90deg, rgba(10, 14, 26, .72) 0%, rgba(10, 14, 26, .42) 34%, rgba(10, 14, 26, 0) 66%);
}
.hero-x .hero-title { text-shadow: 0 2px 28px rgba(6, 9, 18, .45), 0 1px 3px rgba(6, 9, 18, .35); }
.hero-x .hero-lede { text-shadow: 0 1px 14px rgba(6, 9, 18, .55); }
@media (max-width: 720px) {
  .hero-x .hero-shade, :root[dir="rtl"] .hero-x .hero-shade {
    background: linear-gradient(180deg, rgba(10, 14, 26, .45) 0%, rgba(10, 14, 26, .05) 20%, rgba(10, 14, 26, .25) 38%, rgba(10, 14, 26, .78) 60%, rgba(10, 14, 26, .94) 100%);
  }
}

/* ---------- overlay layer: label, caption, hotspots, controls ---------- */
.hero-x .hx-layer { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.hero-x .hx-cap { position: absolute; top: 22px; inset-inline-end: var(--gutter, 24px); display: flex; align-items: center; gap: 10px; max-width: min(520px, 70%); color: #fff; font-size: .78rem; line-height: 1.3; }
.hero-x .hx-badge { flex: none; padding: 4px 11px; border-radius: 999px; font-size: .7rem; font-weight: 600; letter-spacing: .03em; background: rgba(10, 14, 26, .55); border: 1px solid rgba(255, 255, 255, .22); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.hero-x .hx-cap-t { color: rgba(255, 255, 255, .92); text-shadow: 0 1px 8px rgba(0, 0, 0, .55); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-x .hx-cap-t:empty { display: none; }
.hero-x a.hx-cap-t.is-link { pointer-events: auto; color: #fff; text-decoration: underline; text-decoration-color: rgba(230, 207, 152, .6); text-underline-offset: 3px; }
.hero-x a.hx-cap-t.is-link::after { content: " \2192"; }
:root[dir="rtl"] .hero-x a.hx-cap-t.is-link::after { content: " \2190"; }
.hero-x a.hx-cap-t.is-link:hover { text-decoration-color: var(--gold-light, #e6cf98); }
.hero-x a.hx-cap-t:focus-visible { outline: 3px solid var(--gold-light, #e6cf98); outline-offset: 3px; border-radius: 4px; }

.hero-x .hx-ctrl { position: absolute; bottom: 82px; inset-inline-end: var(--gutter, 24px); display: flex; align-items: center; gap: 8px; pointer-events: auto; }
.hero-x .hx-rail { display: flex; gap: 2px; padding: 0 6px; border-radius: 999px; background: rgba(10, 14, 26, .42); border: 1px solid rgba(255, 255, 255, .16); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.hero-x .hx-seg { appearance: none; border: 0; background: none; padding: 0 4px; width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer; border-radius: 10px; }
.hero-x .hx-seg-bar { display: block; width: 100%; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .3); overflow: hidden; transition: height .2s ease, background .2s ease; }
.hero-x .hx-seg-bar i { display: block; height: 100%; background: var(--gold-light, #e6cf98); transform: scaleX(0); transform-origin: left center; }
:root[dir="rtl"] .hero-x .hx-seg-bar i { transform-origin: right center; }
.hero-x .hx-seg[aria-current] .hx-seg-bar { background: rgba(255, 255, 255, .45); }
.hero-x .hx-seg:hover .hx-seg-bar { height: 5px; background: rgba(255, 255, 255, .6); }
.hero-x .hx-btn { appearance: none; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; min-width: 40px; padding: 0 12px; justify-content: center; border-radius: 999px; color: #fff; font: 600 .78rem/1 var(--font-body, system-ui); background: rgba(10, 14, 26, .42); border: 1px solid rgba(255, 255, 255, .2); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); cursor: pointer; transition: background .2s ease, border-color .2s ease; }
.hero-x .hx-btn:hover { background: rgba(10, 14, 26, .62); border-color: rgba(255, 255, 255, .4); }
.hero-x .hx-btn svg { width: 16px; height: 16px; flex: none; }
.hero-x .hx-pause { padding: 0; }
.hero-x .hx-3d[aria-pressed="true"] { background: var(--gold, #c9a45c); border-color: var(--gold, #c9a45c); color: #1b2340; }
.hero-x .hx-3d.is-busy { opacity: .7; cursor: progress; }
.hero-x .hx-3d.is-busy svg { animation: hx-spin 1.2s linear infinite; }
.hero-x .hx-seg:focus-visible, .hero-x .hx-btn:focus-visible { outline: 3px solid var(--gold-light, #e6cf98); outline-offset: 2px; }

/* hotspots */
.hero-x .hx-hs-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.hero-x .hx-hs { position: absolute; left: 0; top: 0; width: 0; height: 0; opacity: 0; visibility: hidden; pointer-events: none; color: #fff; text-decoration: none; transition: opacity .45s ease, visibility 0s linear .45s; will-change: transform; }
.hero-x .hx-hs.on { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .45s ease; }
.hero-x .hx-hs-dot { position: absolute; left: -20px; top: -20px; width: 40px; height: 40px; border-radius: 50%; }
.hero-x .hx-hs-dot::before { content: ""; position: absolute; inset: 13px; border-radius: 50%; background: var(--c, #e6cf98); box-shadow: 0 0 0 2px rgba(255, 255, 255, .92), 0 2px 10px rgba(0, 0, 0, .5); }
.hero-x .hx-hs-dot::after { content: ""; position: absolute; inset: 10px; border-radius: 50%; border: 2px solid var(--c, #e6cf98); animation: hx-pulse 2.4s ease-out infinite; }
.hero-x .hx-hs-tag { position: absolute; top: 0; left: 18px; transform: translateY(-50%); display: flex; align-items: center; gap: 8px; white-space: nowrap; padding: 6px 12px; border-radius: 10px; background: rgba(10, 14, 26, .72); border: 1px solid rgba(255, 255, 255, .22); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font: 600 .8rem/1.25 var(--font-body, system-ui); transition: opacity .3s ease, transform .3s ease; }
.hero-x .hx-hs.l .hx-hs-tag { left: auto; right: 18px; }
.hero-x .hx-hs-chip { display: inline-flex; align-items: center; gap: 5px; font-weight: 500; font-size: .68rem; color: rgba(255, 255, 255, .9); padding: 1px 8px; border-radius: 999px; background: rgba(255, 255, 255, .12); }
.hero-x .hx-hs-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c, #e6cf98); }
.hero-x .hx-hs.c .hx-hs-tag { opacity: 0; pointer-events: none; }
.hero-x .hx-hs.c:hover .hx-hs-tag, .hero-x .hx-hs.c:focus-visible .hx-hs-tag, .hero-x .hx-hs.open .hx-hs-tag { opacity: 1; pointer-events: auto; }
.hero-x .hx-hs:focus-visible { outline: none; }
.hero-x .hx-hs:focus-visible .hx-hs-dot::before { outline: 3px solid #fff; outline-offset: 4px; }
.hero-x .hx-hs:hover, .hero-x .hx-hs:focus-visible, .hero-x .hx-hs.open { z-index: 3; }
.hero-x .hx-hs:hover .hx-hs-tag { background: rgba(10, 14, 26, .88); }

/* real-site 3D mode: its own label/hotspots take over */
.hero-x.hx-mode-3d .hx-cap, .hero-x.hx-mode-3d .hx-rail, .hero-x.hx-mode-3d .hx-pause, .hero-x.hx-mode-3d .hx-hs-layer { display: none; }

@media (max-width: 720px) {
  .hero-x .hx-cap { top: 12px; inset-inline-start: var(--gutter, 16px); max-width: none; font-size: .72rem; }
  .hero-x .hx-ctrl { bottom: auto; top: 46px; inset-inline-end: var(--gutter, 16px); gap: 6px; }
  .hero-x .hx-seg { width: 30px; padding: 0 3px; }
  .hero-x .hx-3d span { display: none; }
  .hero-x .hx-3d { padding: 0; }
  .hero-x .hx-hs-tag { font-size: .74rem; }
}
@media (min-width: 721px) and (max-width: 1100px) { .hero-x .hx-3d span { display: none; } .hero-x .hx-3d { padding: 0; } }

@keyframes hx-pulse { 0% { transform: scale(.8); opacity: .9; } 100% { transform: scale(2); opacity: 0; } }
@keyframes hx-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .hero-x .hx-hs-dot::after { animation: none; opacity: .5; }
  .hero-x .hx-hs, .hero-x .hx-hs-tag, .hero-x .hx-canvas { transition: none; }
}
