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

:root {
    --bg: #09090b;
    --bg-card: rgba(24, 24, 32, 0.65);
    --bg-card-hover: rgba(32, 32, 45, 0.8);
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.14);
    --text: #f4f4f5;
    --text-muted: #a1a1aa;
    --accent-purple: #a78bfa;
    --accent-pink: #ec4899;
    --accent-gradient: linear-gradient(135deg, #a78bfa, #ec4899);
    --radius: 16px;
    --radius-sm: 10px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

/* ===== Nav ===== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 16px 0;
    transition: all 0.3s ease;
}

.nav-scrolled {
    background: rgba(9, 9, 11, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
}

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

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 16px;
    white-space: nowrap;
}

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

.nav-links {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 20px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.2s;
}

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

.nav-cta {
    background: var(--accent-gradient);
    color: #fff !important;
    padding: 8px 18px;
    border-radius: 8px;
    font-weight: 600 !important;
    transition: opacity 0.2s, transform 0.2s !important;
}

.nav-cta:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* ===== Hero ===== */
.hero {
    position: relative;
    padding: 160px 0 100px;
    text-align: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.hero-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.25;
}

.hero-glow-1 {
    width: 500px;
    height: 500px;
    background: var(--accent-purple);
    top: -100px;
    left: 50%;
    transform: translateX(-70%);
}

.hero-glow-2 {
    width: 400px;
    height: 400px;
    background: var(--accent-pink);
    top: 0;
    left: 50%;
    transform: translateX(20%);
}

.hero-grid-lines {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(167, 139, 250, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(167, 139, 250, 0.05) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
}

.hero-container {
    position: relative;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 24px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px 6px 12px;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

.hero-badges {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 28px;
}

.hero-github-link {
    text-decoration: none;
    transition: all 0.3s ease;
}

.hero-github-link:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
    color: var(--text);
}

/* Nav GitHub */
.nav-github {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 7px 14px !important;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.25s ease !important;
}

.nav-github:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: var(--border-hover);
}

.nav-github svg {
    opacity: 0.7;
}

.nav-github:hover svg {
    opacity: 1;
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.5);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.hero h1 {
    font-size: clamp(36px, 6vw, 60px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
}

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 560px;
    margin: 0 auto 36px;
}

.hero-subtitle strong {
    color: var(--text);
    font-weight: 600;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s ease;
    cursor: pointer;
    border: none;
}

.btn-chrome {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 4px 20px rgba(167, 139, 250, 0.3);
}

.btn-chrome:hover {
    box-shadow: 0 6px 30px rgba(167, 139, 250, 0.45);
    transform: translateY(-2px);
}

.btn-edge {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-edge:hover {
    background: rgba(255, 255, 255, 0.11);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.btn-firefox {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-firefox:hover {
    background: rgba(255, 255, 255, 0.11);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

/* Active browser button — gradient + glow */
.btn-active.btn-edge,
.btn-active.btn-firefox {
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    box-shadow: 0 4px 20px rgba(167, 139, 250, 0.3);
}

.btn-active.btn-edge:hover,
.btn-active.btn-firefox:hover {
    box-shadow: 0 6px 30px rgba(167, 139, 250, 0.45);
}

/* When btn-active exists, make the other buttons subtle */
.btn-active ~ .btn-chrome:not(.btn-active),
.btn-active ~ .btn-edge:not(.btn-active),
.btn-active ~ .btn-firefox:not(.btn-active),
.btn-chrome:not(.btn-active):has(~ .btn-active) {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: none;
}

.btn-chrome:not(.btn-active):has(~ .btn-active):hover {
    background: rgba(255, 255, 255, 0.11);
    border-color: var(--border-hover);
}

.hero-social {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 28px;
    padding: 8px 18px;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    font-size: 14px;
    color: var(--text-muted);
}

.hero-social strong {
    color: var(--text);
    font-weight: 700;
}

.hero-stars {
    color: #f5b50a;
    letter-spacing: 2px;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
}

.hero-note {
    margin-top: 18px;
    font-size: 13px;
    color: var(--text-muted);
    opacity: 0.7;
}

/* ===== Features ===== */
.features {
    padding: 100px 0;
}

.section-title {
    text-align: center;
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 56px;
}

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

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.feature-card.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.feature-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-4px);
}

.feature-icon {
    margin-bottom: 14px;
    color: var(--accent-purple);
}

.feature-icon svg {
    display: block;
}

.feature-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
}

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

.feature-card kbd {
    display: inline-block;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* ===== Screenshots ===== */
.screenshots {
    padding: 60px 0 100px;
}

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

.screenshot-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-card);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.screenshot-card.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.screenshot-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.screenshot-label {
    display: none;
}

.screenshot-card img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center top;
}

/* ===== Grid Types ===== */
.grid-types {
    padding: 60px 0 100px;
}

.grid-types-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.grid-type-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.grid-type-card.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.grid-type-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-4px);
}

.grid-type-preview {
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 16px;
}

.grid-type-preview svg {
    width: 100%;
    height: auto;
}

.grid-type-card h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 6px;
}

.grid-type-card p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ===== CTA ===== */
.cta {
    padding: 40px 0 100px;
}

.cta-card {
    text-align: center;
    padding: 60px 40px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.1), rgba(236, 72, 153, 0.1));
    border: 1px solid rgba(167, 139, 250, 0.2);
    position: relative;
    overflow: hidden;
}

.cta-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(167, 139, 250, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(167, 139, 250, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
}

.cta-card h2 {
    font-size: clamp(24px, 3.5vw, 32px);
    font-weight: 800;
    margin-bottom: 12px;
    position: relative;
}

.cta-card p {
    color: var(--text-muted);
    font-size: 16px;
    margin-bottom: 28px;
    position: relative;
}

.cta-card .hero-actions {
    position: relative;
}

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

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 14px;
}

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

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

.footer-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 13px;
    transition: color 0.2s;
}

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

.bmc-link {
    color: #fbbf24 !important;
    font-weight: 600;
}

.bmc-link:hover {
    color: #fde68a !important;
}

.footer-bottom {
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.footer-bottom p {
    font-size: 12px;
    color: var(--text-muted);
    opacity: 0.6;
}

.footer-bottom a {
    color: #fff;
    text-decoration: none;
}

.footer-bottom a:hover {
    text-decoration: underline;
}

/* ===== Responsive ===== */
/* Tablet: hide the secondary text links, keep GitHub + CTA + language switcher */
@media (max-width: 1024px) {
    .nav-links {
        gap: 16px;
    }

    .nav-links a:not(.nav-cta):not(.nav-github):not(.lang-link) {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr;
    }

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

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

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

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

    .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }

    .hero-social {
        flex-direction: column;
        margin-top: 24px;
        padding: 12px 24px;
        font-size: 14px;
        max-width: 92%;
        text-align: center;
        line-height: 1.5;
        justify-content: center;
        gap: 6px;
    }

    .hero-stars {
        font-size: 15px;
        letter-spacing: 3px;
    }

    .nav-links a:not(.nav-cta):not(.lang-link) {
        display: none !important;
    }

    /* Compact language switcher on mobile: flag + caret only */
    .nav-container {
        padding: 0 14px;
    }

    .nav-logo {
        font-size: 15px;
        min-width: 0;
    }

    .nav-logo span {
        white-space: nowrap;
    }

    .nav-links {
        gap: 8px;
    }

    /* The hero section already has install buttons, so drop the nav CTA on
       mobile — leaves logo + language switcher with plenty of room. */
    .nav-cta {
        display: none !important;
    }

    .lang-dd summary {
        height: 38px;
        box-sizing: border-box;
        padding: 0 11px;
        gap: 4px;
    }

    .lang-dd .lang-name {
        display: none;
    }

    .lang-menu {
        position: fixed;
        right: 12px;
        left: auto;
        top: 60px;
    }

    .hero-badges {
        flex-direction: column;
        gap: 8px;
    }

    .footer-content {
        flex-direction: column;
        gap: 16px;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Language switcher (dropdown) */
.lang-switcher {
    display: inline-flex;
    align-items: center;
}

.lang-dd {
    position: relative;
}

.lang-dd summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.lang-dd summary::-webkit-details-marker,
.lang-dd summary::marker {
    display: none;
}

.flag {
    width: 20px;
    height: 15px;
    flex-shrink: 0;
    border-radius: 3px;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.lang-caret {
    opacity: 0.6;
    transition: transform 0.15s;
}

.lang-dd[open] .lang-caret {
    transform: rotate(180deg);
}

.lang-dd summary:hover,
.lang-dd[open] summary {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.32);
}

.lang-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 6px;
    background: #18181b;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    min-width: 190px;
    max-height: 70vh;
    overflow-y: auto;
}

.lang-link {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    color: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
}

.lang-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.lang-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
}

@media (max-width: 480px) {
    .grid-types-list {
        grid-template-columns: 1fr;
    }
}