/* ============================================
   CRYSTAL FACILITY SOLUTIONS — HERO SECTION
   ============================================ */

.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: calc(var(--nav-height, 70px) + 2rem) 2rem 5rem;
    overflow: hidden;
    isolation: isolate;
    background: #0a1628;
}

@supports (height: 100dvh) {
    .hero {
        min-height: 100dvh;
    }
}

/* ============================================
   BACKGROUND IMAGE LAYER
   ============================================ */

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.hero-bg img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transition: opacity 0.8s ease-in-out;
    opacity: 0;
}

.hero.loaded .hero-bg img,
.hero-bg img.loaded {
    opacity: 1;
}

/* Lighter overlay — shows more of the background image */
.hero-bg-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            180deg,
            rgba(10, 22, 40, 0.25) 0%,
            rgba(10, 22, 40, 0.40) 40%,
            rgba(10, 22, 40, 0.55) 70%,
            rgba(10, 22, 40, 0.75) 100%
        );
    z-index: 1;
}

/* Very subtle vignette */
.hero-bg-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse at center,
        transparent 0%,
        transparent 60%,
        rgba(10, 22, 40, 0.25) 100%
    );
    z-index: 2;
    pointer-events: none;
}

/* ============================================
   HERO CONTENT — MUST BE ABOVE BACKGROUND
   ============================================ */

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    pointer-events: auto;
}

/* ============================================
   BADGE
   ============================================ */

.hero-badge-wrapper {
    perspective: 1000px;
    animation: badgeFloat 3s ease-in-out infinite;
}

@keyframes badgeFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: rgba(124, 179, 66, 0.15);
    border: 1px solid rgba(124, 179, 66, 0.4);
    border-radius: 50px;
    color: var(--cfs-green, #7cb342);
    font-weight: 600;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 30px rgba(124, 179, 66, 0.1);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 30px rgba(124, 179, 66, 0.1); }
    50% { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 50px rgba(124, 179, 66, 0.3); }
}

.badge i {
    color: var(--cfs-green, #7cb342);
    animation: starSpin 3s ease-in-out infinite;
}

@keyframes starSpin {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.2); }
}

.badge-pulse {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 2px solid var(--cfs-green, #7cb342);
    animation: badgeRing 2s ease-out infinite;
}

@keyframes badgeRing {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.3); opacity: 0; }
}

/* ============================================
   HERO TITLE
   ============================================ */

.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 800;
    line-height: 1;
    color: #ffffff;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.title-line {
    display: block;
    overflow: hidden;
    position: relative;
}

.title-line-1 .char-wrap {
    display: inline-block;
    animation: titleReveal 1s cubic-bezier(0.77, 0, 0.175, 1) both;
    animation-delay: 0.3s;
    color: #ffffff;
}

.title-line-2 .char-wrap {
    display: inline-block;
    animation: titleReveal 1s cubic-bezier(0.77, 0, 0.175, 1) both;
    animation-delay: 0.5s;
    color: var(--cfs-green, #7cb342);
}

@keyframes titleReveal {
    from {
        opacity: 0;
        transform: translateY(100%) rotateX(-90deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}

/* ============================================
   TYPING ANIMATION
   ============================================ */

.title-line-3 {
    font-size: clamp(1rem, 2.8vw, 1.35rem);
    font-weight: 700;
    color: #7dd3fc;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-top: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    z-index: 10;
    min-height: 1.5em;
}

.typing-text {
    display: inline;
    min-height: 1.2em;
    color: #7dd3fc;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.typing-cursor {
    display: inline-block;
    width: 3px;
    height: 1.3em;
    background: #7dd3fc;
    animation: cursorBlink 1s step-end infinite;
    box-shadow: 0 0 15px #7dd3fc, 0 0 30px rgba(125, 211, 252, 0.3);
    margin-left: 4px;
    flex-shrink: 0;
}

.typing-fallback {
    color: #7dd3fc;
    font-weight: 700;
    letter-spacing: 0.12em;
    font-size: inherit;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ============================================
   HERO DESCRIPTION
   ============================================ */

.hero-description {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
    font-size: clamp(1.05rem, 1.9vw, 1.25rem);
    max-width: 850px;
    line-height: 1.6;
    margin: 0 auto;
    text-align: center;
}

.desc-line {
    display: block;
    opacity: 0;
    animation: fadeSlideUp 0.8s ease-out both;
    animation-delay: 1s;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* ============================================
   HERO BUTTONS
   ============================================ */

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
    opacity: 0;
    animation: fadeSlideUp 0.8s ease-out 1.4s both;
}

.btn-hero-primary,
.btn-hero-secondary {
    position: relative;
    padding: 1.1rem 2.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    border: none;
    font-family: inherit;
}

.btn-hero-primary {
    background: linear-gradient(135deg, var(--cfs-green, #7cb342), var(--cfs-dark-green, #558b2f));
    color: #ffffff;
    box-shadow: 0 10px 40px rgba(124, 179, 66, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.btn-hero-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 20px 60px rgba(124, 179, 66, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

.btn-hero-primary:active {
    transform: translateY(-1px) scale(0.98);
}

.btn-hero-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    backdrop-filter: blur(10px);
}

.btn-hero-secondary:hover {
    background: rgba(124, 179, 66, 0.15);
    border-color: rgba(124, 179, 66, 0.5);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(124, 179, 66, 0.2);
}

.btn-hero-secondary:active {
    transform: translateY(-1px);
}

/* ============================================
   TRUST INDICATORS
   ============================================ */

.trust-indicators {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    opacity: 0;
    animation: fadeSlideUp 0.8s ease-out 1.6s both;
    flex-wrap: wrap;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #ffffff;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.trust-item:hover {
    background: rgba(124, 179, 66, 0.12);
    border-color: rgba(124, 179, 66, 0.3);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(124, 179, 66, 0.15);
}

.trust-icon {
    width: 48px;
    height: 48px;
    background: rgba(124, 179, 66, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cfs-green, #7cb342);
    font-size: 1.25rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.trust-item:hover .trust-icon {
    background: var(--cfs-green, #7cb342);
    color: #ffffff;
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 0 20px rgba(124, 179, 66, 0.4);
}

.trust-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 0.25rem;
}

.trust-text strong {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
}

.trust-text span {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.trust-divider {
    width: 1px;
    height: 50px;
    background: rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

/* ============================================
   SCROLL INDICATOR
   ============================================ */

.hero-scroll-indicator {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    animation: fadeSlideUp 0.8s ease-out 2s both;
    cursor: pointer;
    transition: color 0.3s ease;
    pointer-events: auto;
}

.hero-scroll-indicator:hover {
    color: var(--cfs-green, #7cb342);
}

.hero-scroll-indicator .scroll-mouse {
    width: 18px;
    height: 28px;
    border: 1.5px solid currentColor;
    border-radius: 9px;
    position: relative;
    opacity: 0.5;
}

.hero-scroll-indicator .scroll-wheel {
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 6px;
    background: currentColor;
    border-radius: 2px;
    animation: scrollWheel 1.5s ease-in-out infinite;
}

@keyframes scrollWheel {
    0% { transform: translateX(-50%) translateY(0); opacity: 1; }
    100% { transform: translateX(-50%) translateY(8px); opacity: 0; }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .hero {
        padding: calc(70px + 1rem) 1.5rem 2rem;
        min-height: auto;
        height: auto;
        min-height: 85vh;
        min-height: 85dvh;
    }

    .hero-bg img {
        object-fit: cover;
        object-position: center 30%;
    }

    .hero-content {
        gap: 0.75rem;
        padding-bottom: 0;
        width: 100%;
    }

    .hero-title {
        gap: 0.2rem;
        font-size: clamp(2rem, 10vw, 3.5rem);
    }

    .title-line-3 {
        font-size: 0.7rem;
        letter-spacing: 0.1em;
        margin-top: 0.5rem;
    }

    .typing-cursor {
        height: 0.9em;
    }

    .hero-description {
        font-size: 0.9rem;
        line-height: 1.5;
        max-width: 100%;
        padding: 0 0.5rem;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 260px;
        gap: 0.6rem;
        margin-top: 0.5rem;
    }

    .btn-hero-primary,
    .btn-hero-secondary {
        width: 100%;
        justify-content: center;
        padding: 0.8rem 1.25rem;
        font-size: 0.85rem;
    }

    .badge {
        font-size: 0.75rem;
        padding: 0.5rem 1rem;
    }

    .trust-indicators {
        gap: 0.6rem;
        flex-direction: column;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
    }

    .trust-divider {
        display: none;
    }

    .trust-item {
        width: 100%;
        max-width: 100%;
        padding: 0.6rem 0.875rem;
    }

    .trust-text strong {
        font-size: 0.8rem;
    }

    .trust-text span {
        font-size: 0.7rem;
    }

    .trust-icon {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .hero-scroll-indicator {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero {
        min-height: 80vh;
        min-height: 80dvh;
        padding: calc(70px + 0.5rem) 1rem 1.5rem;
    }

    .hero-title {
        font-size: clamp(1.8rem, 9vw, 2.8rem);
    }

    .title-line-3 {
        font-size: 0.65rem;
        letter-spacing: 0.08em;
    }

    .badge {
        font-size: 0.7rem;
        padding: 0.4rem 0.875rem;
    }

    .hero-description {
        font-size: 0.85rem;
        line-height: 1.45;
    }

    .hero-buttons {
        max-width: 240px;
        gap: 0.5rem;
    }

    .btn-hero-primary,
    .btn-hero-secondary {
        padding: 0.7rem 1rem;
        font-size: 0.8rem;
    }

    .trust-item {
        padding: 0.5rem 0.75rem;
    }

    .trust-icon {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    .trust-text strong {
        font-size: 0.75rem;
    }

    .trust-text span {
        font-size: 0.65rem;
    }

    .hero-scroll-indicator {
        display: none;
    }

    .hero-bg img {
        object-fit: cover;
        object-position: center 20%;
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .badge,
    .typing-cursor,
    .hero-scroll-indicator .scroll-wheel {
        animation: none;
    }

    .char-wrap,
    .desc-line,
    .hero-buttons,
    .trust-indicators,
    .hero-scroll-indicator {
        animation: fadeIn 0.3s ease-out both;
    }

    .hero-bg img {
        transition: none;
    }
}