/* ==========================================================================
   Crafters Development - Bento design system
   Loaded after style.css. It replaces the palette, the chrome and the
   component language, and re-skins the documentation and legal pages that
   still use the old classes.
   ========================================================================== */

:root {
  /* Backgrounds (layers) */
  --bg-canvas: #111216;
  --bg-card: #181A20;
  --bg-card-hover: #20232B;
  --bg-elevated: #262A34;

  /* Accent */
  --accent-primary: #6366F1;
  --accent-hover: #4F46E5;
  --accent-subtle: rgba(99, 102, 241, 0.15);

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(99, 102, 241, 0.45);

  /* Text */
  --text-primary: #FFFFFF;
  --text-secondary: #9CA3AF;
  --text-muted: #6B7280;

  /* Geometry */
  --radius-card: 16px;
  --radius-button: 8px;
  --radius-badge: 6px;
  --gap-grid: 20px;
  --padding-card: 24px;
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Legacy remap: the old pages read these, so the whole site turns dark. */
  --white: var(--bg-canvas);
  --ink: var(--text-primary);
  --ink-soft: var(--text-primary);
  --slate: var(--text-secondary);
  --slate-light: var(--text-muted);
  --line: var(--border-subtle);
  --surface: var(--bg-card);
  --accent-blue: var(--accent-primary);
  --max-w: 1200px;
}

body {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-main);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .display {
  font-family: "Plus Jakarta Sans", var(--font-main);
  color: var(--text-primary);
}

p { color: var(--text-secondary); }

::selection { background: var(--accent-primary); color: #fff; }

:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 3px; }

.wrap { max-width: var(--max-w); margin: 0 auto; padding-inline: clamp(16px, 4vw, 40px); }

/* ---------------------------------------------------------------- NAV ---- */
header.nav,
header.site-nav {
  position: sticky;
  top: 0;
  z-index: 120;
  background: rgba(17, 18, 22, 0.82);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 66px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Plus Jakarta Sans", var(--font-main);
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text-primary);
  white-space: nowrap;
}

.brand-mark { width: 30px; height: 30px; object-fit: contain; flex-shrink: 0; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 0.9rem;
}

.nav-links a:not(.nav-cta) { color: var(--text-secondary); font-weight: 500; transition: color 0.18s ease; }
.nav-links a:not(.nav-cta):hover { color: var(--text-primary); }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
  background: var(--accent-primary);
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  transition: background 0.18s ease;
}

.nav-cta:hover { background: var(--accent-hover); color: #fff; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0 9px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-button);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* -------------------------------------------------------------- BUTTONS -- */
.btn,
.btn-accent,
.btn-solid,
.btn-outline,
.btn-discord {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: var(--font-main);
  border-radius: var(--radius-button);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  background: var(--bg-elevated);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.btn:hover, .btn-solid:hover, .btn-outline:hover, .btn-discord:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.btn-accent,
.btn-solid {
  background: var(--accent-primary);
  border-color: transparent;
}

.btn-accent:hover,
.btn-solid:hover { background: var(--accent-hover); }

.btn-outline { background: transparent; }
.btn-discord { background: #5865F2; border-color: transparent; }
.btn-discord:hover { background: #4752C4; }

.btn-icon { width: 14px; height: 14px; }

/* ------------------------------------------------------------- SECTIONS -- */
.section { padding-block: clamp(40px, 6vw, 72px); }
.section + .section { border-top: 1px solid var(--border-subtle); }

.section-head { max-width: 720px; margin-bottom: 28px; }
.section-head.center { margin-inline: auto; text-align: center; }

.eyebrow,
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.section-head h2,
h2.section-title {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.section-head p { font-size: 0.95rem; line-height: 1.65; }

/* ---------------------------------------------------------------- BENTO -- */
.bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap-grid);
}

.bento-card {
  grid-column: span 12;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: var(--padding-card);
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.bento-card:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.bento-card.is-static:hover { transform: none; border-color: var(--border-subtle); background: var(--bg-card); }

.bento-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.bento-card p { font-size: 0.9rem; line-height: 1.6; }

.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-9 { grid-column: span 9; }

/* --------------------------------------------------------------- HERO ---- */
.hero-app { padding-block: clamp(28px, 5vw, 56px) 8px; }

.hero-lead-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  min-height: 260px;
  background:
    radial-gradient(120% 130% at 100% 0%, rgba(99, 102, 241, 0.18), transparent 60%),
    var(--bg-card);
}

.hero-title {
  font-size: clamp(1.9rem, 4.4vw, 3.1rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.hero-title .grad {
  background: linear-gradient(100deg, #818CF8 0%, #6366F1 45%, #A78BFA 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  line-height: 1.65;
  max-width: 62ch;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.status-card { display: flex; flex-direction: column; gap: 14px; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #86efac;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.28);
  border-radius: 100px;
}

.status-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stat-tile {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
}

.stat-value {
  font-family: "Plus Jakarta Sans", var(--font-main);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.stat-value.accent { color: #A5B4FC; }
.stat-label { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }

.mono-block {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.74rem;
  line-height: 1.9;
  color: var(--text-muted);
  background: #0C0D11;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 14px;
  overflow-x: auto;
}

.mono-block b { color: #A5B4FC; font-weight: 700; }
.mono-block em { color: #86efac; font-style: normal; }

/* --------------------------------------------------------- PLUGIN CARDS -- */
.plugins-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap-grid);
}

.pcard {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.pcard:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.pcard-head { display: flex; align-items: center; gap: 12px; }

.pcard-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 12px;
  font-size: 1.05rem;
  color: #E0E7FF;
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.35), rgba(99, 102, 241, 0.08));
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.pcard-icon.is-muted { color: var(--text-muted); background: var(--bg-elevated); border-color: var(--border-subtle); }

.pcard-name { font-family: "Plus Jakarta Sans", var(--font-main); font-size: 1rem; font-weight: 700; }
.pcard-sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

.pcard-badge {
  margin-left: auto;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: var(--radius-badge);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  background: var(--bg-elevated);
  white-space: nowrap;
}

.pcard-badge.live { color: #86efac; border-color: rgba(34, 197, 94, 0.3); background: rgba(34, 197, 94, 0.1); }
.pcard-badge.soon { color: #FCD34D; border-color: rgba(245, 158, 11, 0.3); background: rgba(245, 158, 11, 0.1); }

.pcard-desc {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pcard-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-badge);
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.tag-accent { color: #C7D2FE; background: var(--accent-subtle); border-color: rgba(99, 102, 241, 0.3); }

.pcard-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.pcard-foot .btn { padding: 8px 14px; font-size: 0.8rem; }
.pcard-foot .btn-accent { flex: 1; }

/* ------------------------------------------------------- DETAIL PAGES ---- */
.detail-hero {
  padding-block: clamp(24px, 4vw, 48px) 8px;
  background:
    radial-gradient(90% 120% at 0% 0%, rgba(99, 102, 241, 0.16), transparent 55%),
    transparent;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.crumbs a { color: var(--text-secondary); }
.crumbs a:hover { color: var(--text-primary); }

.detail-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.detail-lead { max-width: 70ch; font-size: 1rem; line-height: 1.7; }

.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: var(--gap-grid);
  align-items: start;
  padding-block: 24px 56px;
}

.detail-main { display: flex; flex-direction: column; gap: var(--gap-grid); min-width: 0; }
.detail-aside { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 16px; }

.spec-card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-card); padding: 20px; }
.spec-card h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 14px; }

.spec-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: 0.82rem;
  border-bottom: 1px dashed var(--border-subtle);
}

.spec-row:last-child { border-bottom: 0; }
.spec-row dt { color: var(--text-muted); }
.spec-row dd { color: var(--text-primary); font-weight: 600; text-align: right; }

.block-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: var(--padding-card);
}

.block-card > h2,
.block-card > h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.block-card > .block-sub { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 18px; }

.feature-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }

.feature-list li {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
}

.feature-list li i { color: #A5B4FC; margin-top: 2px; }
.feature-list li strong { color: var(--text-primary); }

.cmd-table-wrap { overflow-x: auto; border: 1px solid var(--border-subtle); border-radius: 12px; }

table.cmd-table { width: 100%; border-collapse: collapse; font-size: 0.83rem; min-width: 480px; }
table.cmd-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
}
table.cmd-table td { padding: 10px 14px; border-bottom: 1px solid var(--border-subtle); color: var(--text-secondary); vertical-align: top; }
table.cmd-table tr:last-child td { border-bottom: 0; }
table.cmd-table code { color: #C7D2FE; }

code, kbd {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.85em;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(99, 102, 241, 0.12);
  color: #C7D2FE;
}

.perm-cloud { display: flex; flex-wrap: wrap; gap: 6px; }

.notice {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  font-size: 0.83rem;
  line-height: 1.55;
  color: var(--text-secondary);
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 12px;
}

.notice.warn { background: rgba(245, 158, 11, 0.08); border-color: rgba(245, 158, 11, 0.28); }
.notice i { color: #A5B4FC; margin-top: 2px; }
.notice.warn i { color: #FCD34D; }

.steps { counter-reset: step; display: flex; flex-direction: column; gap: 10px; list-style: none; margin: 0; padding: 0; }

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 42px;
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--text-secondary);
  min-height: 28px;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #C7D2FE;
  background: var(--accent-subtle);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 8px;
}

/* ----------------------------------------------------- MARKDOWN RENDER --- */
.md-body {
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text-secondary);
  overflow-wrap: break-word;
}

.md-body > *:first-child { margin-top: 0; }
.md-body h1, .md-body h2, .md-body h3, .md-body h4 { color: var(--text-primary); margin: 1.6em 0 0.5em; line-height: 1.25; }
.md-body h1 { font-size: 1.5rem; }
.md-body h2 { font-size: 1.2rem; padding-bottom: 6px; border-bottom: 1px solid var(--border-subtle); }
.md-body h3 { font-size: 1.02rem; }
.md-body h4 { font-size: 0.92rem; color: var(--text-secondary); }
.md-body p, .md-body ul, .md-body ol, .md-body blockquote, .md-body pre, .md-body table { margin: 0.9em 0; }
.md-body ul, .md-body ol { padding-left: 1.35em; }
.md-body ul { list-style: disc; }
.md-body ol { list-style: decimal; }
.md-body li { margin: 0.3em 0; }
.md-body li::marker { color: var(--accent-primary); }
.md-body strong { color: var(--text-primary); font-weight: 700; }
.md-body a { color: #A5B4FC; text-decoration: underline; text-underline-offset: 3px; }
.md-body code { font-size: 0.82em; }
.md-body pre {
  padding: 14px 16px;
  overflow-x: auto;
  background: #0C0D11;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
}
.md-body pre code { padding: 0; background: none; color: #E5E7EB; }
.md-body blockquote {
  padding: 10px 16px;
  border-left: 3px solid var(--accent-primary);
  background: rgba(99, 102, 241, 0.08);
  border-radius: 0 10px 10px 0;
}
.md-body blockquote p { color: var(--text-secondary); margin: 0; }
.md-body hr { border: 0; border-top: 1px solid var(--border-subtle); margin: 1.6em 0; }
.md-body table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.md-body th, .md-body td { border: 1px solid var(--border-subtle); padding: 8px 10px; text-align: left; }
.md-table-wrap { overflow-x: auto; margin: 0.9em 0; border: 1px solid var(--border-subtle); border-radius: 12px; }
.md-table-wrap table { min-width: 420px; margin: 0; }
.md-body th { background: var(--bg-elevated); color: var(--text-primary); }

.md-loading { font-size: 0.85rem; color: var(--text-muted); }

/* -------------------------------------------------------------- FOOTER --- */
footer.site-footer,
footer.footer-rich {
  border-top: 1px solid var(--border-subtle);
  background: #0D0E12;
  padding-block: 40px 24px;
  padding-inline: 0;
  margin-top: 24px;
  text-align: left;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-top {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border-subtle);
}

.footer-brand { display: flex; gap: 12px; align-items: flex-start; }
.footer-brand img { width: 34px; height: 34px; object-fit: contain; }
.footer-brand-name { font-family: "Plus Jakarta Sans", var(--font-main); font-weight: 700; font-size: 0.95rem; }
.footer-brand-desc { font-size: 0.8rem; line-height: 1.6; color: var(--text-muted); margin-top: 6px; max-width: 34ch; }

.footer-col-title { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; }
.footer-links { display: flex; flex-direction: column; gap: 7px; }
.footer-links a { font-size: 0.82rem; color: var(--text-secondary); }
.footer-links a:hover { color: var(--text-primary); }

.footer-donate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #FCA5A5;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-button);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding-top: 20px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.footer-legal { max-width: 62ch; line-height: 1.6; margin-top: 4px; }
.footer-legal a { color: var(--text-secondary); text-decoration: underline; }
.footer-right { text-align: right; }

/* ------------------------------------- LEGACY DOCS / LEGAL RE-SKIN ------ */
.docs-hero, .legal-hero { padding-block: clamp(28px, 5vw, 56px) 8px; background: radial-gradient(90% 120% at 0% 0%, rgba(99, 102, 241, 0.14), transparent 55%); }
.docs-hero h1, .legal-hero h1 { color: var(--text-primary); }
.docs-hero p, .legal-hero p { color: var(--text-secondary); }

.docs-badge, .legal-kicker, .version-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  margin: 0 6px 6px 0;
}

.docs-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: var(--gap-grid); align-items: start; padding-block: 28px 56px; }
.docs-sidebar {
  position: sticky;
  top: 86px;
  padding: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
}
.docs-sidebar-title { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; }
.docs-sidebar a { display: block; font-size: 0.82rem; color: var(--text-secondary); padding: 6px 8px; border-radius: 7px; }
.docs-sidebar a:hover, .docs-sidebar a.active { color: var(--text-primary); background: var(--accent-subtle); }

.docs-content { min-width: 0; }
.docs-section { margin-bottom: 36px; }
.docs-section h2, .docs-section h3 { color: var(--text-primary); }
.docs-section p, .docs-section li { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.7; }

.docs-card, .legal-section, .legal-body {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: var(--padding-card);
}

.docs-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.docs-callout, .legal-callout {
  padding: 14px 16px;
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--text-secondary);
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 12px;
}
.docs-callout.warn, .docs-callout.is-warn { background: rgba(245, 158, 11, 0.08); border-color: rgba(245, 158, 11, 0.28); }

.code-block {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  line-height: 1.7;
  color: #E5E7EB;
  background: #0C0D11;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px 16px;
  overflow-x: auto;
  white-space: pre;
}

.docs-table-wrap, .legal-toc { border: 1px solid var(--border-subtle); border-radius: 12px; overflow-x: auto; background: var(--bg-card); padding: 4px; }
table.docs-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; min-width: 440px; }
table.docs-table th { text-align: left; padding: 10px 12px; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); background: var(--bg-elevated); }
table.docs-table td { padding: 9px 12px; color: var(--text-secondary); border-top: 1px solid var(--border-subtle); vertical-align: top; }
table.docs-table code { color: #C7D2FE; }

.legal-toc { padding: 16px 18px; margin-bottom: 20px; }
.legal-toc-title { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; }
.legal-toc a { display: block; font-size: 0.82rem; color: var(--text-secondary); padding: 4px 0; }
.legal-toc a:hover { color: var(--text-primary); }

.legal-section-num { font-family: "JetBrains Mono", monospace; font-size: 0.75rem; color: #A5B4FC; }
.legal-list { padding-left: 1.2em; }
.legal-list li { color: var(--text-secondary); font-size: 0.88rem; line-height: 1.7; margin: 0.35em 0; }
.legal-list li::marker { color: var(--accent-primary); }

.back-to-top {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

/* ---------------------------------------------------------- RESPONSIVE --- */
@media (max-width: 1080px) {
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-aside { position: static; }
  .docs-shell { grid-template-columns: minmax(0, 1fr); }
  .docs-sidebar { position: static; }
  .footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .nav-toggle { display: flex; }

  .nav-links {
    position: fixed;
    inset: 66px 12px auto 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
    box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.75);
    display: none;
  }

  .nav-links.open { display: flex; }
  .nav-links a:not(.nav-cta) { padding: 10px 8px; font-size: 0.92rem; }
  .nav-cta { justify-content: center; margin-top: 6px; }

  .bento-card.span-3, .bento-card.span-4, .bento-card.span-5,
  .bento-card.span-6, .bento-card.span-7, .bento-card.span-8,
  .bento-card.span-9 { grid-column: span 12; }

  .hero-title { font-size: clamp(1.7rem, 7vw, 2.4rem); }
  .detail-title { font-size: 1.7rem; }
  .footer-right { text-align: left; }
}

@media (max-width: 520px) {
  :root { --padding-card: 18px; --gap-grid: 14px; }
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .stat-value { font-size: 1.1rem; }
  .stat-label { font-size: 0.62rem; }
  .footer-top { grid-template-columns: 1fr; }
  .plugins-grid { grid-template-columns: 1fr; }
  .pcard-desc { -webkit-line-clamp: 4; line-clamp: 4; }
  .detail-actions .btn, .hero-actions .btn { width: 100%; }
}

/* ------------------------------------------------------ SCROLL REVEAL --- */
/* Replaces the GSAP choreography. Elements start slightly down and blurred,
   then settle once they enter the viewport. js/shell.js drives is-visible. */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  filter: blur(4px);
  transition:
    opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
  filter: none;
}

@keyframes shell-fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

table.docs-table tbody tr,
.md-body > * {
  animation: shell-fade-up 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal.is-visible {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }

  table.docs-table tbody tr,
  .md-body > *,
  .btn,
  .nav-cta {
    animation: none;
  }

  html { scroll-behavior: auto; }
}

/* ------------------------------------------- LEGACY BUTTON REDESIGN ---- */
/* style.css paints buttons as 100px pills with a diagonal shine sweep. They
   are pulled back to the 8px radius, flat accent surfaces of the redesign. */
.btn,
.hero-ctas .btn,
.cta-actions .btn {
  position: relative;
  isolation: auto;
  overflow: visible;
  padding: 11px 20px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-button);
  transform: none;
  box-shadow: none;
}

.btn::after,
.hero-ctas .btn::after,
.cta-actions .btn::after { content: none; }

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }

.btn-solid {
  background: var(--accent-primary);
  color: #fff;
}
.btn-solid:hover { background: var(--accent-hover); }

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}
.btn-outline:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.cta-actions .btn-outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-subtle);
}
.cta-actions .btn-outline:hover { border-color: var(--border-hover); }

.hero-ctas { gap: 10px; }

/* The sanction application sheet ships its own inline styles, so the button
   needs one extra level of specificity to inherit the new language. */
body .btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent-primary);
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

body .btn-submit:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: none;
}

body .btn-submit:disabled { opacity: 0.45; cursor: not-allowed; }

/* --------------------------------- SANCTION API SHEET (dark pass) ----- */
/* The application form ships a light-only inline stylesheet. These rules
   re-tint the surfaces that were hardcoded in white. */
body .app-warning {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: var(--radius-card);
}
body .app-warning i { color: #FBBF24; }
body .app-warning p { color: #FCD34D; }

body .app-scenario {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: var(--text-secondary);
}
body .app-scenario strong { color: #C7D2FE; }

body .app-section-num {
  background: var(--accent-subtle);
  color: #C7D2FE;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

body #formStatus.status-success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #86EFAC;
}

body #formStatus.status-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #FCA5A5;
}

body #formStatus.status-loading {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

body .app-field .req { color: #F87171; }
body .char-counter.ok { color: #86EFAC; }

/* Utility */
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }


/* ------------------------------------------------------ LEGAL CONSENT ---- */
.legal-consent-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 5, 10, .78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.legal-consent-modal {
  width: min(560px, 100%);
  max-height: min(720px, calc(100vh - 40px));
  overflow-y: auto;
  padding: clamp(22px, 4vw, 34px);
  background: var(--bg-card);
  border: 1px solid rgba(129, 140, 248, .35);
  border-radius: var(--radius-card);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.legal-consent-kicker { display: inline-flex; align-items: center; gap: 8px; color: #A5B4FC; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.legal-consent-kicker i { font-size: .85rem; }
.legal-consent-modal h2 { margin: 12px 0 10px; font-size: clamp(1.35rem, 3vw, 1.75rem); }
.legal-consent-modal p { color: var(--text-secondary); font-size: .9rem; line-height: 1.65; }
.legal-consent-links { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 14px 0 20px; }
.legal-consent-links a { color: #A5B4FC; font-size: .84rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.legal-consent-check { display: flex; align-items: flex-start; gap: 10px; padding: 13px 14px; margin: 18px 0; color: var(--text-primary); font-size: .86rem; line-height: 1.5; background: rgba(99, 102, 241, .08); border: 1px solid rgba(99, 102, 241, .24); border-radius: 10px; cursor: pointer; }
.legal-consent-check input { width: 17px; height: 17px; flex: 0 0 17px; margin: 2px 0 0; accent-color: var(--accent-primary); }
.legal-consent-actions { display: flex; justify-content: flex-end; gap: 10px; }
.legal-consent-accept:disabled { opacity: .45; cursor: not-allowed; transform: none; }
body.legal-consent-open { overflow: hidden; }
@media (max-width: 520px) { .legal-consent-actions .btn { width: 100%; } .legal-consent-actions { flex-direction: column; } }


/* ----------------------------------------------- POLICY UPDATE NOTICE ---- */
.policy-update-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1001;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 5, 10, .78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.policy-update-modal {
  width: min(600px, 100%);
  max-height: min(720px, calc(100vh - 40px));
  overflow-y: auto;
  padding: clamp(22px, 4vw, 34px);
  background: var(--bg-card);
  border: 1px solid rgba(52, 211, 153, .35);
  border-radius: var(--radius-card);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.policy-update-kicker { display: inline-flex; align-items: center; gap: 8px; color: #6EE7B7; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.policy-update-modal h2 { margin: 12px 0 4px; font-size: clamp(1.35rem, 3vw, 1.75rem); }
.policy-update-date { margin: 0 0 14px; color: #6EE7B7; font-size: .8rem; font-weight: 700; }
.policy-update-modal p { color: var(--text-secondary); font-size: .9rem; line-height: 1.65; }
.policy-update-list { display: grid; gap: 9px; margin: 16px 0; padding-left: 1.25rem; color: var(--text-secondary); font-size: .87rem; line-height: 1.55; }
.policy-update-list li::marker { color: #34D399; }
.policy-update-links { font-size: .82rem !important; }
.policy-update-links a { color: #A7F3D0; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.policy-update-actions { display: flex; justify-content: flex-end; margin-top: 22px; }
.policy-update-accept { border: 0; cursor: pointer; }
body.policy-update-open { overflow: hidden; }
@media (max-width: 520px) { .policy-update-actions .btn { width: 100%; } }

.policy-update-group { margin: 18px 0; padding: 14px 16px; background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: 12px; }
.policy-update-group h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0; font-size: .92rem; }
.policy-update-group h3 a { color: var(--text-primary); }
.policy-update-group h3 span { color: #6EE7B7; font-size: .72rem; font-weight: 600; white-space: nowrap; }
.policy-update-group .policy-update-list { margin-bottom: 2px; }
@media (max-width: 520px) { .policy-update-group h3 { align-items: flex-start; flex-direction: column; gap: 4px; } }
