/* ---------- Tokens ---------- */
:root {
    color-scheme: light dark;
    --bg: #ffffff;
    --bg-alt: #f5f6fb;
    --fg: #0f172a;
    --muted: #566079;
    --line: #e3e6ef;
    --card: #ffffff;
    --accent: #4f4fe0;
    --accent-2: #0ea5c4;
    --grad: linear-gradient(120deg, #6d6df5, #14b8d4);
    --shadow: 0 12px 32px rgba(15, 23, 42, .08);
    --radius: 16px;
    --code-bg: #12141c;
    --code-fg: #d7dbe8;
    --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0a0c13;
        --bg-alt: #0e111a;
        --fg: #e9ecf5;
        --muted: #9ba4ba;
        --line: #212638;
        --card: #121624;
        --accent: #9b9bff;
        --accent-2: #3dd0ea;
        --shadow: 0 12px 32px rgba(0, 0, 0, .45);
    }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 76px; }

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--fg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .6rem; text-wrap: balance; }
h1:focus { outline: none; }
p { margin: 0 0 1rem; }
a { color: inherit; }

.container { width: min(1160px, 100% - 2.5rem); margin-inline: auto; }
.container.narrow, .narrow { width: min(760px, 100% - 2.5rem); }
.center { text-align: center; }

.icon { flex: none; vertical-align: middle; }

.eyebrow {
    margin: 0 0 .8rem;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--accent);
}

.lead { font-size: 1.15rem; color: var(--muted); }

.grad {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .75rem 1.4rem;
    border-radius: 999px;
    border: 1px solid transparent;
    background: var(--grad);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(91, 91, 240, .3);
    transition: transform .15s ease, box-shadow .15s ease;
}

.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(91, 91, 240, .4); }
.btn:focus-visible, a:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 3px; }

.btn-ghost {
    background: transparent;
    color: var(--fg);
    border-color: var(--line);
    box-shadow: none;
}

.btn-ghost:hover { border-color: var(--accent); box-shadow: none; }
.btn-small { padding: .5rem 1.05rem; font-size: .92rem; }

/* ---------- Header / footer ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line);
}

.header-inner { display: flex; align-items: center; gap: 2rem; height: 64px; }

.brand {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -.02em;
    text-decoration: none;
}

.brand-logo { display: block; width: 30px; height: 30px; border-radius: 9px; box-shadow: 0 4px 14px rgba(79, 79, 224, .35); }
.window-logo { width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 4px; }
.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--grad);
    color: #fff;
}

.main-nav { display: flex; gap: 1.6rem; margin-left: auto; }
.main-nav a { text-decoration: none; color: var(--muted); font-weight: 500; font-size: .95rem; }
.main-nav a:hover { color: var(--fg); }
.header-inner .btn-small { margin-left: 0; }

.site-footer { border-top: 1px solid var(--line); padding: 2.8rem 0; background: var(--bg-alt); }
.footer-inner { display: flex; justify-content: space-between; align-items: flex-start; gap: 2rem; flex-wrap: wrap; }
.footer-tagline { margin: .6rem 0 0; color: var(--muted); }
.footer-legal { margin: 0; color: var(--muted); font-size: .92rem; text-align: right; }
.footer-legal strong { color: var(--fg); }

/* ---------- Sections ---------- */
.section { padding: 5.5rem 0; }
.section.alt { background: var(--bg-alt); }
.section-head { max-width: 720px; margin: 0 auto 3rem; text-align: center; }
.section h2, .hero h1 { font-weight: 800; }
.section h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.fineprint { margin: 2rem 0 0; text-align: center; color: var(--muted); font-size: .92rem; }

.grid { display: grid; gap: 1.25rem; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.7rem;
    box-shadow: var(--shadow);
    transition: transform .2s ease, border-color .2s ease;
}

.card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.card.flat { box-shadow: none; }
.card h3 { font-size: 1.12rem; }
.card p { margin: 0; color: var(--muted); }

.card-icon {
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin-bottom: 1rem;
    border-radius: 12px;
    background: var(--grad);
    color: #fff;
    flex: none;
}

.card-icon.small { width: 40px; height: 40px; border-radius: 11px; }

/* ---------- Hero ---------- */
.hero {
    padding: 4.5rem 0 5rem;
    background:
        radial-gradient(55% 55% at 85% 0%, rgba(91, 91, 240, .22), transparent 70%),
        radial-gradient(40% 45% at 5% 25%, rgba(20, 184, 212, .16), transparent 70%);
    overflow: hidden;
}

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr); gap: 3.5rem; align-items: center; }
.hero h1 { font-size: clamp(2.5rem, 5.4vw, 4.2rem); letter-spacing: -.035em; line-height: 1.04; margin-bottom: 1.2rem; }
.hero .lead { font-size: 1.25rem; max-width: 34em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .9rem; margin: 2rem 0 1.6rem; }

.ticks { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; color: var(--muted); font-size: .95rem; }
.ticks li { display: inline-flex; align-items: center; gap: .45rem; }
.ticks .icon { color: var(--accent-2); }

/* ---------- App window illustration ---------- */
.window {
    background: var(--code-bg);
    color: var(--code-fg);
    border: 1px solid #2a2f3f;
    border-radius: 14px;
    box-shadow: 0 30px 70px rgba(10, 12, 30, .35), 0 0 0 1px rgba(255, 255, 255, .03);
    overflow: hidden;
    min-width: 0;
}

.window-bar { display: flex; align-items: center; gap: .8rem; padding: .65rem .9rem; background: #181b26; border-bottom: 1px solid #2a2f3f; }
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: #3a4052; }
.dots i:nth-child(1) { background: #ff5f57; }
.dots i:nth-child(2) { background: #febc2e; }
.dots i:nth-child(3) { background: #28c840; }
.window-title { font-size: .78rem; color: #8b93a8; margin-inline: auto; padding-right: 48px; }

.window-tabs { display: flex; gap: .3rem; padding: .5rem .7rem 0; background: #14161f; }
.tab { font-size: .76rem; padding: .35rem .8rem; border-radius: 8px 8px 0 0; color: #8b93a8; }
.tab.active { background: var(--code-bg); color: #e6e9f4; }

.code {
    margin: 0;
    padding: 1rem 1.1rem;
    background: var(--code-bg);
    color: var(--code-fg);
    font: .86rem/1.7 var(--mono);
    overflow-x: auto;
    tab-size: 4;
}

.code code { font: inherit; }
.code .k { color: #8fa8ff; }
.code .s { color: #f0b98d; }
.code .n { color: #a5e075; }
.code .c { color: #6f8a7a; font-style: italic; }
.code .m { color: #e6dc93; }

.code.numbered { counter-reset: ln; }
.code.numbered .line::before {
    counter-increment: ln;
    content: counter(ln);
    display: inline-block;
    width: 1.5em;
    margin-right: 1.1em;
    text-align: right;
    color: #586079;
}

.result-head { display: flex; gap: .4rem; padding: .5rem .7rem; background: #14161f; border-top: 1px solid #2a2f3f; }
.pill { font-size: .72rem; padding: .25rem .7rem; border-radius: 6px; color: #8b93a8; background: #1d2130; }
.pill.on { background: #4f6bff; color: #fff; }

.result { padding: .7rem 1rem 1rem; background: #181b25; }
.result-title { font-size: .78rem; font-weight: 600; margin-bottom: .35rem; color: #cfd4e4; }
.result table { border-collapse: collapse; font: .78rem/1.5 "Segoe UI", system-ui, sans-serif; }
.result th, .result td { border: 1px solid #3a4052; padding: .15rem .7rem; text-align: left; }
.result th { background: #262c3d; font-weight: 600; }
.result td.n { color: #7d869c; text-align: right; }
.window-status { padding: .45rem 1rem; font-size: .72rem; color: #8b93a8; background: #14161f; border-top: 1px solid #2a2f3f; }

/* ---------- How it works ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.steps li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.8rem; }
.steps h3 { font-size: 1.25rem; }
.steps p { margin: 0; color: var(--muted); }

.step-no {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-bottom: 1rem;
    border-radius: 50%;
    background: var(--grad);
    color: #fff;
    font-weight: 800;
}

/* ---------- Developers ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 3.5rem; align-items: start; }
.split-copy h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); }
.split-copy p:last-child { color: var(--muted); margin-bottom: 0; }

.benefits { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.benefits li {
    display: flex;
    gap: 1rem;
    padding: 1.2rem 1.3rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.benefits .card-icon { margin: 0; }
.benefits h3 { font-size: 1.02rem; margin-bottom: .2rem; }
.benefits p { margin: 0; color: var(--muted); font-size: .96rem; }

/* ---------- Learners ---------- */
.learn { background: linear-gradient(135deg, #25255f, #0f5a6b); color: #eef1ff; }
.learn .eyebrow { color: #9fe7f5; }
.learn .lead { color: #cdd6f5; }

.card.on-accent {
    background: rgba(255, 255, 255, .07);
    border-color: rgba(255, 255, 255, .16);
    box-shadow: none;
}

.card.on-accent:hover { border-color: rgba(255, 255, 255, .45); }
.card.on-accent p { color: #d6dcf5; }

.callout {
    margin-top: 1.6rem;
    padding: 1.6rem 1.9rem;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .22);
}

.callout h3 { font-size: 1.2rem; }
.callout p { margin: 0; color: #dde3fa; }

/* ---------- Examples ---------- */
.example {
    min-width: 0;
    padding: 1.5rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.example h3 { font-size: 1.12rem; }
.example p { color: var(--muted); font-size: .96rem; }
/* Short snippets wrap instead of getting a scrollbar; the numbered editor mock keeps its lines intact. */
.example .code { border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.window .code { font-size: .82rem; }

/* ---------- Get started ---------- */
.cta { background: var(--bg-alt); }
.cta h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); }

.requirements { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem 1.4rem; margin: 1.6rem 0; color: var(--muted); font-size: .95rem; }
.requirements span { display: inline-flex; align-items: center; gap: .4rem; }
.requirements .icon { color: var(--accent-2); }
.cta .code { text-align: left; border-radius: 12px; max-width: 520px; margin-inline: auto; }

/* ---------- Shared by the download and help pages ---------- */
.h2 { font-weight: 800; font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.h3 { font-size: 1.12rem; }
.btn-large { padding: 1rem 1.8rem; font-size: 1.08rem; }
.center-cta { justify-content: center; margin-bottom: 0; }
.footer-links { margin: .4rem 0 0; color: var(--muted); font-size: .92rem; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--fg); }
:not(pre) > code {
    font-family: var(--mono);
    font-size: .88em;
    padding: .1em .35em;
    border-radius: 6px;
    background: var(--bg-alt);
    border: 1px solid var(--line);
    overflow-wrap: anywhere;
}
kbd {
    display: inline-block;
    min-width: 1.6em;
    padding: .05em .45em;
    font-family: var(--mono);
    font-size: .85em;
    line-height: 1.5;
    text-align: center;
    color: var(--fg);
    background: var(--card);
    border: 1px solid var(--line);
    border-bottom-width: 2px;
    border-radius: 6px;
    white-space: nowrap;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
    .hero-grid, .split { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .steps { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 820px) {
    .main-nav { display: none; }
    .header-inner { justify-content: space-between; }
}

@media (max-width: 640px) {
    .code { font-size: .78rem; padding: .8rem .9rem; }
    .section { padding: 3.8rem 0; }
    .hero { padding: 3rem 0 3.5rem; }
    .grid-3, .grid-2 { grid-template-columns: minmax(0, 1fr); }
    .footer-legal { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; }
}
