/* ============================================
   Flapjack — flapjack.foo
   Clean. Barebones. Developer-first.
   ============================================ */

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

/* --- Theme --- */
:root {
    --bg: #0a0a0a;
    --bg-subtle: #111;
    --bg-code: #161616;
    --text: #e5e5e5;
    --text-muted: #888;
    --accent: #60a5fa;
    --accent-hover: #93bbfd;
    --border: #222;
    --border-subtle: #1a1a1a;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Consolas', monospace;
    --max-width: 960px;
    --radius: 6px;
}

[data-theme="light"] {
    --bg: #fff;
    --bg-subtle: #f7f7f8;
    --bg-code: #f3f4f6;
    --text: #111;
    --text-muted: #666;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --border: #e5e5e5;
    --border-subtle: #eee;
}

/* --- Base --- */
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
p a, .pricing-note a { text-decoration: underline; text-underline-offset: 2px; }

code {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

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

/* --- Nav --- */
nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
    border-bottom: 1px solid var(--border-subtle);
}

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

.logo {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}
.logo:hover { color: var(--text); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.9rem;
}

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

.github-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    display: flex;
    align-items: center;
}
.theme-toggle:hover { color: var(--text); }

[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }

/* --- Hero --- */
.hero {
    padding: 6rem 0 4rem;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

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

.hero-install pre {
    display: inline-block;
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
}

.prompt { color: var(--text-muted); }

.hero-proof {
    margin-bottom: 2.5rem;
}

.hero-proof pre {
    display: inline-block;
    text-align: left;
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    font-size: 0.85rem;
    line-height: 1.7;
}

.comment { color: var(--text-muted); }

.hero-ctas {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.7rem 1.6rem;
    border-radius: var(--radius);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
}
.btn-primary:hover {
    background: #1d4ed8;
    color: #fff;
}

.btn-secondary {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent-hover);
}

.btn-sm {
    font-size: 0.85rem;
    padding: 0.5rem 1.2rem;
}

/* --- Screen reader only --- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Stats --- */
.stats {
    padding: 2rem 0;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
}

.stats-row {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* --- Features --- */
.features {
    padding: 5rem 0;
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
}

.feature h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

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

.feature code {
    background: var(--bg-code);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.85em;
}

/* --- Code Section --- */
.code-section {
    padding: 4rem 0 5rem;
    border-top: 1px solid var(--border-subtle);
}

.code-section h2 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 2rem;
    text-align: center;
}

/* CSS-only tabs */
.code-tabs {
    display: grid;
    grid-template-columns: repeat(3, auto) 1fr;
    max-width: 720px;
    margin: 0 auto;
}

.code-tabs input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.code-tabs label {
    grid-row: 1;
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    text-align: center;
    transition: color 0.15s;
}

.code-tabs label:hover {
    color: var(--text);
}

.code-tabs input[type="radio"]:checked + label {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.panel {
    grid-column: 1 / -1;
    grid-row: 2;
    display: none;
}

#tab-curl:checked ~ #panel-curl,
#tab-js:checked ~ #panel-js,
#tab-is:checked ~ #panel-is {
    display: block;
}

.panel pre {
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    font-size: 0.82rem;
    line-height: 1.7;
    overflow-x: auto;
    margin-top: 0.5rem;
}

/* --- Cloud Pitch --- */
.cloud-pitch {
    padding: 5rem 0;
    text-align: center;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-subtle);
}

.cloud-pitch h2 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.cloud-pitch p {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 560px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

/* --- Pricing --- */
.pricing {
    padding: 5rem 0;
    text-align: center;
    border-top: 1px solid var(--border-subtle);
}

.pricing h2 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.pricing-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 2.5rem;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.price-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem 1.25rem;
    text-align: center;
}

.price-card.featured {
    border-color: var(--accent);
}

.price-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.price {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 1.25rem;
}

.price span {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-muted);
}

.price-card ul {
    list-style: none;
    margin-bottom: 1.5rem;
}

.price-card li {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0.3rem 0;
}

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

/* --- Footer --- */
footer {
    border-top: 1px solid var(--border-subtle);
    padding: 2.5rem 0;
}

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

.footer-links {
    display: flex;
    gap: 1.5rem;
    font-size: 0.85rem;
}

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

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

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero { padding: 4rem 0 3rem; }
    .hero h1 { font-size: 2.2rem; }
    .subtitle { font-size: 1.05rem; }

    .hero-install pre,
    .hero-proof pre {
        font-size: 0.8rem;
        max-width: 100%;
        overflow-x: auto;
    }

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

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

    .code-tabs {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .nav-links { gap: 1rem; font-size: 0.8rem; }
    .hero h1 { font-size: 1.8rem; }
    .pricing-grid { grid-template-columns: 1fr; }

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