/* Hero Section */
#hero {
    position: relative;
    background-color: #ffffff;
    background-image: none !important;
    min-height: 100vh;
    display: flex;
    align-items: center;
    color: var(--color-text);
    /* Dark text */
    /* Ensure text is readable */
    overflow: hidden;
    /* Ensure particles don't scrollbar */
}

#hero-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    /* Let clicks pass through, JS handles mousemove on parent */
}

/* Ensure text colors override global dark text if needed */
#hero h1,
#hero .hero-description {
    color: var(--color-text);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
    /* Strong white glow/halo */
}

#hero .badge {
    background: rgba(255, 255, 255, 0.7);
    /* Brighter bg for badge */
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--color-primary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.hero-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    position: relative;
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.badge {
    display: inline-flex;
    padding: 0.5rem 1rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: #818cf8;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 2rem;
}

h1 {
    font-family: var(--font-display);
    font-size: clamp(3rem, 5vw, 4.5rem);
    line-height: 1.1;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.hero-description {
    font-size: 1.35rem;
    font-weight: 500;
    color: var(--color-text);
    max-width: 700px;
    margin-bottom: 2.5rem;
    margin-left: auto;
    margin-right: auto;
}

.hero-search-container {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50px;
    padding: 0.4rem;
    padding-left: 1.5rem;
    width: 100%;
    max-width: 580px;
    margin-top: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.hero-search-container:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.85);
}

.hero-search-input {
    flex: 1;
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: #334155;
    outline: none;
    height: 100%;
    font-family: var(--font-body);
}

.hero-search-input::placeholder {
    color: #64748b;
}

.hero-search-btn {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 50%;
    background: #2563eb;
    border: none;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, transform 0.2s ease;
}

.hero-search-btn:hover {
    background: #1d4ed8;
    transform: scale(1.05);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 4px 20px var(--color-primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--color-primary-glow);
}

.btn-outline {
    border: 1px solid var(--color-surface-2);
    color: var(--color-text);
}

.btn-outline:hover {
    border-color: var(--color-text);
    background: rgba(255, 255, 255, 0.05);
}

/* Visual Placeholder / 3D Element */
.hero-visual {
    position: relative;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.glow-circle {
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--color-primary-glow) 0%, transparent 70%);
    opacity: 0.4;
    filter: blur(40px);
    z-index: 1;
}

.visual-placeholder {
    width: 260px;
    height: 520px;
    background: linear-gradient(135deg, var(--color-surface), var(--color-bg));
    border: 2px solid var(--color-surface-2);
    border-radius: 36px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 2;
    transform: rotate(-10deg) translateY(10px);
    transition: transform 0.5s ease;
}

.visual-placeholder:hover {
    transform: rotate(0deg) translateY(0);
}

@media (max-width: 968px) {
    .hero-layout {
        padding-top: 4rem;
        min-height: 70vh;
    }

    h1 {
        font-size: 3rem;
    }
}

/* ===== ROTATING TEXT ANIMATION ===== */
.rotating-text {
    display: inline-block;
    position: relative;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    transition: opacity 0.4s ease, transform 0.4s ease;
    min-width: 3ch;
    /* Reserve space for longest word to prevent layout shift */
}

/* Keep rotating word and following text on same line */
.hero-line-nowrap {
    white-space: nowrap;
}

.rotating-text.fade-out {
    opacity: 0;
    transform: translateY(-20px);
}

.rotating-text.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* Rotating Badge Text */
.rotating-badge {
    display: inline-block;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.rotating-badge.fade-out {
    opacity: 0;
    transform: translateY(-10px);
}

.rotating-badge.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* Image inside phone frame */
.hero-app-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 38px;
    display: block;
}

/* ===== INFINITE MARQUEE ===== */
.hero-marquee-container {
    padding: 20px 0;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    /* Break out of container */
    overflow: hidden;
    position: relative;
    z-index: 10;
    margin-top: auto;
    /* Push to bottom if parent is flex column */
    background: transparent;
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    display: flex;
    flex-direction: column;
    gap: 15px;
    /* Space between rows */
}

.marquee-wrapper {
    display: flex;
    width: max-content;
    animation: scroll 60s linear infinite;
    /* Slower default speed */
}

.marquee-wrapper.reverse {
    animation-direction: reverse;
}

.marquee-wrapper:hover {
    animation-play-state: paused;
}

.marquee-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    margin: 0 0.75rem;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    white-space: nowrap;
    transition: transform 0.3s ease, background 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: var(--color-text);
}

.marquee-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.marquee-icon {
    font-size: 1.25rem;
}

.marquee-text {
    font-weight: 500;
    font-size: 0.95rem;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
        /* Move half way because content is duplicated */
    }
}