/* ===== Reset & Custom Properties ===== */

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

:root {
    --bg-deep: #060a13;
    --bg-dark: #0a0f1c;
    --bg-card: #111827;
    --border: #1e293b;
    --accent: #22d3ee;
    --accent-hover: #06b6d4;
    --accent-glow: rgba(34, 211, 238, 0.10);
    --accent-glow-md: rgba(34, 211, 238, 0.18);
    --accent-glow-strong: rgba(34, 211, 238, 0.28);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --container: 1100px;
    --radius: 12px;
    --radius-lg: 16px;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

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

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

a {
    color: var(--accent);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

button, .btn {
    -webkit-tap-highlight-color: transparent;
}

/* ===== Layout ===== */

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

/* ===== Navigation ===== */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 16px 0;
    background: rgba(6, 10, 19, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(30, 41, 59, 0);
    transition: border-color 0.3s ease;
}

.nav.scrolled {
    border-bottom-color: rgba(30, 41, 59, 0.5);
}

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

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.1rem;
}

.nav-logo img {
    border-radius: 6px;
}

/* ===== Buttons ===== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-family: var(--font);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
}

.btn-sm {
    padding: 8px 18px;
    font-size: 0.875rem;
    background: var(--accent);
    color: var(--bg-deep);
    font-weight: 600;
    border-radius: 6px;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-deep);
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 0 20px var(--accent-glow), 0 0 60px var(--accent-glow);
}

/* Hover only on pointer devices (prevents sticky hover on touch) */
@media (hover: hover) {
    .btn-sm:hover {
        background: var(--accent-hover);
    }

    .btn-primary:hover {
        background: var(--accent-hover);
        box-shadow: 0 0 30px var(--accent-glow-strong), 0 0 80px var(--accent-glow-md);
        transform: translateY(-1px);
    }
}

/* Active state for touch feedback */
.btn:active {
    transform: scale(0.97);
}

.btn-primary:active {
    background: var(--accent-hover);
}

.btn-lg {
    padding: 16px 40px;
    font-size: 1.1rem;
}

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

.hero {
    padding: 160px 0 100px;
    text-align: center;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    height: 600px;
    background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 3.75rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
    background: linear-gradient(180deg, #ffffff 30%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 0.7s ease forwards;
}

.hero-subtitle {
    font-size: clamp(1.05rem, 2vw, 1.2rem);
    color: var(--text-secondary);
    max-width: 540px;
    margin: 0 auto 36px;
    line-height: 1.7;
    opacity: 0;
    animation: fadeInUp 0.7s ease 0.12s forwards;
}

.hero-cta {
    opacity: 0;
    animation: fadeInUp 0.7s ease 0.24s forwards;
}

.hero-screenshot {
    margin-top: 64px;
    position: relative;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.36s forwards;
}

.hero-screenshot img {
    margin: 0 auto;
    width: 100%;
    max-width: 720px;
    filter: drop-shadow(0 25px 50px rgba(0, 0, 0, 0.4))
           drop-shadow(0 0 80px var(--accent-glow-md));
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(28px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Sections (shared) ===== */

.section {
    padding: 120px 0;
}

.section-alt {
    background: var(--bg-dark);
}

.section-label {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 16px;
}

.section h2 {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    line-height: 1.2;
}

.section p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.7;
    max-width: 480px;
}

.section-center {
    text-align: center;
    margin-bottom: 48px;
}

.section-center p {
    margin-left: auto;
    margin-right: auto;
}

/* ===== Section Grid (text + screenshot side by side) ===== */

.section-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
}

.section-grid-reverse .section-media {
    order: -1;
}

/* ===== Section Media (screenshot containers) ===== */

.section-media img {
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.35))
           drop-shadow(0 0 60px var(--accent-glow));
}

.section-media-sm img {
    max-width: 500px;
}

/* ===== Feature List ===== */

.feature-list {
    list-style: none;
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 1rem;
}

.feature-list li::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

/* ===== Search Screenshots Grid ===== */

.search-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.search-item {
    margin: 0;
}

.search-item img {
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.35))
           drop-shadow(0 0 60px var(--accent-glow));
}

.search-item figcaption {
    text-align: center;
    margin-top: 16px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ===== Download CTA ===== */

.section-cta {
    background: var(--bg-dark);
    text-align: center;
    position: relative;
}

.cta-icon {
    margin: 0 auto 32px;
    border-radius: 28px;
    filter: drop-shadow(0 0 50px var(--accent-glow-strong));
}

.section-cta h2 {
    margin-bottom: 12px;
}

.section-cta .btn-primary {
    margin-top: 28px;
}

.cta-note {
    display: block;
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

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

.footer {
    padding: 32px 0;
    border-top: 1px solid var(--border);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.footer-brand img {
    border-radius: 4px;
}

.footer-credit {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===== Scroll Animations ===== */

.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Stagger children slightly */
.fade-in:nth-child(2) {
    transition-delay: 0.1s;
}

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

/* --- Tablet and below (≤900px) --- */
@media (max-width: 900px) {
    .section-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .section-grid-reverse .section-media {
        order: 1;
    }

    .section-media {
        max-width: 88%;
        margin: 0 auto;
    }

    .section-media-sm img {
        max-width: 100%;
    }

    .section-media img,
    .search-item img {
        filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.35));
    }
}

/* --- Mobile landscape / small tablets (≤768px) --- */
@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }

    .nav-inner {
        padding: 0 20px;
    }

    /* Minimum 44px touch targets */
    .btn-sm {
        padding: 10px 20px;
        min-height: 44px;
    }

    .hero {
        padding: 120px 0 60px;
    }

    .hero-subtitle {
        max-width: 100%;
    }

    .hero-screenshot {
        margin-top: 40px;
    }

    .hero-screenshot img {
        filter: drop-shadow(0 16px 32px rgba(0, 0, 0, 0.4));
    }

    .desktop-break {
        display: none;
    }

    .section {
        padding: 80px 0;
    }

    .section p {
        max-width: 100%;
    }

    .section h2 {
        max-width: 100%;
    }

    .search-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .btn-lg {
        padding: 14px 32px;
        font-size: 1rem;
        min-height: 48px;
    }

    .section-center {
        margin-bottom: 36px;
    }

    .cta-icon {
        width: 96px;
        height: 96px;
    }
}

/* --- Mobile portrait (≤480px) --- */
@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .nav-inner {
        padding: 0 16px;
    }

    .hero {
        padding: 100px 0 40px;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 28px;
    }

    .hero-screenshot {
        margin-top: 28px;
    }

    .hero-cta {
        width: 100%;
    }

    .btn-primary {
        width: 100%;
    }

    .section {
        padding: 64px 0;
    }

    .section h2 {
        font-size: 1.5rem;
    }

    .section p {
        font-size: 1rem;
    }

    .section-grid {
        gap: 36px;
    }

    .feature-list {
        margin-top: 20px;
    }

    .search-grid {
        gap: 24px;
    }

    .search-item figcaption {
        font-size: 0.85rem;
        margin-top: 12px;
    }

    .cta-icon {
        width: 80px;
        height: 80px;
        border-radius: 20px;
        margin-bottom: 24px;
    }

    .section-cta .btn-primary {
        width: 100%;
    }

    .footer {
        padding: 24px 0;
    }

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

/* --- Safe area insets for notched devices --- */
@supports (padding: env(safe-area-inset-top)) {
    .nav {
        padding-top: max(16px, env(safe-area-inset-top));
    }

    .footer {
        padding-bottom: max(32px, env(safe-area-inset-bottom));
    }

    .container {
        padding-left: max(24px, env(safe-area-inset-left));
        padding-right: max(24px, env(safe-area-inset-right));
    }
}

/* --- Reduce motion for users who prefer it --- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .hero-title,
    .hero-subtitle,
    .hero-cta,
    .hero-screenshot {
        animation: none;
        opacity: 1;
    }

    .fade-in {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
