/* ==========================================================================
   Layout - AppsLuna
   ========================================================================== */

/* ==========================================================================
   Header
   ========================================================================== */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-fixed);
    padding: var(--space-md) var(--space-xl);
    background: rgba(10, 10, 10, 0.7);
    backdrop-filter: blur(var(--blur-md));
    -webkit-backdrop-filter: blur(var(--blur-md));
    border-bottom: 1px solid transparent;
    transition:
        background var(--transition-base),
        border-color var(--transition-base);
}

.header--scrolled {
    background: rgba(10, 10, 10, 0.95);
    border-bottom-color: var(--border-color);
}

.header__content {
    max-width: var(--container-xl);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo */
.logo {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    transition: opacity var(--transition-fast);
}

.logo:hover {
    opacity: 0.8;
}

.logo__image {
    height: 32px;
    max-height: 32px;
    width: auto;
    max-width: 200px;
    display: block;
}

.logo__text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Navigation */
.nav {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

.nav__link {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
    position: relative;
    padding: var(--space-xs) 0;
    transition: color var(--transition-fast);
}

.nav__link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width var(--transition-base);
}

.nav__link:hover {
    color: var(--text-primary);
}

.nav__link:hover::after {
    width: 100%;
}

/* Mobile menu toggle */
.nav__toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: var(--space-sm);
    cursor: pointer;
}

.nav__toggle-line {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: transform var(--transition-base), opacity var(--transition-fast);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--space-5xl) + 60px) var(--space-xl) var(--space-4xl);
    position: relative;
    overflow: hidden;
}

/* Hero background layers */
.hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero__bg-gradient {
    position: absolute;
    inset: 0;
    background: var(--gradient-hero);
}

.hero__bg-mesh {
    position: absolute;
    inset: 0;
    background: var(--gradient-mesh);
    opacity: 0;
    animation: meshFadeIn 2s ease-out forwards;
}

.hero__bg-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.4;
}

.hero__bg-glow--purple {
    top: -200px;
    left: 20%;
    background: var(--wordwise-color);
}

.hero__bg-glow--blue {
    bottom: -200px;
    right: 10%;
    background: var(--otter-color);
}

/* Floating particles */
.hero__particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.hero__particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--text-primary);
    border-radius: 50%;
    opacity: 0.2;
}

/* Hero content */
.hero__content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    text-align: center;
}

.hero__title {
    font-size: clamp(var(--font-size-4xl), 8vw, var(--font-size-6xl));
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    margin-bottom: var(--space-lg);
}

.hero__title-line {
    display: block;
    overflow: hidden;
}

.hero__title-word {
    display: inline-block;
}

.hero__subtitle {
    font-size: clamp(var(--font-size-lg), 2.5vw, var(--font-size-xl));
    color: rgba(255, 255, 255, 0.85);
    max-width: 600px;
    margin: 0 auto var(--space-2xl);
    line-height: var(--line-height-relaxed);
}

.hero__cta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

/* Scroll indicator */
.hero__scroll {
    position: absolute;
    bottom: var(--space-2xl);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.hero__scroll:hover {
    color: var(--text-secondary);
}

.hero__scroll-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, var(--text-muted), transparent);
    position: relative;
    overflow: hidden;
}

.hero__scroll-line::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 50%;
    background: var(--text-primary);
    animation: scrollLine 2s ease-in-out infinite;
}

/* ==========================================================================
   Products Section
   ========================================================================== */

.products {
    padding: var(--space-5xl) var(--space-xl);
    position: relative;
}

.products__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 500px), 1fr));
    gap: var(--space-xl);
    max-width: var(--container-2xl);
    margin: 0 auto;
}

/* ==========================================================================
   Features Section (Bento Grid)
   ========================================================================== */

.features {
    padding: var(--space-5xl) var(--space-xl);
    background: var(--bg-secondary);
    position: relative;
}

.features::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--border-color) 20%,
        var(--border-color) 80%,
        transparent
    );
}

.features__container {
    max-width: var(--container-2xl);
    margin: 0 auto;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: var(--space-4xl) var(--space-xl);
}

.footer__content {
    max-width: var(--container-xl);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr repeat(2, 1fr);
    gap: var(--space-3xl);
}

/* Footer brand */
.footer__brand {
    max-width: 320px;
}

.footer__brand-name {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-md);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer__brand-description {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: var(--line-height-relaxed);
}

/* Footer links */
.footer__links-title {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
}

.footer__link {
    display: block;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    padding: var(--space-sm) 0;
    position: relative;
    transition: color var(--transition-fast);
}

.footer__link:hover {
    color: var(--text-primary);
}

.footer__link--email {
    color: var(--otter-color);
}

.footer__link--email:hover {
    color: var(--otter-color-light);
}

/* Footer bottom */
.footer__bottom {
    max-width: var(--container-xl);
    margin: var(--space-3xl) auto 0;
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.footer__copyright {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.footer__legal {
    display: flex;
    gap: var(--space-lg);
}

.footer__legal-link {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.footer__legal-link:hover {
    color: var(--text-secondary);
}

/* ==========================================================================
   Responsive - Layout
   ========================================================================== */

@media (max-width: 768px) {
    .header {
        padding: var(--space-md);
    }

    .nav {
        display: none;
    }

    .nav--open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        padding: var(--space-xl);
        border-bottom: 1px solid var(--border-color);
    }

    .nav__toggle {
        display: flex;
    }

    .hero {
        min-height: auto;
        padding: calc(var(--space-5xl) + 40px) var(--space-lg) var(--space-3xl);
    }

    .hero__title {
        font-size: var(--font-size-3xl);
    }

    .hero__subtitle {
        font-size: var(--font-size-base);
    }

    .hero__scroll {
        display: none;
    }

    .products {
        padding: var(--space-3xl) var(--space-md);
    }

    .features {
        padding: var(--space-3xl) var(--space-md);
    }

    .footer__content {
        grid-template-columns: 1fr;
        gap: var(--space-2xl);
    }

    .footer__brand {
        max-width: 100%;
    }

    .footer__bottom {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: calc(var(--space-4xl) + 40px) var(--space-md) var(--space-2xl);
    }

    .hero__title {
        font-size: var(--font-size-2xl);
    }

    .hero__cta {
        flex-direction: column;
        width: 100%;
    }

    .hero__cta .btn {
        width: 100%;
    }
}

/* Landscape mode */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: calc(var(--space-3xl) + 60px) var(--space-xl) var(--space-xl);
    }

    .hero__title {
        font-size: var(--font-size-2xl);
        margin-bottom: var(--space-md);
    }

    .hero__subtitle {
        margin-bottom: var(--space-lg);
    }
}
