/* ============================================
   WAVELENGTH — Design System & Styles
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --color-bg: #ffffff;
    --color-bg-alt: #f7f8fc;
    --color-surface: #ffffff;
    --color-text: #1a1a2e;
    --color-text-secondary: #5a5a7a;
    --color-text-muted: #9696b0;
    --color-border: #e8e8f0;

    --color-cyan: #00e5ff;
    --color-purple: #aa00ff;
    --color-gradient: linear-gradient(135deg, #00e5ff 0%, #7b2ffc 50%, #aa00ff 100%);
    --color-gradient-subtle: linear-gradient(135deg, rgba(0,229,255,0.08) 0%, rgba(170,0,255,0.08) 100%);

    /* Typography */
    --font-display: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;

    /* Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(26,26,46,0.06);
    --shadow-md: 0 4px 16px rgba(26,26,46,0.08);
    --shadow-lg: 0 8px 32px rgba(26,26,46,0.1);
    --shadow-xl: 0 16px 48px rgba(26,26,46,0.12);
    --shadow-glow-cyan: 0 0 40px rgba(0,229,255,0.2);
    --shadow-glow-purple: 0 0 40px rgba(170,0,255,0.15);

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: 0.2s var(--ease-out);
    --transition-normal: 0.4s var(--ease-out);
    --transition-slow: 0.6s var(--ease-out);
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

ul { list-style: none; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-xl);
}

/* --- Gradient Text Utility --- */
.gradient-text {
    background: var(--color-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: var(--space-md);
    text-align: center;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    max-width: 560px;
    margin: 0 auto var(--space-3xl);
    text-align: center;
    line-height: 1.7;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn--primary {
    background: var(--color-text);
    color: var(--color-bg);
    box-shadow: var(--shadow-md);
}

.btn--primary:hover {
    box-shadow: var(--shadow-lg);
    background: #2a2a44;
}

/* Override sizing for App Store buttons to mimic standard badge sizes perfectly */
#cta-appstore, #download-appstore {
    padding: 0.35rem 1rem;
    height: 52px; /* Match exactly the natural height of store badges */
    box-sizing: border-box;
}

#cta-appstore svg, #download-appstore svg {
    width: 28px;
    height: 28px;
    margin-right: 0.5rem;
}

#cta-appstore strong, #download-appstore strong {
    font-size: 0.9rem;
    margin-top: 2px;
}

#cta-appstore small, #download-appstore small {
    font-size: 0.6rem;
}

.btn--primary small {
    font-size: 0.65rem;
    font-weight: 400;
    opacity: 0.8;
    display: block;
    line-height: 1;
    text-align: left;
}

.btn--primary strong {
    display: block;
    font-size: 0.95rem;
    line-height: 1.2;
    text-align: left;
}

.btn--primary div {
    display: flex;
    flex-direction: column;
}

.btn--outline {
    background: transparent;
    color: var(--color-text);
    border: 1.5px solid var(--color-border);
}

.btn--outline:hover {
    border-color: var(--color-cyan);
    color: var(--color-cyan);
    box-shadow: var(--shadow-glow-cyan);
}

.btn--sm { padding: 0.5rem 1.25rem; font-size: 0.85rem; }
.btn--lg { padding: 1rem 2rem; font-size: 1rem; }

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
    transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

.navbar.scrolled {
    box-shadow: var(--shadow-md);
}

.navbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.navbar__logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
}

.navbar__logo-icon {
    flex-shrink: 0;
}

.navbar__links {
    display: flex;
    gap: var(--space-xl);
}

.navbar__links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: color var(--transition-fast);
    position: relative;
}

.navbar__links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-gradient);
    transition: width var(--transition-normal);
    border-radius: 1px;
}

.navbar__links a:hover {
    color: var(--color-text);
}

.navbar__links a:hover::after {
    width: 100%;
}

.navbar__cta {
    border-radius: var(--radius-full);
}

.navbar__hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.navbar__hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.navbar__hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.navbar__hamburger.active span:nth-child(2) {
    opacity: 0;
}
.navbar__hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   HERO
   ============================================ */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 72px;
    overflow: hidden;
    background: var(--color-bg);
}

.hero__wave-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.5;
}

.hero__wave-bg canvas {
    width: 100%;
    height: 100%;
}

.hero__inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3xl);
    padding: var(--space-4xl) 0;
}

.hero__content {
    flex: 1;
    max-width: 560px;
}

.hero__title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4.2rem);
    font-weight: 800;
    line-height: 1.08;
    margin-bottom: var(--space-lg);
    letter-spacing: -0.02em;
}

.hero__subtitle {
    font-size: 1.15rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-2xl);
    max-width: 440px;
}

.hero__cta {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

/* Phone Mockup */
.hero__phone {
    flex-shrink: 0;
    perspective: 1000px;
}

.hero__phone-frame {
    position: relative;
    width: 280px;
    height: 570px;
    background: #1a1a2e;
    border-radius: 40px;
    padding: 12px;
    box-shadow:
        0 0 0 2px rgba(0,0,0,0.1),
        var(--shadow-xl),
        0 0 80px rgba(0,229,255,0.12),
        0 0 80px rgba(170,0,255,0.08);
    overflow: hidden;
    transform: rotateY(-5deg) rotateX(2deg);
    transition: transform var(--transition-slow);
    animation: phone-float 6s ease-in-out infinite;
}

.hero__phone-frame:hover {
    transform: rotateY(0deg) rotateX(0deg);
}

@keyframes phone-float {
    0%, 100% { transform: rotateY(-5deg) rotateX(2deg) translateY(0); }
    50% { transform: rotateY(-5deg) rotateX(2deg) translateY(-12px); }
}

.hero__phone-notch {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 28px;
    background: #1a1a2e;
    border-radius: 0 0 16px 16px;
    z-index: 2;
}

.hero__phone-screen {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 28px;
}

/* ============================================
   FEATURES
   ============================================ */
.features {
    padding: var(--space-4xl) 0;
    background: var(--color-bg-alt);
}

.features__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-xl);
}

.feature-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    text-align: center;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--color-gradient-subtle);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(0,229,255,0.3);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-card__icon {
    position: relative;
    margin-bottom: var(--space-lg);
    display: inline-flex;
}

.feature-card h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    position: relative;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
    position: relative;
}

/* ============================================
   ABOUT
   ============================================ */
.about {
    padding: var(--space-4xl) 0;
    background: var(--color-bg);
}

.about__inner {
    display: flex;
    align-items: center;
    gap: var(--space-4xl);
}

.about__content {
    flex: 1;
}

.about__content .section-title {
    text-align: left;
}

.about__content p {
    font-size: 1.05rem;
    color: var(--color-text-secondary);
    line-height: 1.8;
    margin-bottom: var(--space-xl);
}

.about__list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.about__list li {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-size: 1rem;
    font-weight: 500;
}

.about__check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--color-gradient-subtle);
    color: var(--color-cyan);
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.about__visual {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.about__glow {
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,229,255,0.1) 0%, rgba(170,0,255,0.05) 60%, transparent 80%);
    filter: blur(40px);
    animation: glow-pulse 4s ease-in-out infinite alternate;
}

@keyframes glow-pulse {
    0% { transform: scale(0.9); opacity: 0.5; }
    100% { transform: scale(1.1); opacity: 1; }
}

.about__stats {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    width: 100%;
    max-width: 320px;
}

.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl) var(--space-2xl);
    text-align: center;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* App Store Badge image */
.store-badge-link {
    display: inline-flex;
    align-items: center;
    transition: transform var(--transition-short) ease, opacity var(--transition-short) ease;
}

.store-badge-link:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.store-badge {
    height: 52px; /* Set back to 52px to perfectly align with the new 52px App Store button */
    width: auto;
    object-fit: contain;
    display: block;
}

.stat-card__number {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--color-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.stat-card__suffix {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    background: var(--color-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card__label {
    display: block;
    margin-top: var(--space-xs);
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

/* ============================================
   SECURITY
   ============================================ */
.security {
    padding: var(--space-4xl) 0;
    background: var(--color-bg-alt);
}

.security__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
}

.security__item {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    text-align: center;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.security__item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

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

.security__item h4 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.security__item p {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
}

/* ============================================
   DOWNLOAD CTA
   ============================================ */
.download {
    padding: var(--space-4xl) 0;
    background: var(--color-bg);
    position: relative;
    overflow: hidden;
}

.download__inner {
    text-align: center;
    position: relative;
    z-index: 1;
}

.download__glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(0,229,255,0.06) 0%, rgba(170,0,255,0.04) 50%, transparent 70%);
    filter: blur(60px);
    pointer-events: none;
}

.download__title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 700;
    margin-bottom: var(--space-md);
}

.download__subtitle {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    max-width: 500px;
    margin: 0 auto var(--space-2xl);
    line-height: 1.7;
}

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

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--color-bg-alt);
    border-top: 1px solid var(--color-border);
    padding-top: var(--space-3xl);
}

.footer__inner {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3xl);
    padding-bottom: var(--space-3xl);
    border-bottom: 1px solid var(--color-border);
}

.footer__tagline {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-top: var(--space-sm);
}

.footer__links {
    display: flex;
    gap: var(--space-3xl);
}

.footer__col {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.footer__col h4 {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.footer__col a {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    transition: color var(--transition-fast);
}

.footer__col a:hover {
    color: var(--color-text);
}

.footer__bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-xl) 0;
}

.footer__bottom p {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.footer__socials {
    display: flex;
    gap: var(--space-md);
}

.footer__socials a {
    color: var(--color-text-muted);
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.footer__socials a:hover {
    color: var(--color-text);
    transform: translateY(-2px);
}

/* ============================================
   REVEAL ANIMATIONS
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

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

/* Tablet */
@media (max-width: 992px) {
    .hero__inner {
        flex-direction: column;
        text-align: center;
        gap: var(--space-2xl);
    }

    .hero__content {
        max-width: 100%;
    }

    .hero__subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .hero__cta {
        justify-content: center;
    }

    .hero__phone-frame {
        transform: rotateY(0) rotateX(0);
        animation: phone-float-mobile 6s ease-in-out infinite;
    }

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

    .features__grid,
    .security__grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .about__content .section-title {
        text-align: center;
    }

    .about__list {
        align-items: center;
    }
}

/* Mobile */
@media (max-width: 640px) {
    .container {
        padding: 0 var(--space-md);
    }

    .navbar__links,
    .navbar__cta {
        display: none;
    }

    .navbar__hamburger {
        display: flex;
    }

    /* Mobile Nav Overlay */
    .navbar__links.mobile-open {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(255,255,255,0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: var(--space-2xl);
        gap: var(--space-xl);
        z-index: 999;
        animation: slideDown 0.3s var(--ease-out);
    }

    @keyframes slideDown {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .navbar__links.mobile-open a {
        font-size: 1.2rem;
        font-weight: 600;
        color: var(--color-text);
    }

    .hero {
        min-height: auto;
        padding-top: 100px;
        padding-bottom: var(--space-2xl);
    }

    .hero__title {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    .hero__phone-frame {
        width: 220px;
        height: 450px;
        border-radius: 32px;
        padding: 10px;
    }

    .hero__phone-notch {
        width: 90px;
        height: 22px;
    }

    .hero__phone-screen {
        border-radius: 22px;
    }

    .features__grid,
    .security__grid {
        grid-template-columns: 1fr;
    }

    .about__stats {
        max-width: 100%;
    }

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

    .footer__links {
        flex-direction: column;
        gap: var(--space-xl);
    }

    .footer__bottom {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }

    .hero__cta {
        flex-direction: column;
        align-items: center;
    }

    .download__cta {
        flex-direction: column;
        align-items: center;
    }
}
