/* ============================================================
   Hermes Logios — shared standalone-page design system (site.css)
   ------------------------------------------------------------
   Consumed by every standalone static page that bypasses the
   compiled Next export (docs, ecosystem, legal). Defines the
   brand tokens + a small, restrained component vocabulary.

   Visual language: cyan #51DCFB accent on
   near-black, neutral grays. Cinzel display + IBM Plex Mono.

   LOAD ORDER: load this AFTER hermes/mechanics.css so the page's
   .hl-btn etc. win over the overlay-scoped versions. The reusable
   classes below are the contract other agents' pages reuse:
     .hl-topbar  .hl-page
     .hl-h1 .hl-h2 .hl-h3 .hl-lead
     .hl-card .hl-grid
     .hl-code  .hl-badge
     .hl-btn  .hl-btn--solid
     .hl-foot  .hl-kbd
   ============================================================ */

:root {
  --bg: #101010;
  --panel: #1b1c1d;
  --panel-2: #242629;
  --text: #f5f5f5;
  --muted: #a1a6aa;
  --accent: #51dcfb;
  --accent-dim: #296e7e;
  --green: #55f678;
  --border: #2f3337;
  --font-display: "Cinzel", serif;
  --font-mono: "IBM Plex Mono", monospace;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
}

/* ---------- base ---------- */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px; /* clears stat-bar (30) + topbar (~58) on anchor jumps */
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  margin: 0;
  padding-top: 30px; /* room for the live stat-bar widget */
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease, opacity 0.15s ease;
}
a:hover {
  color: #8be8ff;
}

p {
  margin: 0 0 1em;
}

code {
  font-family: var(--font-mono);
}

::selection {
  background: rgba(81, 220, 251, 0.28);
  color: #fff;
}

/* ---------- topbar (pinned under the 30px stat-bar) ---------- */
.hl-topbar {
  position: fixed;
  top: 30px;
  left: 0;
  right: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 58px;
  padding: 0 22px;
  background: rgba(16, 16, 16, 0.86);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.hl-topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
}
.hl-topbar__brand:hover {
  color: var(--text);
}
.hl-topbar__logo {
  width: 30px;
  height: 30px;
  display: block;
}
.hl-topbar__word {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hl-topbar__nav {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 26px;
}
.hl-topbar__link {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.hl-topbar__link:hover {
  color: var(--accent);
}

@media (max-width: 560px) {
  .hl-topbar {
    gap: 12px;
    padding: 0 14px;
  }
  .hl-topbar__nav {
    gap: 16px;
  }
  .hl-topbar__link {
    font-size: 11px;
  }
}

/* ---------- page shell ---------- */
.hl-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 88px 28px 96px; /* top clears the fixed topbar */
}

@media (max-width: 560px) {
  .hl-page {
    padding: 80px 16px 72px;
  }
}

/* ---------- typography helpers ---------- */
.hl-h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(34px, 6vw, 52px);
  line-height: 1.08;
  letter-spacing: 0.005em;
}
.hl-h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(24px, 3.4vw, 32px);
  line-height: 1.15;
  margin: 0 0 14px;
  scroll-margin-top: 96px;
}
.hl-h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  line-height: 1.25;
  margin: 0 0 8px;
}
.hl-lead {
  color: var(--muted);
  font-size: clamp(16px, 2.2vw, 19px);
  line-height: 1.65;
  max-width: 64ch;
}

.hl-muted {
  color: var(--muted);
}
.hl-accent {
  color: var(--accent);
}

/* ---------- cards + grid ---------- */
.hl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
  gap: 16px;
}

.hl-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 20px 22px;
  transition: border-color 0.18s ease, transform 0.18s ease,
    box-shadow 0.18s ease;
}
.hl-card:hover {
  border-color: var(--accent-dim);
  box-shadow: 0 0 50px -28px rgba(81, 220, 251, 0.55);
}
.hl-card__eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.hl-card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  margin: 0 0 8px;
}
.hl-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

/* ---------- code block ---------- */
.hl-code {
  display: block;
  background: #0c0c0c;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  margin: 0 0 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  overflow-x: auto;
  white-space: pre;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  tab-size: 2;
}
.hl-code::-webkit-scrollbar {
  height: 8px;
}
.hl-code::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
.hl-code .c {
  color: var(--accent);
} /* cyan token */
.hl-code .g {
  color: var(--green);
} /* green token */
.hl-code .d {
  color: var(--muted);
} /* dim / comment */

/* ---------- badge / pill ---------- */
.hl-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(81, 220, 251, 0.08);
  border: 1px solid rgba(81, 220, 251, 0.4);
  border-radius: 999px;
  padding: 4px 11px;
  line-height: 1;
}
.hl-badge--green {
  color: var(--green);
  background: rgba(85, 246, 120, 0.08);
  border-color: rgba(85, 246, 120, 0.4);
}
.hl-badge--muted {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border);
}

/* ---------- buttons ----------
   NOTE: mechanics.css also defines .hl-btn for overlay panels.
   site.css loads AFTER it, so these page-level styles win. Kept
   visually compatible (cyan outline) so there is no jarring shift. */
.hl-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(81, 220, 251, 0.06);
  border: 1px solid rgba(81, 220, 251, 0.45);
  border-radius: 8px;
  padding: 11px 18px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease,
    color 0.15s ease, transform 0.12s ease;
}
.hl-btn:hover {
  background: rgba(81, 220, 251, 0.14);
  border-color: var(--accent);
  color: var(--accent);
}
.hl-btn:active {
  transform: translateY(1px);
}
.hl-btn--solid {
  color: #06141a;
  background: var(--accent);
  border-color: var(--accent);
}
.hl-btn--solid:hover {
  color: #06141a;
  background: #6fe6ff;
  border-color: #6fe6ff;
}

/* ---------- keyboard key ---------- */
.hl-kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 2px 7px;
  line-height: 1;
  white-space: nowrap;
}

/* ---------- footer ---------- */
.hl-foot {
  border-top: 1px solid var(--border);
  margin-top: 64px;
  padding: 32px 28px 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.8;
}
.hl-foot a {
  color: var(--muted);
}
.hl-foot a:hover {
  color: var(--accent);
}
.hl-foot__row {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
}
.hl-foot__brand {
  color: var(--text);
  font-family: var(--font-display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.hl-foot__spacer {
  margin-left: auto;
}

/* ---------- small shared utilities ---------- */
.hl-divider {
  height: 1px;
  background: var(--border);
  border: 0;
  margin: 40px 0;
}
.hl-list {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}
.hl-list li {
  position: relative;
  padding: 7px 0 7px 26px;
  color: var(--text);
  border-bottom: 1px solid rgba(47, 51, 55, 0.55);
}
.hl-list li:last-child {
  border-bottom: 0;
}
.hl-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 16px;
  width: 6px;
  height: 6px;
  background: var(--accent);
  transform: rotate(45deg);
}

/* numbered step list (how-it-works / quickstart) */
.hl-steps {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
  counter-reset: hl-step;
}
.hl-steps > li {
  position: relative;
  counter-increment: hl-step;
  padding: 0 0 22px 52px;
  border-left: 1px solid var(--border);
  margin-left: 16px;
}
.hl-steps > li:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}
.hl-steps > li::before {
  content: counter(hl-step);
  position: absolute;
  left: -16px;
  top: -4px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  background: var(--bg);
  border: 1px solid var(--accent-dim);
  border-radius: 50%;
}
.hl-steps__t {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 5px;
}
.hl-steps p {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 10px;
}

/* stacked architecture diagram (the stack) */
.hl-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 6px;
}
.hl-layer {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 14px 18px;
}
.hl-layer__n {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  width: 28px;
  flex: 0 0 auto;
}
.hl-layer__name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  width: 168px;
  flex: 0 0 auto;
}
.hl-layer__desc {
  color: var(--muted);
  font-size: 13px;
}
@media (max-width: 640px) {
  .hl-layer {
    flex-wrap: wrap;
    gap: 4px 12px;
  }
  .hl-layer__name {
    width: auto;
  }
  .hl-layer__desc {
    flex-basis: 100%;
  }
}

/* metric tiles (analytics) */
.hl-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.hl-metric {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
}
.hl-metric__k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.hl-metric__v {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  color: var(--accent);
}

/* FAQ */
.hl-faq dt {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 6px;
}
.hl-faq dd {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}
.hl-note {
  background: rgba(248, 194, 79, 0.05);
  border: 1px solid rgba(248, 194, 79, 0.3);
  border-radius: 10px;
  padding: 16px 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}
.hl-note strong {
  color: #f8c24f;
}

/* ============================================================
   PHASE 4 — docs v2 components (tabs, code-copy, endpoints table,
   grouped sidebar, lead-in bullets). Match cyan/black aesthetic.
   ============================================================ */

/* ---------- grouped sidebar ---------- */
.hl-side-group {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-dim);
  margin: 22px 0 6px;
  padding-left: 14px;
}
.hl-side-group:first-of-type {
  margin-top: 4px;
}
@media (max-width: 820px) {
  /* in the horizontal mobile strip, group labels become inline dividers */
  .hl-side-group {
    display: inline-block;
    margin: 0 4px 0 10px;
    padding: 0;
    color: var(--border);
    font-size: 9px;
  }
  .hl-side-group::before {
    content: "·";
    margin-right: 8px;
  }
}

/* ---------- "what X is / is not" lead-in bullets ---------- */
.hl-isnot {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 18px 0 6px;
}
.hl-isnot__col {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px 20px;
}
.hl-isnot__col--is {
  border-left: 3px solid var(--green);
}
.hl-isnot__col--not {
  border-left: 3px solid var(--accent-dim);
}
.hl-isnot__h {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 12px;
}
.hl-isnot__col--is .hl-isnot__h {
  color: var(--green);
}
.hl-isnot__col--not .hl-isnot__h {
  color: var(--muted);
}
.hl-isnot ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.hl-isnot li {
  position: relative;
  padding: 6px 0 6px 20px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.55;
}
.hl-isnot li + li {
  border-top: 1px solid rgba(47, 51, 55, 0.5);
}
.hl-isnot li strong {
  font-weight: 600;
}
.hl-isnot__col--is li::before {
  content: "+";
  position: absolute;
  left: 2px;
  top: 6px;
  color: var(--green);
  font-family: var(--font-mono);
}
.hl-isnot__col--not li::before {
  content: "−";
  position: absolute;
  left: 2px;
  top: 6px;
  color: var(--muted);
  font-family: var(--font-mono);
}

/* ---------- endpoints table ---------- */
.hl-table-wrap {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin: 18px 0;
}
.hl-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 13px;
}
.hl-table th {
  text-align: left;
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
}
.hl-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(47, 51, 55, 0.5);
  vertical-align: top;
  color: var(--text);
}
.hl-table tr:last-child td {
  border-bottom: 0;
}
.hl-table tr:hover td {
  background: rgba(81, 220, 251, 0.03);
}
.hl-table__path {
  color: var(--accent);
  white-space: nowrap;
}
.hl-table__desc {
  font-family: var(--font-body);
  color: var(--muted);
  font-size: 13.5px;
}
.hl-method {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 5px;
  line-height: 1;
}
.hl-method--get {
  color: var(--green);
  background: rgba(85, 246, 120, 0.1);
  border: 1px solid rgba(85, 246, 120, 0.32);
}
.hl-method--post {
  color: var(--accent);
  background: rgba(81, 220, 251, 0.1);
  border: 1px solid rgba(81, 220, 251, 0.32);
}
@media (max-width: 600px) {
  .hl-table,
  .hl-table th,
  .hl-table td {
    font-size: 12px;
  }
  .hl-table th,
  .hl-table td {
    padding: 9px 11px;
  }
}

/* ---------- tabbed code block ---------- */
.hl-tabs {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #0c0c0c;
  margin: 0 0 20px;
}
.hl-codehead {
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.018);
  border-bottom: 1px solid var(--border);
  padding: 0 8px 0 0;
}
.hl-tab {
  appearance: none;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 12px 16px 10px;
  cursor: pointer;
  transition: color 0.14s ease, border-color 0.14s ease;
}
.hl-tab:hover {
  color: var(--text);
}
.hl-tab[aria-selected="true"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.hl-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.hl-codehead__spacer {
  margin-left: auto;
}
.hl-copy {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  margin: 7px 0;
  cursor: pointer;
  transition: color 0.14s ease, border-color 0.14s ease,
    background 0.14s ease;
}
.hl-copy:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
  background: rgba(81, 220, 251, 0.06);
}
.hl-copy.is-copied {
  color: var(--green);
  border-color: rgba(85, 246, 120, 0.4);
}
.hl-tabpanel {
  display: none;
}
.hl-tabpanel.is-active {
  display: block;
}
.hl-tabpanel pre {
  margin: 0;
  padding: 16px 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  overflow-x: auto;
  white-space: pre;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  tab-size: 2;
}
.hl-tabpanel pre::-webkit-scrollbar {
  height: 8px;
}
.hl-tabpanel pre::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
/* token tint inside tabbed code (reuses .c/.g/.d from .hl-code) */
.hl-tabpanel .c,
.hl-resp .c {
  color: var(--accent);
}
.hl-tabpanel .g,
.hl-resp .g {
  color: var(--green);
}
.hl-tabpanel .d,
.hl-resp .d {
  color: var(--muted);
}
.hl-tabpanel .s {
  color: #e8c97a;
} /* string literal tint */
.hl-resp .s {
  color: #e8c97a;
}

/* standalone response sample block (json) */
.hl-resp {
  display: block;
  background: #0c0c0c;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 0 0 20px;
  overflow: hidden;
}
.hl-resp__head {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.018);
}
.hl-resp pre {
  margin: 0;
  padding: 16px 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  overflow-x: auto;
  white-space: pre;
  tab-size: 2;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.hl-resp pre::-webkit-scrollbar {
  height: 8px;
}
.hl-resp pre::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

/* inline code chip inside prose */
.docs-content p code,
.hl-faq code,
.hl-card code,
.docs-content li code {
  background: rgba(81, 220, 251, 0.08);
  border: 1px solid rgba(81, 220, 251, 0.18);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 0.9em;
  color: #9fe9ff;
}

/* small two-up def grid used in Receipts / Agents */
.hl-deflist {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin: 18px 0;
}
.hl-deflist__k {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  padding: 12px 16px;
  border-bottom: 1px solid rgba(47, 51, 55, 0.5);
  border-right: 1px solid var(--border);
}
.hl-deflist__v {
  font-size: 14px;
  color: var(--muted);
  padding: 12px 16px;
  border-bottom: 1px solid rgba(47, 51, 55, 0.5);
}
.hl-deflist > :nth-last-child(1),
.hl-deflist > :nth-last-child(2) {
  border-bottom: 0;
}
@media (max-width: 560px) {
  .hl-deflist {
    grid-template-columns: 1fr;
  }
  .hl-deflist__k {
    border-right: 0;
    border-bottom: 0;
    padding-bottom: 0;
  }
}

/* section eyebrow when used as a decode target (keeps badge look) */
.hl-badge[data-scramble],
.hl-badge[data-scramble-in-view] {
  min-height: 1em;
}
