/* Self-hosted Inter (variable) and JetBrains Mono, latin + latin-ext.
   Generated from Google Fonts; unicode-range means browsers fetch only what a page uses. */
@font-face{font-family:'Inter';font-style:normal;font-weight:400;font-display:swap;src:url(/assets/fonts/inter-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;}
@font-face{font-family:'Inter';font-style:normal;font-weight:400;font-display:swap;src:url(/assets/fonts/inter-latin.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
@font-face{font-family:'Inter';font-style:normal;font-weight:500;font-display:swap;src:url(/assets/fonts/inter-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;}
@font-face{font-family:'Inter';font-style:normal;font-weight:500;font-display:swap;src:url(/assets/fonts/inter-latin.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
@font-face{font-family:'Inter';font-style:normal;font-weight:600;font-display:swap;src:url(/assets/fonts/inter-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;}
@font-face{font-family:'Inter';font-style:normal;font-weight:600;font-display:swap;src:url(/assets/fonts/inter-latin.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
@font-face{font-family:'Inter';font-style:normal;font-weight:700;font-display:swap;src:url(/assets/fonts/inter-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;}
@font-face{font-family:'Inter';font-style:normal;font-weight:700;font-display:swap;src:url(/assets/fonts/inter-latin.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
@font-face{font-family:'Inter';font-style:normal;font-weight:800;font-display:swap;src:url(/assets/fonts/inter-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;}
@font-face{font-family:'Inter';font-style:normal;font-weight:800;font-display:swap;src:url(/assets/fonts/inter-latin.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
@font-face{font-family:'Inter';font-style:normal;font-weight:900;font-display:swap;src:url(/assets/fonts/inter-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;}
@font-face{font-family:'Inter';font-style:normal;font-weight:900;font-display:swap;src:url(/assets/fonts/inter-latin.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
@font-face{font-family:'JetBrains Mono';font-style:normal;font-weight:400;font-display:swap;src:url(/assets/fonts/jetbrains-mono-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;}
@font-face{font-family:'JetBrains Mono';font-style:normal;font-weight:400;font-display:swap;src:url(/assets/fonts/jetbrains-mono-latin.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
@font-face{font-family:'JetBrains Mono';font-style:normal;font-weight:500;font-display:swap;src:url(/assets/fonts/jetbrains-mono-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;}
@font-face{font-family:'JetBrains Mono';font-style:normal;font-weight:500;font-display:swap;src:url(/assets/fonts/jetbrains-mono-latin.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
@font-face{font-family:'JetBrains Mono';font-style:normal;font-weight:700;font-display:swap;src:url(/assets/fonts/jetbrains-mono-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;}
@font-face{font-family:'JetBrains Mono';font-style:normal;font-weight:700;font-display:swap;src:url(/assets/fonts/jetbrains-mono-latin.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
/* ==========================================================================
   Zudo — Shared site styles
   Tokens, header, footer, global search, docs shell.
   Loaded on every page before the page-specific stylesheet.
   Soft Brutalism: zero radius, honest borders, muted palette.
   ========================================================================== */

:root {
  /* Brand */
  --z-red: #C0392B;
  --z-red-hover: #A93226;
  --z-blue: #2471A3;
  --z-blue-hover: #1A5276;
  --z-yellow: #D4AC0D;
  --z-green: #1E8449;

  /* Surfaces */
  --z-bg: #FAFAF9;
  --z-surface: #FFFFFF;
  --z-surface-alt: #F5F5F0;
  --z-ink: #1A1A2E;
  --z-ink-2: #16213E;

  /* Text */
  --z-text: #1A1A2E;
  --z-text-2: #4B5563;
  --z-text-3: #9CA3AF;

  /* Borders */
  --z-border: #E5E7EB;
  --z-border-strong: #D1D5DB;

  /* Code (Catppuccin Mocha) */
  --z-code-bg: #1E1E2E;
  --z-code-mantle: #181825;
  --z-code-crust: #11111B;
  --z-code-surface: #313244;
  --z-code-surface-2: #45475A;
  --z-code-overlay: #6C7086;
  --z-code-text: #CDD6F4;
  --z-code-subtext: #A6ADC8;

  /* Type */
  --z-font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --z-font-mono: 'JetBrains Mono', 'Fira Code', 'SFMono-Regular', Consolas, 'Courier New', monospace;

  /* Layout */
  --z-nav-h: 78px;
  --z-container: 1280px;
}

@media (max-width: 767px) {
  :root { --z-nav-h: 66px; }
}

* { border-radius: 0 !important; }

html { scroll-padding-top: calc(var(--z-nav-h) + 16px); }

body {
  font-family: var(--z-font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

code, kbd, pre, samp, .font-mono { font-family: var(--z-font-mono); }

*:focus-visible {
  outline: 3px solid var(--z-blue);
  outline-offset: 2px;
}

::selection { background: var(--z-yellow); color: var(--z-ink); }

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

.z-container {
  max-width: var(--z-container);
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* Skip link */
.z-skip {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 1000;
  background: var(--z-yellow);
  color: var(--z-ink);
  font-weight: 800;
  padding: 0.5rem 1rem;
  border: 2px solid var(--z-ink);
}
.z-skip:focus { top: 1rem; }

/* Reserve the header's height before components.js (deferred) renders it,
   so inserting the header does not push the page down (CLS). */
#zudo-nav { min-height: 78px; }
@media (max-width: 767px) { #zudo-nav { min-height: 68px; } }

/* ==========================================================================
   HEADER — a floating bar: white slab, ink border, hard shadow
   ========================================================================== */

.zh {
  position: sticky;
  top: 0;
  z-index: 60;
  padding: 10px 1rem 8px;
  background: linear-gradient(to bottom, var(--z-bg) 55%, rgba(250, 250, 249, 0));
  pointer-events: none;
}

.zh-bar,
.zh-mobile {
  pointer-events: auto;
  max-width: calc(var(--z-container) - 2rem);
  margin: 0 auto;
  background: var(--z-surface);
  color: var(--z-ink);
  border: 2px solid var(--z-ink);
  box-shadow: 4px 4px 0 var(--z-ink);
}

.zh:not(.is-scrolled) { background: transparent; }

.zh-bar { transition: box-shadow 160ms ease, transform 160ms ease; }
.zh.is-scrolled .zh-bar { box-shadow: 4px 4px 0 var(--z-red); }

.zh-inner {
  height: 56px;
  padding: 0 0.5rem 0 1rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.zh-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: inherit;
  text-decoration: none;
  flex-shrink: 0;
}

.zh-mark {
  width: 28px;
  height: 28px;
  display: block;
  flex-shrink: 0;
}

.zh-word { display: flex; align-items: center; }

.zh-wordmark {
  height: 16px;
  width: auto;
  display: block;
}

.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;
}

.zh-ver {
  font-family: var(--z-font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--z-ink);
  background: var(--z-yellow);
  border: 1.5px solid var(--z-ink);
  padding: 1px 5px;
  line-height: 1.3;
}

.zh-nav {
  display: none;
  align-items: center;
  gap: 0.15rem;
  height: 100%;
  padding-left: 1.25rem;
  border-left: 2px solid var(--z-ink);
}

@media (min-width: 1024px) {
  .zh-nav { display: flex; }
}

.zh-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 34px;
  padding: 0 0.7rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(26, 26, 46, 0.72);
  text-decoration: none;
  background-image: linear-gradient(var(--z-yellow), var(--z-yellow));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 0;
  transition: background-size 140ms ease, color 120ms ease;
}

.zh-link:hover { color: var(--z-ink); background-size: 100% 100%; }

.zh-link.is-active { color: var(--z-ink); font-weight: 700; }
.zh-link.is-active::before {
  content: '';
  width: 7px;
  height: 7px;
  background: var(--z-red);
}

.zh-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.zh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 38px;
  padding: 0 0.75rem;
  background: var(--z-surface);
  color: var(--z-ink);
  border: 2px solid var(--z-ink);
  font-family: var(--z-font-sans);
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 120ms ease, color 120ms ease;
}

.zh-btn:hover { background: var(--z-yellow); }

.zh-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.zh-btn--icon { width: 38px; padding: 0; }

.zh-search {
  color: rgba(26, 26, 46, 0.72);
  border-color: rgba(26, 26, 46, 0.25);
  background: var(--z-bg);
}
.zh-search:hover { color: var(--z-ink); border-color: var(--z-ink); background: var(--z-surface); }
.zh-search .zh-search-label { display: none; }
.zh-search kbd {
  display: none;
  font-family: var(--z-font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 5px;
  border: 1.5px solid rgba(26, 26, 46, 0.3);
  color: rgba(26, 26, 46, 0.72);
  background: var(--z-surface);
}

@media (min-width: 768px) {
  .zh-search { min-width: 200px; justify-content: flex-start; }
  .zh-search .zh-search-label { display: inline; font-weight: 500; }
  .zh-search kbd { display: inline-block; margin-left: auto; }
}

.zh-term {
  font-family: var(--z-font-mono);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.zh-term:hover { background: var(--z-ink); color: #A6E3A1; }

.zh-cta {
  display: none;
  align-items: center;
  gap: 0.4rem;
  height: 38px;
  padding: 0 1rem;
  background: var(--z-red);
  color: #FFFFFF;
  border: 2px solid var(--z-ink);
  font-size: 0.8125rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.zh-cta:hover { transform: translate(-2px, -2px); box-shadow: 2px 2px 0 var(--z-ink); }

@media (min-width: 640px) {
  .zh-cta { display: inline-flex; }
}

@media (max-width: 767px) {
  .zh { padding: 8px 0.75rem 6px; }
  .zh-inner { height: 50px; gap: 0.75rem; padding: 0 0.4rem 0 0.75rem; }
}

@media (max-width: 479px) {
  .zh-ver { display: none; }
  .zh-actions { gap: 0.3rem; }
  .zh-actions > a.zh-btn--icon { display: none; }
  .zh-wordmark { height: 14px; }
}

.zh-burger { display: inline-flex; }
@media (min-width: 1024px) { .zh-burger { display: none; } }

.zh-burger svg { width: 20px; height: 20px; }
.zh-burger .ic-close { display: none; }
.zh.is-menu-open .zh-burger .ic-open { display: none; }
.zh.is-menu-open .zh-burger .ic-close { display: block; }

/* Mobile menu: a second slab that drops under the bar */
.zh-mobile { display: none; margin-top: 8px; }
.zh.is-menu-open .zh-mobile { display: block; }
@media (min-width: 1024px) { .zh.is-menu-open .zh-mobile { display: none; } }

.zh-mobile-inner {
  padding: 0.5rem 1rem 1rem;
  display: grid;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.zh-mobile-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 0.25rem;
  color: rgba(26, 26, 46, 0.78);
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  border-bottom: 1.5px solid rgba(26, 26, 46, 0.1);
}

.zh-mobile-link.is-active { color: var(--z-ink); }
.zh-mobile-link.is-active::after { content: ''; width: 8px; height: 8px; background: var(--z-red); }
.zh-mobile-link:hover { color: var(--z-ink); background: var(--z-bg); }

.zh-mobile-cta {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
}

.zh-mobile-cta .zh-cta { display: inline-flex; flex: 1; justify-content: center; }
.zh-mobile-cta .zh-btn { flex: 1; }

/* ==========================================================================
   GLOBAL SEARCH
   ========================================================================== */

.zs-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(26, 26, 46, 0.92);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: none;
  padding: 1rem;
  overflow-y: auto;
}

.zs-overlay.is-open { display: block; }

.zs-panel {
  max-width: 680px;
  margin: 8vh auto 0;
  background: var(--z-code-bg);
  border: 3px solid var(--z-red);
  color: var(--z-code-text);
  font-family: var(--z-font-sans);
}

.zs-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem 0.5rem 1rem;
  border-bottom: 2px solid var(--z-code-surface);
}

.zs-head svg { width: 18px; height: 18px; color: var(--z-code-overlay); flex-shrink: 0; }

.zs-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--z-code-text);
  font-family: var(--z-font-sans);
  font-size: 1.05rem;
  padding: 0.65rem 0;
}

.zs-input::placeholder { color: var(--z-code-overlay); }

.zs-esc {
  font-family: var(--z-font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--z-code-subtext);
  border: 1px solid var(--z-code-surface-2);
  padding: 2px 6px;
  background: transparent;
  cursor: pointer;
}

.zs-results { max-height: 60vh; overflow-y: auto; }

.zs-group {
  padding: 0.6rem 1rem 0.3rem;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--z-code-overlay);
}

.zs-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  text-decoration: none;
  color: var(--z-code-text);
  border-left: 3px solid transparent;
}

.zs-item:hover, .zs-item.is-active {
  background: var(--z-code-surface);
  border-left-color: var(--z-red);
}

.zs-item-title { font-weight: 700; font-size: 0.9rem; }
.zs-item-excerpt { font-size: 0.78rem; color: var(--z-code-subtext); margin-top: 2px; }
.zs-item-path {
  margin-left: auto;
  font-family: var(--z-font-mono);
  font-size: 0.65rem;
  color: var(--z-code-overlay);
  white-space: nowrap;
  display: none;
}
@media (min-width: 640px) { .zs-item-path { display: block; } }

.zs-item mark { background: transparent; color: #F9E2AF; font-weight: 800; }

.zs-empty { padding: 2rem 1rem; text-align: center; color: var(--z-code-subtext); font-size: 0.9rem; }
.zs-empty strong { color: var(--z-code-text); }

.zs-foot {
  display: flex;
  gap: 1rem;
  padding: 0.5rem 1rem;
  border-top: 2px solid var(--z-code-surface);
  font-size: 0.7rem;
  color: var(--z-code-overlay);
}

.zs-foot kbd {
  font-family: var(--z-font-mono);
  border: 1px solid var(--z-code-surface-2);
  padding: 0 4px;
  color: var(--z-code-subtext);
  margin-right: 4px;
}

/* ==========================================================================
   FOOTER — call to action, link columns, then the wordmark as the floor
   ========================================================================== */

.zf {
  background: var(--z-ink);
  color: var(--z-bg);
  border-top: 4px solid var(--z-red);
  margin-top: auto;
  overflow: hidden;
}

.zf-inner {
  max-width: var(--z-container);
  margin: 0 auto;
  padding: 4rem 1.5rem 0;
}

.zf-cta {
  display: grid;
  gap: 1.75rem;
  padding-bottom: 3rem;
  border-bottom: 2px solid rgba(250, 250, 249, 0.12);
}

@media (min-width: 1024px) {
  .zf-cta { grid-template-columns: 1fr auto; align-items: end; gap: 3rem; }
}

.zf-cta h2 {
  margin: 0;
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.zf-cta h2 span { color: #E6675A; }

.zf-cta p {
  margin: 0.9rem 0 0;
  max-width: 46ch;
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(250, 250, 249, 0.62);
}

.zf-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.zf-install {
  display: flex;
  align-items: stretch;
  border: 2px solid var(--z-bg);
  background: var(--z-code-crust);
  min-width: 0;
}

.zf-install code {
  flex: 1;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  height: 48px;
  font-size: 0.85rem;
  color: var(--z-code-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zf-install code .p { color: #A6E3A1; margin-right: 0.6rem; }

.zf-install button {
  background: var(--z-bg);
  color: var(--z-ink);
  border: none;
  padding: 0 1rem;
  font-family: var(--z-font-sans);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.zf-install button:hover { background: var(--z-yellow); }
.zf-install button.is-done { background: var(--z-green); color: #FFF; }

.zf-docs {
  display: inline-flex;
  align-items: center;
  height: 52px;
  padding: 0 1.5rem;
  background: var(--z-red);
  color: #FFF;
  border: 2px solid var(--z-bg);
  font-size: 0.875rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.zf-docs:hover { transform: translate(-3px, -3px); box-shadow: 3px 3px 0 var(--z-bg); }

.zf-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem 1.5rem;
  padding: 3rem 0;
}

@media (min-width: 1024px) {
  .zf-grid { grid-template-columns: 1.4fr repeat(4, 1fr); gap: 2rem; }
}

.zf-brand { grid-column: 1 / -1; }
@media (min-width: 1024px) { .zf-brand { grid-column: auto; } }

.zf .zh-brand { color: var(--z-bg); }
.zf .zh-ver { border-color: var(--z-bg); }

.zf-tagline {
  margin: 1rem 0 0;
  font-size: 0.875rem;
  line-height: 1.65;
  color: rgba(250, 250, 249, 0.6);
  max-width: 32ch;
}

.zf-col h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 1rem;
  color: rgba(250, 250, 249, 0.5);
}

.zf-col h2::before { content: ''; width: 8px; height: 8px; background: currentColor; }
.zf-col h2.c-red::before { background: #E6675A; }
.zf-col h2.c-blue::before { background: #5DA9E9; }
.zf-col h2.c-yellow::before { background: var(--z-yellow); }
.zf-col h2.c-green::before { background: #52BE80; }

.zf-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }

.zf-col a {
  font-size: 0.9rem;
  color: rgba(250, 250, 249, 0.78);
  text-decoration: none;
}

.zf-col a:hover { color: var(--z-bg); text-decoration: underline; text-decoration-color: var(--z-red); text-decoration-thickness: 2px; text-underline-offset: 4px; }

.zf-col a .ext {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.7em;
  opacity: 0.5;
}

/* The wordmark, drawn edge to edge. Decorative: the brand link above names it. */
.zf-giant {
  display: block;
  width: 100%;
  height: auto;
  color: var(--z-bg);
  margin: 0.5rem 0 -1px;
}

.zf-bottom {
  padding: 1.25rem 0 5.5rem;
  border-top: 2px solid rgba(250, 250, 249, 0.12);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  font-size: 0.8rem;
  color: rgba(250, 250, 249, 0.55);
}

.zf-bottom .sep { opacity: 0.4; }

.zf-social {
  margin-left: auto;
  display: flex;
  gap: 0.5rem;
}

.zf-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 2px solid rgba(250, 250, 249, 0.25);
  color: rgba(250, 250, 249, 0.7);
}

.zf-social a:hover { border-color: var(--z-bg); background: var(--z-bg); color: var(--z-ink); }
.zf-social svg { width: 16px; height: 16px; }

.zf-top {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: rgba(250, 250, 249, 0.7);
  background: none;
  border: 2px solid rgba(250, 250, 249, 0.25);
  padding: 0 0.7rem;
  height: 36px;
  font-family: var(--z-font-sans);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.zf-top svg { width: 14px; height: 14px; }
.zf-top:hover { color: var(--z-ink); background: var(--z-yellow); border-color: var(--z-yellow); }

@media (max-width: 639px) {
  .zf-inner { padding-top: 3rem; }
  .zf-install { flex: 1 1 100%; }
  .zf-docs { flex: 1 1 100%; justify-content: center; }
  .zf-social { margin-left: 0; }
}

/* ==========================================================================
   DOCS SHELL (sidebar / toc / mobile drawer)
   ========================================================================== */

.doc-sidebar {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: var(--z-nav-h);
  height: calc(100vh - var(--z-nav-h));
  overflow-y: auto;
  background: var(--z-surface);
  border-right: 1px solid var(--z-border);
  padding: 1rem 0 2rem;
  scrollbar-width: thin;
}

.doc-toc {
  width: 230px;
  flex-shrink: 0;
  position: sticky;
  top: var(--z-nav-h);
  height: calc(100vh - var(--z-nav-h));
  overflow-y: auto;
  padding: 2rem 1rem;
  background: var(--z-surface);
  border-left: 1px solid var(--z-border);
  scrollbar-width: thin;
}

.doc-toc-sidebar { width: 230px; flex-shrink: 0; display: none; }
.doc-toc-sidebar > div { position: sticky; top: calc(var(--z-nav-h) + 1rem); }
@media (min-width: 1280px) { .doc-toc-sidebar { display: block; } }

@media (max-width: 1279px) {
  .doc-toc { display: none; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .doc-sidebar { width: 220px; }
}

/* Mobile docs toolbar */
.doc-mobilebar {
  display: none;
  position: sticky;
  top: var(--z-nav-h);
  z-index: 40;
  background: var(--z-surface);
  border-bottom: 2px solid var(--z-ink);
  padding: 0 1rem;
  height: 44px;
  align-items: center;
  gap: 0.75rem;
}

.doc-mobilebar button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 2px solid var(--z-ink);
  padding: 0 0.6rem;
  height: 30px;
  font-family: var(--z-font-sans);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--z-ink);
}

.doc-mobilebar button svg { width: 14px; height: 14px; }

.doc-mobilebar .crumb {
  font-size: 0.75rem;
  color: var(--z-text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 44;
  background: rgba(26, 26, 46, 0.5);
}

@media (max-width: 767px) {
  .doc-mobilebar { display: flex; }

  .doc-sidebar {
    position: fixed;
    top: var(--z-nav-h);
    left: 0;
    width: min(300px, 85vw);
    height: calc(100vh - var(--z-nav-h));
    z-index: 45;
    transform: translateX(-100%);
    border-right: 3px solid var(--z-ink);
    transition: transform 160ms ease;
  }

  .doc-sidebar.is-open { transform: translateX(0); }
  .doc-backdrop.is-open { display: block; }

  main.doc-main { padding: 1.5rem 1.25rem !important; }
}

body.doc-drawer-open { overflow: hidden; }

/* Keep docs content inside the viewport on narrow screens */
main, .content-area, main .flex-1, main .flex > * { min-width: 0; max-width: 100%; }
main pre, main .code-block, main .api-signature { max-width: 100%; overflow-x: auto; }
.table-wrap { overflow-x: auto; max-width: 100%; margin: 1rem 0; -webkit-overflow-scrolling: touch; }
.table-wrap > table { margin: 0; }
/* Never let stray wide content zoom the page out on phones and tablets. */
@media (max-width: 1023px) {
  html { overflow-x: hidden; }
  body { overflow-x: clip; }
}

/* Before scripts run, tables must never widen the layout viewport on phones. */
@media (max-width: 767px) {
  main table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
main.doc-main img, main.doc-main svg:not(.pg svg) { max-width: 100%; height: auto; }
main.doc-main .prose, main.doc-main p, main.doc-main li { overflow-wrap: anywhere; }
main.doc-main code { overflow-wrap: anywhere; }

/* Pagination + edit link on docs */
.doc-edit {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--z-text-2);
  text-decoration: none;
}
.doc-edit:hover { color: var(--z-blue); }

/* Markdown copy of a docs page */
.md-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.md-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 32px;
  padding: 0 0.7rem;
  background: var(--z-surface);
  color: var(--z-ink);
  border: 2px solid var(--z-ink);
  font-family: var(--z-font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.md-btn svg { width: 14px; height: 14px; }
.md-btn:hover { background: var(--z-yellow); }
.md-btn.is-done { background: var(--z-green); border-color: var(--z-green); color: #FFF; }

/* ==========================================================================
   COPY BUTTONS (every code block, every page)
   ========================================================================== */

.code-wrap { position: relative; }

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 26px;
  padding: 0 0.55rem;
  background: var(--z-code-surface);
  color: var(--z-code-subtext);
  border: 1px solid var(--z-code-surface-2);
  font-family: var(--z-font-sans);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 120ms ease, background-color 120ms ease;
}

.copy-btn svg { width: 13px; height: 13px; }
.code-wrap:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { background: var(--z-code-surface-2); color: #FFFFFF; }
.copy-btn.is-done { background: var(--z-green); border-color: var(--z-green); color: #FFFFFF; opacity: 1; }

@media (hover: none) { .copy-btn { opacity: 1; } }

/* room for the button on short one-line blocks */
.code-wrap > .code-block, .code-wrap > pre { padding-right: 6.5rem; }
.code-wrap > .hero-term-code { padding-right: 1.25rem; }
.code-wrap > .hero-term-code + .copy-btn { top: -34px; right: 82px; }

/* ==========================================================================
   MOTION LAYER
   Scroll reveals, read progress, card tilt. Everything here is additive:
   with JavaScript off, or reduced motion on, the page renders in its final
   state with no animation.
   ========================================================================== */

/* Content is visible by default. The hidden state applies only while
   `reveal-armed` is on <html>, which effects.js sets synchronously and only
   when it is actually going to animate. No JavaScript, a blocked CDN or
   reduced motion therefore all render the page fully readable. */
.reveal-armed [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 520ms cubic-bezier(0.22, 0.61, 0.36, 1),
              transform 520ms cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: opacity, transform;
}

.reveal-armed [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
  will-change: auto;
}

@media (prefers-reduced-motion: reduce) {
  .reveal-armed [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* Reading progress on documentation pages */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 61;
  pointer-events: none;
  background: transparent;
}

.read-progress i {
  display: block;
  height: 100%;
  background: var(--z-red);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 90ms linear;
}

/* Cards lean a couple of pixels towards the pointer */
.feature-card,
.pkg-card {
  transform: translate(var(--tilt-x, 0), var(--tilt-y, 0));
}

.feature-card:hover,
.pkg-card:hover {
  transform: translate(calc(var(--tilt-x, 0px) - 2px), calc(var(--tilt-y, 0px) - 2px));
}

@media (prefers-reduced-motion: reduce) {
  .feature-card, .pkg-card { transform: none !important; }
}
