/*
   SIS Growth-Story Preloader
   Systematic IT Solutions
   Act 1 seed -> Act 2 SIS engine -> Act 3 growth -> Act 4 reveal
*/

html.sis-loading,
html.sis-loading body {
    overflow: hidden;
}

.sis-loader {
    --sis-a: #f99d4e;
    --sis-b: #e93b6e;
    --sis-bg: #07070b;

    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: transparent; /* the curtain panels ARE the backdrop */
}

/* ---------- backdrop ---------- */

.sis-loader__bg {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

/*
   Full-bleed, cropped, edge-faded via mask so it reads as part of the
   backdrop rather than "a video playing in a box". Opacity is low enough
   that it merges with the grid/aura glow instead of competing with the
   SVG story on top of it.
*/
.sis-loader__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .38;
    -webkit-mask-image: radial-gradient(ellipse 72% 68% at 50% 50%, #000 0%, transparent 84%);
    mask-image: radial-gradient(ellipse 72% 68% at 50% 50%, #000 0%, transparent 84%);
}

.sis-grid {
    position: absolute;
    inset: -10%;
    background-image:
        linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
    background-size: 54px 54px;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 0%, transparent 78%);
    mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 0%, transparent 78%);
    opacity: .5;
    /* one static composited layer — no continuous repaint */
    transform: translateZ(0);
}

/*
   Glow: a plain radial-gradient reads as "soft blurred light" without ever
   touching filter:blur. A blurred, screen-sized, continuously-animated
   layer is one of the most expensive things a browser can paint every
   frame (full re-rasterization on every scale/opacity tick) — this gives
   the same look at a fraction of the GPU cost, and only opacity/transform
   are animated so the compositor can run it without repainting at all.
*/
.sis-aura {
    position: absolute;
    border-radius: 50%;
    will-change: transform, opacity;
}

.sis-aura--a {
    width: 60vmax;
    height: 60vmax;
    left: 50%;
    top: 52%;
    transform: translate3d(-72%, -50%, 0);
    background: radial-gradient(circle, var(--sis-a) 0%, transparent 58%);
    opacity: .22;
    animation: sis-aura-a 12s ease-in-out infinite alternate;
}

.sis-aura--b {
    width: 54vmax;
    height: 54vmax;
    left: 50%;
    top: 48%;
    transform: translate3d(-28%, -50%, 0);
    background: radial-gradient(circle, var(--sis-b) 0%, transparent 58%);
    opacity: .2;
    animation: sis-aura-b 14s ease-in-out infinite alternate;
}

@keyframes sis-aura-a {
    to { transform: translate3d(-62%, -57%, 0) scale(1.1); opacity: .32; }
}

@keyframes sis-aura-b {
    to { transform: translate3d(-38%, -43%, 0) scale(1.08); opacity: .3; }
}

/* ---------- layout ---------- */

.sis-loader__inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 720px;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sis-stage {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin-bottom: 6px;
}

.sis-scene {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

/* ---------- scene defaults (GSAP animates from here) ---------- */

.sis-ground__line { opacity: 0; }

.sis-seed__spark { opacity: 0; }

.sis-seed__stem,
.sis-seed__leaf,
.sis-roof__shape,
.sis-wire,
.sis-trend__line,
.sis-trend__head {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
}

.sis-roof__beacon { opacity: 0; }

.sis-floor { opacity: 0; }

.sis-orbit,
.sis-node { opacity: 0; }

.sis-bar { opacity: 0; }

.sis-spark {
    fill: var(--sis-a);
    opacity: 0;
}

/* ---------- SIS badge (act 2) ---------- */

.sis-badge {
    position: absolute;
    left: 50%;
    top: 56.8%;
    width: 96px;
    height: 96px;
    margin: -48px 0 0 -48px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(.4) rotate(-25deg);
    pointer-events: none;
}

.sis-badge__mark {
    position: relative;
    z-index: 2;
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 2px;
    background: linear-gradient(120deg, var(--sis-a), var(--sis-b));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 14px rgba(249, 157, 78, .45));
}

.sis-badge__ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1.5px solid transparent;
    background:
        linear-gradient(var(--sis-bg), var(--sis-bg)) padding-box,
        conic-gradient(from 0deg, var(--sis-a), var(--sis-b), var(--sis-a)) border-box;
    box-shadow: 0 0 40px rgba(233, 59, 110, .28);
    animation: sis-badge-spin 4s linear infinite;
}

@keyframes sis-badge-spin {
    to { transform: rotate(360deg); }
}

/* ---------- final logo (act 4) ---------- */

.sis-logo {
    position: absolute;
    left: 50%;
    top: 56.8%;
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 16px;
    white-space: nowrap;
}

.sis-logo__icon,
.sis-logo__type b,
.sis-logo__type i {
    opacity: 0;
}

/* only the icon half of logo-dark.webp — the wordmark next to it is black */
.sis-logo__icon {
    flex: 0 0 auto;
    width: 62px;
    height: 62px;
    background: url("../img/logo/logo-dark.webp") no-repeat left center;
    background-size: auto 100%;
    filter: drop-shadow(0 6px 26px rgba(233, 59, 110, .45));
}

.sis-logo__type {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1;
}

.sis-logo__type b {
    font-family: 'Outfit', sans-serif;
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -.5px;
    color: #fff;
}

.sis-logo__type i {
    font-family: 'Outfit', sans-serif;
    font-style: normal;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 5.6px;
    margin-top: 7px;
    background: linear-gradient(90deg, var(--sis-a), var(--sis-b));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ---------- caption ---------- */

.sis-caption {
    position: relative;
    height: 22px;
    width: 100%;
    margin-top: 4px;
    text-align: center;
}

.sis-caption__line {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    display: flex;
    justify-content: center;
    gap: .6em;
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .72);
    opacity: 0;
    white-space: nowrap;
}

.sis-caption__word {
    display: inline-block;
    opacity: 0;
    transform: translateY(10px);
    letter-spacing: 5.5px;
}

/* ---------- meter ---------- */

.sis-meter {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 26px;
}

.sis-meter__track {
    position: relative;
    width: 240px;
    max-width: 52vw;
    height: 2px;
    border-radius: 2px;
    background: rgba(255, 255, 255, .12);
    overflow: hidden;
}

.sis-meter__fill {
    position: absolute;
    inset: 0;
    width: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--sis-a), var(--sis-b));
    box-shadow: 0 0 14px rgba(249, 157, 78, .55);
    /* transform, not width — width would force a layout pass every frame */
    transform: scaleX(0);
    transform-origin: left center;
    will-change: transform;
}

.sis-meter__value {
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: rgba(255, 255, 255, .82);
    min-width: 46px;
    text-align: left;
    font-variant-numeric: tabular-nums;
}

.sis-meter__value i {
    font-style: normal;
    font-size: 10px;
    margin-left: 2px;
    color: var(--sis-a);
    vertical-align: super;
}

/* ---------- curtain reveal ---------- */

.sis-curtain {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: flex;
    pointer-events: none;
}

.sis-curtain__panel {
    flex: 1;
    height: 100%;
    margin-right: -1px; /* kill sub-pixel seams between panels */
    background: var(--sis-bg);
    will-change: transform;
}

/* ---------- responsive ---------- */

@media (max-width: 767px) {
    .sis-caption__line {
        font-size: 9.5px;
        letter-spacing: 3px;
    }

    .sis-badge {
        width: 72px;
        height: 72px;
        margin: -36px 0 0 -36px;
    }

    .sis-badge__mark { font-size: 18px; }

    .sis-logo { gap: 11px; }
    .sis-logo__icon { width: 42px; height: 42px; }
    .sis-logo__type b { font-size: 26px; }
    .sis-logo__type i { font-size: 9px; letter-spacing: 3.4px; margin-top: 5px; }

    .sis-meter { margin-top: 20px; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    .sis-grid,
    .sis-aura,
    .sis-badge__ring {
        animation: none;
    }
}
