/* =============================================
   CARTHOGEN - Section Hero (Enhanced)
   ============================================= */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 8rem 2rem 4rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-mesh);
    pointer-events: none;
}

/* Animated gradient mesh */
.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% 40%, rgba(0, 212, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 60%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    pointer-events: none;
    animation: heroMesh 20s ease-in-out infinite alternate;
}

@keyframes heroMesh {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0.7; transform: scale(1.1); }
}

/* Orbes animees - Enhanced */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
    will-change: transform;
}

.orb-1 {
    width: 700px;
    height: 700px;
    background: radial-gradient(circle at center, rgba(0, 212, 255, 0.2) 0%, rgba(0, 212, 255, 0.05) 50%, transparent 70%);
    top: -250px;
    right: -200px;
    animation-delay: 0s;
    animation-duration: 25s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle at center, rgba(139, 92, 246, 0.15) 0%, rgba(139, 92, 246, 0.03) 50%, transparent 70%);
    bottom: -150px;
    left: -100px;
    animation-delay: -10s;
    animation-duration: 22s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle at center, rgba(20, 184, 166, 0.12) 0%, transparent 60%);
    top: 40%;
    left: 30%;
    animation-delay: -5s;
    animation-duration: 18s;
    filter: blur(60px);
}

/* Container Hero */
.hero-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-content {
    max-width: 650px;
}

/* Hero Title - Enhanced */
.hero h1 {
    font-size: clamp(2.75rem, 5.5vw, 4.25rem);
    font-weight: 800;
    line-height: 1.08;
    margin-bottom: 1.75rem;
    letter-spacing: -0.04em;
    animation: fadeInUp 0.8s ease 0.1s forwards;
    opacity: 0;
    background: linear-gradient(180deg, var(--text-primary) 0%, rgba(248, 250, 252, 0.85) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Light mode - better contrast for hero title */
[data-theme="light"] .hero h1,
:root:not([data-theme="dark"]) .hero h1 {
    background: linear-gradient(180deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) .hero h1 {
        background: linear-gradient(180deg, var(--text-primary) 0%, var(--text-secondary) 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    line-height: 1.75;
    animation: fadeInUp 0.8s ease 0.2s forwards;
    opacity: 0;
    max-width: 580px;
}

/* CTA Buttons */
.hero-cta {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 3.5rem;
    animation: fadeInUp 0.8s ease 0.3s forwards;
    opacity: 0;
}

/* Stats - Enhanced */
.hero-stats {
    display: flex;
    gap: 3.5rem;
    animation: fadeInUp 0.8s ease 0.4s forwards;
    opacity: 0;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.stat {
    text-align: left;
    position: relative;
}

.stat::after {
    content: '';
    position: absolute;
    right: -1.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 40px;
    background: linear-gradient(180deg, transparent, var(--border-color-light), transparent);
}

.stat:last-child::after {
    display: none;
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--accent-cyan);
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    line-height: 1.2;
}

.stat-value span {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.375rem;
    font-weight: 500;
}

.stat-source {
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.7;
    margin-top: 0.25rem;
}

/* Visual Hero - Network Diagram */
.hero-visual {
    position: relative;
    height: 550px;
    animation: fadeIn 1s ease 0.5s forwards;
    opacity: 0;
}

/* Glow effect behind diagram */
.hero-visual::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.1) 0%, transparent 60%);
    filter: blur(40px);
    pointer-events: none;
}

.network-diagram {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
}

/* Network SVG */
.network-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 30px rgba(0, 212, 255, 0.15));
}

/* Floating particles effect */
.hero-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent-cyan);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 8s ease-in-out infinite;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { left: 30%; animation-delay: 1.5s; }
.particle:nth-child(3) { left: 50%; animation-delay: 3s; }
.particle:nth-child(4) { left: 70%; animation-delay: 4.5s; }
.particle:nth-child(5) { left: 90%; animation-delay: 6s; }

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100px) scale(1);
        opacity: 0;
    }
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    animation: fadeIn 1s ease 1s forwards;
    opacity: 0;
}

.scroll-indicator span {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.scroll-mouse {
    width: 24px;
    height: 38px;
    border: 2px solid var(--border-color-light);
    border-radius: 12px;
    position: relative;
}

.scroll-mouse::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: var(--accent-cyan);
    border-radius: 2px;
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 1; }
    50% { transform: translateX(-50%) translateY(10px); opacity: 0.3; }
}

/* =============================================
   Light Mode - Network Diagram Fixes
   ============================================= */

/* Light mode - Network diagram node backgrounds should follow page theme */
[data-theme="light"] .network-svg .schema-node rect,
[data-theme="light"] .network-svg .schema-node circle,
[data-theme="light"] .network-svg .schema-label rect {
    fill: var(--bg-card);
}

/* Also fix the HA badge background */
[data-theme="light"] .network-svg rect[fill="#1a1a25"] {
    fill: var(--bg-card);
}

/* Fix VLAN label background */
[data-theme="light"] .network-svg rect[fill="#0d1117"] {
    fill: var(--bg-card);
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) .network-svg .schema-node rect,
    :root:not([data-theme="dark"]) .network-svg .schema-node circle,
    :root:not([data-theme="dark"]) .network-svg .schema-label rect {
        fill: var(--bg-card);
    }

    :root:not([data-theme="dark"]) .network-svg rect[fill="#1a1a25"] {
        fill: var(--bg-card);
    }

    :root:not([data-theme="dark"]) .network-svg rect[fill="#0d1117"] {
        fill: var(--bg-card);
    }
}
