:root {
    --bg-color: #030308;
    --primary: #00E5FF;
    --secondary: #B400FB;
    --text-main: #F4F4F5;
    --text-muted: #A1A1AA;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    overflow-x: hidden;
    line-height: 1.6;
}

.scroll-glitch-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 229, 255, 0.03) 0px,
        rgba(0, 229, 255, 0.03) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.2s;
}

.scroll-glitch-overlay.active {
    opacity: 1;
    animation: glitch-flicker 0.1s infinite;
}

@keyframes glitch-flicker {
    0% { transform: translateX(0); }
    25% { transform: translateX(2px); opacity: 0.8; }
    50% { transform: translateX(-2px); opacity: 1; }
    75% { transform: translateX(1px); opacity: 0.9; }
    100% { transform: translateX(0); }
}

h1, h2, h3, .logo {
    font-family: 'Space Grotesk', sans-serif;
}

/* Typography */
.highlight {
    color: var(--primary);
    text-shadow: 0 0 20px rgba(0, 229, 255, 0.4);
}
.highlight-purple {
    color: var(--secondary);
    text-shadow: 0 0 20px rgba(180, 0, 251, 0.4);
}

/* Glassmorphism utility */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 120px 0;
    position: relative;
    z-index: 2;
    background-color: var(--bg-color); /* Ensure opaque background between sections */
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 48px;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(3, 3, 8, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 32px;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary);
}

/* Glitch Effect */
.glitch {
    position: relative;
    text-shadow: 0.05em 0 0 rgba(255, 0, 0, 0.75),
                -0.025em -0.05em 0 rgba(0, 255, 0, 0.75),
                0.025em 0.05em 0 rgba(0, 0, 255, 0.75);
    animation: glitch 500ms infinite;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitch 650ms infinite;
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
    transform: translate(-0.025em, -0.0125em);
    opacity: 0.8;
}

.glitch::after {
    animation: glitch 375ms infinite;
    clip-path: polygon(0 80%, 100% 20%, 100% 100%, 0 100%);
    transform: translate(0.0125em, 0.025em);
    opacity: 0.8;
}

@keyframes glitch {
    0% { text-shadow: 0.05em 0 0 rgba(255, 0, 0, 0.75), -0.05em -0.025em 0 rgba(0, 255, 0, 0.75), -0.025em 0.05em 0 rgba(0, 0, 255, 0.75); }
    15% { text-shadow: -0.05em -0.025em 0 rgba(255, 0, 0, 0.75), 0.025em 0.025em 0 rgba(0, 255, 0, 0.75), -0.05em -0.05em 0 rgba(0, 0, 255, 0.75); }
    50% { text-shadow: 0.025em 0.05em 0 rgba(255, 0, 0, 0.75), 0.05em 0 0 rgba(0, 255, 0, 0.75), 0 -0.05em 0 rgba(0, 0, 255, 0.75); }
    100% { text-shadow: -0.025em 0 0 rgba(255, 0, 0, 0.75), -0.025em -0.025em 0 rgba(0, 255, 0, 0.75), -0.025em -0.05em 0 rgba(0, 0, 255, 0.75); }
}

/* Hero Section */
.hero {
    height: 100vh;
    min-height: 700px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 10%;
    position: relative;
    overflow: hidden;
    background-image: url('./hero.jpg');
    background-size: cover;
    background-position: center;
    background-color: var(--bg-color);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 50%, rgba(3, 3, 8, 0.85) 0%, rgba(3, 3, 8, 0.6) 100%);
    z-index: 1;
}

.hero-content {
    max-width: 600px;
    z-index: 10;
    position: relative;
}

.hero h1 {
    font-size: clamp(32px, 5vw, 64px);
    line-height: 1.1;
    margin-bottom: 24px;
}

.hero p {
    font-size: clamp(16px, 2vw, 20px);
    color: var(--text-muted);
    margin-bottom: 40px;
    font-weight: 300;
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--primary);
    box-shadow: 0 0 15px var(--primary);
    opacity: 0.2;
    z-index: 5;
    animation: scanning 10s linear infinite;
    pointer-events: none;
}

@keyframes scanning {
    0% { top: 0; }
    100% { top: 100%; }
}

/* Store Buttons */
.store-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.store-button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    text-decoration: none;
    color: white;
    transition: transform 0.3s, background 0.3s;
}

.store-button:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.1);
}

.store-text {
    display: flex;
    flex-direction: column;
}

.store-text span { font-size: 10px; opacity: 0.8; }
.store-text strong { font-size: 16px; }

/* Features Grid */
.feature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.feature-grid.reversable:nth-child(even) .feature-text { order: 2; }
.feature-grid.reversable:nth-child(even) .feature-image { order: 1; }

.feature-text h2 {
    font-size: clamp(28px, 4vw, 42px);
    margin-bottom: 24px;
}

.feature-text p {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.sci-fi-list { list-style: none; }
.sci-fi-list li { margin-bottom: 16px; display: flex; align-items: flex-start; gap: 12px; }
.sci-fi-list span { color: var(--primary); font-size: 20px; }

.feature-image {
    aspect-ratio: 16/9;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* AI Data Stream */
.data-stream {
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
    font-family: monospace;
    color: #0f0;
}

.stream-item { opacity: 0; animation: typeIn 2s forwards; }
.stream-item:nth-child(2) { animation-delay: 1s; }
.stream-item:nth-child(3) { animation-delay: 2s; color: var(--primary); }

@keyframes typeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mindmap Visual */
.mindmap-visual {
    position: relative;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1;
    margin: 0 auto;
}

.center-node {
    position: absolute;
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 70px; height: 70px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-color); z-index: 10;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.4);
}

.orbit-node {
    position: absolute;
    padding: 6px 12px;
    background: var(--glass-bg);
    border: 1px solid var(--secondary);
    border-radius: 20px;
    font-size: 13px;
    z-index: 10;
    animation: driftNode 4s ease-in-out infinite alternate;
}

.n1 { top: 10%; left: 50%; }
.n2 { top: 30%; right: 5%; }
.n3 { bottom: 15%; right: 15%; }
.n4 { bottom: 15%; left: 15%; }
.n5 { top: 30%; left: 5%; }

@keyframes driftNode {
    from { transform: translateY(0); }
    to { transform: translateY(-10px); }
}

.connection-lines { position: absolute; inset: 0; z-index: 1; }

/* Particles */
.particles {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
}

/* Mobile Responsiveness & Organization */
@media (max-width: 1024px) {
    .container { padding: 0 40px; }
    .hero { padding: 0 5%; }
}

@media (max-width: 768px) {
    .navbar { padding: 15px 24px; }
    .nav-links { display: none; }
    .logo { font-size: 18px; letter-spacing: 2px; }

    .hero {
        padding: 120px 24px 60px;
        justify-content: center;
        text-align: center;
        background-attachment: scroll;
        height: auto;
        min-height: 100vh;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero h1 {
        font-size: 34px;
        margin-bottom: 20px;
    }

    .hero p {
        font-size: 16px;
        margin-bottom: 30px;
    }

    .store-buttons {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .store-button {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }

    .section {
        padding: 80px 0;
    }

    .feature-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .feature-grid.reversable:nth-child(even) .feature-text { order: 1; }
    .feature-grid.reversable:nth-child(even) .feature-image { order: 2; }

    .feature-text h2 {
        font-size: 28px;
    }

    .feature-text p {
        font-size: 16px;
    }

    .sci-fi-list li {
        text-align: left;
        font-size: 14px;
    }

    .feature-image {
        aspect-ratio: 1;
        max-width: 100%;
    }

    .mindmap-visual {
        transform: scale(0.9);
    }

    /* Subpages optimization */
    .policy-container, .terms-container, .contact-container {
        margin-top: 100px;
        padding: 40px 20px;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 28px; }
    .section { padding: 60px 0; }
    .feature-text h2 { font-size: 24px; }
    .mindmap-visual { transform: scale(0.8); }
    .center-node { width: 70px; height: 70px; font-size: 12px; }
    .orbit-node { padding: 6px 12px; font-size: 11px; }
}

/* Feature Image Containers */
.feature-image {
    aspect-ratio: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
}

/* 1. Swipe Era: Defragmentation / Scanner Effect */
.ui-mockup-cross {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(255, 51, 102, 0.05) 0%, transparent 70%);
    position: relative;
    overflow: hidden;
}

.swiping-cards-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ghost-card {
    position: absolute;
    width: 140px;
    height: 200px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    padding: 10px;
    opacity: 0;
}

.ghost-card::before { /* Placeholder image */
    content: '';
    width: 100%;
    height: 70%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 8px;
}

.ghost-card::after { /* Placeholder text */
    content: '';
    width: 60%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.card-left {
    animation: realSwipeLeft 3s infinite cubic-bezier(0.2, 0, 0.2, 1);
}

.card-right {
    animation: realSwipeRight 3s infinite cubic-bezier(0.2, 0, 0.2, 1) 1.5s;
}

@keyframes realSwipeLeft {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
    10% { opacity: 0.8; }
    40% { transform: translate(-300px, -50px) rotate(-20deg); opacity: 0; }
    100% { transform: translate(-300px, -50px) rotate(-20deg); opacity: 0; }
}

@keyframes realSwipeRight {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
    10% { opacity: 0.8; }
    40% { transform: translate(300px, -50px) rotate(20deg); opacity: 0; }
    100% { transform: translate(300px, -50px) rotate(20deg); opacity: 0; }
}

.cross-icon {
    font-size: 100px;
    color: #ff3366;
    text-shadow: 0 0 20px rgba(255, 51, 102, 0.5);
    margin-bottom: 20px;
    position: relative;
    animation: pulseIcon 2s ease-in-out infinite;
}

@keyframes pulseIcon {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
}

.scanner-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: #ff3366;
    box-shadow: 0 0 15px #ff3366;
    animation: scanVertical 3s ease-in-out infinite;
}

@keyframes scanVertical {
    0% { top: 0%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* 2. AI Connection: Binary Intelligence Showcase */
#binary-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

.network-bg {
    background: radial-gradient(circle at center, rgba(180,0,251,0.05) 0%, transparent 80%);
}

.data-packet {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
    filter: blur(1px);
    box-shadow: 0 0 10px var(--primary);
    pointer-events: none;
}

/* 3. Mind Map: Neural Brain Sync */
#neural-brain-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.mindmap-visual {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(0, 229, 255, 0.05) 0%, transparent 70%);
}

.center-node {
    position: absolute;
    width: 90px;
    height: 90px;
    background: #000;
    border: 3px solid var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 2px;
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.4);
    z-index: 10;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    animation: corePulse 4s ease-in-out infinite;
}

@keyframes corePulse {
    0%, 100% { box-shadow: 0 0 30px rgba(0, 229, 255, 0.4); border-color: var(--primary); }
    50% { box-shadow: 0 0 60px rgba(180, 0, 251, 0.5); border-color: var(--secondary); }
}

.orbit-node {
    position: absolute;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid var(--secondary);
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    text-shadow: 0 0 10px var(--secondary);
    backdrop-filter: blur(5px);
}

.orbit-node:hover {
    background: var(--secondary);
    box-shadow: 0 0 30px var(--secondary);
    transform: scale(1.1);
}

.n1 { top: 10%; left: 50%; transform: translateX(-50%); }
.n2 { top: 30%; right: 5%; }
.n3 { bottom: 20%; right: 15%; }
.n4 { bottom: 20%; left: 15%; }
.n5 { top: 30%; left: 5%; }

footer {
    padding: 60px 0;
    text-align: center;
    border-top: 1px solid var(--glass-border);
}

.footer-links { margin: 20px 0; display: flex; justify-content: center; gap: 20px; }
.footer-links a { color: var(--text-muted); text-decoration: none; font-size: 14px; }

/* ── Sci-Fi Scroll Transitions ── */

/* Hidden state: sections start invisible but keep their layout size */
.section.sf-enter {
    opacity: 0;
    transform: translateY(40px);
    filter: blur(6px) brightness(1.6);
    transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.9s cubic-bezier(0.22, 1, 0.36, 1),
                filter 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Visible state */
.section.sf-enter.sf-show {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0) brightness(1);
}

/* Children stagger */
.sf-child {
    opacity: 0;
    transform: translateY(30px);
    filter: blur(4px);
    transition: opacity 0.7s ease, transform 0.7s ease, filter 0.7s ease;
}

.sf-child.sf-show {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

.sf-child:nth-child(1) { transition-delay: 0.15s; }
.sf-child:nth-child(2) { transition-delay: 0.3s; }

/* Scanline sweep that plays once when a section becomes visible */
.section.sf-enter::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(0, 229, 255, 0.12) 48%,
        rgba(0, 229, 255, 0.25) 50%,
        rgba(0, 229, 255, 0.12) 52%,
        transparent 100%
    );
    background-size: 100% 120px;
    background-repeat: no-repeat;
    background-position: 0 -120px;
    pointer-events: none;
    z-index: 50;
    opacity: 0;
}

.section.sf-enter.sf-show::after {
    animation: scanSweep 0.8s 0.1s ease-out forwards;
}

@keyframes scanSweep {
    0%   { background-position: 0 -120px; opacity: 1; }
    100% { background-position: 0 calc(100% + 120px); opacity: 0; }
}

/* ── Neural Sync Visualization ── */
.matching-visualization {
    position: relative;
    width: 100%;
    height: 500px;
    background: radial-gradient(ellipse at 50% 50%, rgba(0, 229, 255, 0.03) 0%, transparent 60%);
    border-radius: 16px;
    border: 1px solid rgba(0, 229, 255, 0.08);
    overflow: hidden;
    cursor: crosshair;
}

#sync-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.label-left, .label-right {
    position: absolute;
    bottom: 18px;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 4px;
    text-transform: uppercase;
    z-index: 10;
    pointer-events: none;
}
.label-left { left: 12%; color: var(--primary); }
.label-right { right: 12%; color: var(--secondary); }

.node-tooltip {
    position: absolute;
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid var(--primary);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-family: 'Space Grotesk', sans-serif;
    pointer-events: none;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.2s;
    white-space: nowrap;
}
.node-tooltip.visible { opacity: 1; }

@media (max-width: 768px) {
    .matching-visualization { height: 350px; }
    .label-left, .label-right { font-size: 11px; letter-spacing: 2px; bottom: 12px; }
    .label-left { left: 5%; }
    .label-right { right: 5%; }
}

@media (max-width: 480px) {
    .matching-visualization { height: 280px; }
}
