/* ==========================================================================
   APEX FORGE HERO SYSTEM  —  hero-apex.css  (V3.1)
   ========================================================================== */

/* ---- Section Shell ---- */
.hero-apex {
    position: relative;
    min-height: 100vh;
    padding: 120px 0 70px;
    background: transparent;
    overflow: hidden;
    display: flex;
    align-items: center;
}

/* ---- Layer 0 : Noise Texture ---- */
.hero-noise {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: 0.04;
    pointer-events: none;
    z-index: 1;
}

/* ---- Layer 0 : Scrolling Grid ---- */
.hero-grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 240, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(circle at 50% 40%, black 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(circle at 50% 40%, black 20%, transparent 75%);
    animation: gridScroll 40s linear infinite;
    z-index: 2;
    pointer-events: none;
}

@keyframes gridScroll {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 0 600px;
    }
}

/* ---- Layer 1 : Neon Depth Blobs ---- */
.bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 3;
    animation: blobFloat 20s ease-in-out infinite alternate;
}

.blob-1 {
    width: 700px;
    height: 700px;
    top: -15%;
    left: -15%;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.2), transparent 70%);
    animation-delay: 0s;
}

.blob-2 {
    width: 650px;
    height: 650px;
    bottom: -15%;
    right: -15%;
    background: radial-gradient(circle, rgba(138, 43, 226, 0.2), transparent 70%);
    animation-delay: -7s;
}

.blob-3 {
    width: 400px;
    height: 400px;
    top: 35%;
    left: 45%;
    background: radial-gradient(circle, rgba(0, 255, 136, 0.06), transparent 70%);
    animation-delay: -12s;
}

@keyframes blobFloat {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(30px, -20px) scale(1.05);
    }

    100% {
        transform: translate(-20px, 40px) scale(0.95);
    }
}

/* ---- Layer 2 : Floating Tech Icons ---- */
.floating-tech-wrap {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 4;
}

.tech-node {
    position: absolute;
    color: var(--accent-blue);
    font-size: 1.4rem;
    opacity: 0.15;
    transition: transform 0.15s ease-out;
    animation: techFloat 6s ease-in-out infinite alternate;
}

.tech-node:nth-child(2) {
    animation-delay: -1.5s;
    color: var(--accent-purple);
}

.tech-node:nth-child(3) {
    animation-delay: -3s;
}

.tech-node:nth-child(4) {
    animation-delay: -4.5s;
    color: var(--accent-green);
}

.tech-node:nth-child(5) {
    animation-delay: -2s;
}

@keyframes techFloat {
    from {
        transform: translateY(0px);
    }

    to {
        transform: translateY(-14px);
    }
}

@media (max-width: 1024px) {
    .tech-node {
        display: none !important;
    }
}

/* ---- Content Container ---- */
.hero-container {
    position: relative;
    z-index: 10;
    width: 100%;
}

/* Centered hero layout */
.hero-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 860px;
    margin: 0 auto;
}

/* ---- Left: Content ---- */
.sys-init-tag {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 7px 18px;
    background: rgba(0, 240, 255, 0.04);
    border: 1px solid rgba(0, 240, 255, 0.15);
    color: var(--accent-blue);
    font-family: var(--font-primary);
    font-size: 0.72rem;
    letter-spacing: 2.5px;
    margin-bottom: 2rem;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-blue);
    box-shadow: 0 0 10px var(--accent-blue);
    display: inline-block;
    flex-shrink: 0;
    animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {

    0%,
    100% {
        box-shadow: 0 0 5px var(--accent-blue);
    }

    50% {
        box-shadow: 0 0 20px var(--accent-blue), 0 0 40px rgba(0, 240, 255, 0.3);
    }
}

.glitch-wrapper {
    display: grid;
    place-items: center;
    position: relative;
    margin-bottom: 0.8rem;
}

.hero-title {
    grid-area: 1/1;
    font-size: clamp(2.4rem, 4.5vw, 4.8rem);
    line-height: 1.04;
    letter-spacing: -0.04em;
    text-transform: uppercase;
    font-family: var(--font-heading);
    font-weight: 800;
    margin: 0;
    position: relative;
    z-index: 1;
}

.glitch-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0.5;
    z-index: 0;
    pointer-events: none;
}

/* Layer 1: Cyan Glitch */
.glitch-layer:nth-child(2) {
    color: var(--accent-blue);
    animation: glitchAnim1 4s infinite linear alternate-reverse;
    transform: translateX(-2px);
    opacity: 0.3;
}

/* Layer 2: Purple Glitch */
.glitch-layer:nth-child(3) {
    color: var(--accent-purple);
    animation: glitchAnim2 3s infinite linear alternate-reverse;
    transform: translateX(2px);
    opacity: 0.3;
}

/* Ensure the gradient span in glitch layers stays visible but simplified */
.glitch-layer .text-gradient-premium {
    background: currentColor;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: none;
}

@keyframes glitchAnim1 {
    0% {
        clip-path: inset(80% 0 0 0);
    }

    10% {
        clip-path: inset(10% 0 85% 0);
    }

    20% {
        clip-path: inset(50% 0 45% 0);
    }

    30% {
        clip-path: inset(20% 0 75% 0);
    }

    40% {
        clip-path: inset(85% 0 10% 0);
    }

    50% {
        clip-path: inset(40% 0 55% 0);
    }

    60% {
        clip-path: inset(70% 0 25% 0);
    }

    70% {
        clip-path: inset(30% 0 65% 0);
    }

    80% {
        clip-path: inset(90% 0 5% 0);
    }

    90% {
        clip-path: inset(15% 0 80% 0);
    }

    100% {
        clip-path: inset(80% 0 0 0);
    }
}

@keyframes glitchAnim2 {
    0% {
        clip-path: inset(0 0 80% 0);
    }

    10% {
        clip-path: inset(85% 0 10% 0);
    }

    20% {
        clip-path: inset(45% 0 50% 0);
    }

    30% {
        clip-path: inset(75% 0 20% 0);
    }

    40% {
        clip-path: inset(10% 0 85% 0);
    }

    50% {
        clip-path: inset(55% 0 40% 0);
    }

    60% {
        clip-path: inset(25% 0 70% 0);
    }

    70% {
        clip-path: inset(65% 0 30% 0);
    }

    80% {
        clip-path: inset(5% 0 90% 0);
    }

    90% {
        clip-path: inset(80% 0 15% 0);
    }

    100% {
        clip-path: inset(0 0 80% 0);
    }
}

.text-gradient-premium {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 30px rgba(0, 240, 255, 0.2));
    display: inline-block;
}

.text-gradient-premium {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 30px rgba(0, 240, 255, 0.2));
    display: inline-block;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 680px;
    line-height: 1.9;
    margin-bottom: 0.8rem;
    font-family: var(--font-primary);
}

.hero-action-btns {
    display: flex;
    gap: 1.2rem;
    margin-top: 1em;
    margin-bottom: 3.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Apex Buttons */
.btn.btn-apex-primary {
    background: var(--accent-blue);
    color: #000000 !important;
    padding: 0.9rem 2.2rem;
    font-weight: 700;
    font-family: var(--font-primary);
    font-size: 0.82rem;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.2);
    border: none;
    cursor: pointer;
}

.btn.btn-apex-primary i,
.btn.btn-apex-primary span {
    color: #000000 !important;
}

.btn.btn-apex-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 14px 40px rgba(0, 240, 255, 0.45);
    color: #000000 !important;
}

.btn.btn-apex-primary:hover i,
.btn.btn-apex-primary:hover span {
    color: #000000 !important;
}

.btn-apex-secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-primary) !important;
    padding: 0.9rem 2.2rem;
    font-family: var(--font-primary);
    font-size: 0.82rem;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.btn-apex-secondary:hover {
    background: rgba(0, 240, 255, 0.05);
    border-color: rgba(0, 240, 255, 0.3);
    color: var(--accent-blue) !important;
}

/* ---- Right: Code Window ---- */
.hero-visual-side {
    position: relative;
}

.code-window {
    width: 100%;
    background: rgba(7, 10, 14, 0.8);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 50px 100px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(0, 240, 255, 0.04) inset;
    position: relative;
    overflow: hidden;
    border-radius: 0;
}

/* Top glowing border line */
.code-window::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
            transparent 0%,
            var(--accent-blue) 35%,
            var(--accent-purple) 65%,
            transparent 100%);
    opacity: 0.8;
}

.window-header {
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.window-controls {
    display: flex;
    gap: 7px;
    align-items: center;
}

.control {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.control.red {
    background: #ff5f56;
    box-shadow: 0 0 5px rgba(255, 95, 86, 0.5);
}

.control.yellow {
    background: #ffbd2e;
    box-shadow: 0 0 5px rgba(255, 189, 46, 0.4);
}

.control.green {
    background: #27c93f;
    box-shadow: 0 0 5px rgba(39, 201, 63, 0.5);
}

.window-title {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-family: var(--font-primary);
    letter-spacing: 1.5px;
}

.window-body {
    padding: 24px 28px;
    font-family: var(--font-primary);
    font-size: 0.82rem;
    line-height: 1.75;
}

.code-line {
    display: flex;
    gap: 18px;
    margin-bottom: 2px;
}

.line-num {
    color: rgba(255, 255, 255, 0.18);
    min-width: 18px;
    user-select: none;
    font-size: 0.74rem;
    flex-shrink: 0;
}

/* Syntax colours */
.keyword {
    color: #c792ea;
}

.string {
    color: #c3e88d;
}

.class {
    color: #82aaff;
}

.comment {
    color: rgba(255, 255, 255, 0.3);
    font-style: italic;
}

.number {
    color: #f78c6c;
}

.typing-line {
    color: #80ffea;
}

.cursor {
    animation: blink-cursor 1s step-end infinite;
}

/* ---- Performance Bars ---- */
.perf-stats {
    padding: 16px 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.stat .label {
    display: block;
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    margin-bottom: 6px;
    font-family: var(--font-primary);
    text-transform: uppercase;
}

.bar-wrap {
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.bar {
    height: 100%;
    background: var(--accent-blue);
    box-shadow: 0 0 8px var(--accent-blue);
}

.bar.accent {
    background: var(--accent-purple);
    box-shadow: 0 0 8px var(--accent-purple);
}

/* ---- Scroll Indicator ---- */
.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.scroll-indicator span {
    font-size: 0.62rem;
    letter-spacing: 3px;
    color: var(--text-muted);
    font-family: var(--font-primary);
}

.mouse {
    width: 20px;
    height: 33px;
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    position: relative;
}

.wheel {
    width: 3px;
    height: 6px;
    background: var(--accent-blue);
    border-radius: 2px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollWheel 2s ease infinite;
}

@keyframes scrollWheel {
    0% {
        transform: translate(-50%, 0);
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, 14px);
        opacity: 0;
    }
}

/* ---- Floating Code Window (top-right) ---- */
.code-window-float {
    position: absolute;
    top: 90px;
    right: 40px;
    width: 390px;
    background: rgba(7, 10, 14, 0.88);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(0, 240, 255, 0.04) inset;
    z-index: 5;
    overflow: hidden;
    animation: floatWindow 6s ease-in-out infinite alternate;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace !important;
}

.code-window-float::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
            transparent,
            var(--accent-blue) 40%,
            var(--accent-purple) 60%,
            transparent);
    opacity: 0.8;
}

.code-window-float::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(5, 5, 8, 0.65);
    pointer-events: none;
    z-index: 5;
}

.code-window-float .window-header {
    padding: 10px 14px;
}

.code-window-float .window-body {
    padding: 14px 16px;
    font-size: 0.74rem;
    line-height: 1.65;
}

.code-window-float .code-line {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1px;
    white-space: nowrap;
}

.code-window-float .line-num {
    font-size: 0.66rem;
}

@keyframes floatWindow {
    from {
        transform: translateY(0px);
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
    }

    to {
        transform: translateY(-8px);
        box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65), 0 0 30px rgba(0, 240, 255, 0.06);
    }
}

/* Prevent code window from overlapping hero text on medium desktop screen sizes */
@media (max-width: 1350px) and (min-width: 1101px) {
    .code-window-float {
        width: 330px !important;
        right: 20px !important;
    }
}

/* ---- Responsive Breakpoints ---- */
@media (max-width: 1100px) {
    .code-window-float {
        display: none;
    }

    /* hide float panel on smaller screens */
    .hero-subtitle {
        max-width: 100%;
    }

    .hero-action-btns {
        justify-content: center;
    }

    .scroll-indicator {
        align-items: center;
    }
}

@media (max-width: 576px) {
    .hero-apex {
        padding: 95px 0 50px;
    }

    .hero-action-btns {
        flex-direction: column;
    }

    .btn-apex-primary,
    .btn-apex-secondary {
        width: 100%;
        justify-content: center;
    }

    .hero-title {
        letter-spacing: -0.03em;
    }
}