/* =========================================================
   SHADOWHAT V41 — CINEMATIC INTRO + SECURITY HANDOFF
   The production V26.2 final-page CSS and mobile CSS remain untouched.
========================================================= */

/* Cloudflare owns the Turnstile iframe. During the challenge, hand control
   to the native cursor so the custom ghost cannot appear frozen over it. */
@media (pointer: fine) {
    body.security-challenge-active,
    body.security-challenge-active *,
    .turnstile-wrap.is-active,
    .turnstile-wrap.is-active iframe {
        cursor: auto !important;
    }

    body.security-challenge-active .ghost-cursor {
        opacity: 0 !important;
    }
}

/* Reduce expensive motion only while the challenge is active. */
body.security-challenge-active .flag-layer,
body.security-challenge-active .orbit-core,
body.security-challenge-active .orbit-dot,
body.security-challenge-active .orbit::before,
body.security-challenge-active .orbit::after,
body.security-challenge-active .site::after {
    animation-play-state: paused !important;
}

body.security-challenge-active .contact-card,
body.security-challenge-active .header,
body.security-challenge-active footer {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* =========================================================
   OPENING — charcoal signal acquisition
   Uses the same ShadowHat palette as the production page.
========================================================= */
.signal-intro {
    position: fixed;
    inset: 0;
    z-index: 200000;
    display: grid;
    place-items: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 42%, rgba(255,255,255,.07), transparent 27%),
        linear-gradient(120deg, #171b1e 0%, #111518 50%, #181c1f 100%);
    opacity: 1;
    visibility: visible;
    transition: opacity .58s ease, visibility .58s ease;
}

.signal-intro.is-gone {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.intro-flag-ghost,
.intro-grid,
.intro-sweep,
.intro-vignette,
.intro-noise {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.intro-flag-ghost {
    inset: -4%;
    background:
        linear-gradient(90deg, rgba(17,21,24,.20), rgba(17,21,24,.76)),
        url("images/flag.png") center / cover no-repeat;
    filter: grayscale(100%) contrast(90%) brightness(.78);
    opacity: .16;
    transform: scale(1.05);
    animation: introFlagBreath 3.2s ease-out both;
}

.intro-grid {
    opacity: .25;
    background-image:
        linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(circle at 50% 46%, black 0 34%, transparent 74%);
    -webkit-mask-image: radial-gradient(circle at 50% 46%, black 0 34%, transparent 74%);
    animation: introGridArrive 2.4s cubic-bezier(.2,.75,.2,1) both;
}

.intro-noise {
    opacity: .035;
    background-image:
        radial-gradient(circle, rgba(255,255,255,.24) 0 .55px, transparent .75px),
        radial-gradient(circle, rgba(255,255,255,.14) 0 .4px, transparent .65px);
    background-size: 47px 47px, 83px 83px;
    background-position: 0 0, 22px 13px;
    mask-image: radial-gradient(circle at center, black, transparent 74%);
    -webkit-mask-image: radial-gradient(circle at center, black, transparent 74%);
    animation: introNoiseDrift 18s linear infinite;
}

.intro-sweep {
    top: -20%;
    height: 18%;
    background: linear-gradient(to bottom, transparent, rgba(255,255,255,.055), transparent);
    filter: blur(16px);
    opacity: .8;
    animation: introSweep 2.35s cubic-bezier(.25,.7,.25,1) .28s both;
}

.intro-vignette {
    background: radial-gradient(circle at center, transparent 24%, rgba(8,10,12,.34) 62%, rgba(5,7,8,.84) 100%);
}

.intro-stage {
    position: relative;
    z-index: 4;
    width: min(86vw, 720px);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transform: translateY(-1vh);
}

.intro-target {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(48vw, 360px);
    aspect-ratio: 1;
    transform: translate(-50%,-56%);
    pointer-events: none;
}

.target-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.11);
    inset: 7%;
}

.target-ring-a {
    border-top-color: rgba(255,255,255,.54);
    border-right-color: rgba(255,255,255,.05);
    box-shadow: 0 0 22px rgba(255,255,255,.018);
    animation: introRingA 6s linear infinite;
}

.target-ring-b {
    inset: 20%;
    border-style: dashed;
    border-color: rgba(255,255,255,.055);
    animation: introRingB 9s linear infinite reverse;
}

.target-ring-c {
    inset: 34%;
    border-color: rgba(255,255,255,.035);
    border-left-color: rgba(255,255,255,.18);
    animation: introRingA 13s linear infinite reverse;
}

.target-bracket {
    position: absolute;
    width: 28px;
    height: 28px;
    opacity: .62;
}

.bracket-tl { top: 0; left: 0; border-top: 1px solid #fff; border-left: 1px solid #fff; }
.bracket-tr { top: 0; right: 0; border-top: 1px solid #fff; border-right: 1px solid #fff; }
.bracket-bl { bottom: 0; left: 0; border-bottom: 1px solid #fff; border-left: 1px solid #fff; }
.bracket-br { bottom: 0; right: 0; border-bottom: 1px solid #fff; border-right: 1px solid #fff; }

.target-axis { position: absolute; background: rgba(255,255,255,.075); }
.axis-x { left: -9%; right: -9%; top: 50%; height: 1px; }
.axis-y { top: -9%; bottom: -9%; left: 50%; width: 1px; }

.intro-logo {
    width: clamp(74px, 8vw, 104px);
    height: auto;
    position: relative;
    z-index: 5;
    filter: drop-shadow(0 0 20px rgba(255,255,255,.13));
    opacity: 0;
    transform: scale(.84);
    animation: introLogoIn .9s cubic-bezier(.2,.8,.2,1) .22s forwards;
}

.intro-kicker {
    margin-top: 32px;
    color: rgba(255,255,255,.42);
    font: 500 7px/1.2 monospace;
    letter-spacing: 2.6px;
    opacity: 0;
    animation: introTextIn .65s ease .72s forwards;
}

.intro-title {
    margin-top: 12px;
    color: #f4f5f5;
    font-family: "Space Grotesk", Arial, sans-serif;
    font-size: clamp(38px, 6.6vw, 78px);
    font-weight: 600;
    line-height: .95;
    letter-spacing: clamp(3px, .7vw, 8px);
    text-shadow: 0 0 26px rgba(255,255,255,.06);
    opacity: 0;
    transform: translateY(8px);
    animation: introTitleIn .82s cubic-bezier(.2,.8,.2,1) .88s forwards;
}

.intro-subtitle {
    margin-top: 13px;
    color: rgba(255,255,255,.35);
    font: 500 6px/1.3 monospace;
    letter-spacing: 2px;
    opacity: 0;
    animation: introTextIn .6s ease 1.14s forwards;
}

.intro-progress {
    width: min(72vw, 440px);
    height: 1px;
    margin-top: 34px;
    overflow: hidden;
    background: rgba(255,255,255,.08);
    opacity: 0;
    animation: introTextIn .4s ease 1.05s forwards;
}

.intro-progress span {
    display: block;
    width: 100%;
    height: 100%;
    transform: scaleX(0);
    transform-origin: left;
    background: linear-gradient(90deg, rgba(255,255,255,.12), rgba(255,255,255,.9), rgba(255,255,255,.18));
    box-shadow: 0 0 14px rgba(255,255,255,.18);
    animation: introProgress 1.65s cubic-bezier(.18,.75,.2,1) 1.02s forwards;
}

.intro-telemetry {
    width: min(72vw, 440px);
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    color: rgba(255,255,255,.24);
    font: 500 5px/1 monospace;
    letter-spacing: 1.4px;
    opacity: 0;
    animation: introTextIn .55s ease 1.35s forwards;
}

.intro-skip {
    position: absolute;
    right: 25px;
    bottom: 22px;
    width: auto;
    height: auto;
    margin: 0;
    padding: 7px 10px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.025);
    color: rgba(255,255,255,.42);
    font: 500 6px/1 monospace;
    letter-spacing: 1.3px;
    opacity: .7;
    cursor: pointer !important;
}

.intro-skip:hover {
    background: rgba(255,255,255,.055);
    color: #fff;
    transform: none;
}

.signal-intro.is-exiting .intro-stage {
    animation: introStageOut .58s cubic-bezier(.4,0,.7,.2) both;
}

.signal-intro.is-exiting .intro-grid { opacity: .08; }

/* Tiny handoff flash: short and localized, not a full-screen strobe. */
.signal-intro::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: rgba(255,255,255,.10);
    opacity: 0;
}
.signal-intro.is-exiting::after {
    animation: introLockFlash .22s ease-out both;
}

@keyframes introFlagBreath { from { opacity:.03; transform:scale(1.09); } to { opacity:.16; transform:scale(1.05); } }
@keyframes introGridArrive { from { opacity:0; transform:scale(1.08); } to { opacity:.25; transform:scale(1); } }
@keyframes introNoiseDrift { to { background-position: 47px 22px, -61px 57px; } }
@keyframes introSweep { from { transform:translateY(-10%); opacity:0; } 18% { opacity:.7; } to { transform:translateY(720%); opacity:0; } }
@keyframes introRingA { to { transform:rotate(360deg); } }
@keyframes introRingB { to { transform:rotate(360deg); } }
@keyframes introLogoIn { to { opacity:1; transform:scale(1); } }
@keyframes introTextIn { to { opacity:1; } }
@keyframes introTitleIn { to { opacity:1; transform:translateY(0); } }
@keyframes introProgress { to { transform:scaleX(1); } }
@keyframes introStageOut { to { opacity:0; transform:translateY(-10px) scale(.985); filter:blur(2px); } }
@keyframes introLockFlash { 0% { opacity:0; } 42% { opacity:.18; } 100% { opacity:0; } }

@media (max-width: 600px) {
    .intro-target { width: min(78vw, 320px); }
    .intro-kicker { font-size: 5px; letter-spacing: 1.6px; }
    .intro-subtitle { font-size: 5px; letter-spacing: 1.25px; }
    .intro-telemetry { font-size: 4px; }
    .intro-skip { right: 14px; bottom: 14px; }
    .intro-noise { opacity: .02; }
}

@media (prefers-reduced-motion: reduce) {
    .intro-flag-ghost,
    .intro-grid,
    .intro-noise,
    .intro-sweep,
    .target-ring,
    .intro-logo,
    .intro-kicker,
    .intro-title,
    .intro-subtitle,
    .intro-progress,
    .intro-progress span,
    .intro-telemetry,
    .signal-intro::after {
        animation: none !important;
    }
}
