/* Warden docs. The landing page's design system: ink on paper, hairlines do
   the structure, 2px radius, Archivo for display, IBM Plex for the rest, and
   one verdict colour language (blue runs, orange blocked, amber asks you). */

:root {
  --hdr: 64px;
  --bg: #EDEEEA;
  --surface: #FAFAF8;
  --paper: #FFFFFF;
  --sunk: #E1E2DC;
  --text: #111311;
  --muted: #4A4F4A;
  --faint: #6B706A;
  --line: #BFC3BC;
  --line-soft: #E1E2DC;
  --ink: #111311;
  --bar: #111311;
  --bar-fg: #EDEEEA;
  --action: #111311;
  --action-fg: #EDEEEA;
  --action-hover: #3A3F3A;
  --hover: #E1E2DC;
  --allow: #1D4ED8;
  --deny: #FF5A1F;
  --ask: #F2B51D;
  --allow-t: #EEF3FD;
  --deny-t: #FFEDE5;
  --ask-t: #FFF8E1;
  --scrim: rgba(17, 19, 17, 0.6);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #111311;
  --surface: #161816;
  --paper: #1B1D1B;
  --sunk: #2A2D2A;
  --text: #EDEEEA;
  --muted: #A9ADA6;
  --faint: #8A8F88;
  --line: #3A3F3A;
  --line-soft: #262926;
  --ink: #EDEEEA;
  --bar: #2A2D2A;
  --bar-fg: #EDEEEA;
  --action: #EDEEEA;
  --action-fg: #111311;
  --action-hover: #FFFFFF;
  --hover: #2A2D2A;
  --allow-t: #17223F;
  --deny-t: #3A1E13;
  --ask-t: #372E12;
  --scrim: rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111311;
    --surface: #161816;
    --paper: #1B1D1B;
    --sunk: #2A2D2A;
    --text: #EDEEEA;
    --muted: #A9ADA6;
    --faint: #8A8F88;
    --line: #3A3F3A;
    --line-soft: #262926;
    --ink: #EDEEEA;
    --bar: #2A2D2A;
    --bar-fg: #EDEEEA;
    --action: #EDEEEA;
    --action-fg: #111311;
    --action-hover: #FFFFFF;
    --hover: #2A2D2A;
    --allow-t: #17223F;
    --deny-t: #3A1E13;
    --ask-t: #372E12;
    --scrim: rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--hdr) + 24px); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--text); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
strong, b { font-weight: 600; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
button { font: inherit; color: inherit; }
.wd-mono { font-family: 'IBM Plex Mono', monospace; }
.wd-label {
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em; color: var(--muted);
  display: flex; gap: 8px; align-items: baseline;
}
.wd-skip { position: absolute; left: -9999px; top: 8px; z-index: 60; background: var(--action); color: var(--action-fg); padding: 8px 12px; }
.wd-skip:focus { left: 8px; }

/* Header: the landing's bar, plus DOCS and search */
.wd-hdr { position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--line); }
.wd-hdr-in { height: var(--hdr); max-width: 1440px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 16px; }
.wd-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; flex: 0 0 auto; }
.wd-word { font-family: 'Archivo', sans-serif; font-weight: 850; font-stretch: 66%; font-size: 24px; letter-spacing: 0.02em; line-height: 1; }
.wd-docs-tag {
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-decoration: none;
  border: 1px solid var(--ink); padding: 2px 8px; border-radius: 2px; margin-left: -4px;
}
.wd-search-btn {
  margin-left: 24px; flex: 0 1 340px; min-width: 0; display: flex; align-items: center; gap: 8px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 2px; padding: 8px 8px 8px 12px;
  color: var(--muted); cursor: pointer; text-align: left; font-size: 14px;
}
.wd-search-btn:hover { border-color: var(--ink); }
.wd-search-ph { flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wd-search-k { display: flex; gap: 2px; }
kbd {
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; line-height: 1; color: var(--text);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 2px; padding: 3px 5px; background: var(--surface);
}
.wd-hdr-links { margin-left: auto; display: flex; gap: 24px; font-size: 14px; font-weight: 500; }
.wd-hdr-links a { text-decoration: none; padding: 12px 0; }
.wd-hdr-links a:hover { text-decoration: underline; }
.wd-theme {
  width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 2px;
  background: transparent; cursor: pointer; flex: 0 0 auto;
}
.wd-theme:hover { background: var(--hover); }
.wd-moon { display: none; }
:root[data-theme="dark"] .wd-sun { display: none; }
:root[data-theme="dark"] .wd-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .wd-sun { display: none; }
  :root:not([data-theme="light"]) .wd-moon { display: block; }
}
.wd-get {
  background: var(--action); color: var(--action-fg); text-decoration: none; font-size: 14px; font-weight: 600;
  padding: 10px 16px; border-radius: 2px; white-space: nowrap;
}
.wd-get:hover { background: var(--action-hover); text-decoration: none; }
.wd-menu { display: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 2px; background: transparent; cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 4px; padding: 0; }
.wd-menu span { display: block; width: 16px; height: 2px; background: var(--text); }

/* Shell */
.wd-shell { max-width: 1440px; margin: 0 auto; display: grid; grid-template-columns: 280px minmax(0, 1fr); }
.wd-side {
  position: sticky; top: var(--hdr); height: calc(100vh - var(--hdr)); overflow-y: auto; overscroll-behavior: contain;
  border-right: 1px solid var(--line); padding: 32px 24px 48px;
}
.wd-navgroup + .wd-navgroup { margin-top: 28px; }
.wd-navgroup .wd-label { padding-bottom: 8px; border-bottom: 1px solid var(--ink); margin-bottom: 4px; color: var(--text); }
.wd-navgroup .wd-label span { color: var(--faint); }
.wd-side ul { list-style: none; margin: 0; padding: 0; }
.wd-side li a {
  display: block; text-decoration: none; font-size: 14px; line-height: 1.4; padding: 6px 10px; margin-left: -10px;
  border-left: 2px solid transparent; color: var(--muted);
}
.wd-side li a:hover { color: var(--text); background: var(--hover); }
.wd-side li a[aria-current="page"] { color: var(--text); font-weight: 600; border-left-color: var(--ink); background: var(--surface); }

.wd-main { display: grid; grid-template-columns: minmax(0, 1fr) 232px; gap: 48px; padding: 40px 48px 96px; min-width: 0; }
.wd-article { min-width: 0; max-width: 780px; }

/* Article head */
.wd-eyebrow {
  display: flex; align-items: baseline; gap: 8px 16px; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; margin-bottom: 20px;
}
.wd-eyebrow span:first-child { color: var(--faint); }
.wd-rule { flex: 1; min-width: 40px; height: 1px; background: var(--ink); align-self: center; }
h1 {
  margin: 0; font-family: 'Archivo', sans-serif; font-weight: 800; font-stretch: 70%;
  font-size: clamp(40px, 5vw, 60px); line-height: 1.0; text-wrap: balance; letter-spacing: 0.005em;
}
.wd-lede { margin: 16px 0 0; font-size: 19px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.wd-pagetools { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 8px; padding-bottom: 24px; border-bottom: 2px solid var(--ink); }
.wd-tool {
  font-size: 13px; font-weight: 500; padding: 5px 10px; border: 1px solid var(--line); border-radius: 2px;
  background: transparent; cursor: pointer; text-decoration: none; color: var(--muted);
}
.wd-tool:hover { border-color: var(--ink); color: var(--text); }

/* Prose */
.wd-prose { font-size: 16px; }
.wd-prose > :first-child { margin-top: 32px; }
.wd-prose p { margin: 16px 0; text-wrap: pretty; }
.wd-prose h2 {
  font-family: 'Archivo', sans-serif; font-weight: 800; font-stretch: 74%; font-size: 32px; line-height: 1.1;
  margin: 56px 0 16px; padding-top: 24px; border-top: 1px solid var(--line); position: relative;
}
.wd-prose h3 { font-size: 18px; font-weight: 600; line-height: 1.35; margin: 36px 0 8px; position: relative; }
.wd-prose h4 { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 28px 0 8px; }
.wd-anchor { margin-left: 8px; text-decoration: none; color: var(--faint); opacity: 0; font-family: 'IBM Plex Mono', monospace; font-weight: 400; font-size: 0.7em; }
h2:hover .wd-anchor, h3:hover .wd-anchor, .wd-anchor:focus { opacity: 1; }
.wd-prose ul, .wd-prose ol { margin: 16px 0; padding-left: 24px; }
.wd-prose li { margin: 6px 0; }
.wd-prose li > ul, .wd-prose li > ol { margin: 6px 0; }
.wd-prose ul { list-style: none; padding-left: 24px; }
.wd-prose ul > li { position: relative; }
.wd-prose ul > li::before { content: "■"; position: absolute; left: -22px; top: 0; font-size: 10px; color: var(--text); line-height: 2.6; }
.wd-prose hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
code {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.86em; background: var(--sunk); padding: 1px 6px; border-radius: 2px;
  overflow-wrap: anywhere;
}
blockquote { margin: 16px 0; padding: 4px 0 4px 20px; border-left: 2px solid var(--line); color: var(--muted); }

/* Code blocks: the landing's dark caption bar over a paper body */
.wd-code { margin: 24px 0; border: 1px solid var(--ink); background: var(--surface); }
.wd-code figcaption {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 4px 4px 14px;
  background: var(--bar); color: var(--bar-fg); font-size: 12px; font-weight: 600; letter-spacing: 0.08em;
}
.wd-copy {
  font-size: 12px; font-weight: 500; letter-spacing: 0; padding: 4px 10px; min-height: 28px; border: 1px solid #6B706A; border-radius: 2px;
  background: transparent; color: var(--bar-fg); cursor: pointer;
}
.wd-copy:hover { background: #2A2D2A; }
:root[data-theme="dark"] .wd-copy:hover { background: #3A3F3A; }
.wd-copy:focus-visible { outline-color: var(--bar-fg); }
.wd-code pre { margin: 0; padding: 16px; overflow-x: auto; font-size: 13.5px; line-height: 1.7; tab-size: 2; }
.wd-code pre code { background: none; padding: 0; font-size: inherit; overflow-wrap: normal; white-space: pre; }
.wd-c { color: var(--faint); }
.wd-k { font-weight: 600; }
.wd-s { color: var(--muted); }
.wd-k-deny, .wd-k-ask, .wd-k-allow { font-weight: 600; padding: 0 3px; margin: 0 -3px; }
.wd-k-deny { background: var(--deny-t); box-shadow: inset 0 -2px 0 var(--deny); }
.wd-k-ask { background: var(--ask-t); box-shadow: inset 0 -2px 0 var(--ask); }
.wd-k-allow { background: var(--allow-t); box-shadow: inset 0 -2px 0 var(--allow); }

/* Verdict chips: one language everywhere */
.wd-verdict {
  display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; line-height: 1.5;
  padding: 1px 7px; border-radius: 2px; vertical-align: 0.1em; white-space: nowrap;
}
.wd-v-deny { background: var(--deny); color: #111311; }
.wd-v-ask { background: var(--ask); color: #111311; }
.wd-v-allow { background: var(--allow); color: #FFFFFF; }

/* Tables */
.wd-table { margin: 24px 0; overflow-x: auto; border-top: 2px solid var(--ink); }
.wd-table table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.5; }
.wd-table th {
  text-align: left; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
  padding: 10px 16px 10px 0; border-bottom: 1px solid var(--ink); white-space: nowrap;
}
.wd-table td { padding: 10px 16px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.wd-table td:first-child { font-weight: 600; }
.wd-table td:first-child code { font-weight: 500; }

/* Callouts */
.wd-callout { margin: 24px 0; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--ink); }
.wd-callout-l { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 4px; }
.wd-callout p { margin: 6px 0; }
.wd-callout > :last-child { margin-bottom: 0; }
.wd-callout-tip .wd-callout-l::before { content: "// "; font-family: 'IBM Plex Mono', monospace; font-weight: 400; color: var(--faint); letter-spacing: 0; }
.wd-callout-warning { border-left-color: var(--deny); }
.wd-callout-limit .wd-callout-l::before { content: "■ "; }

/* Steps: the landing's numbered list, big condensed numerals */
.wd-steps > ol { list-style: none; padding: 0; margin: 24px 0; counter-reset: step; border-top: 2px solid var(--ink); }
.wd-steps > ol > li {
  counter-increment: step; position: relative; margin: 0; padding: 20px 0 20px 64px; border-bottom: 1px solid var(--line);
}
.wd-steps > ol > li::before {
  content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: 14px;
  font-family: 'Archivo', sans-serif; font-weight: 850; font-stretch: 66%; font-size: 36px; line-height: 1;
}
.wd-steps .wd-code { margin: 12px 0 0; }

/* Cards */
.wd-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; margin: 24px 0; }
.wd-card {
  display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border: 1px solid var(--ink); background: var(--paper);
  text-decoration: none; transition: background 150ms ease-out;
}
.wd-card:hover { background: var(--surface); }
.wd-card-t { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; font-size: 17px; line-height: 1.3; }
.wd-card-t span { transition: transform 150ms ease-out; }
.wd-card:hover .wd-card-t span { transform: translateX(3px); }
.wd-card-d { font-size: 14px; line-height: 1.5; color: var(--muted); }

/* Prev / next + page foot */
.wd-pns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 64px; }
.wd-pn { display: flex; flex-direction: column; gap: 4px; padding: 16px 20px; border: 1px solid var(--ink); text-decoration: none; background: var(--paper); }
.wd-pn:hover { background: var(--surface); }
.wd-pn-next { text-align: right; align-items: flex-end; }
.wd-pn-t { font-weight: 600; font-size: 17px; }
.wd-pagefoot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.wd-sitefoot { border-top: 2px solid var(--ink); background: var(--surface); }
.wd-sitefoot-in { max-width: 1440px; margin: 0 auto; padding: 24px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: 13px; color: var(--muted); }

/* On this page */
.wd-toc { position: sticky; top: calc(var(--hdr) + 40px); align-self: start; max-height: calc(100vh - var(--hdr) - 64px); overflow-y: auto; }
.wd-toc .wd-label { margin-bottom: 8px; }
.wd-toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.wd-toc li a {
  display: block; font-size: 13px; line-height: 1.4; padding: 5px 0 5px 14px; margin-left: -1px; text-decoration: none;
  color: var(--muted); border-left: 2px solid transparent;
}
.wd-toc li.wd-toc-3 a { padding-left: 26px; font-size: 12.5px; }
.wd-toc li a:hover { color: var(--text); }
.wd-toc li a.wd-on { color: var(--text); font-weight: 600; border-left-color: var(--ink); }

/* Search */
.wd-search[hidden] { display: none; }
.wd-search { position: fixed; inset: 0; z-index: 50; background: var(--scrim); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.wd-search-box {
  width: 100%; max-width: 680px; max-height: 72vh; display: flex; flex-direction: column; background: var(--paper);
  border: 2px solid var(--ink); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25); animation: wdIn 150ms ease-out both;
}
@keyframes wdIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.wd-search-field { display: flex; align-items: center; gap: 12px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--ink); color: var(--muted); }
.wd-search-field input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font-family: 'IBM Plex Sans', sans-serif;
  font-size: 18px; padding: 16px 0; outline: none;
}
.wd-search-field input::-webkit-search-cancel-button { display: none; }
.wd-esc { font-family: 'IBM Plex Mono', monospace; font-size: 12px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 2px; background: var(--surface); padding: 3px 6px; cursor: pointer; }
#wd-results { list-style: none; margin: 0; padding: 8px; overflow-y: auto; }
#wd-results li a { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; text-decoration: none; border-radius: 2px; }
#wd-results .wd-r-path { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }
#wd-results .wd-r-h { font-weight: 600; font-size: 15px; }
#wd-results .wd-r-x { font-size: 13.5px; color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#wd-results mark { background: none; color: inherit; font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 2px; }
#wd-results li[aria-selected="true"] a { background: var(--action); color: var(--action-fg); }
#wd-results li[aria-selected="true"] .wd-r-path, #wd-results li[aria-selected="true"] .wd-r-x { color: var(--action-fg); opacity: 0.8; }
.wd-empty { padding: 24px 12px; color: var(--muted); font-size: 15px; }
.wd-empty .wd-mono { display: block; margin-top: 8px; font-size: 13px; }
.wd-search-foot { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); background: var(--surface); }
.wd-search-foot .wd-mono { margin-left: auto; }

/* Responsive */
@media (max-width: 1180px) {
  .wd-main { grid-template-columns: minmax(0, 1fr); padding: 40px 40px 96px; }
  .wd-toc { display: none; }
  .wd-hdr-links { display: none; }
  .wd-theme { margin-left: auto; }
}
@media (max-width: 860px) {
  :root { --hdr: 60px; }
  .wd-shell { grid-template-columns: minmax(0, 1fr); }
  .wd-menu { display: flex; }
  .wd-side {
    position: fixed; z-index: 40; top: var(--hdr); left: 0; bottom: 0; height: auto; width: min(320px, 86vw);
    background: var(--bg); transform: translateX(-100%); transition: transform 200ms ease-out; visibility: hidden;
  }
  .wd-side.wd-open { transform: none; visibility: visible; box-shadow: 0 0 0 100vmax var(--scrim); }
  .wd-hdr-in { padding: 0 16px; gap: 10px; }
  .wd-search-btn { margin-left: auto; flex: 0 0 auto; padding: 8px 10px; }
  .wd-search-ph, .wd-search-k { display: none; }
  .wd-theme { margin-left: 0; }
  .wd-main { padding: 28px 16px 72px; }
  .wd-prose h2 { font-size: 28px; }
  .wd-pns { grid-template-columns: 1fr; }
  .wd-search { padding-top: 16px; }
  .wd-search-foot .wd-mono { display: none; }
}
@media (max-width: 480px) {
  .wd-docs-tag { display: none; }
  .wd-get { padding: 10px 12px; }
  .wd-steps > ol > li { padding-left: 52px; }
  .wd-steps > ol > li::before { font-size: 30px; }
}
@media (pointer: coarse) { .wd-side li a { padding-top: 10px; padding-bottom: 10px; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .wd-hdr, .wd-side, .wd-toc, .wd-pagetools, .wd-pns, .wd-search, .wd-copy { display: none !important; }
  .wd-shell, .wd-main { display: block; padding: 0; }
}
