/* Sherlock landing page. Tokens mirror packages/web/src/app/globals.css so the
 * site and the app share one palette; dark is the primary identity, light
 * follows the visitor's system preference. */

@font-face {
    /* Jersey 10, SIL OFL 1.1 (assets/fonts/OFL.txt). Self-hosted so the page
     * makes no third-party requests, matching the app's next/font setup. */
    font-family: "Jersey 10";
    src: url("assets/fonts/jersey-10-latin.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --background: 265 32% 6.5%;
    --background-secondary: 265 30% 8.5%;
    --foreground: 275 25% 93%;
    --card: 265 30% 9%;
    --primary: 266 90% 70%;
    --primary-foreground: 265 40% 8%;
    --muted-foreground: 270 16% 66%;
    --accent: 266 32% 20%;
    --accent-foreground: 270 60% 88%;
    --border: 265 25% 18%;
    --highlight: 189 92% 60%;
    --neon: 266 95% 72%;
    --neon-alt: 189 92% 60%;
    --glow-strength: 0.5;
    --grid-line: 266 80% 70%;
    --grid-opacity: 0.07;
    --logo-glow: 266 95% 72%;
    --logo-glow-strength: 0;
    --logo-ink: 275 25% 93%;
    --code-bg: 265 34% 5%;

    --font-pixel: "Jersey 10", ui-monospace, monospace;
    --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
    --radius: 0.375rem;

    color-scheme: dark;
}

@media (prefers-color-scheme: light) {
    :root {
        --background: 276 30% 97%;
        --background-secondary: 276 26% 94.5%;
        --foreground: 268 45% 11%;
        --card: 0 0% 100%;
        --primary: 266 72% 50%;
        --primary-foreground: 280 40% 99%;
        --muted-foreground: 267 14% 44%;
        --accent: 273 45% 94%;
        --accent-foreground: 266 60% 34%;
        --border: 274 28% 89%;
        --highlight: 189 88% 32%;
        --neon: 266 78% 58%;
        --neon-alt: 189 88% 40%;
        --glow-strength: 0.52;
        --grid-line: 266 55% 60%;
        --grid-opacity: 0.09;
        --logo-glow: 266 80% 56%;
        --logo-glow-strength: 0.32;
        --logo-ink: 268 55% 28%;
        --code-bg: 265 32% 8%;

        color-scheme: light;
    }
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
}

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

body {
    margin: 0;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: hsl(var(--primary));
    text-decoration-color: hsl(var(--primary) / 0.35);
    text-underline-offset: 3px;
}
a:hover { text-decoration-color: currentColor; }

code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    padding: 0.1em 0.35em;
    border-radius: 4px;
    background: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

h1, h2, h3 {
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0;
}

.container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .container { padding: 0 1.5rem; }
}

.pixel-type {
    font-family: var(--font-pixel);
    font-weight: 400;
    letter-spacing: 0;
    text-rendering: geometricPrecision;
}

/* ---------------------------------------------------------------------------
 * Cyberpunk surface treatments, ported from the app.
 * ------------------------------------------------------------------------ */

.cyber-grid {
    position: relative;
    isolation: isolate;
}
.cyber-grid::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(to right, hsl(var(--grid-line)) 1px, transparent 1px),
        linear-gradient(to bottom, hsl(var(--grid-line)) 1px, transparent 1px);
    background-size: 56px 56px;
    opacity: var(--grid-opacity);
    mask-image: radial-gradient(ellipse 80% 70% at 50% 10%, #000 20%, transparent 78%);
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 10%, #000 20%, transparent 78%);
}

.cyber-bloom {
    position: relative;
    isolation: isolate;
}
.cyber-bloom::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 140%;
    aspect-ratio: 2 / 1;
    transform: translate(-50%, -50%);
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(
        ellipse at center,
        hsl(var(--neon) / calc(var(--glow-strength) * 0.55)) 0%,
        hsl(var(--neon) / calc(var(--glow-strength) * 0.18)) 38%,
        transparent 70%
    );
}

.cyber-rule {
    height: 1px;
    margin: 0;
    border: none;
    background-color: hsl(var(--border));
    background-image: linear-gradient(
        to right,
        transparent 0%,
        hsl(var(--neon) / 0.5) 22%,
        hsl(var(--neon-alt) / 0.5) 78%,
        transparent 100%
    );
}

.logo-glow {
    filter:
        drop-shadow(0 0 1px hsl(var(--logo-glow) / var(--logo-glow-strength)))
        drop-shadow(0 0 8px hsl(var(--logo-glow) / calc(var(--logo-glow-strength) * 0.75)));
}

.cyber-focus-glow {
    border-color: hsl(var(--neon) / 0.55);
    box-shadow:
        0 0 0 1px hsl(var(--neon) / 0.35),
        0 0 18px -2px hsl(var(--neon) / calc(var(--glow-strength) * 0.8));
}

/* ---------------------------------------------------------------------------
 * Header
 * ------------------------------------------------------------------------ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: hsl(var(--background) / 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid hsl(var(--border) / 0.7);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: 4rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: hsl(var(--logo-ink));
    text-decoration: none;
    font-size: 1.9rem;
    line-height: 1;
}
.brand img {
    display: block;
    width: 44px;
    height: auto;
    image-rendering: pixelated;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-size: 0.925rem;
}
.site-nav a {
    color: hsl(var(--muted-foreground));
    text-decoration: none;
}
.site-nav a:hover { color: hsl(var(--foreground)); }
.site-nav .nav-github {
    color: hsl(var(--foreground));
    padding: 0.35rem 0.8rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
}
.site-nav .nav-github:hover { border-color: hsl(var(--neon) / 0.6); }

@media (max-width: 639px) {
    .site-nav a:not(.nav-github) { display: none; }
}

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

.hero {
    overflow: hidden;
}

.hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: 5rem;
    padding-bottom: 5rem;
}

@media (min-width: 768px) {
    .hero-inner { padding-top: 7rem; padding-bottom: 6.5rem; }
}

.hero-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(0.75rem, 3vw, 1.75rem);
    margin-bottom: 2.25rem;
}
.hero-mark {
    display: block;
    width: clamp(84px, 18vw, 150px);
    height: auto;
    image-rendering: pixelated;
}
.hero-wordmark {
    color: hsl(var(--logo-ink));
    font-size: clamp(4rem, 16vw, 8.5rem);
    line-height: 0.8;
}

.hero h1 {
    font-size: clamp(2.25rem, 6.5vw, 4rem);
    font-weight: 700;
}

.lede {
    margin: 1rem 0 0;
    font-size: clamp(1.05rem, 2.4vw, 1.35rem);
    color: hsl(var(--muted-foreground));
}

.search-demo {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    max-width: 640px;
    margin-top: 2.5rem;
    padding: 0.85rem 0.9rem 0.85rem 1.1rem;
    border: 1px solid;
    border-radius: 0.6rem;
    background: hsl(var(--card) / 0.8);
    text-align: left;
}
.search-icon {
    flex: none;
    color: hsl(var(--primary));
}
.search-query {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    font-family: var(--font-mono);
    font-size: clamp(0.85rem, 2.4vw, 1.05rem);
    color: hsl(var(--muted-foreground));
}
.search-query .is-typing { color: hsl(var(--foreground)); }
.caret {
    display: inline-block;
    width: 0.55em;
    height: 1.1em;
    margin-left: 2px;
    vertical-align: text-bottom;
    background: hsl(var(--primary) / 0.85);
    animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
    .caret { animation: none; }
}
.search-demo kbd {
    flex: none;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    padding: 0.2rem 0.6rem;
    border-radius: 0.3rem;
    background: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0 1.35rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}
.btn-primary {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    box-shadow: 0 0 22px -4px hsl(var(--neon) / calc(var(--glow-strength) * 1.2));
}
.btn-primary:hover {
    box-shadow: 0 0 30px -2px hsl(var(--neon) / calc(var(--glow-strength) * 1.5));
}
.btn-ghost {
    color: hsl(var(--foreground));
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card) / 0.6);
}
.btn-ghost:hover { border-color: hsl(var(--neon) / 0.6); }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin: 2.75rem 0 0;
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: hsl(var(--muted-foreground));
}
.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: hsl(168 70% 55%);
    box-shadow: 0 0 8px hsl(168 70% 55% / 0.7);
}

/* ---------------------------------------------------------------------------
 * Sections
 * ------------------------------------------------------------------------ */

.section {
    padding: 4.5rem 0;
}
@media (min-width: 768px) {
    .section { padding: 6rem 0; }
}
.section-alt {
    background: hsl(var(--background-secondary));
    border-top: 1px solid hsl(var(--border) / 0.6);
    border-bottom: 1px solid hsl(var(--border) / 0.6);
}

.section-kicker {
    margin: 0 0 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: hsl(var(--highlight));
}

.section h2 {
    font-size: clamp(1.75rem, 4.2vw, 2.6rem);
    font-weight: 700;
    max-width: 22ch;
}

.section-lede,
.split p:not(.section-kicker) {
    max-width: 62ch;
    margin: 1.1rem 0 0;
    color: hsl(var(--muted-foreground));
    font-size: 1.075rem;
}

/* Features */

.feature-grid {
    display: grid;
    gap: 1rem;
    margin-top: 3rem;
}
@media (min-width: 720px) {
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1040px) {
    .feature-grid { grid-template-columns: repeat(4, 1fr); }
}

.card {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    border: 1px solid hsl(var(--border));
    border-radius: 0.6rem;
    background: hsl(var(--card));
    transition: border-color 0.2s, box-shadow 0.2s;
}
.card:hover {
    border-color: hsl(var(--neon) / 0.45);
    box-shadow: 0 0 24px -10px hsl(var(--neon) / calc(var(--glow-strength) * 1.2));
}
.card h3 {
    font-size: 1.1rem;
    margin-top: 1rem;
}
.card p {
    margin: 0.5rem 0 0;
    font-size: 0.95rem;
    color: hsl(var(--muted-foreground));
}
.card-icon {
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    background: hsl(var(--accent));
    color: hsl(var(--primary));
}
.card-icon svg { width: 1.35rem; height: 1.35rem; }

.host-logos {
    display: flex;
    gap: 0.5rem;
    margin: auto 0 0;
    padding: 1.1rem 0 0;
    list-style: none;
}
.host-logos li {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid hsl(var(--border));
    border-radius: 0.4rem;
}
.host-logos img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}
@media (prefers-color-scheme: dark) {
    .host-logos .invert-dark { filter: invert(1); }
}

/* Privacy split */

.split {
    display: grid;
    gap: 2.5rem;
    align-items: center;
}
@media (min-width: 900px) {
    .split { grid-template-columns: 1fr 1fr; gap: 4rem; }
}

.checklist {
    margin: 1.5rem 0 0;
    padding: 0;
    list-style: none;
}
.checklist li {
    position: relative;
    padding-left: 1.75rem;
    margin-top: 0.6rem;
}
.checklist li::before {
    content: "";
    position: absolute;
    left: 0.15rem;
    top: 0.5em;
    width: 0.6rem;
    height: 0.35rem;
    border-left: 2px solid hsl(var(--highlight));
    border-bottom: 2px solid hsl(var(--highlight));
    transform: rotate(-45deg);
}

/* Code */

.code-window,
.code-block {
    position: relative;
    margin: 0;
    border: 1px solid hsl(var(--border));
    border-radius: 0.6rem;
    background: hsl(var(--code-bg));
    color: hsl(275 25% 90%);
    overflow: hidden;
    box-shadow: 0 20px 50px -24px hsl(var(--neon) / calc(var(--glow-strength) * 0.8));
}
.code-window figcaption {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid hsl(265 25% 16%);
}
.code-window figcaption span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: hsl(265 20% 24%);
}
.code-window figcaption em {
    margin-left: 0.6rem;
    font-style: normal;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: hsl(270 16% 62%);
}
.code-window pre,
.code-block pre {
    margin: 0;
    padding: 1.25rem;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.7;
}
.code-window code,
.code-block code {
    padding: 0;
    background: none;
    color: inherit;
    font-size: inherit;
}
.code-block {
    margin-top: 2.25rem;
}
.code-block pre { padding-right: 5.5rem; }

.t-key { color: hsl(266 90% 76%); }
.t-str { color: hsl(189 80% 62%); }
.t-lit { color: hsl(320 75% 70%); }
.t-prompt { color: hsl(270 16% 50%); user-select: none; }

.copy-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.3rem 0.7rem;
    border: 1px solid hsl(265 25% 22%);
    border-radius: 0.3rem;
    background: hsl(265 30% 12%);
    color: hsl(270 20% 80%);
    font: 500 0.78rem var(--font-sans);
    cursor: pointer;
}
.copy-btn:hover { border-color: hsl(266 95% 72% / 0.6); color: #fff; }

/* Steps */

.steps {
    display: grid;
    gap: 1rem;
    margin-top: 2.5rem;
}
@media (min-width: 840px) {
    .steps { grid-template-columns: repeat(3, 1fr); }
}
.step {
    padding: 1.5rem;
    border: 1px solid hsl(var(--border));
    border-radius: 0.6rem;
    background: hsl(var(--card));
}
.step-num {
    display: block;
    font-size: 2.4rem;
    line-height: 1;
    color: hsl(var(--primary));
}
.step h3 {
    margin-top: 0.75rem;
    font-size: 1.1rem;
}
.step p {
    margin: 0.5rem 0 0;
    font-size: 0.95rem;
    color: hsl(var(--muted-foreground));
}

.docs-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin: 2rem 0 0;
    color: hsl(var(--muted-foreground));
    font-size: 0.95rem;
}

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

.site-footer {
    padding: 2.5rem 0 3rem;
    font-size: 0.9rem;
    color: hsl(var(--muted-foreground));
}
.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1.5rem;
}
.footer-brand .pixel-type {
    font-size: 1.75rem;
    line-height: 1;
    color: hsl(var(--logo-ink));
}
.footer-brand p {
    max-width: 52ch;
    margin: 0.5rem 0 0;
}
.footer-nav {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}
.footer-nav a {
    color: hsl(var(--muted-foreground));
    text-decoration: none;
}
.footer-nav a:hover { color: hsl(var(--foreground)); }

/* ---------------------------------------------------------------------------
 * MCP
 * ------------------------------------------------------------------------ */

.announce {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 2.5rem;
    padding: 0.3rem 0.9rem 0.3rem 0.3rem;
    border: 1px solid hsl(var(--neon) / 0.45);
    border-radius: 999px;
    background: hsl(var(--card) / 0.7);
    color: hsl(var(--foreground));
    font-size: 0.875rem;
    text-decoration: none;
    box-shadow: 0 0 18px -6px hsl(var(--neon) / calc(var(--glow-strength) * 1.2));
    transition: border-color 0.15s, box-shadow 0.15s;
}
.announce:hover {
    border-color: hsl(var(--neon) / 0.8);
    box-shadow: 0 0 24px -4px hsl(var(--neon) / calc(var(--glow-strength) * 1.4));
}
.announce-tag {
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.site-nav .nav-mcp {
    color: hsl(var(--primary));
    font-weight: 600;
}

.mcp-split {
    display: grid;
    gap: 3rem;
    align-items: stretch;
}
@media (min-width: 960px) {
    .mcp-split { grid-template-columns: 1fr 1fr; gap: 4.5rem; }
}

.code-block-tight { margin-top: 1.75rem; }

.mcp-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.25rem 0 0;
}

/* Assistant transcript */

.chat-window {
    display: flex;
    flex-direction: column;
    margin: 0;
    border: 1px solid hsl(var(--border));
    border-radius: 1rem;
    background: hsl(var(--code-bg));
    color: hsl(275 25% 90%);
    overflow: hidden;
    box-shadow: 0 24px 60px -32px hsl(var(--neon) / calc(var(--glow-strength) * 1.1));
}

.chat-head {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid hsl(265 25% 15%);
    font-size: 0.9rem;
}
.chat-avatar {
    display: grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: hsl(266 72% 50%);
    color: #fff;
}
.chat-title { font-weight: 600; }
.chat-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: hsl(270 16% 62%);
}
.chat-status .dot { width: 6px; height: 6px; }

/* Messages sit at the bottom of the thread, as in a real chat. */
.chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem 1.25rem;
    font-size: 0.95rem;
}
.chat code {
    background: hsl(266 32% 20%);
    color: hsl(270 60% 88%);
}

.chat-input {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 1rem 1rem;
    padding: 0.55rem 0.55rem 0.55rem 1rem;
    border: 1px solid hsl(265 25% 18%);
    border-radius: 999px;
    background: hsl(265 30% 9%);
    font-size: 0.9rem;
    color: hsl(270 16% 50%);
}
.chat-send {
    display: grid;
    place-items: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    background: hsl(266 32% 22%);
    color: hsl(270 60% 88%);
}

.msg {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    line-height: 1.55;
}
.msg-user {
    align-self: flex-end;
    background: hsl(266 72% 50%);
    color: #fff;
    border-radius: 1.1rem;
    border-bottom-right-radius: 0.3rem;
}
.msg-assistant {
    align-self: flex-start;
    max-width: 100%;
    padding: 0;
}

.tool-call {
    align-self: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: hsl(270 16% 62%);
}
.tool-name { color: hsl(189 92% 66%); }
.tool-name::before { content: "→ "; color: hsl(270 16% 45%); }
