/* ═══════════════════════════════════════════════════════════════
   slate — the plugin pages.

   Shared by /plugins/, /plugins/create/ and /plugins/publish/, so
   the three cannot drift. The chrome here — nav, wordmark, buttons,
   swatches, footer — is the marketing page's rule for rule; the
   palettes are not copied at all, they come from ../palettes.css,
   which index.html links too.

   Everything below the chrome follows the app's own bones: 32px
   scanning rows, the --space-util / --space-prose split, hairlines
   rather than shadows, 2px radius, one accent.
   ═══════════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'PVF Clothing';
  src: url('../assets/fonts/PVF_ClothingLight.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: block;
}

:root {
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', ui-monospace, monospace;
  --radius: 2px;
  --measure: 68ch;
  --dur: 110ms;
  --ease: cubic-bezier(0.2, 0, 0.2, 1);
  --gutter: clamp(20px, 5vw, 64px);
  /* The app's two spacing scales: scanning surfaces stay dense, reading
     surfaces breathe. app/src/styles/base.css defines the same pair. */
  --space-util: 6px;
  --space-prose: 16px;
  --row-h: 32px;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.65;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
::selection { background: var(--selection); color: var(--selection-fg); }

a { color: inherit; text-decoration: none; }
ul { list-style: none; }

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

/* ── Nav — verbatim from index.html ───────────────────────────── */

.nav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 18px;
  height: 46px; padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--bg-overlay) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.nav__mark { display: flex; align-items: center; gap: 8px; }
.nav__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.nav__word { font-family: 'PVF Clothing', var(--font-mono); font-size: 17px; letter-spacing: .04em; }
.nav__links { display: flex; gap: 16px; margin-left: auto; color: var(--fg-subtle); }
.nav__links a, .nav__links button { transition: color var(--dur) var(--ease); }
.nav__links a:hover, .nav__links button:hover { color: var(--fg); }
.nav__cta { padding: 5px 11px; font-size: 11.5px; }
.nav__here { color: var(--fg); }

.swatch {
  width: 15px; height: 15px; padding: 0; border-radius: 50%;
  border: 1px solid var(--border-strong); background: none; cursor: pointer;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.swatch i { display: block; width: 100%; height: 100%; border-radius: 50%; }
.swatch:hover { transform: scale(1.15); }
.swatch[aria-pressed="true"] { border-color: var(--fg); }
.swatches { display: flex; gap: 6px; align-items: center; }
@media (max-width: 860px) { .swatches, .nav__links a[data-opt] { display: none; } }

/* ── Buttons — verbatim from index.html ───────────────────────── */

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; font-size: 12.5px;
  color: var(--accent-fg); background: var(--accent);
  border: 1px solid var(--accent); border-radius: var(--radius);
  cursor: pointer; transition: opacity var(--dur) var(--ease);
}
.btn:hover { opacity: .85; }
.btn--ghost {
  color: var(--fg-muted); background: none; border-color: var(--border-strong);
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.btn--ghost:hover { color: var(--fg); border-color: var(--fg-subtle); opacity: 1; }
.btn--sm { padding: 5px 11px; font-size: 11.5px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn--link { padding: 0; border: none; background: none; color: var(--fg-subtle); font-size: 12px; }
.btn--link:hover { color: var(--fg); text-decoration: underline; opacity: 1; }

/* ── Intro ────────────────────────────────────────────────────── */

.intro { padding: 54px 0 26px; max-width: var(--measure); }
.intro h1 { font-size: 24px; font-weight: 400; letter-spacing: .01em; margin-bottom: 12px; }
.intro p { color: var(--fg-muted); margin-bottom: 8px; }
.intro a { color: var(--accent); }
.intro a:hover { text-decoration: underline; }

.eyebrow {
  font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--fg-subtle); margin-bottom: 10px;
}

/* ── Controls ─────────────────────────────────────────────────── */

.controls {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  padding: var(--space-prose) 0;
  border-bottom: 1px solid var(--border);
}
input[type="search"], input[type="email"], input[type="password"], input[type="text"], input[type="file"] {
  font-family: inherit; font-size: 12.5px;
  background: var(--bg-input); color: var(--fg);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 7px 10px;
}
input[type="search"] { min-width: 210px; }
input:focus-visible { outline: none; border-color: var(--accent-dim); }

.chips { display: flex; gap: var(--space-util); flex-wrap: wrap; }
.chip {
  font-size: 11.5px; padding: 4px 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--fg-subtle);
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.chip:hover { color: var(--fg-muted); }
.chip[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }

/* ── The list — the app's scanning rows ───────────────────────── */

.list { padding: var(--space-prose) 0 70px; }

.plugin {
  /* A thumbnail column, then the text, then the category. The row keeps the
     height it had: 72px of thumbnail is what three lines of text already
     occupied, so nothing below it moves. */
  display: grid;
  grid-template-columns: 108px 1fr auto;
  grid-template-areas:
    'shot name  cat'
    'shot desc  desc'
    'shot meta  meta';
  gap: 3px 16px;
  padding: 13px 12px; margin: 0 -12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer; text-align: left; width: calc(100% + 24px);
  transition: background var(--dur) var(--ease);
}
@media (max-width: 640px) {
  /* Below this the thumbnail costs more width than it earns. */
  .plugin { grid-template-columns: 1fr auto;
            grid-template-areas: 'name cat' 'desc desc' 'meta meta'; }
  .plugin__shot { display: none; }
}

.plugin__shot {
  grid-area: shot; align-self: center;
  width: 108px; height: 72px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-elevated);
  overflow: hidden;
}
.plugin__shot img {
  width: 100%; height: 100%;
  /* Top-anchored: a plugin is recognised by its header and first rows, and
     centring a tall window crops away exactly that. */
  object-fit: cover; object-position: top center;
  display: block;
}
/* No screenshot is the common case for a new plugin, so the placeholder has to
   be quiet and exactly the same size — a row that changes height when a
   picture is missing is worse than no picture. */
.plugin__shot--none {
  display: grid; place-items: center;
  color: var(--fg-subtle); font-size: 16px;
  background: repeating-linear-gradient(
    -45deg, transparent, transparent 5px,
    var(--bg-hover) 5px, var(--bg-hover) 6px);
}
.plugin:hover { background: var(--bg-elevated); }
.plugin:focus-visible { outline: none; background: var(--bg-elevated); box-shadow: inset 2px 0 0 var(--accent); }
.plugin__name { grid-area: name; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 13.5px; }
.plugin__desc { grid-area: desc; color: var(--fg-muted); font-size: 12.5px; }
.plugin__meta { grid-area: meta; color: var(--fg-subtle); font-size: 11.5px; }

.tag {
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 1px 6px; color: var(--fg-subtle); white-space: nowrap;
}
.tag--verified { color: var(--accent); border-color: var(--accent-dim); }
.tag--builtin { color: var(--fg-muted); border-color: var(--fg-subtle); }
.tag--broad { color: var(--warning); border-color: var(--warning); }
.tag--gone { color: var(--danger); border-color: var(--danger); }

/* ── Overlays — one modal, the way the app has one ────────────── */

dialog {
  /* The reset's `* { margin: 0 }` also clears the UA's `margin: auto` on
     dialog, which is what centres it — without this it pins to the top-left. */
  margin: auto;
  max-height: calc(100vh - 60px);
  background: var(--bg-overlay); color: var(--fg);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  max-width: 620px; width: calc(100vw - 40px);
  padding: 0; font-family: inherit; font-size: 13.5px;
}
dialog::backdrop { background: color-mix(in srgb, var(--bg-overlay) 70%, transparent); }
.sheet { padding: 22px 24px 26px; }
.sheet__head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: var(--space-prose);
}
.sheet__head h2 { font-size: 15px; font-weight: 400; }

.rule {
  font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--fg-subtle); border-bottom: 1px solid var(--border);
  padding-bottom: 6px; margin: 22px 0 10px;
}

.perm { display: flex; gap: 10px; padding: 5px 0; font-size: 12.5px; }
.perm__sigil { color: var(--fg-subtle); }
.perm--high .perm__sigil { color: var(--warning); }

.kv { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; font-size: 12.5px; }
.kv dt { color: var(--fg-subtle); }
.kv dd { text-align: right; }
.kv a { color: var(--accent); }

.note {
  border-left: 2px solid var(--accent-dim);
  padding: 7px 0 7px 12px; margin: var(--space-prose) 0;
  color: var(--fg-muted); font-size: 12.5px;
}
.note--warn { border-color: var(--warning); }
.note--danger { border-color: var(--danger); }

kbd {
  display: inline-flex; align-items: center; justify-content: center;
  height: 19px; min-width: 19px; padding: 0 5px;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--bg-elevated); font-size: 10.5px; color: var(--fg-muted);
}

.field { margin: 14px 0; }
.field label { display: block; font-size: 11.5px; color: var(--fg-muted); margin-bottom: 5px; }
.field input { width: 100%; }
.field__hint { font-size: 11.5px; color: var(--fg-subtle); margin-top: 4px; }

.findings { margin: 10px 0; }
.findings li {
  border-left: 2px solid var(--border-strong);
  padding: 5px 0 5px 12px; margin-bottom: 8px;
  font-size: 11.5px; color: var(--fg-muted);
}
.findings li.block { border-color: var(--danger); }
.findings li.review { border-color: var(--warning); }
.findings code { color: var(--fg-subtle); }

.empty { padding: 70px 0; text-align: center; color: var(--fg-subtle); font-size: 12.5px; }
.empty a { color: var(--accent); }

footer.foot { border-top: 1px solid var(--border); padding: 46px 0 60px; color: var(--fg-subtle); font-size: 12px; }
footer.foot a { color: var(--fg-muted); }
footer.foot a:hover { color: var(--fg); }

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

/* ── Long-form documentation ──────────────────────────────────
   The create/ and publish/ pages. A reference someone reads at 2am
   with a half-written plugin open beside it, so: a sticky contents
   rail, headings that can be linked to, and code that is legible
   before it is pretty. */

.doc { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 48px; padding: 40px 0 90px; }
@media (max-width: 900px) { .doc { grid-template-columns: 1fr; gap: 0; } .toc { display: none; } }

.toc { position: sticky; top: 70px; align-self: start; font-size: 12px; max-height: calc(100vh - 100px); overflow-y: auto; }
.toc b { display: block; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-subtle); margin-bottom: 10px; }
.toc a { display: block; padding: 3px 0; color: var(--fg-subtle); border-left: 1px solid transparent; padding-left: 10px; margin-left: -11px; }
.toc a:hover { color: var(--fg); }
.toc a.on { color: var(--accent); border-left-color: var(--accent); }
.toc .toc--sub { padding-left: 22px; font-size: 11.5px; }

.prose { max-width: 74ch; min-width: 0; }
.prose > * + * { margin-top: var(--space-prose); }
.prose h2 {
  font-size: 17px; font-weight: 400; letter-spacing: .01em;
  margin-top: 52px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
  scroll-margin-top: 64px;
}
.prose h3 { font-size: 14px; font-weight: 500; margin-top: 32px; scroll-margin-top: 64px; }
.prose h2 .num { color: var(--fg-subtle); margin-right: 10px; }
.prose p, .prose li { color: var(--fg-muted); }
.prose strong { color: var(--fg); font-weight: 500; }
.prose a { color: var(--accent); }
.prose a:hover { text-decoration: underline; }
.prose ul, .prose ol { padding-left: 20px; }
.prose ul { list-style: none; }
.prose ul > li { position: relative; }
.prose ul > li::before { content: '·'; position: absolute; left: -14px; color: var(--fg-subtle); }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: 6px; }
.prose code {
  font-size: .92em; color: var(--syn-code);
  background: var(--syn-code-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1px 4px;
}
.prose pre {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  overflow-x: auto; font-size: 12px; line-height: 1.6;
}
.prose pre code { background: none; border: none; padding: 0; color: var(--fg); font-size: inherit; }
.prose blockquote {
  border-left: 2px solid var(--accent-dim); padding: 4px 0 4px 14px;
  color: var(--fg-muted);
}

.table-wrap { overflow-x: auto; }
.prose table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.prose th, .prose td { text-align: left; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { color: var(--fg-subtle); font-weight: 400; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
.prose td code { white-space: nowrap; }

.callout {
  border: 1px solid var(--border); border-left-width: 2px;
  border-left-color: var(--accent-dim);
  border-radius: var(--radius); padding: 13px 16px;
  font-size: 12.5px; color: var(--fg-muted);
}
.callout--warn { border-left-color: var(--warning); }
.callout--danger { border-left-color: var(--danger); }
.callout b { display: block; color: var(--fg); font-weight: 500; margin-bottom: 4px; }

.steps { counter-reset: step; list-style: none; padding-left: 0; }
.steps > li { counter-increment: step; position: relative; padding-left: 34px; margin-top: var(--space-prose); }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 22px; height: 22px; display: grid; place-items: center;
  border: 1px solid var(--border-strong); border-radius: 50%;
  font-size: 11px; color: var(--fg-subtle);
}
.steps > li::marker { content: none; }

.check { list-style: none; padding-left: 0; }
.check > li { position: relative; padding-left: 26px; }
.check > li::before { content: '☐'; position: absolute; left: 0; color: var(--fg-subtle); }
.check > li::marker { content: none; }

.pagenav { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--border); }


/* ── Slideshow ────────────────────────────────────────────────
   Two or three pictures in the detail sheet. Deliberately not a carousel that
   moves on its own: it is a thing to look at, not a thing to be shown. */

.shots { margin-top: 4px; }
/* The stage hugs the picture rather than boxing it. Plugin windows are tall
   and narrow, so a fixed landscape frame spent half its width on empty panel
   either side — the border belongs on the image, not around the gap. */
.shots__stage {
  position: relative;
  display: grid; place-items: center;
  min-height: 200px;
}
.shots__stage img {
  max-height: 420px; max-width: 100%; width: auto; height: auto;
  display: block;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-elevated);
}
.shots__nav {
  position: absolute; top: 0; bottom: 0; width: 44px;
  display: grid; place-items: center;
  background: none; border: none; cursor: pointer;
  color: var(--fg); font-size: 18px; line-height: 1;
  opacity: 0; transition: opacity var(--dur) var(--ease);
}
.shots__stage:hover .shots__nav,
.shots__nav:focus-visible { opacity: 1; }
.shots__nav span {
  display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg-overlay) 82%, transparent);
  border: 1px solid var(--border-strong);
}
.shots__nav--prev { left: 0; }
.shots__nav--next { right: 0; }

.shots__dots { display: flex; gap: 6px; justify-content: center; margin-top: 10px; }
.shots__dot {
  width: 6px; height: 6px; padding: 0; border-radius: 50%;
  border: 1px solid var(--fg-subtle); background: none; cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.shots__dot[aria-current="true"] { background: var(--accent); border-color: var(--accent); }
.shots__count { text-align: center; font-size: 11px; color: var(--fg-subtle); margin-top: 6px; }
