/* Bloch Genesis-4 Developer Portal — self-contained stylesheet, no external assets */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --bg-code: #f4f5f7;
  --text: #1b2330;
  --muted: #5b6472;
  --border: #e3e6ea;
  --accent: #2b4fd8;
  --accent-soft: #e8edfb;
  --warn-bg: #fdf6e3;
  --warn-border: #d9a520;
  --danger-bg: #fdefef;
  --danger-border: #c94848;
  --ok-bg: #eaf6ee;
  --ok-border: #3d9960;
  --badge-live-bg: #e2f2e8;
  --badge-live-fg: #1d6b3d;
  --badge-next-bg: #fbf1d8;
  --badge-next-fg: #8a6410;
  --badge-refused-bg: #f9e3e3;
  --badge-refused-fg: #9c2f2f;
  --header-h: 56px;
  --nav-w: 268px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1117;
    --bg-alt: #141924;
    --bg-code: #161c28;
    --text: #dbe2ec;
    --muted: #8b94a3;
    --border: #232a38;
    --accent: #7d97ff;
    --accent-soft: #1b2340;
    --warn-bg: #2a2310;
    --warn-border: #b98d2e;
    --danger-bg: #2b1717;
    --danger-border: #b04a4a;
    --ok-bg: #14261b;
    --ok-border: #3d9960;
    --badge-live-bg: #17301f;
    --badge-live-fg: #6fcb92;
    --badge-next-bg: #322a12;
    --badge-next-fg: #dcb54e;
    --badge-refused-bg: #331a1a;
    --badge-refused-fg: #e08a8a;
  }
}

:root[data-theme="dark"] {
  --bg: #0e1117;
  --bg-alt: #141924;
  --bg-code: #161c28;
  --text: #dbe2ec;
  --muted: #8b94a3;
  --border: #232a38;
  --accent: #7d97ff;
  --accent-soft: #1b2340;
  --warn-bg: #2a2310;
  --warn-border: #b98d2e;
  --danger-bg: #2b1717;
  --danger-border: #b04a4a;
  --ok-bg: #14261b;
  --ok-border: #3d9960;
  --badge-live-bg: #17301f;
  --badge-live-fg: #6fcb92;
  --badge-next-bg: #322a12;
  --badge-next-fg: #dcb54e;
  --badge-refused-bg: #331a1a;
  --badge-refused-fg: #e08a8a;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15.5px;
  line-height: 1.62;
}

code, pre, kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 40;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand .mark {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--accent);
  font-size: 18px;
}
.brand .sub { font-weight: 400; color: var(--muted); font-size: 13px; }
.header-spacer { flex: 1; }
.header-links { display: flex; gap: 14px; font-size: 13.5px; }
.icon-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 5px 11px;
  font-size: 13px;
  cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
#nav-toggle { display: none; }

/* ---------- layout ---------- */
.layout { display: flex; }

.sidenav {
  position: fixed;
  top: var(--header-h);
  bottom: 0;
  left: 0;
  width: var(--nav-w);
  overflow-y: auto;
  padding: 18px 10px 40px 16px;
  border-right: 1px solid var(--border);
  background: var(--bg-alt);
  z-index: 30;
}
.sidenav h5 {
  margin: 18px 6px 4px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.sidenav h5:first-child { margin-top: 2px; }
.sidenav ul { list-style: none; margin: 0 0 4px; padding: 0; }
.sidenav a {
  display: block;
  padding: 3px 8px;
  border-radius: 5px;
  color: var(--text);
  font-size: 13.5px;
}
.sidenav a.method-link { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.sidenav a:hover { background: var(--accent-soft); text-decoration: none; }
.sidenav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

main {
  margin-left: var(--nav-w);
  padding: calc(var(--header-h) + 24px) 40px 40px;
  max-width: calc(var(--nav-w) + 900px);
  width: 100%;
}
main > section { margin-bottom: 56px; }

/* ---------- typography ---------- */
h1 { font-size: 30px; line-height: 1.25; margin: 0 0 10px; }
h2 {
  font-size: 23px;
  margin: 0 0 14px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  position: relative;
}
section:first-of-type h2 { border-top: none; padding-top: 0; }
h3 { font-size: 18px; margin: 30px 0 8px; position: relative; }
h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 20px 0 6px; }
p { margin: 0 0 12px; }
ul, ol { margin: 0 0 12px; padding-left: 24px; }
li { margin-bottom: 4px; }
.lead { font-size: 17px; color: var(--muted); }
.hanchor {
  margin-left: 8px;
  color: var(--muted);
  opacity: 0;
  font-weight: 400;
  font-size: 0.85em;
}
h2:hover .hanchor, h3:hover .hanchor { opacity: 1; }
hr { border: none; border-top: 1px solid var(--border); margin: 28px 0; }

/* ---------- code ---------- */
code {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.85em;
}
pre {
  position: relative;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.55;
}
pre code { background: none; border: none; padding: 0; font-size: inherit; }
.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 5px;
  font-size: 11.5px;
  padding: 3px 9px;
  cursor: pointer;
  opacity: 0.75;
}
.copy-btn:hover { opacity: 1; color: var(--accent); border-color: var(--accent); }
.copy-btn.done { color: var(--ok-border); border-color: var(--ok-border); opacity: 1; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 0 16px; border: 1px solid var(--border); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { text-align: left; padding: 7px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--bg-alt); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); white-space: nowrap; }
tr:last-child td { border-bottom: none; }
td code { white-space: nowrap; }
td.wrap code { white-space: normal; word-break: break-all; }

/* ---------- callouts ---------- */
.callout {
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  background: var(--bg-alt);
  border-radius: 6px;
  padding: 12px 16px;
  margin: 0 0 16px;
}
.callout > :last-child { margin-bottom: 0; }
.callout.warn { border-left-color: var(--warn-border); background: var(--warn-bg); }
.callout.danger { border-left-color: var(--danger-border); background: var(--danger-bg); }
.callout.ok { border-left-color: var(--ok-border); background: var(--ok-bg); }
.callout .title { font-weight: 700; display: block; margin-bottom: 4px; }

/* ---------- badges ---------- */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 1px 7px;
  vertical-align: 2px;
  margin-left: 8px;
}
.badge.live { background: var(--badge-live-bg); color: var(--badge-live-fg); }
.badge.next { background: var(--badge-next-bg); color: var(--badge-next-fg); }
.badge.refused { background: var(--badge-refused-bg); color: var(--badge-refused-fg); }

.sig {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  margin: 0 0 12px;
  overflow-x: auto;
  white-space: nowrap;
}

.method { border-top: 1px dashed var(--border); padding-top: 8px; margin-top: 34px; }
.method:first-of-type { border-top: none; margin-top: 0; }

.kv { color: var(--muted); font-size: 13px; margin-bottom: 12px; }

/* ---------- footer ---------- */
.site-footer {
  margin-left: var(--nav-w);
  border-top: 1px solid var(--border);
  padding: 26px 40px 46px;
  color: var(--muted);
  font-size: 13.5px;
}
.site-footer .links { margin-bottom: 8px; }
.site-footer .links a { margin-right: 18px; }
.site-footer .verify { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }

/* ---------- mobile ---------- */
.nav-overlay { display: none; }

@media (max-width: 980px) {
  #nav-toggle { display: inline-block; }
  .sidenav {
    transform: translateX(-105%);
    transition: transform 0.18s ease-out;
    box-shadow: none;
    width: min(var(--nav-w), 84vw);
  }
  body.nav-open .sidenav { transform: translateX(0); box-shadow: 0 0 32px rgba(0,0,0,0.35); }
  body.nav-open .nav-overlay {
    display: block;
    position: fixed;
    inset: var(--header-h) 0 0 0;
    background: rgba(0,0,0,0.35);
    z-index: 25;
  }
  main, .site-footer { margin-left: 0; padding-left: 20px; padding-right: 20px; }
  .header-links { display: none; }
  h1 { font-size: 25px; }
}

@media (max-width: 520px) {
  .brand .sub { display: none; }
}

blockquote {
  margin: 8px 0 10px;
  padding: 6px 14px;
  border-left: 3px solid var(--warn-border);
  background: var(--bg-alt);
  border-radius: 0 6px 6px 0;
  color: var(--text);
  font-style: italic;
}

/* POSTERN VISUAL STANDARD v1 — approved 2026-09-08.
   Shared palette aliases preserve each product's existing components.
   Dark is the default; an explicit light preference remains available.
   Status colors remain distinct from the lime brand accent. */
:root, :root:not([data-theme="light"]), :root[data-theme="dark"] {
  --ground: #101211;
  --panel: #161916;
  --surface: #161916;
  --surface-2: #1d221c;
  --surface-3: #263020;
  --bg: #101211;
  --bg0: #101211;
  --bg1: #161916;
  --bg2: #161916;
  --bg3: #1d221c;
  --bg4: #263020;
  --bg-alt: #161916;
  --bg-code: #0c0f0b;
  --bg-elev: #161916;
  --bg-elev-2: #1d221c;
  --bg-glow: #1b2316;
  --bg-deep: #0c0f0b;
  --fg: #f2f0e7;
  --text: #f2f0e7;
  --ink: #f2f0e7;
  --fg-2: #cad1c3;
  --ink-2: #cad1c3;
  --text-dim: #cad1c3;
  --muted: #a5ada6;
  --faint: #93a08c;
  --text-faint: #93a08c;
  --line: #30382f;
  --line-strong: #526049;
  --line-soft: #252d22;
  --accent: #c8fa72;
  --accent-strong: #d6ff96;
  --accent-hover: #d6ff96;
  --accent-soft: rgba(200,250,114,.10);
  --brass: #c8fa72;
  --brass-bright: #d6ff96;
  --brass-hi: #d6ff96;
  --brass-deep: #b7e660;
  --brass-ink: #142009;
  --brass-dim: rgba(200,250,114,.10);
  --brass-line: rgba(200,250,114,.32);
  --brass-glow: rgba(200,250,114,.12);
  --on-accent: #142009;
  --link: #c8fa72;
  --link-hover: #d6ff96;
  --focus: #c8fa72;
  --ok: #82b4ee;
  --ok-dim: rgba(130,180,238,.12);
  --ok-soft: #172331;
  --ok-bg: #172331;
  --ok-border: #82b4ee;
  --warn: #e8be84;
  --warn-dim: rgba(232,190,132,.12);
  --signal: #e8be84;
  --signal-text: #e8be84;
  --signal-soft: #2b2419;
  --warn-bg: #2b2419;
  --warn-border: #9a774b;
  --warn-bord: #9a774b;
  --crit: #ff8e83;
  --crit-dim: rgba(255,142,131,.12);
  --danger: #ff8e83;
  --danger-bg: #321d19;
  --danger-border: #c27569;
  --err: #ff8e83;
  --err-soft: #321d19;
  --info: #b8a9ee;
  --info-dim: rgba(184,169,238,.12);
  --violet: #b8a9ee;
  --violet-soft: #211d30;
  --badge-live-bg: #172331;
  --badge-live-fg: #a1c9f7;
  --badge-next-bg: #2b2419;
  --badge-next-fg: #e8be84;
  --badge-refused-bg: #321d19;
  --badge-refused-fg: #ffaaa1;
  --globe-dot: #d6ff96;
  --globe-dot-back: rgba(200,250,114,.28);
  --globe-line: rgba(242,240,231,.10);
  --globe-glow: rgba(200,250,114,.16);
  --globe-arc: rgba(200,250,114,.5);
  --notice-bg: #23321b;
  --notice-ink: #f2f0e7;
  --shadow: 0 12px 32px -24px rgba(0,0,0,.5);
  --glow: 0 0 0 1px var(--brass-line);
  --font-ui: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: var(--font-ui);
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --display: var(--font-ui); --body: var(--font-ui); --sans: var(--font-ui); --mono: var(--font-mono);
  --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px;
  --radius-card: 12px; --radius-table: 8px; --radius-pill: 5px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --ground: #f7faf4;
  --panel: #ffffff;
  --surface: #ffffff;
  --surface-2: #edf3e7;
  --surface-3: #e2eadb;
  --bg: #f7faf4;
  --bg0: #f7faf4;
  --bg1: #ffffff;
  --bg2: #ffffff;
  --bg3: #edf3e7;
  --bg4: #e2eadb;
  --bg-alt: #edf3e7;
  --bg-code: #edf3e7;
  --bg-elev: #ffffff;
  --bg-elev-2: #edf3e7;
  --bg-glow: #ffffff;
  --bg-deep: #edf3e7;
  --fg: #17200f;
  --text: #17200f;
  --ink: #17200f;
  --fg-2: #35432b;
  --ink-2: #35432b;
  --text-dim: #35432b;
  --muted: #526348;
  --faint: #596951;
  --text-faint: #596951;
  --line: #d2ddc8;
  --line-strong: #8b9f7d;
  --line-soft: #e1e9d9;
  --accent: #446719;
  --accent-strong: #314e0e;
  --accent-hover: #314e0e;
  --accent-soft: #e8f1dc;
  --brass: #446719;
  --brass-bright: #314e0e;
  --brass-hi: #314e0e;
  --brass-deep: #314e0e;
  --brass-ink: #ffffff;
  --brass-dim: #e8f1dc;
  --brass-line: #9bb875;
  --brass-glow: rgba(68,103,25,.12);
  --on-accent: #ffffff;
  --link: #446719;
  --link-hover: #314e0e;
  --focus: #446719;
  --ok: #1d5fae;
  --ok-dim: #e3edf9;
  --ok-soft: #e3edf9;
  --ok-bg: #e3edf9;
  --ok-border: #1d5fae;
  --warn: #855013;
  --warn-dim: #fbefdd;
  --signal: #855013;
  --signal-text: #855013;
  --signal-soft: #fbefdd;
  --warn-bg: #fbefdd;
  --warn-border: #855013;
  --warn-bord: #855013;
  --crit: #a3231b;
  --crit-dim: #f9e6e3;
  --danger: #a3231b;
  --danger-bg: #f9e6e3;
  --danger-border: #a3231b;
  --err: #a3231b;
  --err-soft: #f9e6e3;
  --info: #574293;
  --info-dim: #eee8f9;
  --violet: #574293;
  --violet-soft: #eee8f9;
  --badge-live-bg: #e3edf9;
  --badge-live-fg: #1d5fae;
  --badge-next-bg: #fbefdd;
  --badge-next-fg: #855013;
  --badge-refused-bg: #f9e6e3;
  --badge-refused-fg: #a3231b;
  --globe-dot: #446719;
  --globe-dot-back: rgba(68,103,25,.28);
  --globe-line: rgba(23,32,15,.12);
  --globe-glow: rgba(68,103,25,.12);
  --globe-arc: rgba(68,103,25,.5);
  --notice-bg: #e8f1dc;
  --notice-ink: #17200f;
  --shadow: 0 12px 30px -24px rgba(23,32,15,.2);
  --glow: 0 0 0 1px var(--brass-line);
  color-scheme: light;
}

/* Product typography and interaction finish. Data and code retain mono faces. */
body { font-family: var(--font-ui); }
h1, h2, h3 { font-family: var(--font-ui); letter-spacing: -.035em; }
.wordmark, .wm-a, .wm-b { font-family: var(--font-ui); letter-spacing: -.045em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
::selection { color: var(--on-accent); background: var(--accent); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

:root, :root[data-theme] { --border: var(--line); --header-h: 80px; --nav-w: 270px; }
body { font-size: 16px; line-height: 1.65; }
.site-header { padding-inline: 28px; gap: 16px; }
.brand { align-items: center; gap: 10px; font-size: 23px; font-weight: 550; letter-spacing: -.045em; }
.brand .sub { font-size: 14px; letter-spacing: 0; }
.brand .mark { line-height: 0; }
.brand .mark svg { width: 32px; height: 32px; }
.header-links { font-size: 14px; }
.header-links a { color: var(--muted); }
.header-links a:hover { color: var(--accent); }
.icon-btn { min-height: 42px; font-size: 14px; border-radius: 6px; padding: 8px 13px; }
.sidenav { background: var(--panel); padding: 28px 20px; }
.sidenav h5 { font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; color: var(--muted); }
.sidenav a { font-size: 14px; padding-block: 9px; border-radius: 6px; }
main { padding-top: 122px; max-width: 1330px; }
h1 { font-size: clamp(2.2rem,3.5vw,3.6rem); font-weight: 500; letter-spacing: -.05em; line-height: 1.12; margin-bottom: 24px; }
h2 { font-size: 28px; font-weight: 500; margin-bottom: 22px; }
h3 { font-weight: 550; }
.lead { font-size: 18px; line-height: 1.65; max-width: 780px; color: var(--muted); }
main > section { padding-top: 26px; margin-top: 28px; }
main > section:first-child { padding-top: 0; margin-top: 0; }
.callout { padding: 21px 24px; border-radius: 8px; }
.table-wrap { border-radius: 10px; }
table { font-size: 14px; }
th, td { padding: 13px 16px; }
th { font-size: 12px; }
pre { padding: 24px; border-radius: 8px; border: 1px solid var(--line); font-size: 14px; }
.copy-btn { font-size: 12px; border-radius: 5px; }
.badge { font-size: 12px; font-weight: 500; padding: 3px 7px; }
.sig, .kv { font-size: 14px; }
.site-footer { padding-top: 32px; font-size: 14px; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; padding: 12px 18px; color: var(--on-accent); background: var(--accent); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
@media (max-width: 980px) { main { padding-top: 112px; } .site-header { padding-inline: 18px; } }
@media (max-width: 520px) { :root, :root[data-theme] { --header-h: 72px; } .site-header { gap: 8px; padding-inline: 12px; } .brand { font-size: 21px; } .brand .mark svg { width: 27px; height: 27px; } main { padding-top: 102px; } h1 { font-size: 34px; } h2 { font-size: 25px; } .callout { padding: 18px; } .icon-btn { padding-inline: 10px; } }
