/* Hero epic landing component */
.hero-epic {
    --hero-bg-top: #0d1b2a;
    --hero-bg-bottom: #02070f;
    --hero-glass: rgba(13, 202, 240, 0.12);
    --hero-border: rgba(13, 202, 240, 0.35);
    --hero-highlight: rgba(13, 202, 240, 0.6);
    position: relative;
    display: flex;
    align-items: center;
    min-height: min(100vh, 920px);
    padding-block-start: calc(var(--header-offset, 7.5rem) + clamp(2rem, 8vw, 4rem));
    padding-block-end: clamp(3rem, 9vw, 6rem);
    padding-inline: clamp(1.5rem, 6vw, 4rem);
    color: var(--text-white);
    background: radial-gradient(ellipse at bottom, var(--hero-bg-top) 0%, var(--hero-bg-bottom) 100%);
    overflow: hidden;
    isolation: isolate;
    box-shadow: inset 0 40px 120px rgba(0, 0, 0, 0.55);
}

.hero-ocean-scene {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: -1;
}

.ocean-layer {
    position: absolute;
    inset: 0;
    width: 200%;
    opacity: 0.28;
    transform: translateX(-35%);
    animation: ocean-drift var(--ocean-duration, 24s) ease-in-out infinite;
}

.layer-1 {
    --ocean-duration: 22s;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(13, 110, 253, 0.12) 35%,
        rgba(13, 202, 240, 0.18) 65%,
        transparent 100%
    );
}

.layer-2 {
    --ocean-duration: 26s;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(32, 201, 151, 0.18) 40%,
        rgba(13, 202, 240, 0.14) 70%,
        transparent 100%
    );
    animation-direction: reverse;
    animation-delay: -6s;
    opacity: 0.24;
}

.layer-3 {
    --ocean-duration: 30s;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(111, 66, 193, 0.12) 50%,
        rgba(72, 187, 120, 0.12) 80%,
        transparent 100%
    );
    animation-delay: -10s;
    opacity: 0.2;
}

.particle-field {
    position: absolute;
    inset: 0;
}

.plankton {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(13, 202, 240, 0.85) 0%, transparent 65%);
    box-shadow: 0 0 12px rgba(13, 202, 240, 0.5);
    animation: particle-rise var(--particle-duration, 18s) ease-in-out infinite;
    animation-delay: var(--particle-delay, 0s);
}

.plankton:nth-child(6n + 1) {
    left: 6%;
    top: 72%;
    --particle-duration: 18s;
    --particle-delay: 0s;
}

.plankton:nth-child(6n + 2) {
    left: 18%;
    top: 48%;
    --particle-duration: 15s;
    --particle-delay: 2s;
}

.plankton:nth-child(6n + 3) {
    left: 32%;
    top: 86%;
    --particle-duration: 20s;
    --particle-delay: 4s;
}

.plankton:nth-child(6n + 4) {
    left: 50%;
    top: 60%;
    --particle-duration: 16s;
    --particle-delay: 6s;
}

.plankton:nth-child(6n + 5) {
    left: 68%;
    top: 42%;
    --particle-duration: 19s;
    --particle-delay: 8s;
}

.plankton:nth-child(6n) {
    left: 86%;
    top: 26%;
    --particle-duration: 17s;
    --particle-delay: 10s;
}

.hero-epic-container {
    position: relative;
    z-index: 1;
    width: min(100%, var(--container-width-xl));
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: clamp(3rem, 6vw, 5rem);
    align-items: center;
}

.hero-epic-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
}

.hero-epic-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.6rem;
    background: var(--hero-glass);
    border: 1px solid var(--hero-border);
    border-radius: var(--border-radius-full);
    color: var(--info-light);
    font-size: 0.9rem;
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    backdrop-filter: blur(18px);
    box-shadow: 0 20px 40px rgba(13, 202, 240, 0.18);
}

.badge-glow {
    display: none;
}

.hero-epic-badge i {
    font-size: 1.1rem;
    color: var(--info-light);
}

.hero-epic-title {
    font-size: clamp(3rem, 7vw, 4.5rem);
    font-weight: var(--font-extrabold);
    line-height: 1.05;
    letter-spacing: -0.04em;
    margin-bottom: var(--space-4);
}

.title-line {
    display: block;
}

.hero-epic-title .word {
    display: inline-block;
    color: var(--text-white);
    animation: word-float 6s ease-in-out infinite;
    animation-delay: calc(var(--word-index, 0) * 0.2s);
}

.word-1 {
    --word-index: 0;
}

.word-2 {
    --word-index: 1;
}

.word-3 {
    --word-index: 2;
}

.word-4 {
    --word-index: 3;
}

.gradient-shimmer {
    color: var(--info-light);
    text-shadow: 0 0 18px rgba(13, 202, 240, 0.45);
}

.subtitle-line {
    font-size: clamp(1.75rem, 4.5vw, 2.5rem);
    font-weight: var(--font-semibold);
    color: rgba(255, 255, 255, 0.82);
}

.hero-epic-description {
    max-width: 40rem;
    font-size: 1.2rem;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.75);
}

.highlight-text {
    color: var(--info-light);
    font-weight: var(--font-semibold);
}

.hero-epic-stats {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-5);
}

.stat-card {
    position: relative;
    flex: 1 1 180px;
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: 1.5rem;
    background: rgba(8, 28, 45, 0.72);
    border: 1px solid var(--hero-border);
    border-radius: 18px;
    backdrop-filter: blur(18px);
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.45);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(13, 202, 240, 0.55);
    box-shadow: 0 22px 60px rgba(13, 202, 240, 0.28);
}

.stat-glow {
    position: absolute;
    inset: -30%;
    background: radial-gradient(circle, rgba(13, 202, 240, 0.35) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.stat-card:hover .stat-glow {
    opacity: 1;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #0dcaf0, #20c997);
    color: #02111f;
    font-size: 1.4rem;
    box-shadow: 0 12px 30px rgba(13, 202, 240, 0.35);
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-value {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: var(--font-extrabold);
    letter-spacing: -0.02em;
    color: var(--text-white);
}

.stat-label {
    font-size: 0.85rem;
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.62);
}

.hero-epic-features {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.feature-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.4rem;
    border-radius: 999px;
    background: rgba(13, 202, 240, 0.12);
    border: 1px solid var(--hero-border);
    color: var(--text-white);
    font-size: 0.95rem;
    font-weight: var(--font-semibold);
    letter-spacing: 0.04em;
    backdrop-filter: blur(12px);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.feature-badge:hover {
    transform: translateY(-2px);
    border-color: rgba(13, 202, 240, 0.6);
    box-shadow: 0 14px 32px rgba(13, 202, 240, 0.22);
}

.feature-badge i {
    color: var(--info-light);
    font-size: 1.1rem;
}

.hero-epic-cta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.btn-epic {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1.1rem 2.4rem;
    font-size: 1.05rem;
    font-weight: var(--font-semibold);
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 0;
}

.btn-background {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    transition: transform 0.3s ease;
    z-index: 0;
}

.btn-content {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-text {
    white-space: nowrap;
}

.btn-glow {
    position: absolute;
    inset: -30%;
    border-radius: inherit;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.35) 0%, transparent 70%);
    transform: scale(0);
    opacity: 0;
    transition: transform 0.45s ease, opacity 0.45s ease;
    pointer-events: none;
    z-index: 1;
}

.btn-epic-primary {
    color: #03121d;
    box-shadow: 0 20px 45px rgba(13, 202, 240, 0.32);
}

.btn-epic-primary .btn-background {
    background: linear-gradient(135deg, #0dcaf0, #20c997);
}

.btn-epic-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 28px 60px rgba(13, 202, 240, 0.4);
}

.btn-epic-primary:hover .btn-background {
    transform: scale(1.06);
}

.btn-epic-primary:hover .btn-glow {
    transform: scale(1);
    opacity: 0.85;
}

.arrow-icon {
    transition: transform 0.3s ease;
}

.btn-epic-primary:hover .arrow-icon {
    transform: translateX(6px);
}

.btn-epic-ghost {
    border: 1px solid var(--hero-border);
    color: var(--text-white);
    backdrop-filter: blur(15px);
}

.btn-epic-ghost .btn-background {
    background: rgba(13, 202, 240, 0.1);
}

.btn-epic-ghost:hover {
    transform: translateY(-2px);
    border-color: rgba(13, 202, 240, 0.6);
    box-shadow: 0 18px 42px rgba(13, 202, 240, 0.28);
}

.btn-epic-ghost:hover .btn-background {
    transform: scale(1.05);
}

.hero-epic-showcase {
    position: relative;
    min-height: 540px;
    display: grid;
    place-items: center;
}

.showcase-main {
    position: relative;
    width: min(100%, 340px);
    padding: clamp(2.5rem, 4vw, 3rem);
    border-radius: 28px;
    background: rgba(6, 20, 35, 0.78);
    border: 1px solid var(--hero-border);
    backdrop-filter: blur(20px);
    box-shadow: 0 36px 90px rgba(0, 0, 0, 0.56);
    animation: float-loop 8s ease-in-out infinite;
    overflow: hidden;
}

.showcase-border-animation {
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(130deg, rgba(13, 202, 240, 0.5), rgba(32, 201, 151, 0.5), rgba(13, 202, 240, 0.5));
    background-size: 200% 200%;
    animation: gradient-shift 9s ease infinite;
    opacity: 0.8;
    pointer-events: none;
}

.showcase-content {
    position: relative;
    z-index: 1;
    display: grid;
    gap: var(--space-4);
    text-align: center;
}

.showcase-icon-large {
    position: relative;
    width: 110px;
    height: 110px;
    margin: 0 auto;
    border-radius: 24px;
    background: linear-gradient(135deg, #0dcaf0, #20c997);
    display: grid;
    place-items: center;
    color: #02111f;
    box-shadow: 0 18px 60px rgba(13, 202, 240, 0.45);
    overflow: hidden;
}

.showcase-logo {
    width: 76%;
    height: 76%;
    object-fit: contain;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.35));
}

.icon-pulse {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: pulse-ring 3.2s ease-out infinite;
    pointer-events: none;
}

.showcase-title {
    font-size: clamp(1.75rem, 4vw, 2.1rem);
    font-weight: var(--font-extrabold);
    color: var(--text-white);
    letter-spacing: -0.02em;
}

.showcase-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
}

.showcase-detail {
    display: grid;
    gap: 0.75rem;
}

.detail-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 14px;
    background: rgba(13, 202, 240, 0.14);
    color: var(--text-white);
    font-weight: var(--font-semibold);
}

.detail-item i {
    color: #20c997;
}

.showcase-orbit {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.orbit-card {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-radius: 18px;
    background: rgba(8, 28, 45, 0.78);
    border: 1px solid var(--hero-border);
    color: var(--text-white);
    font-weight: var(--font-semibold);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
    animation: orbit-sway var(--orbit-duration, 10s) ease-in-out infinite;
}

.orbit-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0dcaf0, #20c997);
    display: grid;
    place-items: center;
    color: #02111f;
    font-size: 1.25rem;
    box-shadow: 0 10px 30px rgba(13, 202, 240, 0.35);
}

.orbit-1 {
    top: -28px;
    left: -18px;
    --orbit-duration: 9s;
}

.orbit-2 {
    top: 36%;
    right: -52px;
    --orbit-duration: 11s;
}

.orbit-3 {
    bottom: -24px;
    left: 18%;
    --orbit-duration: 10s;
}

.hero-epic-scroll {
    position: absolute;
    bottom: clamp(2rem, 5vw, 3.5rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

.scroll-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    animation: scroll-bounce 3s ease-in-out infinite;
}

.scroll-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(13, 202, 240, 0.12);
    border: 1px solid var(--hero-border);
    color: var(--info-light);
    backdrop-filter: blur(16px);
    box-shadow: 0 16px 40px rgba(13, 202, 240, 0.28);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.scroll-circle:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 50px rgba(13, 202, 240, 0.32);
}

.scroll-circle i {
    animation: arrow-bob 1.6s ease-in-out infinite;
}

.scroll-text {
    font-size: 0.85rem;
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.65);
}

@keyframes ocean-drift {
    0%,
    100% {
        transform: translateX(-35%);
    }
    50% {
        transform: translateX(-12%);
    }
}

@keyframes particle-rise {
    0% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 0.85;
    }
    90% {
        opacity: 0.75;
    }
    100% {
        transform: translateY(-110vh) translateX(40px) scale(1.4);
        opacity: 0;
    }
}

@keyframes word-float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

@keyframes float-loop {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-18px);
    }
}

@keyframes gradient-shift {
    0%,
    100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 0.75;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

@keyframes orbit-sway {
    0%,
    100% {
        transform: translate3d(0, 0, 0);
    }
    50% {
        transform: translate3d(18px, -16px, 0);
    }
}

@keyframes scroll-bounce {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(12px);
    }
}

@keyframes arrow-bob {
    0%,
    100% {
        transform: translateY(-3px);
    }
    50% {
        transform: translateY(3px);
    }
}

@media (max-width: 1200px) {
    .hero-epic {
        min-height: auto;
    }

    .hero-epic-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: clamp(3rem, 8vw, 4.5rem);
    }

    .hero-epic-content {
        align-items: center;
    }

    .hero-epic-title {
        text-align: center;
    }

    .hero-epic-stats {
        justify-content: center;
    }

    .hero-epic-features {
        justify-content: center;
    }

    .hero-epic-cta {
        justify-content: center;
    }

    .hero-epic-showcase {
        display: none;
    }
}

@media (max-width: 992px) {
    .hero-epic {
        padding-inline: clamp(1rem, 6vw, 2rem);
        padding-block-start: calc(var(--header-offset, 7.5rem) + 3rem);
    }

    .hero-epic-title {
        font-size: clamp(2.6rem, 8vw, 3.4rem);
    }

    .subtitle-line {
        font-size: clamp(1.6rem, 5vw, 2.1rem);
    }

    .hero-epic-description {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .hero-epic-cta {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-epic {
        width: 100%;
        justify-content: center;
    }

    .hero-epic-features {
        gap: var(--space-3);
    }

    .feature-badge {
        width: 100%;
        justify-content: center;
    }

    .hero-epic-stats {
        flex-direction: column;
    }

    .stat-card {
        width: 100%;
    }
}

@media (max-width: 540px) {
    .hero-epic {
        padding-inline: var(--space-3);
        padding-block-start: calc(var(--header-offset, 7.5rem) + 2.5rem);
        padding-block-end: var(--space-8);
    }

    .hero-epic-badge {
        font-size: 0.8rem;
        padding: 0.6rem 1.1rem;
    }

    .hero-epic-title {
        font-size: clamp(2.2rem, 9vw, 2.6rem);
    }

    .subtitle-line {
        font-size: clamp(1.3rem, 6vw, 1.6rem);
    }

    .hero-epic-description {
        font-size: 1rem;
    }

    .stat-value {
        font-size: 1.6rem;
    }

    .scroll-circle {
        width: 48px;
        height: 48px;
    }
}

/* ==========================================
   MOBILE ANIMATION OPTIMIZATION
   Slow down fast animations on mobile devices
========================================== */

@media (max-width: 768px) {
    /* Slow down ocean drift animations */
    .ocean-layer {
        animation-duration: 45s !important; /* Slower from 24s */
    }
    
    .layer-1 {
        --ocean-duration: 40s; /* Slower from 22s */
    }
    
    .layer-2 {
        --ocean-duration: 48s; /* Slower from 26s */
    }
    
    .layer-3 {
        --ocean-duration: 55s; /* Slower from 30s */
    }
    
    /* Slow down particle animations */
    .plankton {
        animation-duration: 35s !important; /* Slower from 18s */
    }
    
    .plankton:nth-child(6n + 1) {
        --particle-duration: 35s;
    }
    
    .plankton:nth-child(6n + 2) {
        --particle-duration: 38s;
    }
    
    .plankton:nth-child(6n + 3) {
        --particle-duration: 42s;
    }
    
    .plankton:nth-child(6n + 4) {
        --particle-duration: 40s;
    }
    
    .plankton:nth-child(6n + 5) {
        --particle-duration: 36s;
    }
    
    .plankton:nth-child(6n) {
        --particle-duration: 44s;
    }
    
    /* Reduce particle opacity for less visual noise */
    .plankton {
        opacity: 0.6;
    }
    
    /* Slow down word float animations - MUCH SLOWER */
    .hero-epic-title .word {
        animation-duration: 10s !important; /* Much slower from 6s */
        animation-timing-function: ease-in-out;
    }
    
    /* Slow down gradient shift */
    .hero-epic-badge,
    .btn-epic-primary,
    .stat-card {
        animation-duration: 8s !important; /* Slower from 6s */
    }
}

@media (max-width: 480px) {
    /* Even slower on small mobile devices */
    .ocean-layer {
        animation-duration: 60s !important;
        opacity: 0.15; /* Reduce opacity further */
    }
    
    .layer-1 {
        --ocean-duration: 55s;
    }
    
    .layer-2 {
        --ocean-duration: 65s;
    }
    
    .layer-3 {
        --ocean-duration: 70s;
    }
    
    /* Much slower particles */
    .plankton {
        animation-duration: 50s !important;
        opacity: 0.4; /* Less visible */
    }
    
    /* EXTRA SLOW text animation on small screens */
    .hero-epic-title .word {
        animation-duration: 15s !important; /* Very slow */
        animation-delay: calc(var(--word-index, 0) * 0.4s) !important; /* Slower stagger */
    }
    
    /* Hide some particles to reduce processing */
    .plankton:nth-child(n+13) {
        display: none;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .ocean-layer,
    .plankton,
    .word-float,
    .hero-epic-badge,
    .btn-epic-primary,
    .stat-card {
        animation: none !important;
    }
    
    .hero-ocean-scene {
        opacity: 0.3;
    }
}
