/* Kiri Plugins styles. Copied design tokens from runkiri.com. No animations. */

:root {
  color-scheme: light;
  --bg: #F6F2EA;
  --bg-alt: #EFE9DD;
  --surface: #FFFDF8;
  --surface-2: #F3EEE4;
  --ink: #0F1419;
  --text-2: #3A424C;
  --muted: #5E6773;
  --line: #E1D9CA;
  --line-strong: #CFC5B3;
  --ember: #8A6A00;
  --ember-lid: #A88300;
  --on-ember: #FFFFFF;
  --ember-text: #6E5400;
  --ember-soft: color-mix(in srgb, var(--ember) 12%, transparent);
  --moss: #1F7656;
  --moss-soft: rgba(31, 118, 86, 0.12);
  --term-bg: #0F1419;
  --term-fg: #E7E3DA;
  --shadow: 0 1px 0 rgba(15, 20, 25, 0.04), 0 12px 32px -18px rgba(15, 20, 25, 0.28);

  --f-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --f-text: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --radius: 18px;
  --gutter: clamp(16px, 4vw, 40px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0F1419;
    --bg-alt: #131920;
    --surface: #171E26;
    --surface-2: #1D252E;
    --ink: #F6F2EA;
    --text-2: #C9CDD2;
    --muted: #9AA3AE;
    --line: #26303A;
    --line-strong: #34404C;
    --ember: #E0B420;
    --ember-lid: #F2CF5B;
    --on-ember: #1A1400;
    --ember-text: #E8C04A;
    --ember-soft: color-mix(in srgb, var(--ember) 16%, transparent);
    --moss: #5CC99A;
    --moss-soft: rgba(92, 201, 154, 0.14);
    --term-bg: #0A0E12;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 16px 40px -20px rgba(0, 0, 0, 0.7);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0F1419;
  --bg-alt: #131920;
  --surface: #171E26;
  --surface-2: #1D252E;
  --ink: #F6F2EA;
  --text-2: #C9CDD2;
  --muted: #9AA3AE;
  --line: #26303A;
  --line-strong: #34404C;
  --ember: #E0B420;
  --ember-lid: #F2CF5B;
  --on-ember: #1A1400;
  --ember-text: #E8C04A;
  --ember-soft: color-mix(in srgb, var(--ember) 16%, transparent);
  --moss: #5CC99A;
  --moss-soft: rgba(92, 201, 154, 0.14);
  --term-bg: #0A0E12;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 16px 40px -20px rgba(0, 0, 0, 0.7);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-text);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img, svg { max-width: 100%; }
a { color: var(--ember-text); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; border-radius: 6px; }
code {
  font-family: var(--f-mono);
  font-size: 0.88em;
  background: var(--surface-2);
  padding: 0.1em 0.38em;
  border-radius: 6px;
  border: 1px solid var(--line);
}
h1, h2, h3 { font-family: var(--f-display); letter-spacing: -0.02em; line-height: 1.08; margin: 0; }
h1 { font-size: clamp(34px, 5.2vw, 56px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.04; }
h2 { font-size: clamp(24px, 3.2vw, 34px); font-weight: 700; }
h3 { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 10px;
}
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- buttons & chips ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 15px/1 var(--f-text);
  padding: 12px 18px; border-radius: 12px;
  background: var(--ember); color: var(--on-ember); text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
}
.btn:hover { background: var(--ember-lid); color: var(--on-ember); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-small { padding: 9px 14px; font-size: 14px; border-radius: 10px; white-space: nowrap; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 11px/1 var(--f-mono); text-transform: uppercase; letter-spacing: .06em;
  padding: 5px 9px; border-radius: 999px; white-space: nowrap;
  border: 1px solid transparent;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: currentColor; }
.chip-dev { color: var(--ember-text); background: var(--ember-soft); border-color: color-mix(in srgb, var(--ember) 28%, transparent); }
.chip-coming { color: var(--muted); background: var(--surface-2); border-color: var(--line-strong); }

/* ---------- header ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
@media (hover: none), (pointer: coarse) {
  .nav { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; min-width: 0; flex-shrink: 0; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 36px; height: 36px; flex: none; }
.brand-word { width: 48px; height: 30px; margin-top: 2px; flex: none; }
.brand-page {
  margin-left: 2px; padding-left: 10px; border-left: 1px solid var(--line-strong);
  font: 600 15px/1 var(--f-display); color: var(--text-2); white-space: nowrap;
}
.nav-links { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--text-2); text-decoration: none; font-size: 15px; font-weight: 500; padding: 8px 12px; border-radius: 9px; white-space: nowrap; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
.nav-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.nav-gh {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 600; white-space: nowrap;
}
.nav-gh:hover { background: var(--surface-2); color: var(--ink); }
.nav-gh svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
.theme-toggle {
  width: 38px; height: 38px; display: grid; place-items: center; flex: none;
  border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer;
}
.theme-toggle:hover { background: var(--surface-2); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

@media (max-width: 960px) { .nav-links { display: none; } }
@media (max-width: 560px) {
  .nav-inner { gap: 8px; height: 60px; }
  .nav-gh { width: 36px; height: 36px; padding: 0; }
  .nav-gh span { display: none; }
  .theme-toggle { width: 36px; height: 36px; }
  .brand { gap: 6px; }
  .brand-mark { width: 30px; height: 30px; }
  .brand-word { width: 40px; height: 26px; }
  .brand-page { padding-left: 8px; font-size: 14px; }
  .nav-actions { gap: 6px; }
  .btn-small { padding: 8px 11px; font-size: 13px; }
}

/* ---------- sections ---------- */
.page-head { padding: clamp(36px, 6vw, 68px) 0 clamp(28px, 4vw, 40px); }
.kicker {
  font: 600 13px/1 var(--f-mono); text-transform: uppercase; letter-spacing: .1em;
  color: var(--ember-text); margin-bottom: 14px; display: flex; align-items: center; gap: 10px;
}
.kicker::before { content: ""; width: 14px; height: 10px; background: var(--ember); border-radius: 3px; transform: skewX(-10deg); flex: none; }
.head-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 14px; }
.lede { font-size: clamp(16.5px, 1.5vw, 19px); color: var(--text-2); max-width: 46em; }
.crumb { font: 500 14px/1.4 var(--f-text); color: var(--muted); margin-bottom: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.crumb a { color: var(--text-2); text-decoration: none; }
.crumb a:hover { color: var(--ink); text-decoration: underline; }

.section { padding: 0 0 clamp(48px, 6vw, 76px); }
.section-band { padding: clamp(36px, 5vw, 56px) 0; background: var(--bg-alt); border-block: 1px solid var(--line); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 3vw, 28px); box-shadow: var(--shadow); }

/* ---------- what a plugin is ---------- */
.what-box {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px 36px; align-items: start;
}
@media (max-width: 820px) { .what-box { grid-template-columns: 1fr; } }
.what-box h2 { margin-bottom: 10px; font-size: clamp(22px, 3vw, 28px); }
.what-box p { color: var(--text-2); }
.what-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.what-facts li {
  padding: 12px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 15px; color: var(--text-2);
}
.what-facts b { color: var(--ink); }

/* ---------- plugin catalogue grid ---------- */
.plugins-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 900px) { .plugins-grid { grid-template-columns: 1fr; } }
.plugin-card { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.plugin-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.plugin-id { display: inline-flex; align-items: center; gap: 12px; }
.plugin-logo {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--ink);
}
.plugin-logo svg { width: 24px; height: 24px; fill: currentColor; }
.plugin-title { font-size: 24px; font-weight: 700; }
.plugin-tagline { font-weight: 600; color: var(--ink); font-size: 16.5px; }
.plugin-summary { color: var(--text-2); font-size: 15.5px; }
.plugin-foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 8px; border-top: 1px solid var(--line); }
.plugin-link { font-weight: 600; text-decoration: none; }
.plugin-link:hover { text-decoration: underline; }

/* ---------- install bar (labelled Coming) ---------- */
.install-box {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px;
  background: var(--term-bg); color: var(--term-fg);
  border-radius: 12px; padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 0;
}
.install-prompt { color: var(--ember-lid); font: 600 13.5px/1 var(--f-mono); user-select: none; }
.install-cmd {
  flex: 1 1 180px; min-width: 0;
  font: 13.5px/1.4 var(--f-mono); color: var(--term-fg);
  background: none; border: 0; padding: 0;
  overflow-x: auto; white-space: nowrap;
}
@media (max-width: 480px) {
  .install-box { padding: 10px 12px; gap: 8px; }
  .install-cmd, .install-prompt { font-size: 12.5px; }
}
.coming-pill {
  font: 600 11px/1 var(--f-mono); text-transform: uppercase; letter-spacing: .08em;
  padding: 5px 8px; border-radius: 999px;
  background: rgba(224, 180, 32, 0.16); color: #E8C04A;
  border: 1px solid rgba(224, 180, 32, 0.34); white-space: nowrap;
}

/* ---------- plugin detail page layout ---------- */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(24px, 4vw, 44px); align-items: start; }
@media (max-width: 920px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-copy { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; min-width: 0; }
.detail-copy > * { min-width: 0; }
.detail-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.detail-card > * { min-width: 0; }
.detail-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.detail-list li { padding-left: 20px; position: relative; color: var(--text-2); font-size: 16px; }
.detail-list li::before {
  content: ""; position: absolute; left: 0; top: 0.6em;
  width: 8px; height: 8px; border-radius: 2px; background: var(--ember); transform: skewX(-10deg);
}
.meta-note { font-size: 14px; color: var(--muted); }

/* ---------- Kiri-window panel mock (HTML/CSS, no animations) ---------- */
.panel-figure { margin: 0; display: grid; gap: 10px; min-width: 0; }
.panel-figure figcaption { font-size: 13.5px; color: var(--muted); }
.kw {
  --w-bg: #0F1419;
  --w-side: #121920;
  --w-panel: #171D24;
  --w-input: #0C1116;
  --w-line: #2A313A;
  --w-text: #F2F0EB;
  --w-muted: #98A1AC;
  --w-moss: #3FB68B;
  --w-ember: #E0B420;
  border-radius: 14px;
  overflow: hidden;
  background: var(--w-bg);
  color: var(--w-text);
  border: 1px solid var(--w-line);
  box-shadow: 0 24px 50px -28px rgba(0, 0, 0, 0.65);
  font: 13px/1.4 var(--f-text);
  min-width: 0;
}
.kw-bar {
  display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px;
  background: var(--w-side); border-bottom: 1px solid var(--w-line);
}
.kw-dots { display: inline-flex; gap: 6px; }
.kw-dots i { width: 10px; height: 10px; border-radius: 50%; background: #2E3640; display: block; }
.kw-bar-title { margin-left: 8px; font-size: 12px; font-weight: 600; color: var(--w-muted); }
.kw-bar-tag {
  margin-left: auto; font: 600 10px/1 var(--f-mono); text-transform: uppercase; letter-spacing: .08em;
  color: var(--w-muted); padding: 3px 7px; border-radius: 999px; border: 1px solid var(--w-line);
}
.kw-body { display: grid; grid-template-columns: 46px minmax(0, 1fr); }
.kw-rail {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 0; background: var(--w-side); border-right: 1px solid var(--w-line);
}
.kw-rail-item {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; color: var(--w-muted);
}
.kw-rail-item svg { width: 16px; height: 16px; fill: currentColor; }
.kw-rail-item.is-active {
  color: var(--w-ember); background: rgba(224, 180, 32, 0.14);
  border: 1px solid rgba(224, 180, 32, 0.32);
}
.kw-pane { padding: 14px; display: grid; gap: 12px; min-width: 0; }
.kw-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.kw-head-title { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14.5px; color: var(--w-text); }
.kw-head-title svg { width: 17px; height: 17px; fill: currentColor; }
.kw-status {
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 11.5px/1 var(--f-text); padding: 4px 9px; border-radius: 999px;
  color: var(--w-moss); background: rgba(63, 182, 139, 0.14); border: 1px solid rgba(63, 182, 139, 0.34);
}
.kw-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--w-moss); display: block; }
.kw-fields { display: grid; gap: 10px; min-width: 0; }
.kw-field { display: grid; gap: 4px; min-width: 0; }
.kw-label { font: 600 11px/1.2 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--w-muted); }
.kw-input {
  display: flex; align-items: center; justify-content: space-between; gap: 6px 10px;
  padding: 8px 10px; border-radius: 8px;
  background: var(--w-input); border: 1px solid var(--w-line);
  font: 12.5px/1.3 var(--f-mono); color: var(--w-text);
  min-width: 0; overflow: hidden;
}
.kw-input span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.kw-input em { font-style: normal; color: var(--w-muted); font-size: 11px; flex: none; }
.kw-input-wrap { flex-wrap: wrap; }
.kw-input-wrap span { flex: none; }
.kw-input-wrap em { overflow-wrap: anywhere; flex: 0 1 auto; }
.kw-row2 { display: grid; grid-template-columns: minmax(0, 1fr) 86px; gap: 8px; min-width: 0; }
@media (max-width: 420px) { .kw-row2 { grid-template-columns: 1fr; } }

.kw-list {
  list-style: none; margin: 0; padding: 0;
  border-radius: 8px; border: 1px solid var(--w-line); background: var(--w-panel);
  overflow: hidden;
}
.kw-list li {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  font-size: 12px; min-width: 0;
}
.kw-list li + li { border-top: 1px solid var(--w-line); }
.kw-check {
  width: 14px; height: 14px; border-radius: 4px; flex: none;
  border: 1px solid var(--w-line); background: var(--w-input);
  display: grid; place-items: center; font: 700 10px/1 var(--f-mono);
}
.kw-check.on { background: var(--w-ember); border-color: var(--w-ember); color: #1A1400; }
.kw-cname { font-weight: 600; color: var(--w-text); }
.kw-cimg { font-family: var(--f-mono); font-size: 11.5px; color: var(--w-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.kw-cport { font-family: var(--f-mono); font-size: 11.5px; color: var(--w-muted); flex: none; }
.kw-list li.is-off { opacity: 0.55; }

.kw-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  padding-top: 8px; border-top: 1px solid var(--w-line);
  font-size: 11.5px; color: var(--w-muted);
}
.kw-foot-addr { font-family: var(--f-mono); color: var(--w-text); overflow-wrap: anywhere; }

/* ---------- footer ---------- */
.footer { padding: 48px 0 36px; border-top: 1px solid var(--line); margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: 1fr auto; gap: 28px 40px; align-items: start; }
.footer-tag { margin-top: 10px; color: var(--muted); font-size: 15px; max-width: 28em; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, auto); gap: 8px 32px; }
.footer-links a { color: var(--text-2); text-decoration: none; font-size: 15px; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }
.legal { grid-column: 1 / -1; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 20px; }
@media (max-width: 640px) { .footer-grid { grid-template-columns: 1fr; } }
