/* BindX — Cool Slate & Steel Blue Design System
 * Shared across index.html, developers.html, architecture.html,
 * bindx.html, manager.html, and spoke.html.
 */

@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/instrument-sans-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans Fallback";
  src: local("Arial"), local("Helvetica"), local("Liberation Sans");
  size-adjust: 97%;
  ascent-override: 98%;
  descent-override: 25%;
  line-gap-override: 0%;
}

:root {
  --paper: #EEF1F6;
  --paper-2: #E3E8F0;
  --stone: #E3E8F0;
  --surface: #F7F9FC;
  --stage: #D8E2EE;
  --stage-2: #CDD9E8;
  --stage-border: rgba(15, 23, 42, 0.16);
  --ink: #0F172A;
  --ink-2: #334155;
  --muted: #556478;
  --line: rgba(15, 23, 42, 0.10);
  --line-strong: rgba(15, 23, 42, 0.20);

  /* Deep steel-navy showcase surfaces */
  --plate: #162032;
  --plate-2: #1E2C42;
  --plate-3: #273854;
  --plate-line: rgba(226, 236, 248, 0.14);
  --plate-line-strong: rgba(226, 236, 248, 0.26);
  --plate-ink: #F1F5F9;
  --plate-muted: #9DB0C9;

  /* Restrained 2-accent palette (no rainbows) */
  --cobalt: #1D4ED8;
  --cobalt-soft: rgba(29, 78, 216, 0.09);
  --cobalt-line: rgba(29, 78, 216, 0.28);

  --green: #046C4E;
  --green-bright: #10B981;
  --green-soft: rgba(4, 120, 87, 0.10);
  --green-line: rgba(4, 120, 87, 0.30);

  --red: #B42318;
  --red-soft: rgba(180, 35, 24, 0.10);
  --red-line: rgba(180, 35, 24, 0.30);

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 6px 18px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 34px rgba(15, 23, 42, 0.09);
  --shadow-dark: 0 24px 64px rgba(0, 0, 0, 0.34);

  --max: 1160px;
  --sans: "Instrument Sans", "Instrument Sans Fallback", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --radius: 16px;
  --radius-lg: 22px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--paper); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.58;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

/* Subtle architectural vertical hairline grid */
.alt-guides {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-left: 1px solid rgba(18, 20, 23, 0.055);
  border-right: 1px solid rgba(18, 20, 23, 0.055);
}
.alt-guides span { border-right: 1px solid rgba(18, 20, 23, 0.04); }
.alt-guides span:last-child { border-right: 0; }

nav, main, footer { position: relative; z-index: 1; }

a { color: var(--cobalt); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; }
code {
  font-family: var(--mono);
  font-size: 0.87em;
  background: rgba(18, 20, 23, 0.07);
  padding: 2px 6px;
  border-radius: 6px;
}

.skip {
  position: absolute; left: 12px; top: 12px; transform: translateY(-200%);
  background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px;
  font-weight: 600; z-index: 90; text-decoration: none;
}
.skip:focus { transform: none; }
.wrap { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }

/* ---------- Sticky Top Navigation ---------- */
nav.alt-nav, nav[aria-label="Primary"] {
  position: sticky; top: 0; z-index: 40;
  background: rgba(238, 241, 246, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; min-height: 64px; padding: 8px 0; flex-wrap: nowrap;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none; font-weight: 700;
  font-size: 1.06rem; letter-spacing: -0.03em; flex: 0 0 auto; white-space: nowrap;
}
.app-icon-sm { width: 30px; height: 30px; border-radius: 22%; display: block; }
.nav-center {
  display: flex; align-items: center; gap: 3px;
  background: var(--plate);
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(18, 20, 23, 0.25);
  box-shadow: 0 4px 14px rgba(18, 20, 23, 0.12);
  flex: 0 1 auto; min-width: 0; flex-wrap: nowrap;
  overflow-x: auto; scrollbar-width: none;
}
.nav-center::-webkit-scrollbar { display: none; }
.tab {
  appearance: none; border: 0; background: transparent; color: #B8C0CE;
  font: inherit; font-size: 0.86rem; font-weight: 500; border-radius: 999px;
  padding: 6px 13px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
  white-space: nowrap; flex: 0 0 auto;
  transition: background 0.16s ease, color 0.16s ease;
}
.tab:hover { color: #FFFFFF; }
.tab:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; }
.tab[aria-current="page"], .tab[aria-selected="true"] {
  color: var(--ink); background: var(--surface); font-weight: 650;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
}
.nav-sep { width: 1px; height: 16px; background: rgba(255, 255, 255, 0.16); margin: 0 4px; flex: 0 0 auto; }
.nav-short { display: none; }
.nav-app { display: inline-flex; align-items: center; gap: 6px; }
.nav-app-ic { width: 18px; height: 18px; border-radius: 22%; display: block; flex-shrink: 0; }
.nav-cta {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px;
  border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); text-decoration: none;
  font-size: 0.86rem; font-weight: 600; flex: 0 0 auto; white-space: nowrap;
  transition: border-color 0.16s ease, transform 0.16s ease;
}
.nav-cta:hover { border-color: var(--ink); transform: translateY(-1px); }
.nav-cta svg { width: 15px; height: 15px; fill: currentColor; flex-shrink: 0; }

/* Restrained single-accent page scroll bar */
.page-progress-track {
  position: absolute; left: 0; right: 0; bottom: 0; height: 2.5px;
  background: rgba(18, 20, 23, 0.06); overflow: hidden; pointer-events: none;
}
.page-progress-fill {
  height: 100%; width: 0%;
  background: var(--cobalt);
  transition: width 0.08s linear;
}

/* ---------- Editorial Chapter Meta & Typography ---------- */
.chapter-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-bottom: 14px; margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.band-dark .chapter-meta, section.band-plate .chapter-meta {
  border-bottom-color: var(--plate-line);
  color: var(--plate-muted);
}
.chapter-index { color: var(--cobalt); }
.band-dark .chapter-index, section.band-plate .chapter-index { color: var(--green-bright); }

h1, h2, h3, h4 { margin: 0; color: var(--ink); letter-spacing: -0.034em; line-height: 1.08; }
h1 { font-size: clamp(2.45rem, 5vw, 4rem); font-weight: 700; max-width: 16ch; }
h2 { font-size: clamp(1.85rem, 3.4vw, 2.7rem); font-weight: 700; line-height: 1.1; }
h3 { font-size: 1.2rem; font-weight: 650; line-height: 1.24; }
p { margin: 0; }
.lede { font-size: 1.1rem; line-height: 1.62; color: var(--ink-2); max-width: 54ch; }
.label-mono {
  font-family: var(--mono); font-size: 0.73rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}

/* ---------- Buttons & Chips ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 0.94rem; font-weight: 600; padding: 11px 20px;
  border-radius: 999px; cursor: pointer; text-decoration: none;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s var(--ease);
}
.btn:hover { border-color: var(--ink); transform: translateY(-1px); }
.btn:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; }
.btn.primary {
  background: var(--plate); color: #fff; border-color: var(--plate);
  box-shadow: 0 4px 14px rgba(18, 20, 23, 0.16);
}
.btn.primary:hover { background: var(--plate-2); border-color: var(--plate-2); }
.btn.bright { background: var(--green-bright); color: #051D10; border-color: transparent; }
.btn.bright:hover { background: #1EE280; }
.btn.ghost-dark {
  background: rgba(255, 255, 255, 0.08); color: #F2F4F7;
  border-color: rgba(255, 255, 255, 0.22);
}
.btn.ghost-dark:hover { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.45); }
.btn.sm { padding: 8px 15px; font-size: 0.85rem; }

.chip {
  appearance: none; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink-2); font: inherit; font-size: 0.85rem; font-weight: 550;
  padding: 7px 14px; border-radius: 999px; cursor: pointer; transition: all 0.16s ease;
}
.chip:hover { color: var(--ink); border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--plate); color: #fff; border-color: var(--plate); }

.band-dark .chip, .dark-card .chip {
  background: rgba(255, 255, 255, 0.06); color: var(--plate-muted); border-color: var(--plate-line-strong);
}
.band-dark .chip:hover, .dark-card .chip:hover { color: #fff; border-color: rgba(255, 255, 255, 0.45); }
.band-dark .chip[aria-pressed="true"], .dark-card .chip[aria-pressed="true"] {
  background: #F2F4F7; color: var(--plate); border-color: #F2F4F7; font-weight: 650;
}

/* ---------- Alternating Section Bands ---------- */
section { padding: 88px 0; scroll-margin-top: 72px; position: relative; }
section.band-stone, section.band-alt {
  background: var(--stone);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
section.band-dark, section.band-plate {
  background: var(--plate);
  color: var(--plate-ink);
  border-top: 1px solid rgba(0, 0, 0, 0.6);
  border-bottom: 1px solid rgba(0, 0, 0, 0.6);
}
section.band-dark h2, section.band-dark h3,
section.band-plate h2, section.band-plate h3 { color: var(--plate-ink); }
section.band-dark .lede, section.band-plate .lede { color: var(--plate-muted); }
section.band-dark code, section.band-plate code { background: rgba(255, 255, 255, 0.10); color: #E2E8F0; }

.section-head { max-width: 64ch; margin-bottom: 38px; }
.section-head p { margin-top: 12px; font-size: 1.06rem; color: var(--ink-2); }
section.band-dark .section-head p, section.band-plate .section-head p { color: var(--plate-muted); }

/* Matte charcoal contained card inside light sections */
.dark-card {
  background: var(--plate);
  color: var(--plate-ink);
  border: 1px solid rgba(18, 20, 23, 0.24);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-dark);
}
.dark-card h3 { color: var(--plate-ink); }
.dark-card code { background: rgba(255, 255, 255, 0.09); color: #E2E8F0; }

/* ---------- Unobstructed Device Frame ---------- */
.device {
  width: min(296px, 100%);
  padding: 9px;
  border-radius: 36px;
  background: #0B0D11;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(255, 255, 255, 0.12);
  position: relative;
}
.device-screen {
  border-radius: 27px;
  overflow: hidden;
  background: #060709;
  aspect-ratio: 720 / 1560;
}
.device-screen img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  transition: opacity 0.28s var(--ease);
}

/* ---------- Modality Chips ---------- */
.mod-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 0.7rem; font-weight: 600;
  padding: 3px 9px; border-radius: 999px; border: 1px solid;
  white-space: nowrap; flex-shrink: 0;
}
.mod-chip svg { width: 13px; height: 13px; fill: currentColor; }
.mod-text { color: #F59E0B; background: rgba(245, 158, 11, 0.14); border-color: rgba(245, 158, 11, 0.34); }
.mod-stt { color: #60A5FA; background: rgba(59, 130, 246, 0.14); border-color: rgba(59, 130, 246, 0.36); }
.mod-vision { color: #C4B5FD; background: rgba(139, 92, 246, 0.14); border-color: rgba(139, 92, 246, 0.36); }
.mod-tts { color: #34D399; background: rgba(16, 185, 129, 0.14); border-color: rgba(16, 185, 129, 0.36); }
.mod-image { color: #F472B6; background: rgba(236, 72, 153, 0.14); border-color: rgba(236, 72, 153, 0.36); }
.mod-tools { color: #38BDF8; background: rgba(56, 189, 248, 0.14); border-color: rgba(56, 189, 248, 0.36); }
.mod-omni { color: #E879F9; background: rgba(232, 121, 249, 0.14); border-color: rgba(232, 121, 249, 0.36); }

/* ---------- Scroll Progress Rails ---------- */
.section-progress { width: min(300px, 100%); display: grid; gap: 6px; }
.progress-rail {
  width: 100%; height: 4px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.14); overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0%; border-radius: 999px;
  background: var(--green-bright);
  transition: width 0.12s ease-out;
}
.progress-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-family: var(--mono); font-size: 0.72rem; color: var(--plate-muted);
}
.progress-skip {
  appearance: none; border: 0; background: none; padding: 0; font: inherit;
  color: #E2E8F0; font-weight: 600; cursor: pointer; text-decoration: underline;
}

/* ---------- Modals & Lightbox ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(10, 12, 16, 0.76); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.modal-backdrop[hidden] { display: none; }
.carousel-bar[hidden] { display: none !important; }
.modal-panel {
  background: var(--paper); color: var(--ink);
  width: min(980px, 100%); max-height: 90svh;
  border-radius: 22px; border: 1px solid var(--line-strong);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.48);
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-head {
  padding: 18px 24px; border-bottom: 1px solid var(--line);
  background: var(--surface);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.modal-head .btn { white-space: nowrap; flex: 0 0 auto; }
.modal-body {
  padding: 20px 24px; overflow-y: auto; display: grid; gap: 16px;
  scrollbar-width: thin;
}
.modal-foot {
  padding: 14px 24px; border-top: 1px solid var(--line);
  background: var(--surface);
  display: flex; justify-content: space-between; gap: 10px;
}

.shot-lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(10, 12, 16, 0.94);
  backdrop-filter: blur(10px); display: grid; grid-template-rows: auto 1fr auto;
  align-items: center; justify-items: center; padding: 16px; gap: 12px; color: #F2F4F7;
}
.shot-lightbox[hidden] { display: none; }
.lb-top { width: min(720px, 100%); display: flex; align-items: center; justify-content: space-between; font-family: var(--mono); font-size: 0.82rem; color: #9AA3B0; }
.lb-close, .lb-nav {
  appearance: none; border: 1px solid rgba(255, 255, 255, 0.22); background: rgba(255, 255, 255, 0.10);
  color: #F2F4F7; font: inherit; font-size: 0.86rem; font-weight: 600; padding: 7px 14px; border-radius: 999px; cursor: pointer;
}
.lb-nav:disabled { opacity: 0.35; cursor: default; }
.lb-stage { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 0; }
.lb-img { max-width: 92vw; max-height: 82vh; width: auto; height: auto; border-radius: 16px; }
.lb-foot { width: min(720px, 100%); display: grid; gap: 10px; justify-items: center; text-align: center; }
.lb-cap { font-size: 0.9rem; color: #CBD5E1; }
.lb-controls { display: flex; gap: 12px; }

/* ---------- Footer ---------- */
.site-foot {
  border-top: 1px solid var(--line);
  padding: 52px 0 38px; font-size: 0.9rem; color: var(--ink-2);
  background: var(--paper);
}
.site-foot .foot-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 28px; }
.site-foot h2 { font-size: 0.76rem; font-family: var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; font-weight: 600; }
.site-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.site-foot a { color: var(--ink); text-decoration: none; }
.site-foot a:hover { text-decoration: underline; }
.site-foot .repo-note { display: block; color: var(--muted); font-size: 0.78rem; }
.site-foot .foot-about p { margin: 6px 0 0; max-width: 46ch; }
.site-foot .foot-about a { color: var(--cobalt); text-decoration: underline; }
.site-foot .foot-legal {
  margin-top: 32px; padding-top: 18px; border-top: 1px dashed var(--line-strong);
  display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: space-between;
  color: var(--muted); font-size: 0.82rem;
}

/* ---------- Subtle Scroll Reveal ---------- */
[data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity 0.55s var(--ease), transform 0.55s var(--ease); }
[data-reveal].revealed { opacity: 1; transform: none; }

/* ---------- Responsive Shared ---------- */
@media (max-width: 1024px) {
  .nav-cta-long, .nav-app-label { display: none; }
  .nav-center .tab { padding: 6px 10px; font-size: 0.84rem; }
  .nav-center .nav-app { padding: 5px 7px; }
}
@media (max-width: 960px) {
  .site-foot .foot-grid { grid-template-columns: 1fr 1fr; }
  .site-foot .foot-about { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .nav-long { display: none; }
  .nav-short { display: inline; }
}
@media (max-width: 640px) {
  section { padding: 62px 0; }
  .nav-inner { gap: 8px; }
  .nav-sep, .brand-text, .nav-app-label, .nav-cta-short, .nav-cta-long { display: none; }
  .nav-long { display: none; }
  .nav-short { display: inline; }
  .nav-center { flex: 1 1 auto; justify-content: space-around; gap: 1px; padding: 3px 5px; }
  .nav-center .tab { font-size: 0.74rem; padding: 5px 7px; }
  .nav-app-ic { width: 17px; height: 17px; }
  .nav-cta { padding: 6px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}
