/* ============================================================================
   HEKA Cosmos — additive WebGL layer styles.
   Never overrides sacred.css rules; only new classes plus body.heka-gl /
   body.heka-gl-fallback / body.heka-orrery scoped tweaks.
   ============================================================================ */

/* --- site-wide fixed cosmos canvas ------------------------------- */
#heka-cosmos {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    display: block;
}

/* keep all page content above the fixed canvas */
body.heka-gl .navbar,
body.heka-gl .hero,
body.heka-gl .section,
body.heka-gl .footer {
    position: relative;
    z-index: 1;
}

/* the WebGL cosmos replaces the CSS conic mandala */
body.heka-gl .bg-sacred::before {
    opacity: 0;
}

/* let the nebula breathe faintly through banded sections */
body.heka-gl .section-alt,
body.heka-gl .footer {
    background: rgba(10, 10, 18, 0.86);
}

body.heka-gl-fallback #heka-cosmos {
    display: none;
}

/* --- hero orrery --------------------------------------------------- */
.hero-visual {
    position: relative;
}

/* the orrery is the hero's jewel: widen its stage while GL is active;
   tighter gap + slightly wider copy column lets the title breathe on two lines.
   Desktop only — the mobile single-column stack stays sacred.css's. */
@media (min-width: 901px) {
    body.heka-orrery .hero-content {
        grid-template-columns: 1.16fr 0.84fr;
        gap: var(--space-xl);
    }
}

/* breathing room so CTAs never kiss the fold: top-aligned composition with
   generous air above and below (content is taller than most viewports) */
body.heka-gl .hero {
    align-items: flex-start;
    padding-top: 90px;
    padding-bottom: 80px;
}

/* the page scrollbar becomes a designed detail, not a seam */
html:has(body.heka-gl) {
    scrollbar-width: thin;
    scrollbar-color: var(--stone) var(--void);
}
html:has(body.heka-gl)::-webkit-scrollbar {
    width: 8px;
}
html:has(body.heka-gl)::-webkit-scrollbar-track {
    background: var(--void);
}
html:has(body.heka-gl)::-webkit-scrollbar-thumb {
    background: var(--temple);
    border-radius: 4px;
}

#heka-orrery {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    opacity: 0;
    transition: opacity 1.2s ease;
    cursor: grab;
    touch-action: none;
}

#heka-orrery:active {
    cursor: grabbing;
}

body.heka-orrery #heka-orrery {
    opacity: 1;
}

/* mockup tablet stays in the DOM; hidden only while the orrery runs */
body.heka-orrery .hero-visual > .tablet {
    visibility: hidden;
}

.heka-orrery-ui {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 2;
}

.heka-labels {
    position: absolute;
    inset: 0;
}

.heka-label {
    position: absolute;
    left: 0;
    top: 0;
    font-family: var(--font-ritual);
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--silver);
    white-space: nowrap;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.95), 0 0 18px rgba(0, 0, 0, 0.6);
    will-change: transform, opacity;
}

.heka-link-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.heka-link-line {
    stroke: var(--gold);
    stroke-width: 1;
    stroke-opacity: 0.55;
    vector-effect: non-scaling-stroke;
}

/* "You are here" chip */
.heka-here {
    position: absolute;
    left: 0;
    top: 0;
    max-width: 240px;
    padding: 10px 14px;
    background: rgba(10, 10, 18, 0.72);
    border: 1px solid rgba(212, 175, 55, 0.45);
    border-radius: 3px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45), inset 0 0 18px rgba(212, 175, 55, 0.05);
    will-change: transform, opacity;
}

.heka-here-name {
    display: block;
    font-family: var(--font-ritual);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    color: var(--gold);
}

.heka-here-sub {
    display: block;
    margin-top: 4px;
    font-family: var(--font-clean);
    font-size: 0.58rem;
    letter-spacing: 0.08em;
    color: var(--light-secondary);
}

/* mobile: tighter chip; labels for current/tapped moons are JS-driven */
@media (pointer: coarse) {
    .heka-here-sub {
        font-size: 0.55rem;
    }
}

/* --- arc medallions -------------------------------------------------- */
.heka-medallion {
    display: block;
    width: 84px;
    height: 84px;
    margin: 0 auto 18px;
    pointer-events: none;
}

/* --- reduced motion: composed still, no motion cues ------------------- */
@media (prefers-reduced-motion: reduce) {
    #heka-orrery {
        transition: none;
    }
}

/* --- no-JS progressive enhancement: keep reveal content visible ------- */
.no-js .reveal,
.no-js .reveal-left,
.no-js .reveal-right,
.no-js .reveal-scale {
    opacity: 1 !important;
    transform: none !important;
}
