/* ============================================
   Pinpin — Landing Page
   Style: Apple-inspired, clean, minimal
   Palette: Black, white, grays only
   ============================================ */

:root {
    --color-bg: #ffffff;
    --color-bg-alt: #f5f5f7;
    --color-text: #1d1d1f;
    --color-text-secondary: #86868b;
    --color-text-tertiary: #aeaeb2;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --max-width: 1120px;
    --radius: 16px;
}

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

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

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

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

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

/* ---- Animations ---- */
.download-inner {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.download-inner.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered children in download section */
.download-inner .download-title,
.download-inner .download-subtitle,
.download-inner .download-badges,
.download-inner .download-note {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.download-inner.visible .download-title {
    opacity: 1; transform: translateY(0);
    transition-delay: 0s;
}

.download-inner.visible .download-subtitle {
    opacity: 1; transform: translateY(0);
    transition-delay: 0.1s;
}

.download-inner.visible .download-badges {
    opacity: 1; transform: translateY(0);
    transition-delay: 0.2s;
}

.download-inner.visible .download-note {
    opacity: 1; transform: translateY(0);
    transition-delay: 0.3s;
}

/* Hero staggered entrance */
@keyframes hero-fade-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-app-icon,
.hero-title,
.hero-subtitle,
.hero-actions,
.hero-devices,
.hero-sync {
    opacity: 0;
    animation: hero-fade-up 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.hero-app-icon   { animation-delay: 0s; }
.hero-title      { animation-delay: 0.1s; }
.hero-subtitle   { animation-delay: 0.2s; }
.hero-actions    { animation-delay: 0.3s; }
.hero-devices    { animation-delay: 0.45s; }
.hero-sync       { animation-delay: 0.6s; }

/* ---- Navigation ---- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0 24px;
    transition: background 0.3s, backdrop-filter 0.3s, box-shadow 0.3s;
}

.nav.scrolled {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

.nav-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: color 0.2s;
}

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

.nav-cta {
    background: var(--color-text);
    color: #fff !important;
    padding: 8px 18px;
    border-radius: 980px;
    font-size: 0.8125rem !important;
    transition: background 0.2s, transform 0.15s !important;
}

.nav-cta:hover {
    background: #333 !important;
    transform: scale(1.03);
}

/* ---- Hero ---- */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 140px 24px 0;
    text-align: center;
    gap: 24px;
}

.hero-content {
    max-width: 720px;
}

.hero-app-icon {
    width: 80px;
    height: 80px;
    border-radius: 18px;
    margin: 0 auto 32px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.08;
    margin-bottom: 24px;
}

.hero-subtitle {
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    color: var(--color-text-secondary);
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto 40px;
}

.share-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    margin-top: -0.15em;
    margin-right: 4px;
    width: 34px;
    height: 34px;
    background: var(--color-text);
    color: #ffffff;
    border-radius: 50%;
}

.share-icon svg {
    width: 18px;
    height: 18px;
}

.hero-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font);
    font-size: 0.9375rem;
    font-weight: 600;
    padding: 14px 28px;
    border-radius: 980px;
    border: none;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}

.btn:hover {
    transform: scale(1.03);
}

.btn-primary {
    background: var(--color-text);
    color: #fff;
}

.btn-primary:hover {
    background: #333;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background: var(--color-bg-alt);
    color: var(--color-text);
}

.btn-secondary:hover {
    background: #ebebed;
}

/* ---- Hero Devices Carousel ---- */
.hero-devices {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    overflow: hidden;
}

.hero-devices::before,
.hero-devices::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 120px;
    z-index: 2;
    pointer-events: none;
}

.hero-devices::before {
    left: 0;
    background: linear-gradient(to right, var(--color-bg), transparent);
}

.hero-devices::after {
    right: 0;
    background: linear-gradient(to left, var(--color-bg), transparent);
}

.hero-track {
    display: flex;
    gap: 28px;
    padding: 60px 24px 120px;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.hero-track::-webkit-scrollbar {
    display: none;
}

.hero-card {
    flex-shrink: 0;
    overflow: hidden;
    background: var(--color-bg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hero-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.22);
}

.hero-card img {
    height: 100%;
    width: auto;
    display: block;
}

.hero-card-phone {
    height: 420px;
    border-radius: 28px;
    background: #000;
    padding: 6px;
}

.hero-card-phone img {
    border-radius: 22px;
}

.hero-card-desktop {
    height: 580px;
    border-radius: 16px;
}

.hero-sync {
    font-size: 1.0625rem;
    color: var(--color-text-secondary);
    text-align: center;
    max-width: 480px;
    margin: -80px auto 0;
    padding: 0 24px 60px;
    position: relative;
}

/* ---- Download CTA ---- */
.download {
    padding: 100px 24px;
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.download-inner {
    max-width: 640px;
    margin: 0 auto;
}

.download-title {
    font-size: clamp(2rem, 4.5vw, 3.25rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 16px;
}

.download-subtitle {
    font-size: 1.125rem;
    color: var(--color-text-secondary);
    margin-bottom: 36px;
}

.download-badges {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.app-store-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: transform 0.15s;
}

.app-store-badge:hover {
    transform: scale(1.04);
}

.app-store-badge-disabled {
    opacity: 0.35;
    pointer-events: none;
}

.badge-platform {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.download-note {
    margin-top: 24px;
    font-size: 0.8125rem;
    color: var(--color-text-tertiary);
}

/* ---- Footer ---- */
.footer {
    padding: 32px 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

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

.footer-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-logo {
    font-weight: 700;
    font-size: 1rem;
}

.footer-copy {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    transition: color 0.2s;
}

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

/* ============================================
   Responsive
   ============================================ */


@media (max-width: 640px) {
    .nav-links a:not(.nav-cta) {
        display: none;
    }

    .hero {
        padding: 110px 20px 0;
        gap: 16px;
    }

    .hero-app-icon {
        width: 64px;
        height: 64px;
        border-radius: 14px;
        margin-bottom: 24px;
    }

    .hero-card-phone {
        height: 260px;
    }

    .hero-card-desktop {
        height: 360px;
    }

    .footer-inner {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .footer-brand {
        flex-direction: column;
        gap: 4px;
    }

    .download {
        padding: 64px 20px;
    }

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

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}
