/* SpawnWeaver landing page — self-contained, dependency-free.
   Light + dark via prefers-color-scheme; fluid type; reduced-motion respected. */

:root {
    --bg: #ffffff;
    --bg-subtle: #f6f7f9;
    --bg-inset: #0d1117;          /* code windows stay dark in both themes */
    --text: #17202a;
    --text-secondary: #4b5563;
    --text-faint: #8b95a1;
    --border: #e5e8ec;
    --accent: #4f6bf5;
    --accent-strong: #3d55d6;
    --accent-soft: rgba(79, 107, 245, 0.09);
    --ok: #16a34a;
    --code-text: #dbe2ea;
    --code-comment: #7b8794;
    --code-accent: #7ea6ff;
    --code-string: #98d3a5;
    --shadow: 0 1px 2px rgba(13, 18, 28, 0.05), 0 8px 24px rgba(13, 18, 28, 0.06);
    --radius: 10px;
    --radius-lg: 14px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0c0f14;
        --bg-subtle: #12161d;
        --text: #e8edf3;
        --text-secondary: #a6b0bd;
        --text-faint: #6b7686;
        --border: #232a34;
        --accent: #6d86ff;
        --accent-strong: #8299ff;
        --accent-soft: rgba(109, 134, 255, 0.12);
        --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
    }
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
    font-family: "Inter", -apple-system, "Segoe UI", system-ui, Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* --- Topbar --- */

.topbar {
    position: sticky; top: 0; z-index: 10;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.topbar-inner {
    display: flex; align-items: center; gap: 28px;
    height: 60px;
}

.logo {
    display: flex; align-items: center; gap: 10px;
    font-weight: 700; font-size: 17px; color: var(--text);
    letter-spacing: -0.01em;
}
.logo img { width: 26px; height: 26px; border-radius: 6px; }
.logo:hover { color: var(--text); }

.topbar-nav { display: flex; gap: 22px; font-size: 14.5px; }
.topbar-nav a { color: var(--text-secondary); font-weight: 500; }
.topbar-nav a:hover { color: var(--text); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 14.5px; }
.topbar-right > a { color: var(--text-secondary); font-weight: 500; }
.topbar-right > a:hover { color: var(--text); }

/* --- Buttons --- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 20px; border-radius: 8px;
    font-size: 15px; font-weight: 600; line-height: 1.2;
    border: 1px solid transparent; cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.btn-sm { padding: 7px 14px; font-size: 14px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); color: #fff; transform: translateY(-1px); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--text-faint); color: var(--text); }

/* --- Hero --- */

.hero { padding: clamp(56px, 10vw, 110px) 0 clamp(40px, 6vw, 72px); }

.hero-grid {
    display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: clamp(32px, 5vw, 64px); align-items: center;
}

.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
    color: var(--accent); background: var(--accent-soft);
    padding: 5px 12px; border-radius: 999px; margin-bottom: 18px;
}

h1 {
    font-size: clamp(34px, 5vw, 54px);
    line-height: 1.08; letter-spacing: -0.03em; font-weight: 800;
}

.hero .sub {
    margin-top: 18px; font-size: clamp(16px, 1.6vw, 19px);
    color: var(--text-secondary); max-width: 34em;
}

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.hero-note { margin-top: 14px; font-size: 13.5px; color: var(--text-faint); }

/* --- Code window --- */

.code-window {
    background: var(--bg-inset); border-radius: var(--radius-lg);
    box-shadow: var(--shadow); overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.code-titlebar {
    display: flex; align-items: center; gap: 6px;
    padding: 11px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.code-titlebar .dot { width: 11px; height: 11px; border-radius: 50%; opacity: 0.9; }
.code-titlebar .dot:nth-child(1) { background: #f26d6d; }
.code-titlebar .dot:nth-child(2) { background: #f2c14c; }
.code-titlebar .dot:nth-child(3) { background: #54d68a; }
.code-titlebar .code-file { margin-left: 8px; font-size: 12.5px; color: var(--code-comment); font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }

.code-window pre {
    padding: 18px 20px; overflow-x: auto;
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 13.5px; line-height: 1.7; color: var(--code-text);
}
.code-window .c { color: var(--code-comment); }
.code-window .k { color: var(--code-accent); }
.code-window .s { color: var(--code-string); }

/* --- Sections --- */

.section { padding: clamp(44px, 7vw, 84px) 0; }
.section.alt { background: var(--bg-subtle); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-head { max-width: 640px; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head h2 { font-size: clamp(26px, 3.2vw, 36px); letter-spacing: -0.02em; line-height: 1.15; }
.section-head p { margin-top: 12px; color: var(--text-secondary); font-size: 16.5px; }

/* Steps */

.steps-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }

.step {
    background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 24px;
}
.step-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 8px;
    background: var(--accent-soft); color: var(--accent);
    font-weight: 700; font-size: 14px; margin-bottom: 14px;
}
.step h3 { font-size: 16.5px; letter-spacing: -0.01em; }
.step p { margin-top: 6px; font-size: 14.5px; color: var(--text-secondary); }
.step code {
    display: block; margin-top: 12px; padding: 9px 12px;
    background: var(--bg-inset); color: var(--code-text);
    border-radius: 7px; font-size: 12px; overflow-x: auto; white-space: nowrap;
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
}

/* Feature grid */

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

.feature {
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 24px; background: var(--bg);
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.feature:hover { border-color: var(--accent); transform: translateY(-2px); }
.feature-icon {
    width: 38px; height: 38px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent-soft); color: var(--accent); margin-bottom: 14px;
}
.feature-icon svg { width: 20px; height: 20px; }
.feature h3 { font-size: 16.5px; letter-spacing: -0.01em; }
.feature p { margin-top: 6px; font-size: 14.5px; color: var(--text-secondary); }
.feature .snippet {
    margin-top: 12px; font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 12px; color: var(--accent); background: var(--accent-soft);
    padding: 6px 10px; border-radius: 6px; display: inline-block;
    max-width: 100%; overflow-x: auto; white-space: nowrap;
}

/* Honest fit */

.fit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.fit-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; background: var(--bg); }
.fit-card h3 { font-size: 16px; margin-bottom: 12px; }
.fit-card ul { list-style: none; }
.fit-card li { padding: 6px 0 6px 28px; position: relative; font-size: 14.5px; color: var(--text-secondary); }
.fit-card li::before { position: absolute; left: 0; top: 6px; font-weight: 700; }
.fit-good li::before { content: "✓"; color: var(--ok); }
.fit-bad li::before { content: "—"; color: var(--text-faint); }

/* Final CTA */

.final-cta { text-align: center; padding: clamp(52px, 8vw, 96px) 0; }
.final-cta h2 { font-size: clamp(28px, 3.6vw, 40px); letter-spacing: -0.02em; }
.final-cta p { margin: 14px auto 0; max-width: 32em; color: var(--text-secondary); font-size: 16.5px; }
.final-cta .cta-row { justify-content: center; }

/* Feedback */

.feedback { max-width: 560px; }
.feedback .field {
    width: 100%; margin-top: 10px; padding: 10px 14px;
    border: 1px solid var(--border); border-radius: 8px;
    background: var(--bg); color: var(--text);
    font: inherit; font-size: 14.5px;
}
.feedback .field:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.feedback textarea.field { resize: vertical; min-height: 96px; }

/* Footer */

.footer { border-top: 1px solid var(--border); padding: 36px 0; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; font-size: 14px; color: var(--text-faint); }
.footer-inner .logo { font-size: 15px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; margin-left: auto; }
.footer-links a { color: var(--text-secondary); }
.footer-links a:hover { color: var(--text); }

/* Reveal animation (opt-in via .reveal; disabled under reduced motion) */

@media (prefers-reduced-motion: no-preference) {
    .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
    .reveal.shown { opacity: 1; transform: none; }
}

/* --- Responsive --- */

@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; }
    .steps-grid, .features { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
    .topbar-nav { display: none; }
    .steps-grid, .features, .fit-grid { grid-template-columns: 1fr; }
}
