/* ========================================
   LAYOUT
   Nav, Hero, Sections, Grid, Footer
   ======================================== */

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

nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1rem 0;
    transition: background 0.3s, backdrop-filter 0.3s;
}

nav.scrolled {
    background: rgba(10, 14, 20, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

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

.logo {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.logo span {
    color: var(--cyan);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
}

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

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

.nav-cta {
    background: var(--cyan);
    color: var(--bg) !important;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.nav-cta:hover {
    background: var(--cyan-dim);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
}

/* CLI Theme - Nav CTA */
[data-theme="cli"] .nav-cta {
    background: transparent !important;
    border: 1px solid var(--cyan);
    color: var(--cyan) !important;
}

[data-theme="cli"] .nav-cta:hover {
    background: var(--cyan) !important;
    color: var(--bg) !important;
}

/* CLI Theme - Links */
[data-theme="cli"] a {
    text-decoration: none;
    position: relative;
}

[data-theme="cli"] a:not(.btn):not(.nav-cta):not(.logo)::after {
    content: '_';
    animation: blink 1s step-end infinite;
}

/* ----------------------------------------
   Theme Toggle
   ---------------------------------------- */

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    font-family: var(--font-mono);
}

.theme-toggle:hover {
    border-color: var(--cyan);
}

.theme-toggle-track {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--bg-elevated);
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.theme-toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all 0.3s ease;
}

[data-theme="cli"] .theme-toggle-thumb {
    left: 22px;
    background: var(--cyan);
    box-shadow: 0 0 10px var(--cyan);
}

.theme-label {
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
    min-width: 45px;
}

[data-theme="cli"] .theme-label {
    color: var(--cyan);
}

/* Mobile Theme Toggle */
.theme-toggle.mobile-only {
    display: none;
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    background: var(--bg-elevated);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

[data-theme="cli"] .theme-toggle.mobile-only {
    box-shadow: 0 0 20px rgba(0, 255, 159, 0.4);
}

@media (max-width: 768px) {
    .nav-links li:has(.theme-toggle) {
        display: none;
    }

    .theme-toggle.mobile-only {
        display: flex;
    }
}

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

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 6rem;
    position: relative;
    overflow: hidden;
}

/* Clean Theme - Gradient mesh background */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(0, 217, 255, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(20, 184, 166, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at center top, rgba(0, 217, 255, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

/* CLI Theme - Matrix Rain Background */
[data-theme="cli"] .hero::before {
    background:
        radial-gradient(ellipse at center top, rgba(0, 255, 159, 0.1) 0%, transparent 50%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Ctext x='10' y='20' fill='%23003311' font-family='monospace' font-size='10'%3E01%3C/text%3E%3Ctext x='50' y='40' fill='%23002211' font-family='monospace' font-size='8'%3E10%3C/text%3E%3Ctext x='30' y='70' fill='%23003311' font-family='monospace' font-size='10'%3E11%3C/text%3E%3Ctext x='70' y='90' fill='%23002211' font-family='monospace' font-size='8'%3E00%3C/text%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.hero h1 {
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

/* ----------------------------------------
   Problem/Solution Section
   ---------------------------------------- */

.problem-solution {
    background: var(--bg-elevated);
}

.ps-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-top: 3rem;
}

.ps-column h3 {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ps-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.ps-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.ps-icon.problem {
    background: rgba(239, 68, 68, 0.15);
    color: var(--red);
}

.ps-icon.solution {
    background: rgba(34, 197, 94, 0.15);
    color: var(--green);
}

.ps-item h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.ps-item p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* CLI Theme - Problem/Solution Icons */
[data-theme="cli"] .ps-icon.problem {
    background: transparent;
    border: 1px solid var(--red);
    color: var(--red);
    text-shadow: 0 0 5px var(--red);
}

[data-theme="cli"] .ps-icon.solution {
    background: transparent;
    border: 1px solid var(--green);
    color: var(--green);
    text-shadow: 0 0 5px var(--green);
}

/* ----------------------------------------
   How It Works (Steps)
   ---------------------------------------- */

.steps-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 4rem;
    position: relative;
}

.steps-container::before {
    content: '';
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: var(--border);
}

.step {
    text-align: center;
    position: relative;
    z-index: 1;
    flex: 1;
    max-width: 280px;
}

.step-number {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
}

.step:hover .step-number {
    border-color: var(--cyan);
    box-shadow: 0 0 30px rgba(0, 217, 255, 0.2);
}

.step h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.step p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* CLI Theme - Step Numbers */
[data-theme="cli"] .step-number {
    border: 2px solid var(--cyan);
    background: transparent;
    color: var(--cyan);
    font-family: var(--font-mono);
    text-shadow: 0 0 10px var(--cyan);
}

[data-theme="cli"] .step:hover .step-number {
    box-shadow: 0 0 30px var(--cyan);
}

/* ----------------------------------------
   Section Backgrounds
   ---------------------------------------- */

.terminal-section {
    background: var(--bg-elevated);
}

.config-section {
    background: var(--bg-elevated);
}

.comparison-section {
    background: var(--bg-elevated);
}

.comparison-intro {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.pricing-section {
    background: var(--bg-elevated);
}

.pricing-intro {
    text-align: center;
    margin-bottom: 3rem;
}

.pricing-intro p {
    color: var(--text-muted);
    font-size: 1.125rem;
}

.pricing-footer {
    text-align: center;
    margin-top: 3rem;
}

.pricing-footer a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* ----------------------------------------
   Grids
   ---------------------------------------- */

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 3rem;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.faq-grid {
    max-width: 800px;
    margin: 3rem auto 0;
}

/* ----------------------------------------
   CTA Section
   ---------------------------------------- */

.cta-section {
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg-elevated) 100%);
    text-align: center;
}

.cta-section h2 {
    margin-bottom: 1rem;
}

.cta-section > .container > p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.cta-platforms {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-top: 2rem;
}

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

footer {
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: 4rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 1rem;
    max-width: 280px;
}

.footer-column h4 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    margin-bottom: 1rem;
}

.footer-column ul {
    list-style: none;
}

.footer-column li {
    margin-bottom: 0.5rem;
}

.footer-column a {
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.875rem;
}

.footer-legal {
    display: flex;
    gap: 2rem;
}

.footer-legal a {
    color: var(--text-dim);
}

/* CLI Theme - Footer */
[data-theme="cli"] footer {
    border-top-color: var(--cyan);
}

[data-theme="cli"] .footer-column h4 {
    color: var(--cyan);
}

[data-theme="cli"] .footer-column h4::before {
    content: '# ';
}

/* ----------------------------------------
   CLI Theme - Section Decorations
   ---------------------------------------- */

[data-theme="cli"] section h2 {
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

[data-theme="cli"] section:not(.hero)::before {
    content: '────────────────────────────────────────────────────────────────────────────────';
    display: block;
    color: var(--border);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-align: center;
    margin-bottom: 2rem;
    overflow: hidden;
    white-space: nowrap;
}

[data-theme="cli"] h2::before {
    content: '> ';
    color: var(--cyan);
}

/* CLI Command Prompt Prefix */
.cli-prompt {
    display: none;
    color: var(--cyan);
    font-family: var(--font-mono);
    margin-right: 0.5rem;
}

[data-theme="cli"] .cli-prompt {
    display: inline;
}

/* ----------------------------------------
   Matrix Canvas
   ---------------------------------------- */

#matrix-canvas {
    display: none;
}

[data-theme="cli"] #matrix-canvas {
    display: block;
}

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

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

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
}

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

    .mobile-menu-btn {
        display: block;
    }

    .ps-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .steps-container {
        flex-direction: column;
        align-items: center;
    }

    .steps-container::before {
        display: none;
    }

    .step {
        max-width: 100%;
    }

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

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

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-brand p {
        margin: 1rem auto 0;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}
