/* llm-wiki.net — pure static, no framework */

:root {
  /* Dark is the default for everyone — no prefers-color-scheme check.
     Very dark gray, not black. Users can flip to light via the header toggle. */
  --bg: #17181c;
  --bg-alt: #1e1f24;
  --bg-elev: #24262c;
  --border: #2e3037;
  --border-strong: #43454d;
  --fg: #e7e9ee;
  --fg-dim: #a7adb8;
  --fg-muted: #7a7f8a;
  --accent: #00ffa6;
  --accent-2: #6af7ff;
  --accent-warn: #ffaa00;
  --code-bg: #13141a;
  --code-fg: #d7dbe4;
  --max: 1100px;
  --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
}

/* Opt-in light theme — only applied when the user explicitly toggles. */
:root[data-theme="light"] {
  --bg: #fafafa;
  --bg-alt: #f2f3f5;
  --bg-elev: #ffffff;
  --border: #e3e5ea;
  --border-strong: #cdd0d7;
  --fg: #15171b;
  --fg-dim: #454953;
  --fg-muted: #6b7280;
  --accent: #00a570;
  --accent-2: #1b84a0;
  --accent-warn: #b87400;
  --code-bg: #f4f5f7;
  --code-fg: #1b1d22;
}

* { box-sizing: border-box; min-width: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  max-width: 100vw;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

code, pre, .mono { font-family: var(--mono); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #000; padding: 8px 12px;
  z-index: 100;
}
.skip:focus { left: 8px; top: 8px; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px;
}
.brand-row { display: inline-flex; align-items: baseline; gap: 8px; }
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-weight: 700; font-size: 15px;
  color: var(--fg);
}
.brand:hover { text-decoration: none; }
.brand-by {
  font-family: var(--mono); font-size: 11px;
  color: var(--fg-muted); letter-spacing: 0.02em;
  user-select: none;
}
.brand-mark {
  display: inline-grid; place-items: center;
  width: 24px; height: 24px; border-radius: 6px;
  background: var(--accent); color: #000; font-size: 14px;
}
.site-header nav { display: flex; align-items: center; gap: 18px; }
.site-header nav a {
  color: var(--fg-dim);
  font-size: 14px;
  font-family: var(--mono);
}
.site-header nav a:hover { color: var(--fg); text-decoration: none; }
.site-header nav a.gh {
  color: var(--fg);
  border: 1px solid var(--border-strong);
  padding: 6px 10px;
  border-radius: 6px;
}
.site-header nav a.gh:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-toggle {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  color: var(--fg-dim);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: color .12s, border-color .12s, transform .08s;
}
.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.theme-toggle:active { transform: scale(0.94); }

/* Show the icon that represents the *current* theme.
   Dark is the default, so the sun shows unless the user has forced light. */
.theme-icon { display: none; }
.theme-icon-sun { display: block; }
:root[data-theme="light"] .theme-icon-sun { display: none; }
:root[data-theme="light"] .theme-icon-moon { display: block; }

@media (max-width: 640px) {
  .site-header nav a:not(.gh) { display: none; }
}

/* hero */
.hero {
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(900px 400px at 50% -100px, color-mix(in oklab, var(--accent) 10%, transparent), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg));
}
.hero .wrap { text-align: center; }
.banner-wrap { overflow: hidden; max-width: 100%; }
.banner {
  display: block;
  font-family: var(--mono);
  font-weight: 700;
  line-height: 1;
  margin: 0 auto 24px;
  padding: 0;
  color: var(--accent);
  text-shadow: 0 0 24px color-mix(in oklab, var(--accent) 40%, transparent);
  /* Sized so each line fits on a phone viewport: the banner is ~60 chars wide,
     and at 1.35vw the line stays under ~100% viewport width down to 320px.
     Container-query-like cap at 16px prevents over-sizing on wide screens. */
  font-size: clamp(4px, 1.35vw, 16px);
  letter-spacing: 0;
  white-space: pre;
  text-align: center;
  background: transparent;
}
@media (max-width: 500px) {
  .banner { font-size: 1.35vw; }
}
h1 {
  font-size: clamp(28px, 4.4vw, 44px);
  line-height: 1.15;
  font-weight: 700;
  margin: 0 auto 16px;
  max-width: 1000px;
  letter-spacing: -0.02em;
}
.lede {
  max-width: 680px;
  margin: 0 auto 28px;
  font-size: clamp(15px, 1.6vw, 18px);
  color: var(--fg-dim);
}
.lede code { color: var(--accent-2); }
.lede-sm {
  color: var(--fg-dim); margin: 0 0 16px;
}
.cta-row {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 10px;
  margin-bottom: 28px;
}
.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  color: var(--fg);
  font-size: 14px;
  font-family: var(--mono);
  font-weight: 600;
  transition: transform .08s, border-color .12s, background .12s, color .12s;
}
.btn:hover {
  text-decoration: none;
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}
.btn.primary {
  background: var(--accent); color: #000; border-color: var(--accent);
}
.btn.primary:hover {
  background: color-mix(in oklab, var(--accent) 85%, white);
  color: #000;
}
.btn.ghost { color: var(--fg-dim); }

.badges {
  display: flex; justify-content: center; align-items: center;
  flex-wrap: wrap; gap: 8px;
}
.badges img { height: 20px; width: auto; }
.release-live {
  font-family: var(--mono); font-size: 12px; color: var(--fg-muted);
  padding-left: 8px;
}
.release-live::before { content: ""; }

.hero-sub {
  max-width: 560px;
  margin: 24px auto 0;
  font-size: 14px;
  color: var(--fg-muted);
  text-align: center;
  line-height: 1.55;
}

/* sections */
.section {
  padding: 72px 0;
  border-bottom: 1px solid var(--border);
}
.section.alt { background: var(--bg-alt); }
.section.compact { padding: 48px 0; }
.section h2 {
  font-size: clamp(22px, 3vw, 30px);
  margin: 0 0 24px;
  letter-spacing: -0.01em;
}
.section h2.h2-small {
  font-size: 15px;
  font-family: var(--mono);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-muted);
  margin-bottom: 16px;
}
.section h3 {
  font-size: 17px;
  margin: 0 0 8px;
  letter-spacing: -0.005em;
}
.section-lede {
  max-width: 760px;
  margin: 0 0 28px;
  color: var(--fg-dim);
  font-size: 16.5px;
  line-height: 1.65;
}
.section-lede code { color: var(--accent-2); }
.muted { color: var(--fg-dim); }
.small { font-size: 13px; }

/* features grid */
.grid.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.grid.features article {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color .15s, transform .08s;
}
.grid.features article:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.grid.features p { margin: 6px 0 0; color: var(--fg-dim); font-size: 14px; }
.grid.features code {
  font-size: 12px; padding: 1px 5px;
  background: var(--code-bg); border-radius: 4px; color: var(--accent-2);
}
@media (max-width: 900px) { .grid.features { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .grid.features { grid-template-columns: 1fr; } }

/* install */
.install-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.install-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.install-card p { margin: 8px 0; font-size: 14px; color: var(--fg-dim); }
.install-card h3 { color: var(--accent); font-family: var(--mono); }
@media (max-width: 900px) { .install-grid { grid-template-columns: 1fr; } }

.upgrade {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 20px;
}
.upgrade > summary {
  padding: 16px 0;
  cursor: pointer;
  font-family: var(--mono);
  font-weight: 600;
  list-style: none;
  display: flex; align-items: center; gap: 8px;
}
.upgrade > summary::-webkit-details-marker { display: none; }
.upgrade > summary::before {
  content: "▸";
  color: var(--accent);
  transition: transform .15s;
}
.upgrade[open] > summary::before { transform: rotate(90deg); }
.upgrade-body { padding-bottom: 20px; }
.upgrade-body p { margin: 12px 0 6px; }

/* code blocks */
pre.code {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--code-fg);
  margin: 12px 0;
}
pre.code code { background: transparent; padding: 0; color: inherit; font-size: inherit; }
code {
  font-size: 0.92em;
  padding: 1px 6px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--accent-2);
}
pre.code.prompt .c { color: var(--accent); font-weight: 600; }
pre.code.prompt .s { color: var(--accent-warn); }
pre.code.prompt .cm { color: var(--fg-muted); font-style: italic; }

pre.code.tree {
  font-size: 12.5px;
  line-height: 1.5;
}

/* flow steps */
.flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}
.flow-step {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 16px 16px 48px;
}
.flow-step .n {
  position: absolute;
  left: 14px; top: 14px;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}
.flow-step strong { display: block; margin-bottom: 4px; font-family: var(--mono); }
.flow-step span:last-child { color: var(--fg-dim); font-size: 14px; }
.flow-step code { font-size: 12px; }

.callouts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 24px;
}
.callout {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 16px 18px;
}
.callout h4 { margin: 0 0 6px; font-size: 14px; font-family: var(--mono); color: var(--accent); }
.callout p { margin: 0; color: var(--fg-dim); font-size: 14px; }
@media (max-width: 720px) { .callouts { grid-template-columns: 1fr; } }

/* commands table */
.cmd-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
}
.cmd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.cmd-table th, .cmd-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.cmd-table thead th {
  background: var(--bg-alt);
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
  position: sticky; top: 0;
}
.cmd-table tbody tr:last-child td { border-bottom: 0; }
.cmd-table tbody tr:hover { background: color-mix(in oklab, var(--accent) 4%, transparent); }
.cmd-table code {
  font-size: 12.5px;
  color: var(--accent-2);
  white-space: nowrap;
}
.cmd-table td:last-child code {
  white-space: normal;
  color: var(--accent);
}

/* release card */
.release-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.release-card header {
  display: flex; align-items: baseline; gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.release-version {
  font-family: var(--mono); font-weight: 700; font-size: 20px;
  color: var(--accent);
}
.release-date { color: var(--fg-muted); font-size: 13px; font-family: var(--mono); }
.release-body { color: var(--fg-dim); font-size: 14.5px; }
.release-body p { margin: 0 0 10px; }
.release-body strong { color: var(--fg); }
.release-body code { font-size: 12px; }
.release-card footer { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }

/* plugin grid */
.plugin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.plugin-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.plugin-card header {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: 8px;
}
.plugin-card h3 {
  margin: 0; font-family: var(--mono); color: var(--accent);
}
.plugin-version {
  font-family: var(--mono); font-size: 12px; color: var(--fg-muted);
  padding: 2px 6px; border: 1px solid var(--border); border-radius: 4px;
}
.plugin-card p { margin: 0 0 10px; font-size: 14px; color: var(--fg-dim); }
.plugin-card footer { font-size: 12px; color: var(--fg-muted); font-family: var(--mono); }
.tag {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  background: color-mix(in oklab, var(--accent) 16%, transparent);
  color: var(--accent);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* FAQ */
.faq {
  display: grid;
  gap: 8px;
}
.faq details {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 18px;
  transition: border-color .12s;
}
.faq details[open] { border-color: var(--border-strong); }
.faq summary {
  padding: 16px 0;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  color: var(--accent);
  font-family: var(--mono); font-size: 18px; line-height: 1;
  transition: transform .15s;
}
.faq details[open] summary::after { content: "–"; }
.faq-body { padding: 0 0 18px; color: var(--fg-dim); border-top: 1px solid var(--border); }
.faq-body p:first-child { margin-top: 12px; }

/* credits */
.credits { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: 14px; }
.credits li { color: var(--fg-dim); }

/* footer */
.site-footer {
  padding: 32px 0 48px;
  color: var(--fg-muted);
  font-family: var(--mono);
  font-size: 13px;
  text-align: center;
}
.site-footer p { margin: 4px 0; }
.site-footer a { color: var(--fg-dim); }

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

::selection { background: color-mix(in oklab, var(--accent) 50%, transparent); color: var(--fg); }
