/* ==========================================================================
   Edge — a monochrome Hugo theme
   Tokens → base → layout → components → shortcodes → utilities
   ========================================================================== */

:root {
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Light */
  --bg: #ffffff;
  --bg-subtle: #fafafa;
  --bg-muted: #f2f2f2;
  --fg: #171717;
  --fg-muted: #666666;
  --fg-subtle: #8f8f8f;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);
  --grid-line: rgba(0, 0, 0, 0.05);
  --header-bg: rgba(255, 255, 255, 0.8);
  --shadow: 0 0 0 1px var(--border), 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 8px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 0 0 1px var(--border), 0 8px 30px rgba(0, 0, 0, 0.08);

  --blue: #0070f3;  --blue-bg: #eaf3ff;
  --green: #18794e; --green-bg: #e9f9ef;
  --amber: #a35200; --amber-bg: #fff5e0;
  --red: #d8213b;   --red-bg: #ffebee;

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --container: 1200px;
  --header-h: 64px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}

/* Dark tokens — applied for explicit dark, or system preference when not forced light */
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark; }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --bg-subtle: #0a0a0a; --bg-muted: #1a1a1a;
    --fg: #ededed; --fg-muted: #a1a1a1; --fg-subtle: #737373;
    --border: rgba(255, 255, 255, 0.1); --border-strong: rgba(255, 255, 255, 0.18);
    --grid-line: rgba(255, 255, 255, 0.06);
    --header-bg: rgba(0, 0, 0, 0.7);
    --shadow: 0 0 0 1px var(--border);
    --shadow-lg: 0 0 0 1px var(--border-strong), 0 8px 30px rgba(0, 0, 0, 0.6);
    --blue: #52a8ff;  --blue-bg: #06193a;
    --green: #62c073; --green-bg: #0b2512;
    --amber: #ffb224; --amber-bg: #2a1a00;
    --red: #ff6166;   --red-bg: #3c0d12;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --bg-subtle: #0a0a0a; --bg-muted: #1a1a1a;
  --fg: #ededed; --fg-muted: #a1a1a1; --fg-subtle: #737373;
  --border: rgba(255, 255, 255, 0.1); --border-strong: rgba(255, 255, 255, 0.18);
  --grid-line: rgba(255, 255, 255, 0.06);
  --header-bg: rgba(0, 0, 0, 0.7);
  --shadow: 0 0 0 1px var(--border);
  --shadow-lg: 0 0 0 1px var(--border-strong), 0 8px 30px rgba(0, 0, 0, 0.6);
  --blue: #52a8ff;  --blue-bg: #06193a;
  --green: #62c073; --green-bg: #0b2512;
  --amber: #ffb224; --amber-bg: #2a1a00;
  --red: #ff6166;   --red-bg: #3c0d12;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.site-main { flex: 1; }
img, svg, video { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--fg); color: var(--bg); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.02em; font-weight: 600; margin: 0 0 0.5em; }
p { margin: 0 0 1em; }
.muted { color: var(--fg-muted); }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--fg); color: var(--bg); padding: 8px 12px; border-radius: var(--radius-sm); }
.skip-link:focus { left: 8px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .container { padding: 0 16px; } }
.section { padding-top: 64px; padding-bottom: 64px; }

/* Grid paper background */
.grid-bg {
  position: relative;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center top;
  border-bottom: 1px solid var(--border);
}
.grid-bg::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 30%, var(--bg) 80%);
}
.grid-bg > * { position: relative; z-index: 1; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--border); }
.header-inner { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.02em; font-size: 17px; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* Theme toggle icons */
.icon-btn {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; padding: 0;
  border: 1px solid var(--border); border-radius: 50%;
  background: transparent; color: var(--fg-muted); cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.icon-btn:hover { color: var(--fg); background: var(--bg-muted); }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none; }
  :root:not([data-theme="light"]) .i-moon { display: block; }
}

/* ---------- Navigation (mega menus) ---------- */
.site-nav { display: flex; align-items: center; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.nav-item { position: relative; }
.nav-link {
  display: inline-flex; align-items: center; gap: 4px;
  height: 32px; padding: 0 12px; border-radius: 999px;
  font: inherit; font-size: 14px; color: var(--fg-muted);
  background: none; border: 0; cursor: pointer; white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover, .nav-link.is-active, .nav-link[aria-expanded="true"] { color: var(--fg); background: var(--bg-muted); }
.nav-chevron { transition: transform 0.2s var(--ease); opacity: 0.7; }
.nav-link[aria-expanded="true"] .nav-chevron { transform: rotate(180deg); }

.mega {
  position: absolute; top: calc(100% + 12px); left: -8px; z-index: 60;
  max-width: calc(100vw - 32px);
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(-6px) scale(0.985); transform-origin: top left;
  transition: opacity 0.16s var(--ease), transform 0.2s var(--ease), visibility 0.16s;
}
/* invisible bridge so the pointer can travel from trigger to panel */
.mega::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px; }
.has-mega.is-open .mega { opacity: 1; visibility: visible; pointer-events: auto; transform: none; transition: opacity 0.16s var(--ease), transform 0.2s var(--ease), visibility 0s; }
.mega-inner {
  display: flex; padding: 8px; gap: 4px;
  background: var(--bg); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}
.mega-col { width: 272px; padding: 4px; }
.mega-col + .mega-col { border-left: 1px solid var(--border); padding-left: 8px; }
.mega-heading { margin: 0; padding: 8px 10px 6px; font-size: 12px; font-weight: 500; color: var(--fg-subtle); letter-spacing: 0.01em; }
.mega-links { list-style: none; margin: 0; padding: 0; }
.mega-link {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 8px 10px; border-radius: var(--radius);
  transition: background 0.12s;
}
.mega-link:hover, .mega-link:focus-visible { background: var(--bg-muted); }
.mega-icon {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: var(--radius-sm); color: var(--fg-muted);
  background: var(--bg); box-shadow: 0 0 0 1px var(--border);
  transition: color 0.12s;
}
.mega-link:hover .mega-icon { color: var(--fg); }
.mega-text { display: flex; flex-direction: column; min-width: 0; padding-top: 1px; }
.mega-text strong { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; line-height: 1.3; }
.mega-text > span { font-size: 13px; line-height: 1.4; color: var(--fg-muted); margin-top: 2px; }
.mega-text .ext { color: var(--fg-subtle); }
.badge-xs { height: 18px; padding: 0 6px; font-size: 11px; }

.mega-featured {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px;
  width: 260px; min-height: 220px; padding: 16px; margin-left: 4px; overflow: hidden;
  border-radius: var(--radius); background: var(--bg-subtle); box-shadow: inset 0 0 0 1px var(--border);
}
.mega-featured-art {
  position: absolute; inset: 0 0 45% 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    radial-gradient(circle at 70% 30%, color-mix(in srgb, var(--blue) 35%, transparent), transparent 55%),
    radial-gradient(circle at 25% 70%, color-mix(in srgb, var(--fg) 12%, transparent), transparent 50%);
  background-size: 24px 24px, 24px 24px, 100% 100%, 100% 100%;
  -webkit-mask-image: linear-gradient(#000 40%, transparent);
  mask-image: linear-gradient(#000 40%, transparent);
}
.mega-featured > :not(.mega-featured-art) { position: relative; }
.mega-featured-eyebrow { font: 500 11px var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-subtle); }
.mega-featured strong { font-size: 15px; font-weight: 600; }
.mega-featured-desc { font-size: 13px; color: var(--fg-muted); line-height: 1.45; }
.mega-featured .link-arrow { margin-top: 8px; font-size: 13px; }
.mega-featured:hover .link-arrow { color: var(--fg); }

.nav-toggle, .nav-mobile-cta { display: none; }
.burger { position: relative; width: 14px; height: 8px; }
.burger span { position: absolute; left: 0; width: 100%; height: 1.5px; background: currentColor; transition: transform 0.2s var(--ease), top 0.2s; }
.burger span:first-child { top: 0; }
.burger span:last-child { top: 6.5px; }
.nav-open .burger span:first-child { top: 3.25px; transform: rotate(45deg); }
.nav-open .burger span:last-child { top: 3.25px; transform: rotate(-45deg); }

@media (max-width: 960px) {
  .nav-toggle { display: inline-grid; }
  .hide-sm { display: none !important; }
  /* backdrop-filter would trap the fixed menu inside the header */
  .nav-open .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); border-bottom-color: var(--border); }
  .site-nav {
    position: fixed; inset: var(--header-h) 0 0 0;
    flex-direction: column; align-items: stretch; justify-content: space-between;
    padding: 8px 16px 24px; background: var(--bg); overflow-y: auto;
    opacity: 0; visibility: hidden; transition: opacity 0.2s, visibility 0.2s;
  }
  .nav-open .site-nav { opacity: 1; visibility: visible; }
  .nav-open { overflow: hidden; }
  .nav-list { flex-direction: column; gap: 0; }
  .nav-item { border-bottom: 1px solid var(--border); }
  .nav-link { width: 100%; height: 52px; justify-content: space-between; padding: 0 4px; border-radius: 0; font-size: 16px; color: var(--fg); }
  .nav-link:hover, .nav-link.is-active, .nav-link[aria-expanded="true"] { background: none; }
  .mega { position: static; max-width: none; display: none; opacity: 1; visibility: visible; pointer-events: auto; transform: none; transition: none; }
  .mega::before { display: none; }
  .has-mega.is-open .mega { display: block; }
  .mega-inner { flex-direction: column; padding: 0 0 12px; box-shadow: none; background: none; }
  .mega-col, .mega-col + .mega-col { width: auto; border: 0; padding: 0; }
  .mega-heading { padding: 12px 4px 4px; }
  .mega-link { padding: 8px 4px; align-items: center; }
  .mega-text > span { display: none; }
  .mega-featured { width: auto; min-height: 0; margin: 8px 0 0; }
  .mega-featured-art { display: none; }
  .nav-mobile-cta { display: grid; gap: 8px; padding-top: 24px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 999px;
  font: inherit; font-size: 14px; font-weight: 500; white-space: nowrap;
  border: 1px solid transparent; cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.98); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn-primary { background: var(--fg); color: var(--bg); }
.btn-primary:hover { opacity: 0.88; }
.btn-secondary { background: var(--bg); color: var(--fg); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--bg-muted); }
.btn-ghost { background: transparent; color: var(--fg-muted); }
.btn-ghost:hover { color: var(--fg); background: var(--bg-muted); }

/* ---------- Hero ---------- */
.hero { padding: 120px 0 104px; text-align: center; }
.hero-inline { overflow: hidden; margin: 2rem 0; padding: 72px 24px; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.hero-inner { display: flex; flex-direction: column; align-items: center; }
.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700; letter-spacing: -0.05em; line-height: 1.02;
  max-width: 14ch; margin: 0 auto 20px;
  background: linear-gradient(180deg, var(--fg) 30%, var(--fg-muted));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-subtitle { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--fg-muted); max-width: 46ch; margin: 0 auto 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 28px;
  padding: 4px 12px 4px 8px; border-radius: 999px; font-size: 13px; color: var(--fg-muted);
  background: var(--bg); box-shadow: var(--shadow); transition: color 0.15s;
}
.pill:hover { color: var(--fg); }
.pill-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 3px var(--blue-bg); }
.code-404 { font-family: var(--font-mono); color: var(--fg-subtle); margin-bottom: 8px; }

/* ---------- Page head ---------- */
.page-head { padding: 72px 0 56px; }
.page-head h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.04em; }
.lead { font-size: 1.15rem; color: var(--fg-muted); max-width: 60ch; }
.eyebrow { display: inline-block; font-size: 14px; color: var(--fg-muted); margin-bottom: 12px; }
.eyebrow:hover { color: var(--fg); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-head h2 { font-size: 1.75rem; margin: 0; }
.link-arrow { font-size: 14px; color: var(--fg-muted); transition: color 0.15s; }
a:hover > .link-arrow, .link-arrow:hover { color: var(--fg); }
.home-content { padding-top: 64px; }

/* ---------- Cards ---------- */
.card-grid { display: grid; gap: 16px; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); margin: 1.5rem 0; }
@media (max-width: 900px) { .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .card-grid { grid-template-columns: 1fr; } }
.card {
  display: flex; flex-direction: column;
  padding: 24px; border-radius: var(--radius-lg);
  background: var(--bg); box-shadow: var(--shadow);
  transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.card-link:hover { box-shadow: var(--shadow-lg); }
.card-icon { font-size: 22px; margin-bottom: 12px; }
.card-title, .prose .card-title, .prose .feature h3 { font-size: 1.1rem; margin: 0 0 8px; }
.card-text { color: var(--fg-muted); font-size: 15px; flex: 1; }
.card-text > :last-child { margin-bottom: 0; }
.card-meta { font-size: 13px; color: var(--fg-subtle); font-family: var(--font-mono); margin-bottom: 12px; }
.card .link-arrow { margin-top: 16px; }

/* ---------- Article ---------- */
.article { padding-top: 56px; padding-bottom: 80px; max-width: 760px; }
.article.has-toc { max-width: 1040px; }
.article-head { margin-bottom: 40px; padding-bottom: 32px; border-bottom: 1px solid var(--border); }
.article-head h1 { font-size: clamp(2rem, 4.5vw, 3rem); letter-spacing: -0.04em; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--fg-subtle); }
.has-toc .article-body { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 56px; }
.has-toc .toc { order: 2; }
.toc { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; font-size: 14px; }
.toc-title { font-weight: 500; margin-bottom: 8px; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc ul ul { padding-left: 12px; }
.toc a { display: block; padding: 4px 0; color: var(--fg-muted); }
.toc a:hover, .toc a.is-active { color: var(--fg); }
@media (max-width: 960px) { .has-toc .article-body { grid-template-columns: 1fr; } .toc { display: none; } }
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 48px; }
.prev-next { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 48px; }
.pn-card { padding: 16px 20px; border-radius: var(--radius-lg); box-shadow: var(--shadow); transition: box-shadow 0.2s; }
.pn-card:hover { box-shadow: var(--shadow-lg); }
.pn-card span { display: block; font-size: 13px; color: var(--fg-subtle); }
.pn-next { text-align: right; grid-column: 2; }
.pagination { display: flex; align-items: center; justify-content: space-between; margin-top: 40px; font-size: 14px; }

/* ---------- Prose ---------- */
.prose { font-size: 16px; line-height: 1.75; }
.prose h2 { font-size: 1.6rem; margin-top: 2.2em; }
.prose h3 { font-size: 1.25rem; margin-top: 1.8em; }
.prose a { text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; transition: text-decoration-color 0.15s; }
.prose a:hover { text-decoration-color: var(--fg); }
.prose a.btn, .prose a.card, .prose a.badge { text-decoration: none; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: 0.35em 0; }
.prose li::marker { color: var(--fg-subtle); }
.prose blockquote { margin: 1.5em 0; padding-left: 1em; border-left: 2px solid var(--border-strong); color: var(--fg-muted); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 3em 0; }
.prose img { border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 1.5em 0; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.prose th { font-weight: 500; color: var(--fg-muted); }
.prose :not(pre) > code {
  font-family: var(--font-mono); font-size: 0.875em;
  padding: 0.15em 0.4em; border-radius: 4px; background: var(--bg-muted); border: 1px solid var(--border);
}
.prose pre, .highlight pre {
  position: relative; font-family: var(--font-mono); font-size: 13.5px; line-height: 1.7;
  padding: 16px 20px; border-radius: var(--radius-lg); overflow-x: auto;
  background: var(--bg-subtle) !important; border: 1px solid var(--border);
}
.code-wrap { position: relative; }
.code-wrap .copy-btn { position: absolute; top: 10px; right: 10px; opacity: 0; }
.code-wrap:hover .copy-btn, .code-wrap .copy-btn:focus { opacity: 1; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
  background: var(--bg-muted); color: var(--fg-muted);
}
a.badge:hover { color: var(--fg); }
.badge-lg { height: 32px; padding: 0 14px; font-size: 14px; }
.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-red { background: var(--red-bg); color: var(--red); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Callouts ---------- */
.callout { margin: 1.5em 0; padding: 14px 16px; border-radius: var(--radius); border: 1px solid; font-size: 15px; }
.callout-title { font-weight: 600; margin: 0 0 4px; }
.callout-body > :last-child { margin-bottom: 0; }
.callout-note { background: var(--blue-bg); border-color: color-mix(in srgb, var(--blue) 30%, transparent); }
.callout-note .callout-title { color: var(--blue); }
.callout-tip { background: var(--green-bg); border-color: color-mix(in srgb, var(--green) 30%, transparent); }
.callout-tip .callout-title { color: var(--green); }
.callout-warning { background: var(--amber-bg); border-color: color-mix(in srgb, var(--amber) 30%, transparent); }
.callout-warning .callout-title { color: var(--amber); }
.callout-error { background: var(--red-bg); border-color: color-mix(in srgb, var(--red) 30%, transparent); }
.callout-error .callout-title { color: var(--red); }

/* ---------- Features ---------- */
.feature-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin: 2rem 0; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
}
.feature { padding: 28px; box-shadow: 1px 0 0 var(--border), 0 1px 0 var(--border); }
.feature h3 { font-size: 1rem; margin: 0 0 6px; }
.feature .muted { font-size: 15px; }
.feature .muted > :last-child { margin-bottom: 0; }
.feature-icon { display: inline-grid; place-items: center; width: 36px; height: 36px; margin-bottom: 16px; border-radius: var(--radius); box-shadow: var(--shadow); font-size: 18px; }

/* ---------- Tabs ---------- */
.tabs { margin: 1.5em 0; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.tab-list { display: flex; gap: 4px; padding: 0 8px; border-bottom: 1px solid var(--border); background: var(--bg-subtle); overflow-x: auto; }
.tab-btn {
  position: relative; padding: 10px 10px; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 14px; color: var(--fg-muted);
}
.tab-btn:hover { color: var(--fg); }
.tab-btn.is-active { color: var(--fg); }
.tab-btn.is-active::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; background: var(--fg); }
.tab-panel { padding: 16px; }
.tab-panel > :last-child { margin-bottom: 0; }
.tab-panel pre { margin: 0; }

/* ---------- Terminal ---------- */
.terminal { margin: 1.5em 0; border-radius: var(--radius-lg); overflow: hidden; background: #0a0a0a; color: #ededed; box-shadow: 0 0 0 1px rgba(255,255,255,0.1), 0 8px 30px rgba(0,0,0,0.2); }
.terminal-bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.terminal-bar > span { width: 10px; height: 10px; border-radius: 50%; background: #333; }
.terminal-bar p { flex: 1; margin: 0; text-align: center; font-size: 12px; color: #8f8f8f; font-family: var(--font-mono); }
.terminal .terminal-body { margin: 0; padding: 16px 20px; background: transparent !important; border: 0; font-size: 13.5px; color: #ededed; }
.t-line::before { content: "$ "; color: #737373; user-select: none; }
.copy-btn {
  height: 26px; padding: 0 10px; border-radius: var(--radius-sm); cursor: pointer;
  font: 500 12px var(--font-sans); color: var(--fg-muted);
  background: var(--bg); border: 1px solid var(--border);
}
.terminal .copy-btn { background: transparent; color: #a1a1a1; border-color: rgba(255,255,255,0.15); }
.copy-btn:hover { color: var(--fg); }
.terminal .copy-btn:hover { color: #fff; }

/* ---------- Steps ---------- */
.steps { counter-reset: step; margin: 2em 0; padding-left: 40px; border-left: 1px solid var(--border); margin-left: 14px; }
.steps h3 { counter-increment: step; position: relative; margin-top: 1.8em; }
.steps h3:first-child { margin-top: 0; }
.steps h3::before {
  content: counter(step); position: absolute; left: -56px; top: -2px;
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  font: 500 13px var(--font-mono); background: var(--bg-muted); border: 4px solid var(--bg); box-sizing: content-box;
}

/* ---------- Video ---------- */
.video { position: relative; aspect-ratio: 16/9; margin: 1.5em 0; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); background: #000; }
.video-play { all: unset; cursor: pointer; display: block; width: 100%; height: 100%; position: relative; }
.video-play img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; box-shadow: none; }
.video-icon { position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,0.6); color: #fff; font-size: 20px; backdrop-filter: blur(6px); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-subtle); padding: 48px 0 24px; font-size: 14px; }
.footer-top { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 32px; }
.footer-cols { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 40px 24px; }
.footer-heading { margin: 0 0 12px; font-size: 14px; font-weight: 500; letter-spacing: 0; }
.footer-col-toggle { display: none; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin: 0 0 10px; }
.footer-links a { color: var(--fg-muted); transition: color 0.15s; }
.footer-links a .badge, .footer-links a .ext { margin-left: 4px; vertical-align: middle; }
.footer-links a .badge { position: relative; top: -1px; }
.footer-links a:hover { color: var(--fg); }
.footer-links .ext { color: var(--fg-subtle); }

.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--border); }
.footer-bottom-left, .footer-bottom-right { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.footer-copy { margin: 0; color: var(--fg-muted); }
.footer-status { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--blue); }
a.footer-status:hover { text-decoration: underline; text-underline-offset: 3px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 20%, transparent); }
.status-warn { color: var(--amber); }
.status-down { color: var(--red); }
.social { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.social a { display: grid; place-items: center; min-width: 32px; height: 32px; padding: 0 4px; border-radius: 50%; color: var(--fg-muted); transition: color 0.15s, background 0.15s; }
.social a:hover { color: var(--fg); background: var(--bg-muted); }

.theme-switch { display: inline-flex; padding: 2px; gap: 2px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--border); }
.theme-switch button {
  display: grid; place-items: center; width: 28px; height: 28px; padding: 0;
  border: 0; border-radius: 50%; background: none; color: var(--fg-subtle); cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.theme-switch button:hover { color: var(--fg); }
.theme-switch button[aria-checked="true"] { color: var(--fg); background: var(--bg); box-shadow: 0 0 0 1px var(--border-strong); }
.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; }

@media (max-width: 1024px) { .footer-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .footer-top { grid-template-columns: 1fr; gap: 24px; }
  .footer-cols { grid-template-columns: 1fr; gap: 0; }
  .footer-col { border-bottom: 1px solid var(--border); }
  .footer-heading { margin: 0; }
  .footer-col-title { display: none; }
  .footer-col-toggle {
    display: flex; width: 100%; align-items: center; justify-content: space-between;
    padding: 14px 0; border: 0; background: none; cursor: pointer;
    font: inherit; font-size: 15px; font-weight: 500; color: var(--fg);
  }
  .footer-chevron { color: var(--fg-subtle); transition: transform 0.2s var(--ease); }
  .footer-col-toggle[aria-expanded="true"] .footer-chevron { transform: rotate(180deg); }
  .footer-links { display: none; padding-bottom: 12px; }
  .footer-col.is-open .footer-links { display: block; }
  .footer-bottom { flex-direction: column-reverse; align-items: flex-start; margin-top: 24px; border-top: 0; }
  .footer-bottom-right { width: 100%; justify-content: space-between; }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
