/* =========================================================
   AIDENTIVE.AI — Neural Core Dive Hero
   Pinned, scroll-driven hero: canvas neural network + orbit
   rings + radar scan + live HUD telemetry, dives inward as
   the visitor scrolls, then hands off to the page below.
   ========================================================= */

.neural-hero {
    position: relative;
    height: 230vh;
    /* must stay fully 'visible' on both axes — the sitewide rule
       "section{overflow-x:hidden}" would otherwise force overflow-y
       to compute to 'auto', turning this into its own scroll
       container and breaking position:sticky on .nh-pin below */
    overflow: visible;
}

.nh-pin {
    /* position is driven by JS (see neural-hero.js) rather than
       CSS position:sticky — this site sets overflow-x:hidden on
       html/body sitewide to stop stray horizontal scrollbars, and
       that combination is a known Chromium quirk that silently
       breaks position:sticky. JS toggles fixed/absolute instead. */
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #0F172A 0%, #0d2535 60%, #134e4a 100%);
    background-size: 200% 200%;
    animation: nhGradient 12s ease infinite;
}
.nh-pin::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background: radial-gradient(circle at 80% 20%, rgba(255,255,255,.12), transparent 45%),
                radial-gradient(circle at 10% 90%, rgba(255,255,255,.06), transparent 40%);
}
.nh-pin::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 75% 70% at 55% 40%, #000 25%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 75% 70% at 55% 40%, #000 25%, transparent 75%);
    pointer-events: none;
}
@keyframes nhGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.nh-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; display: block; }

/* ---- Radar sweep + orbit rings ---- */
.nh-radar {
    position: absolute; z-index: 2; top: 50%; left: 50%;
    width: min(120vmin, 780px); aspect-ratio: 1;
    transform: translate(-50%,-50%);
    border-radius: 50%; pointer-events: none; opacity: .4;
    background: conic-gradient(from 0deg, rgba(20,184,170,.18), transparent 22%, transparent 100%);
    mask: radial-gradient(circle, #000 0 64%, transparent 66%);
    -webkit-mask: radial-gradient(circle, #000 0 64%, transparent 66%);
    animation: nhSpin 11s linear infinite;
    transition: opacity .3s;
}
.nh-ring {
    position: absolute; z-index: 2; top: 50%; left: 50%;
    border-radius: 50%; pointer-events: none;
    transform: translate(-50%,-50%);
    transition: opacity .3s;
}
.nh-ring svg { width: 100%; height: 100%; display: block; overflow: visible; }
.nh-ring.r1 { width: min(78vmin,540px); aspect-ratio: 1; animation: nhSpin 26s linear infinite; }
.nh-ring.r2 { width: min(92vmin,620px); aspect-ratio: 1; animation: nhSpin 42s linear infinite reverse; }
.nh-ring.r3 { width: min(62vmin,440px); aspect-ratio: 1; animation: nhSpin 16s linear infinite; }
@keyframes nhSpin { to { transform: translate(-50%,-50%) rotate(360deg); } }

/* ---- Core emblem ---- */
.nh-core {
    position: absolute; z-index: 6; top: 50%; left: 50%;
    transform: translate(-50%,-50%);
    width: min(28vmin, 180px); aspect-ratio: 1;
    display: flex; align-items: center; justify-content: center;
    transition: opacity .2s; will-change: opacity, transform;
}
.nh-core-inner {
    position: relative;
    width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
    background: linear-gradient(135deg, #14B8AA, #06B6DA);
    display: flex; align-items: center; justify-content: center;
    box-shadow:
        0 0 0 14px rgba(20,184,170,.1),
        0 0 0 28px rgba(20,184,170,.06),
        0 0 60px rgba(20,184,170,.55),
        0 0 120px rgba(6,182,218,.28);
    animation: nhCoreGlow 3s ease-in-out infinite;
}
@keyframes nhCoreGlow {
    0%,100% { box-shadow: 0 0 0 14px rgba(20,184,170,.1), 0 0 0 28px rgba(20,184,170,.06), 0 0 60px rgba(20,184,170,.55), 0 0 120px rgba(6,182,218,.28); }
    50%      { box-shadow: 0 0 0 20px rgba(20,184,170,.14), 0 0 0 42px rgba(20,184,170,.07), 0 0 80px rgba(20,184,170,.68), 0 0 150px rgba(6,182,218,.35); }
}
.nh-core-logo {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 3rem; font-weight: 900; color: rgba(255,255,255,.55); letter-spacing: -1px;
}
.nh-scan { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.nh-scan::after {
    content: '';
    position: absolute; left: 0; right: 0; height: 46%; top: -46%;
    background: linear-gradient(to bottom, transparent, rgba(255,255,255,.35) 78%, rgba(255,255,255,.75));
    animation: nhScanMove 4.2s ease-in-out infinite;
}
@keyframes nhScanMove { 0% { top: -46%; } 55%, 100% { top: 100%; } }

/* ---- Corner brackets ---- */
.nh-bracket {
    position: absolute; z-index: 9; width: 26px; height: 26px;
    border: 1px solid rgba(20,184,170,.28); transition: opacity .3s;
}
.nh-bracket.tl { top: 18px; left: 18px; border-right: 0; border-bottom: 0; }
.nh-bracket.tr { top: 18px; right: 18px; border-left: 0; border-bottom: 0; }
.nh-bracket.bl { bottom: 18px; left: 18px; border-right: 0; border-top: 0; }
.nh-bracket.br { bottom: 18px; right: 18px; border-left: 0; border-top: 0; }

/* ---- HUD telemetry panels ---- */
.nh-hud {
    position: absolute; z-index: 9;
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    transition: opacity .3s;
}
.nh-hud-hd {
    font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: #5eead4;
    display: flex; align-items: center; gap: 7px; margin-bottom: 8px;
}
.nh-hud-hd::before { content: ''; width: 14px; height: 1px; background: #5eead4; }
.nh-hud-box {
    border: 1px solid rgba(20,184,170,.22);
    background: rgba(6,20,26,.55);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    border-radius: 10px; padding: 12px 14px;
}

.nh-hud-tl { top: 120px; left: 26px; }
.nh-chip { display: flex; align-items: center; gap: 12px; }
.nh-chipring { width: 46px; height: 46px; flex: none; }
.nh-chip-spin { animation: nhSpin 6s linear infinite; transform-origin: center; }
.nh-bars { display: flex; flex-direction: column; gap: 5px; width: 120px; }
.nh-bar { height: 4px; background: rgba(20,184,170,.12); border-radius: 3px; overflow: hidden; }
.nh-bar i { display: block; height: 100%; background: linear-gradient(90deg,#14B8AA,#06B6DA); border-radius: 3px; }
.nh-lab { font-size: 9px; color: rgba(255,255,255,.45); letter-spacing: .08em; }

.nh-hud-tr { top: 120px; right: 26px; width: 230px; }
.nh-hud-tr pre {
    margin: 0; font-size: 10.5px; line-height: 1.5; color: #7fd9cd;
    white-space: pre-wrap; word-break: break-word; max-height: 150px; overflow: hidden;
}
.nh-cursor { display: inline-block; width: 6px; height: 12px; background: #5eead4; vertical-align: -2px; animation: nhBlink 1s steps(1) infinite; }
@keyframes nhBlink { 50% { opacity: 0; } }

.nh-hud-bl { bottom: 26px; left: 26px; width: 230px; }
.nh-graph-svg { width: 100%; height: 60px; display: block; }
.nh-read { display: flex; justify-content: space-between; margin-top: 8px; font-size: 10px; color: rgba(255,255,255,.45); }
.nh-read b { color: #5eead4; font-weight: 500; }

.nh-hud-br { bottom: 26px; right: 26px; width: 205px; }
.nh-row { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 0; border-bottom: 1px dashed rgba(20,184,170,.14); }
.nh-row:last-child { border-bottom: 0; }
.nh-k { font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.4); }
.nh-v { font-size: 14px; color: #5eead4; font-weight: 600; }
.nh-v.vi { color: #a5b4fc; }

/* ---- Hero content overlay ---- */
.nh-content { position: relative; z-index: 10; width: 100%; will-change: opacity, transform; }
.nh-h1 {
    color: #fff; font-size: clamp(2.6rem, 5vw, 4rem); font-weight: 900; line-height: 1.08; letter-spacing: -.5px;
    text-shadow: 0 4px 32px rgba(2,8,14,.65);
}
.nh-content .hero-desc { text-shadow: 0 2px 18px rgba(2,8,14,.85); }
.nh-content .hero-stats .sn,
.nh-content .hero-stats .sl { text-shadow: 0 2px 14px rgba(2,8,14,.7); }

/* soft scrim behind the text so it stays legible over the bright core/canvas */
.nh-text-scrim {
    position: absolute; z-index: -1; top: 50%; left: 50%; transform: translate(-50%,-50%);
    width: min(94vw, 980px); height: 82%;
    background: radial-gradient(ellipse 64% 62% at 50% 46%, rgba(3,10,15,.78) 0%, rgba(3,10,15,.42) 55%, transparent 78%);
    pointer-events: none;
}

/* ---- Scroll cue ---- */
.nh-cue {
    position: absolute; z-index: 10; bottom: 26px; left: 50%; transform: translateX(-50%);
    text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px;
    transition: opacity .2s;
}
.nh-cue-lbl {
    font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: .24em;
    text-transform: uppercase; color: rgba(255,255,255,.4);
}
.nh-cue-arr {
    width: 1px; height: 28px;
    background: linear-gradient(to bottom, rgba(20,184,170,.85), transparent);
    animation: nhCue 2s ease-in-out infinite;
}
@keyframes nhCue { 0%,100% { opacity: 1; transform: scaleY(1); } 50% { opacity: .3; transform: scaleY(.5); } }

@media (max-width: 991px) {
    .nh-hud-tl { display: none; }
    .nh-bracket { display: none; }
}
@media (max-width: 820px) {
    .nh-hud-tr, .nh-hud-bl { width: 168px; }
    .nh-hud-br { width: 148px; }
    .nh-hud-tr pre { font-size: 9.5px; max-height: 110px; }
}
@media (max-width: 576px) {
    .neural-hero { height: 190vh; }
    .nh-hud { display: none; }
    .nh-radar, .nh-ring { opacity: .22; }
}
@media (prefers-reduced-motion: reduce) {
    .nh-radar, .nh-ring, .nh-scan::after, .nh-cue-arr, .nh-core-inner, .nh-chip-spin, .nh-cursor, .nh-pin {
        animation: none !important;
    }
}
