/* ============================================
   ExodusHub - Home Redesign (Strategic Scroller)
   ============================================ */

html {
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    scroll-behavior: smooth;
}

body {
    /* Reset body snap to avoid root conflict */
    scroll-snap-type: none;
    margin: 0;
    padding: 0;
}

:root {
    --section-height: 100vh;
    --data-stream-width: 2px;
}

/* Base Layout */
.scroller-container {
    position: relative;
    overflow-x: hidden;
}

/* Continuous Data-Stream Visual Anchor */
.data-stream {
    position: fixed;
    left: 50px;
    top: 0;
    width: var(--data-stream-width);
    height: 100vh;
    background: linear-gradient(to bottom,
            transparent,
            var(--neon-red) 20%,
            var(--neon-red) 80%,
            transparent);
    box-shadow: 0 0 10px var(--neon-red-glow);
    z-index: 5;
    pointer-events: none;
    opacity: 0.4;
}

.data-stream__node {
    position: absolute;
    left: -4px;
    width: 10px;
    height: 10px;
    background: var(--neon-red);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--neon-red-bright);
    animation: stream-node-travel 10s linear infinite;
}

@keyframes stream-node-travel {
    0% {
        top: -10px;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        top: 100vh;
        opacity: 0;
    }
}

/* Multi-Header Typography */
.huge-header {
    font-family: var(--font-display);
    font-size: clamp(5rem, 15vw, 15rem);
    line-height: 0.8;
    letter-spacing: -0.05em;
    color: var(--neon-red);
    text-transform: uppercase;
    margin: 0;
    opacity: 0.1;
    position: absolute;
    pointer-events: none;
    white-space: nowrap;
    z-index: 2;
}

/* Common Section Layout */
.scroll-section,
.hq-video-section {
    min-height: 100vh;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    padding: 10vw;
    z-index: 2;
    background: var(--bg-primary);
    /* Snaps section perfectly to the center of viewport */
    scroll-snap-align: center;
    scroll-snap-stop: always;
}

.scroll-section--compact {
    /* Shorter but not tiny */
    padding-bottom: 10vw;
}

/* Final Directive Badge */
.final-directive {
    text-align: center;
    padding: 4rem 0;
    opacity: 0.5;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.3em;
    color: var(--neon-red-dim);
    border-top: 1px solid color-mix(in srgb, var(--neon-red) 10%, transparent);
}

.section-content {
    position: relative;
    z-index: 3;
    max-width: 800px;
}

/* Asymmetric Alignment Utilities */
.reveal-left {
    transform: translateX(-30px);
    opacity: 0;
    transition: transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1),
        opacity 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: transform, opacity;
}

.reveal-right {
    transform: translateX(30px);
    opacity: 0;
    transition: transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1),
        opacity 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: transform, opacity;
}

.reveal-center {
    transform: scale(0.9);
    opacity: 0;
    transition: all 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.active .reveal-left,
.active .reveal-right,
.active .reveal-center {
    transform: translate(0) scale(1);
    opacity: 1;
}

/* Side Image Containers */
.side-image-container {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40%;
    height: 70vh;
    z-index: 1;
    pointer-events: none;
    opacity: 0.3;
    overflow: hidden;
    filter: grayscale(1) contrast(1.2);
    transition: all 1.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.side-image-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 20%, var(--bg-primary) 80%);
}

.side-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.side-image-container.left {
    left: 4vw;
}

.side-image-container.right {
    right: 4vw;
}

.reveal-image-left {
    transform: translate(-50px, -50%) !important;
    opacity: 0;
}

.reveal-image-right {
    transform: translate(50px, -50%) !important;
    opacity: 0;
}

.active .reveal-image-left,
.active .reveal-image-right {
    transform: translate(0, -50%) !important;
    opacity: 0.3;
}

/* Section Specifics */
.hq-hero-new {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    padding-top: 80px;
    /* Clear fixed navbar */
}

.hq-hero-new .section-content {
    max-width: none;
}

.video-frame {
    width: 100%;
    max-width: 1200px;
    background: #000;
    border: 2px solid var(--neon-red);
    box-shadow: 0 0 20px var(--neon-red-glow), inset 0 0 10px var(--neon-red-glow);
    position: relative;
    overflow: hidden;
    line-height: 0;
}

.video-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.8), inset 0 0 100px rgba(0, 0, 0, 0.4);
    z-index: 2;
}

.video-controls {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    z-index: 10;
    display: flex;
    gap: 1rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.video-frame:hover .video-controls {
    opacity: 1;
}

.video-control-btn {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--neon-red-dim);
    color: var(--neon-red);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 1.2rem;
    backdrop-filter: blur(5px);
    transition: all 0.2s;
    border-radius: 4px;
}

.video-control-btn:hover {
    background: var(--neon-red);
    color: var(--bg-primary);
    border-color: var(--neon-red-bright);
    box-shadow: 0 0 15px var(--neon-red-glow);
}

.hq-hero__title {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .hq-hero__title {
        white-space: normal;
    }
}

.hero-logo-container {
    position: relative;
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.hero-logo {
    width: 25rem;
    height: 8rem;
    max-width: 80vw;
    background-color: var(--neon-red);
    -webkit-mask-image: url('/assets/media/exodus-white.svg');
    mask-image: url('/assets/media/exodus-white.svg');
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    filter: drop-shadow(0 0 20px var(--neon-red-glow));
    transition: background-color 0.3s;
}



/* Transitions */
.distortion-wipe {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.distortion-wipe.triggering {
    opacity: 0.5;
    animation: glitch-flicker 0.2s steps(2) infinite;
}

@keyframes glitch-flicker {
    0% {
        transform: translate(0);
        background: color-mix(in srgb, var(--neon-red) 10%, transparent);
    }

    50% {
        transform: translate(5px, -5px);
        background: rgba(0, 221, 255, 0.1);
    }

    100% {
        transform: translate(-5px, 5px);
        background: color-mix(in srgb, var(--neon-red) 10%, transparent);
    }
}

/* Rank Carousel */
.rank-carousel-wrapper {
    margin-top: 3rem;
    position: relative;
    overflow: visible;
    padding: 2rem 0;
    width: 100%;
}

.rank-carousel {
    display: flex;
    gap: 2rem;
    justify-content: flex-start;
    align-items: stretch;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-x: auto;
    /* Adding internal padding so the first/last cards can be centered properly */
    padding: 2rem 250px;
    margin: 0 -250px;
    -ms-overflow-style: none;
    scrollbar-width: none;
    /* Stronger mask to hide cards as they leave the right-side section area */
    -webkit-mask-image: linear-gradient(to right, transparent, black 25%, black 75%, transparent);
    mask-image: linear-gradient(to right, transparent, black 25%, black 75%, transparent);
}

.rank-carousel::-webkit-scrollbar {
    display: none;
}

.rank-node {
    flex: 0 0 300px;
    background: rgba(10, 5, 5, 0.7);
    border: 1px solid var(--neon-red-dim);
    padding: 2.5rem;
    text-align: left;
    opacity: 0.5;
    transition: all 0.3s;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 250px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.rank-node.active {
    opacity: 1;
    border-color: var(--neon-red);
    box-shadow: 0 0 20px var(--neon-red-glow);
    transform: scale(1.05);
}

.rank-node__rank {
    color: var(--neon-red);
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.rank-node__title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #fff;
}

.rank-node__desc {
    font-size: 0.85rem;
    opacity: 0.8;
}

.rank-controls {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.rank-nav {
    background: transparent;
    border: 1px solid var(--neon-red);
    color: var(--neon-red);
    padding: 0.5rem 1.5rem;
    font-family: var(--font-mono);
    transition: all 0.3s;
}

.rank-nav:hover {
    background: var(--neon-red);
    color: var(--bg-primary);
    box-shadow: 0 0 15px var(--neon-red-glow);
}

/* Modules Grid */
.modules-grid-new {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 4rem;
}

.module-card {
    background: rgba(10, 5, 5, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid color-mix(in srgb, var(--neon-red) 15%, transparent);
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.module-card:hover {
    border-color: var(--neon-red);
    background: color-mix(in srgb, var(--neon-red) 5%, transparent);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.module-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon-red), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.module-card:hover::before {
    transform: translateX(100%);
}

.module-card__id {
    font-family: var(--font-mono);
    color: var(--neon-red-dim);
    font-size: 0.9rem;
    display: block;
    margin-bottom: 1rem;
}

.module-card h3 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    margin-bottom: 1rem;
    text-shadow: none;
}

.module-card p {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Intel Terminal FAQ */
.intel-terminal-wrapper {
    display: grid;
    grid-template-columns: 1fr 320px;
    /* Fixed right col ensures consistent space for queries */
    gap: 2rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--neon-red-dim);
    padding: 2.5rem;
    /* Increased padding to prevent gluing to borders */
    position: relative;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
    flex-grow: 1;
}

.intel-console {
    background: #050202;
    border: 1px solid var(--neon-red-dim);
    padding: 1.5rem;
    min-height: 320px;
    position: relative;
    box-shadow: inset 0 0 20px color-mix(in srgb, var(--neon-red) 10%, transparent);
    min-width: 0;
    /* Crucial for grid stability */
    display: flex;
    flex-direction: column;
}

.console-screen {
    font-family: var(--font-mono);
    color: var(--neon-red);
    font-size: 0.9rem;
    line-height: 1.6;
    position: relative;
    flex-grow: 1;
    overflow-wrap: anywhere;
    /* Hard wrap any ultra-long strings */
}

.console-header {
    border-bottom: 1px solid color-mix(in srgb, var(--neon-red) 20%, transparent);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.75rem;
    opacity: 0.7;
}

.console-body {
    min-height: 200px;
}

.console-cursor {
    display: inline-block;
    width: 8px;
    height: 15px;
    background: var(--neon-red);
    animation: cursor-blink 1s infinite steps(2);
    vertical-align: middle;
}

@keyframes cursor-blink {
    50% {
        opacity: 0;
    }
}

.query-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.query-item {
    font-family: var(--font-mono);
    color: var(--neon-red-dim);
    padding: 1rem;
    padding-right: 2rem;
    /* Added explicitly to prevent hitting border */
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    /* Keep packet IDs clean */
}

.query-item:hover {
    background: color-mix(in srgb, var(--neon-red) 5%, transparent);
    color: var(--neon-red);
    border-color: color-mix(in srgb, var(--neon-red) 20%, transparent);
}

.query-item.active {
    background: color-mix(in srgb, var(--neon-red) 10%, transparent);
    color: var(--neon-red);
    border-color: var(--neon-red);
    box-shadow: 0 0 10px var(--neon-red-glow);
}

/* Marquee Effect for long queries */
.query-item {
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    display: block;
}

.query-item__content {
    display: inline-block;
    white-space: nowrap;
    transform: translateX(0);
}

.query-item--scroll .query-item__content {
    animation: query-marquee 8s ease-in-out infinite;
    padding-right: 2rem;
}

@keyframes query-marquee {

    0%,
    15% {
        transform: translateX(0);
    }

    45%,
    55% {
        transform: translateX(calc(-1 * var(--scroll-distance, 0px)));
    }

    85%,
    100% {
        transform: translateX(0);
    }
}

.faq-contact-grid>div {
    display: flex;
    flex-direction: column;
}

/* Redundant Definition Removed - Merged into line 443 */

#contact {
    display: flex;
    flex-direction: column;
}

.transmission-details-minimal {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 1.5rem;
}

.transmission-details-minimal iframe {
    flex-grow: 1;
    min-height: 350px;
    border: 1px solid color-mix(in srgb, var(--neon-red) 10%, transparent);
}

/* CRT Scanline Effect for Console */
.intel-console::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
        linear-gradient(90deg, color-mix(in srgb, var(--neon-red) 6%, transparent), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 2;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

/* Responsiveness & Grids Refined */
@media (max-width: 1200px) {
    .section-content {
        margin-left: 5vw !important;
        margin-right: 5vw !important;
    }
}

@media (max-width: 992px) {
    .modules-grid-new {
        grid-template-columns: repeat(2, 1fr);
    }

    .faq-contact-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    .scroll-section {
        padding: 4rem 5% !important;
        min-height: auto;
    }

    .section-title {
        font-size: 3rem !important;
    }

    .huge-header {
        font-size: 10rem;
        opacity: 0.05;
    }

    .hero-logo-container img {
        width: 12rem;
    }

    .hq-hero__title {
        font-size: 2.5rem !important;
    }

    .intel-terminal-wrapper {
        grid-template-columns: 1fr;
        /* Stack on mobile */
        height: auto;
        padding: 1.5rem;
    }

    .intel-console {
        flex: none;
        height: 300px;
    }

    .query-list {
        flex: none;
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .query-item {
        padding: 0.8rem;
        font-size: 0.8rem;
        border-bottom: 1px solid var(--neon-red-dim);
    }
}

@media (max-width: 1280px) {
    .hq-video-section {
        display: none !important;
    }

    .huge-header {
        font-size: 6rem;
        position: relative;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        margin-bottom: 2rem;
        opacity: 0.2;
    }

    .scroll-section {
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        text-align: center !important;
        padding: 4rem 1.5rem !important;
    }

    .section-content {
        margin: 0 !important;
        width: 100% !important;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .data-stream {
        display: none;
    }

    .hq-hero__title {
        white-space: normal !important;
        font-size: 2rem !important;
    }

    .side-image-container {
        display: none !important;
    }

    .rank-carousel {
        justify-content: flex-start !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        padding: 2rem 10vw !important;
        scroll-padding: 0 10vw;
        scroll-snap-type: x mandatory !important;
        width: 100%;
        max-width: 100vw;
    }

    .rank-node {
        flex: 0 0 80vw !important;
        max-width: 320px;
        scroll-snap-align: center !important;
        margin: 0 1rem !important;
    }

    .query-list {
        grid-template-columns: 1fr;
    }

    .mission-text {
        margin: 0 auto;
    }
}

@media (max-width: 600px) {
    .modules-grid-new {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 2.2rem !important;
    }
}