/* Haystash DB: site and docs.
   The palette is the console's own: a cool, neutral page; one navy for "locked" (the console's
   locked tag and column tint); amber hatching for "waiting / be careful". Light and dark follow
   the system. No decoration beyond those two marks. */
:root {
  color-scheme: light dark;
  --paper: #f5f6f4;
  --paper-2: #eaece9;
  --surface: #ffffff;
  --ink: #18212c;
  --ink-2: #47515e;
  --ink-3: #6f7884;
  --line: #d8dce0;
  --locked: #27466f;
  --locked-ink: #ffffff;
  --locked-tint: #e3e9f2;
  --amber: #8a5a0b;
  --amber-hatch: #f1d58f;
  --bad: #a2432e;
  --code-bg: #1a222d;
  --code-ink: #e4e9f0;
  --code-dim: #8a96a6;
  --display: "Instrument Sans", "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --r: 6px;
  /* kept for older pages */
  --verdigris: var(--locked);
  --verdigris-2: var(--locked-tint);
  --warn: var(--bad);
  --cipher: var(--locked);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #11161d;
    --paper-2: #19202a;
    --surface: #161d26;
    --ink: #e7ebf0;
    --ink-2: #a9b2bd;
    --ink-3: #7f8996;
    --line: #29323e;
    --locked: #a9c2e6;
    --locked-ink: #10161e;
    --locked-tint: #1a2637;
    --amber: #e3b660;
    --amber-hatch: #6b5222;
    --bad: #e58a72;
    --code-bg: #0b0f14;
    --code-ink: #dfe5ec;
    --code-dim: #7b8796;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font: 16.5px/1.6 var(--sans); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--locked); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--locked); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.12; margin: 0; letter-spacing: -0.02em; font-weight: 600; text-wrap: balance; }
h1 { font-size: clamp(36px, 5.4vw, 66px); letter-spacing: -0.032em; line-height: 1.04; }
h2 { font-size: clamp(26px, 3.2vw, 38px); }
h3 { font-size: 19px; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
img { max-width: 100%; height: auto; display: block; }
code, pre, .mono { font-family: var(--mono); font-size: 0.86em; }
pre code { font-size: inherit; }
pre { background: var(--code-bg); color: var(--code-ink); padding: 20px 22px; border-radius: var(--r); overflow: auto; line-height: 1.6; margin: 0 0 1.2em; font-size: 13.5px; }
:not(pre) > code { background: var(--paper-2); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 32px; }
.muted { color: var(--ink-3); }

/* Nav */
.nav { display: flex; align-items: center; gap: 28px; padding-top: 20px; padding-bottom: 20px; flex-wrap: wrap; }
.nav .logo { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 600; font-size: 19px; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
/* The mark: one readable half, one locked half. */
.logo-mark { width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(90deg, var(--surface) 0 50%, var(--locked) 50% 100%); border: 1.5px solid var(--ink); flex: none; }
.nav nav { display: flex; gap: 24px; margin-left: auto; }
.nav nav a { color: var(--ink-2); text-decoration: none; font-weight: 500; }
.nav nav a:hover, .nav nav a[aria-current=page] { color: var(--ink); }

/* Buttons and fields */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: var(--r); border: 1.5px solid var(--ink); background: var(--ink); color: var(--paper); font: 500 15.5px var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--locked); border-color: var(--locked); color: var(--locked-ink); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--paper-2); color: var(--ink); border-color: var(--ink); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn-note { font-size: 12.5px; font-weight: 500; opacity: 0.75; border-left: 1px solid currentColor; padding-left: 8px; }
.cta-note { margin-top: 14px; }
input[type=text] { font: inherit; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); width: 100%; }
input[type=text]:focus { outline: none; border-color: var(--locked); }

/* Hero: the headline, then the database itself, wide. */
.hero { padding-top: 64px; padding-bottom: 80px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 52px; }
.hero h1 { max-width: 19ch; }
.hero .lede, .lede { font-size: 20px; line-height: 1.55; color: var(--ink-2); max-width: 58ch; margin-top: 22px; }
.hero .ctas { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }

/* Screenshots: framed like a window, never cropped. */
.shot { margin: 0; }
.shot img { border: 1px solid var(--line); border-radius: 10px; background: var(--paper-2); box-shadow: 0 1px 0 var(--line), 0 18px 40px -24px rgba(16, 24, 36, 0.35); }
.shot figcaption { font-size: 14.5px; color: var(--ink-2); margin-top: 12px; max-width: 70ch; }
.hero-shot img { border-color: var(--ink); border-width: 1.5px; }

/* Sections */
section.band { padding: 76px 0; border-top: 1px solid var(--line); }
.lede-sm { color: var(--ink-2); max-width: 64ch; margin-top: 14px; font-size: 17.5px; }
.note { font-size: 14.5px; color: var(--ink-2); max-width: 72ch; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.grid2 > pre { margin: 0; }

/* Steps: a real sequence, so numbered. */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px; margin: 36px 0 0; padding: 0; counter-reset: step; }
.steps li { list-style: none; counter-increment: step; border-top: 1.5px solid var(--ink); padding-top: 18px; }
.steps li::before { content: counter(step); display: block; font-family: var(--display); font-weight: 600; font-size: 15px; color: var(--locked); margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.steps h3 { margin-bottom: 8px; }
.steps p { color: var(--ink-2); margin: 0; }

/* Tables */
table { border-collapse: collapse; width: 100%; font-size: 15.5px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { color: var(--ink-3); font-weight: 500; font-size: 14px; }
tbody th { font-weight: 500; }
.table-scroll { overflow-x: auto; margin-top: 28px; }
.ok { color: var(--locked); font-weight: 600; }
.bad, .compare td.bad { color: var(--bad); }
.compare td:first-child { font-weight: 500; }

/* The leak table: the Haystash column is drawn as a locked column, the way the console draws one. */
.leak { min-width: 560px; }
.leak th, .leak td { padding: 16px 18px; }
.leak tbody th { width: 34%; }
.leak .locked-col { background: var(--locked-tint); }
.leak thead .locked-col { color: var(--ink); font-weight: 600; box-shadow: inset 0 2px 0 var(--locked); }
.tag { display: inline-block; font: 500 12px var(--sans); color: var(--locked-ink); background: var(--locked); padding: 1px 7px; border-radius: 4px; margin-left: 6px; vertical-align: 1px; }
#leaks .note { margin-top: 18px; }

/* What fits */
.fit { margin-top: 32px; gap: 24px; }
.fit > div { border-radius: 10px; padding: 24px 26px; }
.fit h3 { margin-bottom: 12px; }
.fit ul { margin: 0; padding-left: 20px; }
.fit li { margin-bottom: 6px; }
.fit-yes { background: var(--locked-tint); box-shadow: inset 3px 0 0 var(--locked); }
.fit-no { border: 1px solid var(--line); }
.fit-no li { color: var(--ink-2); }

/* Lists with bold leads */
.plain-list { list-style: none; padding: 0; margin: 22px 0 22px; }
.plain-list li { padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.plain-list li:first-child { border-top: 1px solid var(--line); }
.plain-list b { color: var(--ink); font-weight: 600; }

/* Console strip */
.strip { list-style: none; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.strip .shot figcaption { font-size: 14px; }

/* Limits: hatched like the console's "waiting" values. */
.limits { list-style: none; margin: 0; padding: 0 0 0 22px; position: relative; }
.limits::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 6px; border-radius: 3px; background: repeating-linear-gradient(135deg, var(--amber) 0 2px, var(--amber-hatch) 2px 6px); }
.limits li { padding: 0 0 16px; color: var(--ink-2); }
.limits li:last-child { padding-bottom: 0; }
.limits b { color: var(--ink); font-weight: 600; }

footer { padding: 40px 0 64px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 14.5px; }
.foot { display: flex; justify-content: space-between; gap: 12px 32px; flex-wrap: wrap; }
.foot p { margin: 0; max-width: 70ch; }
.foot a { color: var(--ink-2); margin-right: 16px; }

/* Docs */
.docs { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 52px; padding-top: 28px; padding-bottom: 80px; }
.docs aside { position: sticky; top: 16px; align-self: start; font-size: 15px; max-height: calc(100vh - 32px); overflow-y: auto; }
.docs aside a { display: block; padding: 5px 0; color: var(--ink-2); text-decoration: none; }
.docs aside a:hover { color: var(--locked); }
.docs aside .group { font-weight: 600; color: var(--ink); margin: 16px 0 4px; font-family: var(--display); }
.docs article { max-width: 76ch; }
.docs article h1 { font-size: clamp(32px, 4vw, 42px); }
.docs article h2 { margin: 52px 0 14px; padding-top: 8px; }
.docs article h3 { margin: 28px 0 10px; }
.docs article li { margin-bottom: 6px; }
.docs article table { font-size: 14.5px; margin-bottom: 1.2em; }
.docs article img { border: 1px solid var(--line); border-radius: 8px; margin: 8px 0 18px; }
.agent-note { border-left: 3px solid var(--locked); background: var(--locked-tint); padding: 12px 16px; border-radius: 0 var(--r) var(--r) 0; font-size: 15px; }
.kicker { font-size: 14px; font-weight: 600; color: var(--locked); margin-bottom: 6px; }
.docs-plain { max-width: 76ch; padding-top: 48px; padding-bottom: 80px; }
.docs-plain h1 { font-size: clamp(32px, 4vw, 42px); }
.ctas-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 22px 0 0; }

@media (max-width: 900px) {
  .steps, .grid2, .strip { grid-template-columns: minmax(0, 1fr); }
  .steps { gap: 28px; }
  .grid2 { gap: 32px; }
  .docs { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .docs aside { position: static; max-height: none; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .wrap { padding: 0 20px; }
  .nav nav { gap: 18px; margin-left: 0; }
  .hero { padding-top: 24px; padding-bottom: 56px; gap: 36px; }
  .hero .lede, .lede { font-size: 18px; }
  section.band { padding: 56px 0; }
  .fit > div { padding: 20px; }
  pre { font-size: 12.5px; padding: 16px; }
  /* The leak table becomes one block per row, so the Haystash column never scrolls off-screen. */
  .leak { min-width: 0; }
  .leak thead { display: none; }
  .leak, .leak tbody, .leak tr, .leak th, .leak td { display: block; width: auto; }
  .leak tr { border-top: 1.5px solid var(--ink); padding: 14px 0 18px; }
  .leak tbody th { width: auto; padding: 0 0 8px; border: 0; font-size: 17px; }
  .leak td { border: 0; padding: 8px 12px; border-radius: var(--r); }
  .leak td::before { content: attr(data-label); display: block; font-size: 13px; color: var(--ink-3); font-weight: 500; }
}
