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

:root {
    --color-bg: #060a14;
    --color-surface: #0d1525;
    --color-surface-2: #131d33;
    --color-border: rgba(56, 189, 248, 0.1);
    --color-text: #e2e8f0;
    --color-text-muted: #94a3b8;
    --color-heading: #f8fafc;
    --color-primary: #0ea5e9;
    --color-primary-hover: #38bdf8;
    --color-accent: #22d3ee;
    --color-blue: #1e3a8a;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;
    --container: 1120px;
    --radius: 12px;
    --radius-sm: 8px;
}

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

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

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--color-primary-hover);
}

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

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

/* ── Header ────────────────────────────────────────────────── */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(6, 10, 20, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--color-border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-heading);
    text-decoration: none;
}

.logo:hover {
    color: var(--color-heading);
}

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

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

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

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
    position: relative;
    padding: 160px 0 100px;
    text-align: center;
    overflow: hidden;
    min-height: 90vh;
    display: flex;
    align-items: center;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 60% at 50% 30%, rgba(30, 58, 138, 0.3) 0%, transparent 70%),
                radial-gradient(ellipse 50% 40% at 70% 60%, rgba(14, 165, 233, 0.1) 0%, transparent 70%);
}

/* Star field animation */
.stars {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 10% 20%, rgba(248, 250, 252, 0.6), transparent),
        radial-gradient(1px 1px at 25% 45%, rgba(248, 250, 252, 0.4), transparent),
        radial-gradient(1.5px 1.5px at 40% 15%, rgba(248, 250, 252, 0.5), transparent),
        radial-gradient(1px 1px at 55% 70%, rgba(248, 250, 252, 0.3), transparent),
        radial-gradient(1px 1px at 70% 35%, rgba(248, 250, 252, 0.5), transparent),
        radial-gradient(1.5px 1.5px at 85% 55%, rgba(248, 250, 252, 0.4), transparent),
        radial-gradient(1px 1px at 15% 80%, rgba(248, 250, 252, 0.3), transparent),
        radial-gradient(1px 1px at 90% 85%, rgba(248, 250, 252, 0.5), transparent),
        radial-gradient(1px 1px at 50% 50%, rgba(248, 250, 252, 0.3), transparent),
        radial-gradient(1.5px 1.5px at 35% 90%, rgba(248, 250, 252, 0.4), transparent);
    animation: drift 60s linear infinite;
}

.stars-2 {
    background-image:
        radial-gradient(1px 1px at 5% 60%, rgba(34, 211, 238, 0.4), transparent),
        radial-gradient(1px 1px at 20% 10%, rgba(248, 250, 252, 0.3), transparent),
        radial-gradient(1.5px 1.5px at 45% 85%, rgba(248, 250, 252, 0.4), transparent),
        radial-gradient(1px 1px at 60% 25%, rgba(34, 211, 238, 0.3), transparent),
        radial-gradient(1px 1px at 75% 60%, rgba(248, 250, 252, 0.5), transparent),
        radial-gradient(1px 1px at 95% 15%, rgba(248, 250, 252, 0.4), transparent),
        radial-gradient(1px 1px at 30% 55%, rgba(248, 250, 252, 0.3), transparent),
        radial-gradient(1.5px 1.5px at 80% 90%, rgba(34, 211, 238, 0.3), transparent);
    animation: drift 90s linear infinite reverse;
}

@keyframes drift {
    from { transform: translateY(0); }
    to { transform: translateY(-100px); }
}

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

.hero-icon {
    margin: 0 auto 32px;
    border-radius: 32px;
    filter: drop-shadow(0 0 40px rgba(14, 165, 233, 0.3));
    animation: float 6s ease-in-out infinite;
}

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

.hero h1 {
    font-size: clamp(2.8rem, 6vw, 4.5rem);
    font-weight: 700;
    color: var(--color-heading);
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.35rem);
    color: var(--color-text-muted);
    margin-bottom: 12px;
}

.hero-subtitle a {
    color: var(--color-accent);
    font-weight: 500;
}

.hero-desc {
    font-size: 1.05rem;
    color: var(--color-text-muted);
    max-width: 600px;
    margin: 0 auto 36px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 40px;
}

.hero-platforms {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.platform-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 100px;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

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

.btn-primary:hover {
    background: var(--color-primary-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(14, 165, 233, 0.3);
}

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

.btn-secondary:hover {
    background: var(--color-surface);
    color: var(--color-heading);
    border-color: rgba(56, 189, 248, 0.2);
}

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

.btn-outline:hover {
    color: var(--color-heading);
    border-color: rgba(56, 189, 248, 0.3);
    background: rgba(14, 165, 233, 0.05);
}

.btn-sm {
    padding: 8px 20px;
    font-size: 0.875rem;
}

/* ── Section common ────────────────────────────────────────── */
.section-title {
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
    font-weight: 700;
    color: var(--color-heading);
    text-align: center;
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.section-subtitle {
    text-align: center;
    color: var(--color-text-muted);
    max-width: 640px;
    margin: 0 auto 48px;
    font-size: 1.05rem;
    line-height: 1.7;
}

/* ── Features ──────────────────────────────────────────────── */
.features {
    padding: 100px 0;
    background: var(--color-bg);
}

.features .section-title {
    margin-bottom: 56px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.feature-card {
    padding: 28px 24px;
    border-radius: var(--radius);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    transition: border-color 0.3s, transform 0.3s;
}

.feature-card:hover {
    border-color: rgba(56, 189, 248, 0.25);
    transform: translateY(-2px);
}

.feature-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(14, 165, 233, 0.1);
    color: var(--color-accent);
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-heading);
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    line-height: 1.6;
}

/* ── Screenshots ───────────────────────────────────────────── */
.screenshots {
    padding: 80px 0 100px;
    background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-surface) 50%, var(--color-bg) 100%);
}

.screenshots-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 32px;
    align-items: start;
}

.screenshot-item {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
}

.screenshot-item img {
    width: 100%;
    display: block;
}

.screenshot-item figcaption {
    padding: 12px 16px;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    text-align: center;
}

/* ── Platforms ──────────────────────────────────────────────── */
.platforms {
    padding: 100px 0;
    background: var(--color-bg);
}

.platforms-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.platform-card {
    padding: 32px 24px;
    border-radius: var(--radius);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    text-align: center;
    transition: border-color 0.3s, transform 0.3s;
    display: flex;
    flex-direction: column;
}

.platform-card:hover {
    border-color: rgba(56, 189, 248, 0.25);
    transform: translateY(-3px);
}

.platform-card-icon {
    color: var(--color-accent);
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.platform-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-heading);
    margin-bottom: 6px;
}

.platform-tech {
    font-size: 0.8rem;
    color: var(--color-primary);
    font-family: var(--font-mono);
    margin-bottom: 12px;
}

.platform-desc {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-bottom: 24px;
    flex: 1;
}

.platform-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.platform-actions .btn {
    justify-content: center;
    width: 100%;
}

.store-badge img {
    display: block;
    height: 52px;
    width: auto;
}

/* ── Open Source ────────────────────────────────────────────── */
.open-source {
    padding: 80px 0;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.oss-content {
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
}

.oss-content h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-heading);
    margin-bottom: 20px;
}

.oss-content p {
    color: var(--color-text-muted);
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 16px;
}

.oss-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 32px;
}

.oss-repo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: 0.875rem;
    font-family: var(--font-mono);
    transition: all 0.2s;
}

.oss-repo:hover {
    color: var(--color-heading);
    border-color: rgba(56, 189, 248, 0.25);
    background: rgba(14, 165, 233, 0.05);
}

/* ── Footer ────────────────────────────────────────────────── */
.footer {
    padding: 40px 0;
    background: var(--color-bg);
}

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

.footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--color-heading);
    font-size: 1rem;
}

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

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

@media (max-width: 768px) {
    .header-inner {
        height: 56px;
    }

    .nav {
        gap: 16px;
    }

    .nav a {
        font-size: 0.85rem;
    }

    .hero {
        padding: 120px 0 60px;
        min-height: auto;
    }

    .hero-icon {
        width: 120px;
        height: 120px;
    }

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

    .hero-actions .btn {
        width: 100%;
        max-width: 260px;
        justify-content: center;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .screenshots-grid {
        grid-template-columns: 1fr;
    }

    .platforms-grid {
        grid-template-columns: 1fr;
    }

    .platform-card {
        max-width: 400px;
        margin: 0 auto;
        width: 100%;
    }

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

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

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

@media (max-width: 480px) {
    .nav {
        display: none;
    }

    .container {
        padding: 0 16px;
    }

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

/* ── Mobile touch & safe area ──────────────────────────────── */
@supports (padding: env(safe-area-inset-bottom)) {
    .footer {
        padding-bottom: calc(40px + env(safe-area-inset-bottom));
    }
}

@media (hover: none) {
    .feature-card:hover,
    .platform-card:hover {
        transform: none;
    }
}

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