/* Shared by every page under site/. Plain CSS: no build step, no framework. */
:root {
  --bg: #0a0a0a;
  --panel: #111113;
  --panel-2: #17171a;
  --line: #26262b;
  --text: #ededef;
  --muted: #a1a1aa;
  --accent: #3b82f6;
  --accent-strong: #2563eb;
  --code: #d4d4d8;
  --radius: 12px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

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

code, pre { font-family: var(--mono); }
:not(pre) > code { background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 0.1em 0.4em; font-size: 0.9em; }
pre { margin: 0 0 16px; padding: 14px 16px; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); color: var(--code); font-size: 0.78rem; line-height: 1.55; tab-size: 2; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; }
.brand { color: var(--text); font-weight: 650; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 0.95rem; }
.site-nav a { color: var(--muted); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); text-decoration: none; }

/* Hero */
.hero { padding: 64px 0 32px; }
.hero h1 { font-size: clamp(2rem, 5.5vw, 3.4rem); line-height: 1.1; letter-spacing: -0.03em; margin: 0 0 16px; max-width: 18ch; }
.hero .lede { font-size: clamp(1.05rem, 2.2vw, 1.25rem); color: var(--muted); max-width: 62ch; margin: 0 0 28px; }
.hero .lede strong { color: var(--text); font-weight: 600; }

.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-weight: 550; }
.btn:hover { text-decoration: none; border-color: #3a3a42; }
.btn.primary { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); }

/* Command lines with a copy button */
.cmd { display: flex; align-items: stretch; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cmd code { flex: 1; min-width: 0; padding: 12px 14px; font-size: 0.9rem; color: var(--code); white-space: pre; overflow-x: auto; background: none; border: 0; border-radius: 0; }
.cmd button { flex: none; min-width: 64px; border: 0; border-left: 1px solid var(--line); background: var(--panel-2); color: var(--muted); font: inherit; font-size: 0.85rem; cursor: pointer; }
.cmd button:hover { color: var(--text); }
.hero .cmd { max-width: 640px; }

/* Hero image: a browser frame around a generated screenshot. Replace with a demo GIF by adding docs/demo.gif. */
.shot { display: block; margin: 36px 0 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6); }
.shot:hover { text-decoration: none; border-color: #3a3a42; }
.shot-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--panel-2); color: var(--muted); font-size: 0.8rem; }
.shot-bar i { width: 10px; height: 10px; border-radius: 50%; background: #3a3a42; }
.shot-bar span { margin-left: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shot img { display: block; width: 100%; }
.shot-caption { margin: 10px 2px 0; color: var(--muted); font-size: 0.9rem; }

/* Sections */
section.block { padding: 48px 0 8px; }
section.block h2 { font-size: 1.5rem; letter-spacing: -0.02em; margin: 0 0 8px; }
section.block > .wrap > p { color: var(--muted); max-width: 66ch; margin: 0 0 24px; }

.steps { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); list-style: none; padding: 0; margin: 0; counter-reset: step; }
.steps li { counter-increment: step; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 26px; height: 26px; margin-bottom: 10px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; }
.steps h3 { margin: 0 0 6px; font-size: 1.05rem; }
.steps p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.installs { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.install { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.install.wide { grid-column: 1 / -1; }
.install h3 { margin: 0 0 4px; font-size: 1.05rem; }
.install > p { margin: 0 0 12px; color: var(--muted); font-size: 0.95rem; }
.install .cmd + .cmd { margin-top: 8px; }
.note { color: var(--muted); font-size: 0.9rem; margin-top: 16px; }

.links { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.link-card { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; color: var(--text); }
.link-card:hover { text-decoration: none; border-color: #3a3a42; }
.link-card strong { display: block; }
.link-card span { color: var(--muted); font-size: 0.9rem; }

.site-footer { margin-top: 64px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 20px; padding-bottom: 28px; }

/* Gallery */
.page-head { padding: 48px 0 16px; }
.page-head h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); letter-spacing: -0.03em; line-height: 1.15; margin: 0 0 12px; }
.page-head p { color: var(--muted); max-width: 68ch; margin: 0 0 8px; }

.index { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 20px 0 0; }
.index a { display: inline-block; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 0.9rem; }
.index a:hover { color: var(--text); text-decoration: none; border-color: #3a3a42; }

.entry { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; padding: 32px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 8px; }
.entry:last-child { border-bottom: 0; }
.entry h2 { margin: 0 0 6px; font-size: 1.3rem; letter-spacing: -0.02em; }
.entry .desc { margin: 0 0 12px; color: var(--muted); }

.thumb { display: block; position: relative; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); margin-bottom: 14px; }
.thumb:hover { text-decoration: none; border-color: var(--accent); }
.thumb img { display: block; width: 100%; aspect-ratio: 8 / 5; object-fit: cover; object-position: top; }
.thumb span { position: absolute; right: 10px; bottom: 10px; padding: 4px 10px; border-radius: 999px; background: rgba(10, 10, 10, 0.85); border: 1px solid var(--line); color: var(--text); font-size: 0.85rem; }

.stats { display: flex; flex-wrap: wrap; gap: 6px 8px; list-style: none; padding: 0; margin: 0 0 12px; }
.stats li { padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--muted); font-size: 0.85rem; }
.stats li.tokens { color: var(--text); }
.entry .links-row { margin: 0; font-size: 0.95rem; }

.source { min-width: 0; display: flex; flex-direction: column; }
.source h3 { margin: 0 0 8px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.source pre { flex: 1; margin: 0; max-height: 440px; }

@media (max-width: 820px) {
  .steps, .links { grid-template-columns: 1fr; }
  .installs { grid-template-columns: 1fr; }
  .entry { grid-template-columns: 1fr; gap: 16px; }
  .source pre { max-height: 320px; }
  .hero { padding-top: 40px; }
}

@media (max-width: 480px) {
  .wrap { padding: 0 16px; }
  .cta .btn { flex: 1 1 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
