/* Copyright 2026, Jiri Eischmann <jiri@eischmann.cz> and the meshy contributors */
/* SPDX-License-Identifier: GPL-3.0-or-later */

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

:root {
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    --blue-50: #eff6ff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --radius: 12px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--gray-800);
    line-height: 1.6;
    background: #fff;
}

a {
    color: var(--blue-600);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ---- Navigation ---- */

nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gray-200);
    z-index: 100;
}

nav .nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

nav .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--gray-900);
}

nav .logo img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 32px;
}

nav ul a {
    color: var(--gray-600);
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.15s;
}

nav ul a:hover {
    color: var(--blue-600);
    text-decoration: none;
}

/* ---- Hero ---- */

.hero {
    padding: 140px 24px 80px;
    text-align: center;
    background: linear-gradient(180deg, var(--blue-50) 0%, #fff 100%);
}

.hero img.app-icon {
    width: 128px;
    height: 128px;
    border-radius: 28px;
    margin-bottom: 24px;
    box-shadow: 0 8px 30px rgba(37, 99, 235, 0.18);
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.hero p {
    font-size: 1.25rem;
    color: var(--gray-600);
    max-width: 620px;
    margin: 0 auto 36px;
}

.hero .cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--blue-600);
    color: #fff;
    padding: 14px 32px;
    border-radius: 99px;
    font-size: 1.05rem;
    font-weight: 600;
    transition: background 0.15s;
}

.hero .cta:hover {
    background: var(--blue-700);
    text-decoration: none;
}

/* ---- Section common ---- */

section {
    padding: 80px 24px;
}

section:nth-child(even) {
    background: var(--gray-50);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
    color: var(--gray-900);
}

.section-subtitle {
    text-align: center;
    color: var(--gray-600);
    max-width: 600px;
    margin: 0 auto 48px;
    font-size: 1.1rem;
}

/* ---- Features ---- */

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 28px;
}

.feature-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 28px;
    transition: box-shadow 0.2s;
}

.feature-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 14px;
    display: block;
}

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

.feature-card p {
    color: var(--gray-600);
    font-size: 0.95rem;
}

/* ---- Screenshots ---- */

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

.screenshots-grid figure {
    margin: 0;
}

.screenshots-grid img {
    width: 100%;
    border-radius: var(--radius);
    transition: transform 0.2s;
    cursor: pointer;
}

.screenshots-grid img:hover {
    transform: translateY(-4px);
}

.screenshots-grid figcaption {
    text-align: center;
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--gray-600);
}

/* ---- Install ---- */

.install-oneclick {
    text-align: center;
    margin-bottom: 32px;
}

.install-oneclick .cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--blue-600);
    color: #fff;
    padding: 14px 32px;
    border-radius: 99px;
    font-size: 1.05rem;
    font-weight: 600;
    transition: background 0.15s;
    margin-bottom: 12px;
}

.install-oneclick .cta:hover {
    background: var(--blue-700);
    text-decoration: none;
}

.install-oneclick p {
    color: var(--gray-600);
    font-size: 0.9rem;
}

.install-divider {
    text-align: center;
    color: var(--gray-600);
    font-size: 0.95rem;
    margin-bottom: 28px;
    position: relative;
}

.install-divider::before,
.install-divider::after {
    content: "";
    display: inline-block;
    width: 60px;
    height: 1px;
    background: var(--gray-200);
    vertical-align: middle;
    margin: 0 16px;
}

.install-content {
    max-width: 700px;
    margin: 0 auto;
}

.install-step {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 18px;
}

.install-step h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--gray-900);
}

.install-step code {
    display: block;
    background: var(--gray-900);
    color: #e5e7eb;
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 0.9rem;
    overflow-x: auto;
    font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
    line-height: 1.5;
}

.install-step p {
    color: var(--gray-600);
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.install-note {
    text-align: center;
    margin-top: 28px;
    color: var(--gray-600);
    font-size: 0.95rem;
}

/* ---- Links / Community ---- */

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    max-width: 750px;
    margin: 0 auto;
}

.link-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 24px;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.link-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border-color: var(--blue-600);
    text-decoration: none;
}

.link-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.link-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.link-card p {
    color: var(--gray-600);
    font-size: 0.9rem;
}

/* ---- Footer ---- */

footer {
    padding: 40px 24px;
    text-align: center;
    border-top: 1px solid var(--gray-200);
    color: var(--gray-600);
    font-size: 0.9rem;
}

footer a {
    color: var(--gray-600);
    font-weight: 500;
}

/* ---- Lightbox ---- */

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 200;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: var(--radius);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.4);
}

/* ---- Responsive ---- */

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.2rem;
    }

    .hero p {
        font-size: 1.05rem;
    }

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

    nav ul {
        gap: 18px;
    }

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

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

    .hero {
        padding: 110px 16px 60px;
    }

    section {
        padding: 60px 16px;
    }
}

/* ---- Dark mode (MeshCore Dark theme) ---- */

@media (prefers-color-scheme: dark) {
    :root {
        --blue-600: #3b82f6;
        --blue-700: #2563eb;
        --blue-50: rgba(59, 130, 246, 0.1);
        --gray-50: #0d1117;
        --gray-100: #111827;
        --gray-200: rgba(255, 255, 255, 0.1);
        --gray-600: rgba(255, 255, 255, 0.65);
        --gray-700: rgba(255, 255, 255, 0.8);
        --gray-800: rgba(255, 255, 255, 0.85);
        --gray-900: rgba(255, 255, 255, 0.9);
    }

    body {
        background: #111827;
    }

    nav {
        background: rgba(17, 24, 39, 0.9);
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }

    .hero {
        background: linear-gradient(180deg, #0d1117 0%, #111827 100%);
    }

    .feature-card,
    .install-step,
    .link-card {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .feature-card:hover {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }

    .link-card:hover {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
        border-color: var(--blue-600);
    }

    .install-step code {
        background: #0d1117;
    }

    footer {
        border-top-color: rgba(255, 255, 255, 0.1);
    }

    .hero .app-icon {
        box-shadow: 0 8px 30px rgba(59, 130, 246, 0.25);
    }
}
