/* The homepage, https://wisp.pidster.com/ (ADR 0065). Colours come from palette.css; dark first, light from
   prefers-color-scheme. No web fonts and no third-party requests: the system's own faces. */

:root {
    --bg: var(--web-night);
    --raised: var(--web-night-raised);
    --rule: var(--web-night-rule);
    --text: var(--tui-white);
    --muted: var(--tui-mist);
    --accent: var(--tui-wisp);
    --strong: var(--tui-glow);
    --attention: var(--tui-amber);
    --code-bg: var(--tui-sent);
    --button-text: var(--web-night);
    --shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
}

@media (prefers-color-scheme: light) {
    :root {
        --bg: var(--web-paper);
        --raised: var(--web-paper-raised);
        --rule: var(--web-rule);
        --text: var(--web-ink);
        --muted: var(--web-slate);
        --accent: var(--web-blue);
        --strong: var(--web-blue-deep);
        --attention: var(--web-amber-ink);
        --code-bg: var(--web-paper-sunk);
        --button-text: #FFFFFF;
        --shadow: 0 30px 70px -35px rgba(13, 63, 92, 0.45);
        color-scheme: light;
    }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 17px/1.6 var(--web-sans);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

code, pre { font-family: var(--web-mono); }
code { font-size: 0.88em; }
p code, li code, dd code { color: var(--strong); }

h1, h2, h3 { font-family: var(--web-display); color: var(--strong); line-height: 1.15; letter-spacing: -0.015em; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); margin: 0 0 0.6rem; max-width: 22ch; }
h3 { font-size: 1.08rem; margin: 0 0 0.4rem; letter-spacing: 0; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

.skip { position: absolute; left: -999px; top: 8px; background: var(--raised); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.eyebrow {
    margin: 0 0 0.75rem;
    color: var(--attention);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.section-lede { color: var(--muted); max-width: 62ch; margin: 0 0 2rem; }

section { padding: 72px 0; }
@media (min-width: 900px) { section { padding: 96px 0; } }
section + section { border-top: 1px solid var(--rule); }

/* The bar */

.bar { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--rule); }
.bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--strong); font-weight: 650; font-size: 1.15rem; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand.small { font-size: 1rem; gap: 8px; }
.bar nav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.bar nav a { color: var(--muted); padding: 6px 10px; border-radius: 8px; font-size: 0.93rem; }
.bar nav a:hover { color: var(--strong); background: var(--raised); text-decoration: none; }
@media (max-width: 560px) {
    .bar nav a:nth-child(3) { display: none; }
    .bar nav a { padding: 6px 7px; }
}

/* The hero */

.hero { padding-top: 40px; overflow: hidden; }
.hero-inner { display: grid; gap: 24px; align-items: center; }
@media (min-width: 900px) {
    .hero { padding-top: 56px; }
    .hero-inner { grid-template-columns: 1.05fr 1fr; gap: 16px; }
}
.hero h1 { font-size: clamp(2.2rem, 5.6vw, 3.6rem); margin: 0 0 1.2rem; max-width: 15ch; letter-spacing: -0.025em; }
.lede { font-size: 1.12rem; color: var(--muted); max-width: 56ch; margin: 0 0 1.8rem; }
.needs { color: var(--muted); font-size: 0.88rem; margin: 1.2rem 0 0; }

.hero-art { margin: 0; position: relative; order: -1; }
@media (min-width: 900px) { .hero-art { order: 0; margin-right: -80px; } }
.hero-art img {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    -webkit-mask-image: radial-gradient(ellipse 62% 60% at 52% 46%, #000 52%, transparent 100%);
    mask-image: radial-gradient(ellipse 62% 60% at 52% 46%, #000 52%, transparent 100%);
}
@media (prefers-color-scheme: light) {
    /* The picture is a night scene; on paper it sits in a dark well of its own. */
    .hero-art img {
        border-radius: 28px;
        -webkit-mask-image: none;
        mask-image: none;
        box-shadow: var(--shadow);
    }
}

/* Install and buttons */

.install { position: relative; max-width: 460px; }
.install pre {
    margin: 0;
    padding: 16px 84px 16px 18px;
    background: var(--code-bg);
    border: 1px solid var(--rule);
    border-radius: 12px;
    color: var(--strong);
    font-size: 0.92rem;
    line-height: 1.7;
    overflow-x: auto;
}
.install code { font-size: inherit; }
.dim { color: var(--muted); user-select: none; -webkit-user-select: none; }
.copy {
    position: absolute;
    top: 10px;
    right: 10px;
    font: 600 0.78rem var(--web-sans);
    color: var(--muted);
    background: var(--raised);
    border: 1px solid var(--rule);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
}
.copy:hover { color: var(--strong); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.4rem; }
.button {
    display: inline-flex;
    align-items: center;
    padding: 11px 18px;
    border-radius: 10px;
    border: 1px solid var(--rule);
    color: var(--strong);
    font-weight: 600;
    font-size: 0.95rem;
    background: var(--raised);
}
.button:hover { text-decoration: none; border-color: var(--accent); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--button-text); }
.button.primary:hover { background: var(--strong); border-color: var(--strong); }

.more { display: inline-block; margin-top: 1.6rem; font-weight: 600; }
.more::after { content: " →"; }

/* The terminal: always wisp-tui's own dark colours, whatever the page's theme. */

.session { padding-top: 32px; border-top: none !important; }
.terminal {
    max-width: 860px;
    margin: 0 auto;
    background: var(--web-night);
    border: 1px solid var(--tui-deep);
    border-radius: 14px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.term-top { display: flex; align-items: center; gap: 7px; padding: 11px 14px; background: var(--tui-sent); border-bottom: 1px solid var(--tui-deep); }
.term-top i { width: 11px; height: 11px; border-radius: 50%; background: var(--tui-deep); }
.term-top span { margin-left: 10px; color: var(--tui-mist); font: 0.78rem var(--web-sans); }
.term-body {
    margin: 0;
    padding: 18px 20px 14px;
    color: var(--tui-white);
    font-size: clamp(0.56rem, 1.55vw, 0.84rem);
    /* Close enough for the dialog's box-drawing lines to join, as they do in a terminal. */
    line-height: 1.32;
    overflow-x: auto;
}
.t-user { color: var(--tui-white); font-weight: 700; }
.t-body { color: var(--tui-white); }
.t-tool, .t-note { color: var(--tui-mist); }
.t-out { color: var(--tui-white); opacity: 0.86; }
.t-amber { color: var(--tui-amber); }
.t-wisp { color: var(--tui-wisp); }
.t-glow { color: var(--tui-glow); }
.t-prompt { color: var(--tui-glow); font-weight: 700; }
.t-input { display: inline-block; background: var(--tui-deep); margin-top: 6px; padding: 1px 0; width: 100%; }
.t-status { display: inline-block; padding-top: 2px; }
.caption { color: var(--muted); font-size: 0.92rem; text-align: center; max-width: 60ch; margin: 1.2rem auto 0; }

/* Cards */

.cards { display: grid; gap: 20px; margin-top: 2rem; }
@media (min-width: 820px) { .cards.two { grid-template-columns: 1fr 1fr; } }
.card { background: var(--raised); border: 1px solid var(--rule); border-radius: 16px; padding: 26px; display: flex; flex-direction: column; }
.card p { color: var(--muted); margin: 0 0 1rem; }
.card pre {
    margin: 0;
    padding: 14px 16px;
    background: var(--code-bg);
    border: 1px solid var(--rule);
    border-radius: 10px;
    color: var(--strong);
    font-size: 0.82rem;
    line-height: 1.65;
    overflow-x: auto;
}
.card pre code { font-size: inherit; }
.card .more { margin-top: auto; padding-top: 1.2rem; }

/* The gate */

.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; counter-reset: step; }
@media (min-width: 640px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .steps { grid-template-columns: repeat(5, 1fr); } }
.steps li { position: relative; background: var(--raised); border: 1px solid var(--rule); border-radius: 14px; padding: 20px 18px; }
.steps li p { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.55; }
.step-n {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    margin-bottom: 12px;
    border: 1px solid var(--accent);
    color: var(--accent);
    font: 600 0.8rem var(--web-mono);
}
.steps li.you { border-color: var(--attention); }
.steps li.you .step-n { border-color: var(--attention); color: var(--attention); }
.steps li.you h3 { color: var(--attention); }
@media (min-width: 1000px) {
    .steps li:not(:last-child)::after {
        content: "";
        position: absolute;
        top: 32px;
        right: -13px;
        width: 12px;
        height: 1px;
        background: var(--rule);
    }
}

/* MCP tools */

.tool-grid { display: grid; gap: 1px; margin: 0; background: var(--rule); border: 1px solid var(--rule); border-radius: 14px; overflow: hidden; }
@media (min-width: 640px) { .tool-grid { grid-template-columns: repeat(2, 1fr); } }
.tool-grid div { background: var(--raised); padding: 16px 18px; }
.tool-grid dt { font-family: var(--web-mono); font-size: 0.88rem; color: var(--strong); font-weight: 600; }
.tool-grid dd { margin: 4px 0 0; color: var(--muted); font-size: 0.9rem; }

/* Models */

.models-inner { display: grid; gap: 32px; align-items: center; }
@media (min-width: 900px) { .models-inner { grid-template-columns: 1fr 1fr; } }
.models .section-lede { margin-bottom: 0; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.chips li { background: var(--raised); border: 1px solid var(--rule); border-radius: 999px; padding: 8px 16px; color: var(--muted); font-size: 0.92rem; }
.chips code { color: var(--strong); margin-right: 4px; }

/* Closing and footer */

.closing { text-align: center; }
.closing-inner { display: flex; flex-direction: column; align-items: center; }
.closing h2 { margin: 1rem auto 1.4rem; max-width: none; }
.closing .install { width: 100%; text-align: left; }
.closing .actions { justify-content: center; }

.foot { border-top: 1px solid var(--rule); padding: 32px 0 40px; color: var(--muted); font-size: 0.9rem; }
.foot-inner { display: grid; gap: 12px; }
@media (min-width: 720px) { .foot-inner { grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; } }
.foot p { margin: 0; }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.foot nav a { color: var(--muted); }
.foot nav a:hover { color: var(--strong); }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Grid and flex children shrink below their code's width; the code scrolls inside its own box instead. */
.hero-inner > *, .cards > *, .models-inner > *, .steps > *, .card pre, .install { min-width: 0; }
@media (max-width: 480px) {
    .install pre { padding-right: 18px; }
    .copy { display: none; }
}
