:root {
  color-scheme: dark;
  --bg: #111214;
  --surface: #181a1f;
  --surface-strong: #20232a;
  --line: #30343d;
  --text: #f4f0e8;
  --muted: #aaa59a;
  --accent: #e65b70;
  --accent-2: #e7b84c;
  --accent-3: #44b78b;
  --blue: #6a9af0;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
  --sidebar-width: 280px;
  --content-width: 1180px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(230, 91, 112, 0.12), transparent 28%),
    linear-gradient(315deg, rgba(68, 183, 139, 0.12), transparent 32%),
    var(--bg);
  color: var(--text);
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

code {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101114;
  color: #ffe6a0;
  font-size: 0.92em;
  padding: 0.12rem 0.35rem;
}

button,
input {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 16px;
  min-height: calc(100vh - 36px);
}

.page-frame {
  max-width: 1600px;
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: 18px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: calc(100vh - 36px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(17, 18, 20, 0.94);
  box-shadow: var(--shadow);
  padding: 22px 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(230, 91, 112, 0.65);
  border-radius: 8px;
  background: #20171b;
  color: #ffb8c2;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  margin-top: 2px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-list a {
  border-radius: 8px;
  color: var(--muted);
  padding: 10px 12px;
  transition: background 0.18s, color 0.18s;
}

.nav-list a:hover,
.nav-list a.active {
  background: var(--surface-strong);
  color: var(--text);
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  color: var(--muted);
  font-size: 0.82rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-3);
  box-shadow: 0 0 0 4px rgba(68, 183, 139, 0.14);
}

.content {
  min-width: 0;
  padding: 0 0 64px;
}

.topbar {
  position: sticky;
  top: 18px;
  z-index: 5;
  display: flex;
  justify-content: center;
  border: 1px solid rgba(48, 52, 61, 0.78);
  border-radius: 16px;
  background: rgba(17, 18, 20, 0.92);
  padding: 14px 22px;
  backdrop-filter: blur(16px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(var(--content-width), 100%);
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f1013;
  color: var(--muted);
  padding: 0 13px;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.search:focus-within {
  border-color: rgba(230, 91, 112, 0.7);
  box-shadow: 0 0 0 3px rgba(230, 91, 112, 0.12);
}

.search input {
  width: 100%;
  min-height: 44px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.support-link,
.primary-action,
.secondary-action,
.ghost-button,
.category-button,
.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}

.support-link,
.secondary-action,
.ghost-button,
.category-button,
.copy-button {
  border: 1px solid var(--line);
  background: #14161a;
  color: var(--text);
  padding: 0 14px;
}

.primary-action {
  border: 1px solid rgba(230, 91, 112, 0.65);
  background: var(--accent);
  color: #fff;
  font-weight: 750;
  padding: 0 16px;
}

.ghost-button,
.category-button,
.copy-button {
  font-size: 0.92rem;
}

.section {
  scroll-margin-top: 92px;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 56px 0;
}

section[hidden] {
  display: none !important;
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.92fr);
  align-items: center;
  gap: 34px;
  padding-bottom: 28px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 16px;
  font-size: clamp(3rem, 7vw, 5.8rem);
  line-height: 0.96;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.lead {
  max-width: 650px;
  color: #d3cec4;
  font-size: 1.16rem;
  line-height: 1.7;
}

.creator-callout {
  margin: 0 0 12px;
  color: #ffe0a3;
  font-size: clamp(1.9rem, 4.2vw, 3.45rem);
  font-weight: 900;
  line-height: 1.02;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-visual {
  display: grid;
  grid-template-columns: repeat(3, minmax(76px, 1fr));
  gap: 12px;
  align-items: center;
  min-height: 360px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 16px;
  background:
    radial-gradient(ellipse at 20% 60%, rgba(230, 91, 112, 0.32) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 60%, rgba(165, 140, 255, 0.28) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 110%, rgba(68, 183, 139, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 30%, rgba(106, 154, 240, 0.14) 0%, transparent 60%),
    linear-gradient(170deg, #1c1628 0%, #141018 50%, #0f1418 100%);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(165, 140, 255, 0.08);
  overflow: hidden;
  padding: 26px 26px 16px;
  position: relative;
}

/* Star field */
.hero-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255,255,255,0.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 28% 8%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 44% 22%, rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 12%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 75% 20%, rgba(255,255,255,0.65) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 88% 9%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 8% 38%, rgba(255,255,255,0.35) 0%, transparent 100%),
    radial-gradient(1px 1px at 35% 45%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 92% 35%, rgba(255,255,255,0.45) 0%, transparent 100%),
    radial-gradient(1px 1px at 55% 50%, rgba(255,255,255,0.25) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 20% 55%, rgba(255,200,255,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 82% 52%, rgba(200,220,255,0.4) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* Bottom glow floor */
.hero-visual::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to top, rgba(165, 140, 255, 0.08), transparent);
  pointer-events: none;
  z-index: 0;
}

@keyframes kwami-float {
  0%   { transform: translateY(0px); }
  50%  { transform: translateY(-18px); }
  100% { transform: translateY(0px); }
}

@keyframes kwami-float-mid {
  0%   { transform: translateY(-20px); }
  50%  { transform: translateY(-38px); }
  100% { transform: translateY(-20px); }
}

.hero-visual img {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  position: relative;
  z-index: 1;
  will-change: transform;
  margin-bottom: 20px;
}

.hero-visual img:nth-child(1) {
  animation: kwami-float 3.6s ease-in-out infinite;
  animation-delay: 0s;
  filter:
    drop-shadow(0 0 18px rgba(230, 91, 112, 0.45))
    drop-shadow(0 16px 14px rgba(0, 0, 0, 0.4));
}

.hero-visual img:nth-child(2) {
  animation: kwami-float-mid 4.1s ease-in-out infinite;
  animation-delay: -1.4s;
  filter:
    drop-shadow(0 0 18px rgba(100, 100, 130, 0.5))
    drop-shadow(0 16px 14px rgba(0, 0, 0, 0.45));
}

.hero-visual img:nth-child(3) {
  animation: kwami-float 3.8s ease-in-out infinite;
  animation-delay: -0.9s;
  filter:
    drop-shadow(0 0 18px rgba(165, 140, 255, 0.45))
    drop-shadow(0 16px 14px rgba(0, 0, 0, 0.4));
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: var(--content-width);
  margin: -8px auto 0;
}

.stats-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 26, 31, 0.9);
  padding: 20px;
}

.stats-grid span {
  display: block;
  font-size: 2.2rem;
  font-weight: 800;
}

.stats-grid small {
  color: var(--muted);
}

.split-section {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
  gap: 34px;
}

.split-section h2 {
  font-size: clamp(2rem, 3vw, 3rem);
  overflow-wrap: anywhere;
}

.split-section p,
.guide-band p,
.policy-section p {
  color: #d3cec4;
  line-height: 1.72;
}

.setup-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.setup-list li {
  position: relative;
  border-left: 3px solid var(--accent);
  background: rgba(24, 26, 31, 0.78);
  padding: 16px 18px 16px 48px;
}

.setup-list li::before {
  position: absolute;
  left: 18px;
  top: 16px;
  color: var(--accent-2);
  font-weight: 800;
  counter-increment: step;
  content: counter(step);
}

.setup-list strong,
.setup-list span {
  display: block;
}

.setup-list span {
  color: var(--muted);
  margin-top: 4px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.category-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.category-note {
  margin: -8px 0 18px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.92rem;
}

.category-note strong {
  color: var(--text);
}

.category-button {
  transition: border-color 0.18s, background 0.18s, color 0.18s;
}

.category-button.active {
  border-color: color-mix(in srgb, var(--tone, var(--accent)) 80%, transparent);
  background: color-mix(in srgb, var(--tone, var(--accent)) 14%, #14161a);
  color: var(--text);
}

.category-button span {
  color: var(--muted);
  margin-left: 4px;
}

.command-grid {
  column-count: 2;
  column-gap: 14px;
}

.commands-panel[hidden],
.collapsed-state[hidden] {
  display: none;
}

.command-card {
  display: grid;
  width: 100%;
  gap: 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--tone, #6a9af0);
  border-radius: 8px;
  background: rgba(24, 26, 31, 0.92);
  break-inside: avoid;
  margin: 0 0 14px;
  padding: 18px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.command-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28), 0 0 0 1px color-mix(in srgb, var(--tone, #6a9af0) 30%, transparent);
}

.command-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.command-title {
  min-width: 0;
}

.command-title code {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: #fff3c8;
  font-size: 1.05rem;
  font-weight: 800;
}

.command-card p {
  color: #d3cec4;
  line-height: 1.6;
  margin-bottom: 0;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  padding: 4px 8px;
}

.tag.restricted {
  border-color: rgba(230, 91, 112, 0.6);
  color: #ffb8c2;
}

.tag.cooldown {
  border-color: rgba(231, 184, 76, 0.58);
  background: rgba(231, 184, 76, 0.08);
  color: #ffe6a0;
}

.option-list,
.subcommand-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.option-list li {
  display: grid;
  grid-template-columns: max-content max-content minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.option-list code {
  justify-self: start;
}

.option-kind {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #cfc8ba;
  font-size: 0.72rem;
  padding: 2px 7px;
}

.group-label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.subcommand-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.subcommand-chips code {
  color: #fff3c8;
  font-weight: 800;
}

.subcommand-item {
  border-top: 1px solid rgba(48, 52, 61, 0.72);
  padding-top: 10px;
}

.subcommand-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.subcommand-main {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.subcommand-main code {
  color: #fff3c8;
  font-weight: 800;
}

.inline-options {
  display: grid;
  gap: 6px;
  list-style: none;
  margin: 8px 0 0;
  padding: 0 0 0 12px;
}

.inline-options li {
  display: grid;
  grid-template-columns: max-content max-content minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

mark {
  background: rgba(231, 184, 76, 0.28);
  color: #ffe6a0;
  border-radius: 3px;
  padding: 0 2px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 24px;
}

.result-count {
  color: var(--muted);
  font-size: 0.84rem;
  margin-bottom: 14px;
  min-height: 1.2em;
}

.result-count strong {
  color: var(--text);
}

/* Hamburger button */
.hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #14161a;
  cursor: pointer;
  flex-shrink: 0;
}

.hamburger span,
.hamburger span::before,
.hamburger span::after {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  position: relative;
  transition: transform 0.22s, opacity 0.22s;
}

.hamburger span::before,
.hamburger span::after {
  content: '';
  position: absolute;
  left: 0;
}

.hamburger span::before { top: -5px; }
.hamburger span::after  { top: 5px; }

.hamburger[aria-expanded="true"] span { background: transparent; }
.hamburger[aria-expanded="true"] span::before { transform: rotate(45deg) translate(3px, 4px); }
.hamburger[aria-expanded="true"] span::after  { transform: rotate(-45deg) translate(3px, -4px); }

/* Mobile nav overlay */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

.nav-overlay.open {
  display: block;
}

.mobile-nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
  width: min(300px, 85vw);
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  transform: translateX(-100%);
  transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.mobile-nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.mobile-nav-close {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #14161a;
  color: var(--text);
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  transition: background 0.18s, border-color 0.18s, transform 0.12s;
}

.mobile-nav-close:hover {
  border-color: rgba(230, 91, 112, 0.55);
  background: rgba(230, 91, 112, 0.12);
}

.mobile-nav-close:active {
  transform: scale(0.94);
}

.mobile-nav.open {
  transform: translateX(0);
}

.mobile-nav .nav-list {
  display: grid;
  gap: 6px;
}

.collapsed-state {
  border: 1px dashed rgba(231, 184, 76, 0.45);
  border-radius: 8px;
  background: rgba(231, 184, 76, 0.08);
  color: #d3cec4;
  margin: 0;
  padding: 22px;
}

.guide-band {
  border-top: 1px solid var(--line);
}

.guide-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 18px;
}

.guide-columns-economy {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.guide-columns article {
  border-left: 3px solid var(--accent-3);
  background: rgba(24, 26, 31, 0.62);
  padding: 16px;
}

.guide-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 100%;
  border: 1px solid color-mix(in srgb, var(--card-tone, var(--accent-3)) 22%, var(--line));
  border-left: 3px solid var(--card-tone, var(--accent-3));
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--card-tone, var(--accent-3)) 10%, rgba(24, 26, 31, 0.92)), rgba(24, 26, 31, 0.92) 36%),
    rgba(24, 26, 31, 0.88);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.16);
  padding: 18px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.kwami-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: start;
  gap: 18px;
  margin: 18px 0 18px;
}

.kwami-spotlight,
.kwami-control-card {
  min-height: 0;
  height: fit-content;
}

.kwami-flow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.kwami-flow-step {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  column-gap: 10px;
  row-gap: 6px;
  align-self: start;
  height: fit-content;
  align-items: start;
  border: 1px solid color-mix(in srgb, var(--card-tone, var(--accent-3)) 18%, var(--line));
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 11px 11px;
}

.kwami-flow-step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  grid-column: 1;
  grid-row: 1;
  border-radius: 999px;
  background: color-mix(in srgb, var(--card-tone, var(--accent-3)) 22%, #101114);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
}

.kwami-flow-step strong {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  color: #fbf7ef;
  font-size: 0.96rem;
}

.kwami-flow-step .command-pills {
  grid-column: 1 / -1;
  grid-row: 2;
  margin-top: 0;
}

.kwami-pill-grid {
  gap: 7px;
}

.kwami-pill-grid code {
  font-size: 0.8rem;
}

.guide-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.22);
  border-color: color-mix(in srgb, var(--card-tone, var(--accent-3)) 44%, var(--line));
}

.card-kicker {
  margin: 0;
  color: var(--card-tone, var(--accent-3));
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.guide-card h3 {
  margin: 0;
  color: #fbf7ef;
}

.miraculous-grid {
  align-items: start;
  margin-top: 18px;
}

.miraculous-grid .guide-card {
  min-height: 0;
  height: fit-content;
}

.community-section {
  padding-bottom: 56px;
}

.community-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  align-items: start;
  gap: 18px;
  margin: 20px 0 18px;
}

.community-feature,
.community-mini-card {
  display: grid;
  align-content: start;
  gap: 12px;
  border: 1px solid color-mix(in srgb, var(--card-tone, var(--accent-3)) 24%, var(--line));
  border-left: 3px solid var(--card-tone, var(--accent-3));
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--card-tone, var(--accent-3)) 8%, transparent), transparent 44%),
    rgba(24, 26, 31, 0.82);
  padding: 18px;
}

.community-feature h3,
.community-mini-card h3 {
  margin: 0;
  color: #fbf7ef;
}

.community-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.community-flow div {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  column-gap: 10px;
  row-gap: 5px;
  align-items: center;
  border-top: 1px solid color-mix(in srgb, var(--card-tone, var(--accent-3)) 28%, var(--line));
  padding-top: 10px;
}

.community-flow span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  grid-row: 1 / span 2;
  border-radius: 999px;
  background: color-mix(in srgb, var(--card-tone, var(--accent-3)) 20%, #101114);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 850;
}

.community-flow strong {
  color: var(--text);
  line-height: 1.2;
}

.community-flow code {
  justify-self: start;
  border-color: color-mix(in srgb, var(--card-tone, var(--accent-3)) 28%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--card-tone, var(--accent-3)) 10%, #101114);
}

.community-quick-panels {
  display: grid;
  gap: 14px;
}

.community-mini-card {
  min-height: 0;
}

.community-mini-card .command-pills {
  margin-top: 0;
}

.community-command-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: start;
}

.community-command-grid .guide-card {
  min-height: 0;
  height: fit-content;
}

.patreon-section {
  padding-bottom: 56px;
}

.patreon-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.72fr);
  align-items: stretch;
  gap: 20px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(230, 91, 112, 0.12), transparent 42%),
    linear-gradient(315deg, rgba(231, 184, 76, 0.09), transparent 44%),
    rgba(24, 26, 31, 0.88);
  margin: 20px 0 18px;
  padding: 20px;
}

.patreon-hero h3 {
  margin: 0;
  color: #fbf7ef;
  font-size: clamp(1.35rem, 2vw, 1.9rem);
}

.patreon-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.patreon-highlights span {
  border: 1px solid color-mix(in srgb, var(--accent-2) 28%, var(--line));
  border-radius: 999px;
  background: rgba(231, 184, 76, 0.09);
  color: #ffe7a8;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.42rem 0.68rem;
}

.patreon-proof-card {
  display: grid;
  gap: 10px;
  border: 1px solid color-mix(in srgb, var(--accent-3) 28%, var(--line));
  border-radius: 8px;
  background: rgba(17, 18, 20, 0.62);
  padding: 16px;
}

.patreon-proof-card p,
.patreon-proof-card ul {
  margin: 0;
}

.patreon-proof-card > p {
  color: var(--accent-3);
  font-size: 0.75rem;
  font-weight: 850;
  text-transform: uppercase;
}

.patreon-proof-card strong {
  color: var(--text);
  font-size: 1.04rem;
}

.patreon-proof-card ul {
  display: grid;
  gap: 8px;
  color: #d3cec4;
  line-height: 1.5;
  padding-left: 18px;
}

.patreon-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 10px;
}

.patreon-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
}

.patreon-grid .guide-card {
  min-height: 0;
  height: fit-content;
}

.patreon-process {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.patreon-process article {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  column-gap: 10px;
  row-gap: 5px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 26, 31, 0.76);
  padding: 14px;
}

.patreon-process span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  grid-row: 1 / span 2;
  border-radius: 999px;
  background: rgba(231, 184, 76, 0.14);
  color: #ffe6a0;
  font-size: 0.82rem;
  font-weight: 850;
}

.patreon-process strong {
  color: var(--text);
}

.patreon-process p {
  grid-column: 2;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.patreon-trust-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.patreon-trust-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 26, 31, 0.64);
  padding: 15px;
}

.patreon-trust-grid strong {
  color: #fbf7ef;
}

.patreon-trust-grid p {
  color: var(--muted);
  line-height: 1.6;
  margin: 8px 0 0;
}

.patreon-help-callout {
  margin-top: 18px;
}

.card-copy {
  margin: 0;
  color: #d3cec4;
  line-height: 1.68;
}

.command-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.command-pills code {
  border: 1px solid color-mix(in srgb, var(--card-tone, var(--accent-3)) 28%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--card-tone, var(--accent-3)) 10%, #101114);
  color: #fff3c8;
  font-size: 0.82rem;
  padding: 0.24rem 0.58rem;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.news-grid-preview {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.news-section .news-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.news-card {
  display: grid;
  align-content: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 26, 31, 0.86);
  padding: 18px;
}

.news-card h3 {
  margin: 0;
  font-size: 1.04rem;
}

.news-card-summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.news-meta {
  margin: 0;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.news-card-link {
  justify-self: start;
  margin-top: 4px;
  border: 1px solid rgba(230, 91, 112, 0.45);
  border-radius: 999px;
  background: rgba(230, 91, 112, 0.08);
  color: #ffd8df;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.42rem 0.72rem;
}

.section-intro {
  max-width: 760px;
  color: #d3cec4;
  line-height: 1.72;
  margin-bottom: 0;
}

.help-callout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  border-radius: 8px;
  background: rgba(24, 26, 31, 0.88);
  margin-top: 16px;
  padding: 16px;
}

.help-callout-title {
  color: var(--accent-2);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.help-callout-copy {
  color: #d3cec4;
  line-height: 1.62;
  margin: 0;
}

.support-preflight {
  border: 1px solid color-mix(in srgb, var(--accent-3) 18%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(68, 183, 139, 0.08), transparent 38%),
    rgba(24, 26, 31, 0.86);
  margin-top: 18px;
  padding: 16px;
}

.support-checklist {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}

.support-checklist li {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px 13px;
}

.support-checklist strong {
  color: var(--text);
  font-size: 0.96rem;
}

.support-checklist span {
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.94rem;
}

.support-stack {
  display: grid;
  gap: 16px;
  align-content: start;
}

.support-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.support-card {
  display: grid;
  gap: 10px;
  border: 1px solid color-mix(in srgb, var(--card-tone, var(--accent-3)) 22%, var(--line));
  border-left: 3px solid var(--card-tone, var(--accent-3));
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--card-tone, var(--accent-3)) 8%, rgba(24, 26, 31, 0.94)), rgba(24, 26, 31, 0.94) 36%),
    rgba(24, 26, 31, 0.9);
  padding: 16px;
}

.support-card h3 {
  color: #fbf7ef;
  margin: 0;
  font-size: 1.02rem;
}

.support-card .card-copy {
  line-height: 1.65;
}

.support-card .inline-link {
  margin-top: 4px;
  width: fit-content;
}

.support-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.staff-section {
  padding-top: 44px;
}

.staff-section h2 {
  font-size: clamp(2.3rem, 4vw, 3.8rem);
  margin-bottom: 10px;
}

.staff-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
  margin: 20px 0 16px;
}

.staff-overview-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 26, 31, 0.82);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.16);
  padding: 16px;
}

.staff-overview-card-main {
  border-color: color-mix(in srgb, var(--accent-2) 18%, var(--line));
}

.staff-overview-label {
  margin: 0;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.staff-overview-copy {
  color: #d3cec4;
  line-height: 1.6;
  margin: 0;
  max-width: 70ch;
}

.staff-overview-summary {
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.55;
  margin: -4px 0 0;
  max-width: 70ch;
}

.staff-overview-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.staff-overview-stats div {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 11px;
}

.staff-overview-stats strong {
  color: var(--text);
  font-size: 1.42rem;
  line-height: 1;
}

.staff-overview-stats span {
  color: var(--muted);
  font-size: 0.82rem;
}

.staff-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
}

.staff-join-callout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border: 1px solid color-mix(in srgb, var(--accent-3) 24%, var(--line));
  border-left: 3px solid var(--accent-3);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(68, 183, 139, 0.12), transparent 42%),
    rgba(24, 26, 31, 0.84);
  margin-top: 16px;
  padding: 18px;
}

.staff-join-callout h3 {
  color: var(--text);
  margin: 0 0 8px;
}

.staff-join-callout p:last-child {
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.staff-card {
  --staff-tone: #f3c04d;
  --staff-soft: color-mix(in srgb, var(--staff-tone) 10%, transparent);
  --staff-border: color-mix(in srgb, var(--staff-tone) 28%, transparent);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(64, 70, 84, 0.95);
  border-radius: 8px;
  background:
    linear-gradient(180deg, var(--staff-soft), rgba(24, 26, 31, 0.9) 28%),
    rgba(24, 26, 31, 0.9);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.18);
  min-height: 0;
  padding: 18px;
}

.staff-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: 8px 0 0 8px;
  background: linear-gradient(180deg, var(--staff-tone), rgba(255, 255, 255, 0.2));
}

.staff-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px 12px;
  margin-bottom: 10px;
}

.staff-card-head > div {
  display: grid;
  gap: 5px;
}

.staff-card .staff-tier {
  color: var(--staff-tone);
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1;
  margin: 0;
  text-transform: uppercase;
}

.staff-count {
  flex-shrink: 0;
  border: 1px solid var(--staff-border);
  border-radius: 999px;
  background: var(--staff-soft);
  color: #f4ede0;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 9px;
}

.staff-rank-title {
  color: #fbf7ef;
  font-size: 1.08rem;
  font-weight: 850;
  line-height: 1.15;
  margin: 0;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.staff-card p {
  color: #d3cec4;
  line-height: 1.6;
  margin-bottom: 0;
}

.staff-members {
  display: grid;
  gap: 9px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.staff-members li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: #e8edf8;
  line-height: 1.35;
  padding: 11px 12px;
}

.staff-members li::before {
  content: none;
}

.staff-avatar {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--staff-border);
  border-radius: 8px;
  background: var(--staff-soft);
  color: #fff6dc;
  font-size: 0.78rem;
  font-weight: 850;
}

.staff-name {
  display: block;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.staff-note {
  border: 1px dashed var(--staff-border);
  border-radius: 8px;
  background: var(--staff-soft);
  color: #efe2c7;
  line-height: 1.55;
  margin: 0;
  padding: 12px 13px;
}

.staff-card-empty {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(24, 26, 31, 0.88) 30%),
    rgba(24, 26, 31, 0.88);
}

.staff-card code {
  white-space: nowrap;
}

.staff-card-empire {
  --staff-tone: #f3c04d;
  --staff-soft: rgba(243, 192, 77, 0.1);
  --staff-border: rgba(243, 192, 77, 0.28);
}

.staff-card-empress {
  --staff-tone: #f06292;
  --staff-soft: rgba(240, 98, 146, 0.1);
  --staff-border: rgba(240, 98, 146, 0.28);
}

.staff-card-supervisor {
  --staff-tone: #8f7cff;
  --staff-soft: rgba(143, 124, 255, 0.1);
  --staff-border: rgba(143, 124, 255, 0.28);
}

.staff-card-deputy {
  --staff-tone: #8bd3ff;
  --staff-soft: rgba(139, 211, 255, 0.1);
  --staff-border: rgba(139, 211, 255, 0.28);
}

.staff-card-guardian {
  --staff-tone: #ffb347;
  --staff-soft: rgba(255, 179, 71, 0.1);
  --staff-border: rgba(255, 179, 71, 0.28);
}

.staff-card-royal {
  --staff-tone: #43d6c5;
  --staff-soft: rgba(67, 214, 197, 0.1);
  --staff-border: rgba(67, 214, 197, 0.28);
}

.staff-card-empire .staff-rank-title,
.staff-card-supervisor .staff-rank-title {
  font-size: 1rem;
}

.inline-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid rgba(230, 91, 112, 0.56);
  border-radius: 8px;
  background: #20171b;
  color: #ffd8df;
  font-weight: 750;
  margin-top: 14px;
  padding: 0 13px;
}

.faq-list {
  display: grid;
  gap: 8px;
  align-content: start;
  justify-items: stretch;
}

.faq-item {
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 26, 31, 0.82);
  overflow: hidden;
}

.faq-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  text-align: left;
}

.faq-toggle:hover {
  background: rgba(255, 255, 255, 0.02);
}

.faq-toggle:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 48%, transparent);
  outline-offset: -2px;
}

.faq-icon {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1;
  transition: transform 0.22s ease, color 0.22s;
}

.faq-toggle[aria-expanded="true"] .faq-icon {
  transform: rotate(45deg);
  color: var(--text);
}

.faq-answer {
  padding: 0 13px 12px;
}

.faq-answer[hidden] {
  display: none;
}

.faq-answer p {
  margin: 0;
  color: #d3cec4;
  line-height: 1.58;
  animation: faq-reveal 0.22s ease forwards;
}

@keyframes faq-reveal {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.policy-section {
  border-top: 1px solid var(--line);
}

.policy-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 10px;
}

.policy-banner {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(240px, 0.92fr);
  gap: 16px;
  align-items: start;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  border-radius: 8px;
  background: rgba(24, 26, 31, 0.86);
  margin-top: 18px;
  padding: 18px;
}

.policy-bullets {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.policy-bullets li {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  padding: 12px 13px;
}

.policy-bullets strong {
  color: var(--text);
  font-size: 0.96rem;
}

.policy-bullets span {
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.94rem;
}

.policy-grid {
  margin-top: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.policy-grid .guide-card {
  min-height: 100%;
}

.policy-help-callout {
  margin-top: 18px;
}

.sidebar-footer strong {
  color: var(--text);
}

@media (max-width: 960px) {
  body {
    padding: 0;
  }

  .page-frame {
    max-width: none;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .content {
    padding: 0 20px 52px;
  }

  .topbar {
    top: 0;
    border-radius: 0;
    padding: 14px 20px;
  }

  .breadcrumbs {
    width: auto;
    margin: 14px 20px 0;
  }

  .mobile-page-rail {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    width: auto;
    margin: 14px 20px 0;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .mobile-page-rail::-webkit-scrollbar {
    display: none;
  }

  .mobile-page-rail a {
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(24, 26, 31, 0.92);
    color: var(--muted);
    padding: 9px 12px;
    white-space: nowrap;
  }

  .mobile-page-rail a.active {
    border-color: color-mix(in srgb, var(--accent) 70%, transparent);
    background: color-mix(in srgb, var(--accent) 10%, #14161a);
    color: var(--text);
  }

  .hero-section,
  .split-section {
    grid-template-columns: 1fr;
  }

  .policy-banner,
  .policy-grid {
    grid-template-columns: 1fr;
  }

  .hero-section {
    min-height: auto;
    padding-top: 40px;
  }

  .command-grid,
  .guide-columns,
  .community-overview,
  .kwami-overview,
  .support-grid,
  .patreon-hero,
  .patreon-process,
  .patreon-trust-grid,
  .staff-overview,
  .staff-grid,
  .news-grid {
    grid-template-columns: 1fr;
    column-count: 1;
  }

  .kwami-flow {
    grid-template-columns: 1fr;
  }

  .staff-overview-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .staff-card-head,
  .staff-join-callout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar-inner {
    align-items: stretch;
    flex-direction: column;
  }

  .support-link {
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 240px;
    padding: 16px;
  }

  .section-heading,
  .section-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .ghost-button,
  .section-actions,
  .support-actions {
    width: 100%;
  }

  .support-actions .secondary-action {
    width: 100%;
  }

  .option-list li,
  .inline-options li {
    grid-template-columns: 1fr;
  }

  .community-flow {
    grid-template-columns: 1fr;
  }

  .patreon-actions {
    justify-content: stretch;
  }

  .patreon-actions .primary-action,
  .patreon-actions .secondary-action {
    width: 100%;
  }

  .back-to-top {
    right: 16px;
    bottom: 16px;
  }
}/* ============================================================
   MEMP DOCS — Enhancement Patch
   Improvements: 2 (cards), 4 (search), 5 (nav/topbar), 7 (details)
   Append to styles.css
   ============================================================ */

/* ----------------------------------------------------------
   2. Command Cards
   ---------------------------------------------------------- */

/* Fix: inline-grid blocks transform — override to grid */
.command-card {
  display: grid;
}

/* Tone glow on hover (replaces existing flat box-shadow) */
.command-card:hover {
  transform: translateY(-3px);
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.36),
    0 0 0 1px color-mix(in srgb, var(--tone, #6a9af0) 40%, transparent),
    0 0 20px -4px color-mix(in srgb, var(--tone, #6a9af0) 28%, transparent);
}

/* Fade-up entrance animation for cards — opacity only so hover transform works */
@keyframes card-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.command-card {
  animation: card-in 0.3s ease both;
}

/* Stagger via nth-child (up to 12 visible at a time) */
.command-card:nth-child(1)  { animation-delay: 0.02s; }
.command-card:nth-child(2)  { animation-delay: 0.05s; }
.command-card:nth-child(3)  { animation-delay: 0.08s; }
.command-card:nth-child(4)  { animation-delay: 0.11s; }
.command-card:nth-child(5)  { animation-delay: 0.14s; }
.command-card:nth-child(6)  { animation-delay: 0.17s; }
.command-card:nth-child(7)  { animation-delay: 0.20s; }
.command-card:nth-child(8)  { animation-delay: 0.23s; }
.command-card:nth-child(9)  { animation-delay: 0.25s; }
.command-card:nth-child(10) { animation-delay: 0.27s; }
.command-card:nth-child(11) { animation-delay: 0.29s; }
.command-card:nth-child(12) { animation-delay: 0.31s; }

/* Copy button — polished states */
.copy-button {
  position: relative;
  overflow: hidden;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.12s;
}

.copy-button:hover {
  border-color: color-mix(in srgb, var(--tone, #6a9af0) 60%, transparent);
  background: color-mix(in srgb, var(--tone, #6a9af0) 10%, #14161a);
  color: var(--text);
}

.copy-button:active {
  transform: scale(0.93);
}

/* "Copied" — green flash */
.copy-button[data-copied] {
  border-color: rgba(68, 183, 139, 0.6);
  background: rgba(68, 183, 139, 0.12);
  color: #44b78b;
}

/* Restricted tag — tone-matched */
.tag.restricted {
  border-color: rgba(230, 91, 112, 0.5);
  background: rgba(230, 91, 112, 0.08);
  color: #ffb8c2;
}

/* ----------------------------------------------------------
   4. Search
   ---------------------------------------------------------- */

/* Animated border on focus — uses accent color with smooth glow */
.search {
  transition: border-color 0.22s, box-shadow 0.22s;
}

.search:focus-within {
  border-color: rgba(106, 154, 240, 0.75);
  box-shadow:
    0 0 0 3px rgba(106, 154, 240, 0.14),
    0 0 12px -2px rgba(106, 154, 240, 0.18);
}

/* Search icon color shift on focus */
.search:focus-within svg,
.search:focus-within .search-icon {
  opacity: 1;
  color: var(--blue);
  transition: color 0.22s, opacity 0.22s;
}

/* Animated result count — smooth fade in */
@keyframes count-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.result-count:not(:empty) {
  animation: count-in 0.2s ease both;
}

/* Empty state — friendlier, centred */
.empty-state {
  text-align: center;
  padding: 40px 24px;
  border-radius: 10px;
}

.empty-state::before {
  content: '✦';
  display: block;
  font-size: 2rem;
  color: var(--line);
  margin-bottom: 10px;
}

/* ----------------------------------------------------------
   5. Nav / Topbar
   ---------------------------------------------------------- */

/* Topbar — stronger glass effect when scrolled
   (the existing backdrop-filter: blur(16px) is already great;
    we add a subtle top-border accent line and sharper bg) */
.topbar {
  border-bottom-color: rgba(48, 52, 61, 0.6);
  background: rgba(14, 15, 18, 0.94);
  transition: background 0.3s, border-bottom-color 0.3s, box-shadow 0.3s;
}

/* JS adds .topbar--scrolled when window.scrollY > 40 */
.topbar--scrolled {
  background: rgba(11, 12, 15, 0.97);
  border-bottom-color: rgba(48, 52, 61, 0.85);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.28);
}

/* Sidebar nav — vertical left-bar active indicator */
.nav-list a {
  position: relative;
  transition: background 0.18s, color 0.18s;
}

.nav-list a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-list a.active::before {
  transform: scaleY(1);
}

.nav-list a.active {
  background: var(--surface-strong);
  color: var(--text);
}

/* Category filter buttons — glow + scale on active */
.category-button {
  transition: border-color 0.18s, background 0.18s, color 0.18s,
              box-shadow 0.2s, transform 0.15s;
}

.category-button:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--tone, var(--accent)) 45%, transparent);
  background: color-mix(in srgb, var(--tone, var(--accent)) 8%, #14161a);
}

.category-button.active {
  transform: translateY(-1px);
  box-shadow: 0 0 14px -2px color-mix(in srgb, var(--tone, var(--accent)) 40%, transparent);
}

.category-button:active {
  transform: scale(0.95);
}

/* ----------------------------------------------------------
   7. Small but impactful details
   ---------------------------------------------------------- */

/* Stats section — fade-up entrance (driven by .stats-visible class
   added by IntersectionObserver in JS patch) */
@keyframes stat-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.stats-grid div {
  opacity: 0;
  transition: border-color 0.2s;
}

.stats-grid div:hover {
  border-color: rgba(106, 154, 240, 0.35);
}

.stats-grid.stats-visible div {
  opacity: 1;
  animation: stat-in 0.4s ease both;
}

.stats-grid.stats-visible div:nth-child(1) { animation-delay: 0.05s; }
.stats-grid.stats-visible div:nth-child(2) { animation-delay: 0.14s; }
.stats-grid.stats-visible div:nth-child(3) { animation-delay: 0.23s; }

/* Status dot — subtle pulse */
@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(68, 183, 139, 0.14); }
  50%       { box-shadow: 0 0 0 6px rgba(68, 183, 139, 0.06); }
}

.status-dot {
  animation: dot-pulse 2.4s ease-in-out infinite;
}

/* Copy → Copied checkmark via CSS content swap */
.copy-button[data-copied]::after {
  content: '';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: inherit;
  border-radius: inherit;
  animation: copied-flash 0.22s ease;
}

@keyframes copied-flash {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}

/* Smooth scroll for hash navigation already in html { scroll-behavior: smooth }
   — ensure anchor targets have breathing room */
[id] {
  scroll-margin-top: 96px;
}

/* Focus-visible ring — accessible, tidy */
:focus-visible {
  outline: 2px solid rgba(106, 154, 240, 0.7);
  outline-offset: 3px;
  border-radius: 4px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(var(--content-width), 100%);
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.breadcrumbs a {
  color: #d8e2ff;
}

.breadcrumbs span[aria-current="page"] {
  color: var(--text);
  font-weight: 700;
}

.mobile-page-rail {
  display: none;
}

.usage-box {
  display: grid;
  gap: 6px;
  border: 1px solid color-mix(in srgb, var(--tone, var(--accent)) 22%, var(--line));
  border-radius: 8px;
  background: rgba(15, 16, 19, 0.92);
  padding: 12px 14px;
}

.usage-box span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.usage-box code {
  display: block;
  width: 100%;
  overflow-wrap: anywhere;
}

.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 26, 31, 0.9);
  padding: 18px;
}

.empty-shell {
  display: grid;
  gap: 14px;
}

.empty-kicker {
  margin: 0;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.empty-shell h3 {
  margin-bottom: 0;
  font-size: 1.18rem;
}

.empty-shell p {
  color: var(--muted);
  margin-bottom: 0;
}

.empty-actions {
  display: grid;
  gap: 12px;
}

.empty-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.empty-suggestions .category-button {
  width: auto;
}

.news-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 2px;
}

.news-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid rgba(230, 91, 112, 0.45);
  border-radius: 999px;
  background: rgba(230, 91, 112, 0.1);
  color: #ffd8df;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  padding: 0 9px;
  text-transform: uppercase;
}

.news-card-featured {
  border-color: color-mix(in srgb, var(--accent) 22%, var(--line));
  background:
    linear-gradient(180deg, rgba(230, 91, 112, 0.08), rgba(24, 26, 31, 0.86) 32%),
    rgba(24, 26, 31, 0.9);
}

.news-section .news-card-featured {
  grid-column: 1 / -1;
}

.news-card-featured h3 {
  font-size: 1.18rem;
}

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(230, 91, 112, 0.45);
  border-radius: 999px;
  background: rgba(17, 18, 20, 0.94);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  transition: transform 0.18s, background 0.18s, border-color 0.18s, opacity 0.18s;
}

.back-to-top:hover {
  transform: translateY(-2px);
  border-color: rgba(230, 91, 112, 0.7);
  background: rgba(33, 24, 29, 0.98);
}

.back-to-top[hidden] {
  display: none;
}

.patreon-popover {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 35;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: min(660px, calc(100vw - 36px));
  border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--line));
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(230, 91, 112, 0.18), transparent 38%),
    linear-gradient(315deg, rgba(231, 184, 76, 0.12), transparent 40%),
    rgba(17, 18, 20, 0.97);
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.38);
  padding: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 28px) scale(0.98);
  transition: opacity 0.22s ease, transform 0.26s ease;
}

.patreon-popover[hidden] {
  display: none;
}

.patreon-popover.is-visible {
  animation: patreon-pop-in 0.52s cubic-bezier(0.2, 0.8, 0.2, 1);
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
}

.patreon-popover-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.patreon-popover-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.patreon-popover-copy p,
.patreon-popover-copy span {
  margin: 0;
}

.patreon-popover-copy p {
  color: var(--accent-2);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.patreon-popover-copy strong {
  color: var(--text);
  line-height: 1.25;
}

.patreon-popover-copy span {
  color: #d3cec4;
  font-size: 0.9rem;
  line-height: 1.45;
}

.patreon-popover-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.patreon-popover-link,
.patreon-popover-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  min-height: 38px;
}

.patreon-popover-link {
  border: 1px solid rgba(230, 91, 112, 0.7);
  background: var(--accent);
  color: #fff;
  font-size: 0.86rem;
  font-weight: 800;
  padding: 0 14px;
  white-space: nowrap;
}

.patreon-popover-close {
  width: 38px;
  border: 1px solid var(--line);
  background: rgba(24, 26, 31, 0.78);
  color: var(--muted);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.18s;
}

.patreon-popover-close:hover {
  border-color: rgba(230, 91, 112, 0.56);
  background: rgba(33, 24, 29, 0.98);
  color: var(--text);
  transform: translateY(-1px);
}

.patreon-popup-open .back-to-top {
  bottom: 106px;
}

@keyframes patreon-pop-in {
  0% {
    opacity: 0;
    transform: translate(-50%, 36px) scale(0.96);
  }
  72% {
    opacity: 1;
    transform: translate(-50%, -4px) scale(1);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

@media (max-width: 960px) {
  .breadcrumbs {
    width: auto;
    margin: 14px 20px 0;
  }

  .mobile-page-rail {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    width: auto;
    margin: 14px 20px 0;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .mobile-page-rail::-webkit-scrollbar {
    display: none;
  }

  .mobile-page-rail a {
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(24, 26, 31, 0.92);
    color: var(--muted);
    padding: 9px 12px;
    white-space: nowrap;
  }

  .mobile-page-rail a.active {
    border-color: color-mix(in srgb, var(--accent) 70%, transparent);
    background: color-mix(in srgb, var(--accent) 10%, #14161a);
    color: var(--text);
  }

  .help-callout {
    grid-template-columns: 1fr;
  }

  .back-to-top {
    right: 16px;
    bottom: 16px;
  }
}

@media (max-width: 640px) {
  .patreon-popover {
    grid-template-columns: auto minmax(0, 1fr);
    bottom: 14px;
    width: calc(100vw - 24px);
    padding: 12px;
  }

  .patreon-popover-actions {
    grid-column: 1 / -1;
    align-items: stretch;
  }

  .patreon-popover-link {
    flex: 1;
  }

  .patreon-popup-open .back-to-top {
    bottom: 144px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
