/* Asylum — matches the app: dark, quiet surfaces, a violet accent. */
:root {
  --bg: #0e0d12;
  --bg-2: #131218;
  --surface: #18171e;
  --surface-2: #1f1e26;
  --border: #2a2932;
  --text: #ecebf2;
  --muted: #9a97a6;
  --faint: #6f6c7a;
  --accent: #7c3aed;
  --accent-hi: #9b6bff;
  --accent-soft: rgba(124, 58, 237, .16);
  --green: #34d399;
  --amber: #f5a524;
  --red: #f87171;
  --code-bg: #15141a;
  --shadow: 0 30px 80px -20px rgba(0, 0, 0, .65), 0 0 0 1px rgba(255, 255, 255, .06);
  --glow: radial-gradient(60% 50% at 50% 0%, rgba(124, 58, 237, .28), transparent 70%);
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Menlo, monospace;
  --radius: 14px;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fbfaff;
    --bg-2: #f4f2fb;
    --surface: #ffffff;
    --surface-2: #f6f5fa;
    --border: #e4e1ee;
    --text: #17151d;
    --muted: #5d5a6a;
    --faint: #8a8797;
    --accent: #6d28d9;
    --accent-hi: #7c3aed;
    --accent-soft: rgba(109, 40, 217, .1);
    --code-bg: #f3f1f8;
    --shadow: 0 30px 70px -25px rgba(40, 20, 90, .35), 0 0 0 1px rgba(20, 10, 50, .08);
    --glow: radial-gradient(60% 50% at 50% 0%, rgba(124, 58, 237, .14), transparent 70%);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-hi); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent-soft); }
code, kbd, pre { font-family: var(--mono); font-size: .88em; }
code { background: var(--code-bg); border: 1px solid var(--border); border-radius: 6px; padding: .08em .38em; }
kbd { background: var(--surface-2); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; padding: .05em .4em; font-size: .82em; }
img { max-width: 100%; display: block; }

.skip { position: fixed; left: 1rem; top: -4rem; z-index: 50; padding: .5rem 1rem; background: var(--accent); color: #fff; border-radius: 8px; }
.skip:focus { top: 1rem; }

.wrap { width: min(1200px, 100% - 40px); margin: 0 auto; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; gap: 28px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 650; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, var(--accent-hi), var(--accent)); display: grid; place-items: center; }
.brand .mark img { width: 20px; height: 20px; image-rendering: pixelated; }
.site-nav { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.site-nav a { color: var(--muted); font-size: 14.5px; font-weight: 500; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); text-decoration: none; }

/* Buttons */
.button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 10px;
  background: var(--accent); color: #fff; font-weight: 600; font-size: 15px;
  border: 1px solid transparent; transition: background .15s, transform .15s;
}
.button:hover { background: var(--accent-hi); text-decoration: none; transform: translateY(-1px); }
.button.secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.button.secondary:hover { background: var(--surface-2); }
.button.small { padding: 7px 13px; font-size: 14px; border-radius: 8px; }

/* Hero */
.hero { position: relative; padding: 64px 0 24px; text-align: center; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; background: var(--glow); pointer-events: none; }
.hero .wrap { position: relative; }
.pill { display: inline-flex; gap: 8px; align-items: center; padding: 5px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-hi); font-size: 13.5px; font-weight: 600; }
.hero h1 { font-size: clamp(2.3rem, 5.4vw, 3.7rem); line-height: 1.05; letter-spacing: -.035em; margin: 18px auto 16px; max-width: 820px; font-weight: 700; }
.hero h1 span { background: linear-gradient(90deg, var(--accent-hi), #c084fc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lede { margin: 0 auto; }
.lede { font-size: clamp(1.02rem, 1.8vw, 1.15rem); color: var(--muted); max-width: 640px; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 26px 0 12px; }
.small-print { color: var(--faint); font-size: 13.5px; }
.window { margin: 44px auto 0; max-width: 1100px; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); background: var(--surface); }
.window img { width: 100%; height: auto; }

/* Sections */
section.block { padding: 96px 0; }
section.block.alt { background: var(--bg-2); border-block: 1px solid var(--border); }
.eyebrow { color: var(--accent-hi); font-size: 13px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 10px; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); line-height: 1.15; letter-spacing: -.025em; margin: 0 0 14px; font-weight: 700; }
h3 { font-size: 1.12rem; letter-spacing: -.01em; margin: 0 0 8px; }
.section-head { max-width: 700px; margin-bottom: 44px; }
.section-head p { color: var(--muted); font-size: 1.08rem; margin: 0; }

.feature { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 56px; align-items: center; }
.feature.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); }
.feature.tight { width: min(960px, 100% - 40px); grid-template-columns: minmax(0, 1fr) minmax(0, 400px); gap: 72px; }
.feature.flip .copy { order: 2; }
.feature .copy { max-width: 440px; }
.feature .copy p { color: var(--muted); font-size: 1.05rem; }
.feature ul { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.feature li { display: flex; gap: 10px; color: var(--text); }
.feature li::before { content: ""; flex: none; width: 18px; height: 18px; margin-top: 4px; border-radius: 50%; background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%239b6bff' stroke-width='2' d='M4 8.5l2.5 2.5L12 5.5'/%3E%3C/svg%3E") center/12px no-repeat; }
/* App panels shown at their real size, never upscaled. */
.media { margin: 0; justify-self: center; width: 100%; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); background: #18171e; }
.media img { width: 100%; }
.media.narrow { max-width: 400px; }
.media.fade { -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent); mask-image: linear-gradient(to bottom, #000 78%, transparent); box-shadow: none; }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card { padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.card h3 { display: flex; align-items: center; gap: 10px; }
.card p { color: var(--muted); margin: 0; font-size: .97rem; }
.icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-hi); flex: none; }
.icon svg { width: 18px; height: 18px; }

.providers { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.providers span { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 14px; }

.cta { text-align: center; padding: 96px 0; }
.cta p { color: var(--muted); margin: 0 auto; max-width: 560px; }

.commandbox { display: flex; align-items: center; gap: 10px; max-width: 640px; margin: 18px auto 0; padding: 10px 12px 10px 16px; border-radius: 12px; background: var(--code-bg); border: 1px solid var(--border); text-align: left; }
.commandbox code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; background: none; border: 0; padding: 0; color: var(--text); }
.commandbox button { font: 600 13px var(--sans); color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; cursor: pointer; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 30px 0 44px; color: var(--faint); font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 28px; justify-content: space-between; }
.site-footer a { color: var(--muted); }

/* Docs, tutorial, admin */
.page-head { padding: 64px 0 28px; position: relative; overflow: hidden; }
.page-head::before { content: ""; position: absolute; inset: 0; background: var(--glow); opacity: .7; pointer-events: none; }
.page-head .wrap { position: relative; }
.page-head h1 { font-size: clamp(2.1rem, 4.5vw, 3rem); letter-spacing: -.03em; line-height: 1.1; margin: 6px 0 12px; }
.content { padding-bottom: 80px; }
.split { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; }
.toc { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 100px); overflow-y: auto; padding-right: 6px; }
.toc a { display: block; padding: 4px 10px; margin-left: -10px; border-radius: 7px; color: var(--muted); font-size: 14.5px; }
.toc a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.toc .group { color: var(--faint); font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; margin: 18px 0 4px; }
.toc .group:first-child { margin-top: 0; }
.doc { min-width: 0; max-width: 780px; }
.doc h2 { font-size: 1.65rem; margin: 56px 0 12px; padding-top: 6px; scroll-margin-top: 80px; }
.doc h2:first-child { margin-top: 0; }
.doc h3 { margin: 28px 0 8px; scroll-margin-top: 80px; }
.doc p, .doc li, .doc dd { color: var(--muted); }
.doc strong, .step strong { color: var(--text); }
.doc ul, .doc ol { padding-left: 1.3em; }
.doc li { margin: 4px 0; }
pre { background: var(--code-bg); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; overflow-x: auto; line-height: 1.6; }
pre code { background: none; border: 0; padding: 0; color: var(--text); }
table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: .95rem; display: block; overflow-x: auto; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--text); font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; background: var(--surface); }
td { color: var(--muted); }
dl { display: grid; grid-template-columns: minmax(150px, max-content) 1fr; gap: 8px 22px; }
dt { color: var(--text); font-weight: 600; }
dd { margin: 0; }
.callout { margin: 24px 0; padding: 14px 18px; border-radius: 12px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); color: var(--text); }
.callout.tip { background: color-mix(in srgb, var(--green) 10%, transparent); border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.callout.warn { background: color-mix(in srgb, var(--amber) 12%, transparent); border-color: color-mix(in srgb, var(--amber) 40%, transparent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chips span { padding: 4px 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 13.5px; }

.step { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 18px; padding: 30px 0; border-bottom: 1px solid var(--border); }
.step:last-of-type { border-bottom: 0; }
.stepnum { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-hi); font-weight: 700; font-size: 14px; }
.step h2 { font-size: 1.35rem; margin: 3px 0 10px; }
.step p, .step li { color: var(--muted); }
.steps > * { max-width: 820px; }

.notfound { text-align: center; padding: 140px 0; }

@media (max-width: 900px) {
  .feature, .feature.flip, .feature.tight { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .feature .copy { max-width: none; }
  .feature.flip .copy { order: 0; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .split { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .toc { position: static; max-height: none; display: flex; flex-wrap: wrap; gap: 2px 6px; border-bottom: 1px solid var(--border); padding-bottom: 16px; }
  .toc .group { width: 100%; margin: 10px 0 0; }
}
@media (max-width: 640px) {
  .site-nav a.hide-sm { display: none; }
  .site-header .wrap { gap: 14px; }
  .site-nav { gap: 14px; }
  .hero { padding-top: 56px; }
  section.block { padding: 60px 0; }
  dl { grid-template-columns: minmax(0, 1fr); }
  dt { margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .button { transition: none; } }
img { height: auto; }

/* Sprites: 16×16 pixel art, scaled without smoothing. */
.party { display: flex; justify-content: center; gap: 8px; margin-bottom: 18px; }
.party img { width: 40px; height: 40px; image-rendering: pixelated; animation: bob 1.2s steps(2) infinite; }
.party img:nth-child(even) { animation-delay: .6s; }
@keyframes bob { 50% { transform: translateY(-3px); } }
@media (max-width: 640px) { .party { gap: 4px; } .party img { width: 34px; height: 34px; } }
@media (prefers-reduced-motion: reduce) { .party img { animation: none; } }
.site-nav a.button, .site-nav a.button:hover { color: #fff; }
