/* ============================================================================
   site-chrome.css — Anweshna site nav + footer, extracted from static/about.html
   ----------------------------------------------------------------------------
   Ported verbatim from about.html's inline <style> (nav 161-241, footer 416-423,
   portal/demo modal 428-456, tokens 127-142). Behaviour and appearance are
   identical; only the file location differs, so 56 blog pages can share one copy
   instead of inlining ~200 lines each.

   ⚠️ about.html still carries its OWN inline copy of these rules. It is frozen to
   head-tag edits, so it was not migrated. A change here must be mirrored there
   until the two are unified. See CLAUDE.md.

   ⚠️ NAMESPACING IS LOAD-BEARING, not cosmetic. The blog pages define their own
   `:root` (--navy/--teal/--light/--gray/--white/--card/--border) and their own
   `.container`, `nav.nav` and `footer.footer`. Four collisions had to be broken:

     --border      blogs define it as light #E2E8F0; the nav needs a dark
                   translucent rule -> all tokens here are prefixed --chr-*
     .container    on a blog page that is the 820px <main> -> .chrome-container
     nav {}        blogs already have <nav class="nav"> (the breadcrumb); a bare
                   element selector would turn it into a second sticky dark bar
                   -> every rule is scoped to nav.site-nav
     footer {}     blogs already have <footer class="footer"> -> footer.site-footer

   Do not "simplify" any of the above back to a bare element selector or an
   unprefixed token.
   ========================================================================== */

:root {
  --chr-border: rgba(255, 255, 255, .08);
  --chr-muted: #93a0bd;
  --chr-emerald: #34d399;
  --chr-grad: linear-gradient(135deg, #7c8cf0 0%, #9d6fe0 100%);
  --chr-pill: 999px;
  --chr-pad-m: 20px;
  --chr-pad-d: 48px;
}

.chrome-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--chr-pad-m);
}

@media (min-width: 900px) {
  .chrome-container { padding: 0 var(--chr-pad-d); }
}

/* ---------- NAV ---------- */
nav.site-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(8, 12, 24, .78);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--chr-border);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  line-height: 1.5;
}

nav.site-nav .chrome-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

nav.site-nav .logo {
  font-family: 'Didot', 'Bodoni MT', Georgia, serif;
  font-weight: 400;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

nav.site-nav .logo .logo-tagline {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  /* about.html uses .45, which measures 4.49:1 on this background — a WCAG AA
     failure for 10px text, confirmed by Lighthouse. Raised to .60 (7.28:1).
     This is the one deliberate visual divergence from the about.html original;
     the defect exists there too but is invisible to the audit because that
     page's footer has no explicit background for the checker to measure. */
  color: rgba(255, 255, 255, .60);
}

nav.site-nav .pill-btn.navbar-cta { display: none; }

@media (min-width: 860px) {
  nav.site-nav .pill-btn.navbar-cta { display: inline-flex; }
}

nav.site-nav .nav-links {
  display: none;
  align-items: center;
  gap: 28px;
}

@media (min-width: 860px) {
  nav.site-nav .nav-links { display: flex; }
}

nav.site-nav .nav-links a {
  color: rgba(255, 255, 255, .78);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color .2s;
}

nav.site-nav .nav-links a:hover { color: #fff; }
nav.site-nav .nav-links a.active { color: #fff; }

nav.site-nav .portal-pill {
  border: 1.5px solid #fff;
  border-radius: var(--chr-pill);
  padding: 6px 16px !important;
  transition: background .2s ease, color .2s ease;
}

nav.site-nav .portal-pill:hover { background: #fff; color: #0a0e1a !important; }
nav.site-nav .mobile-menu .portal-pill { display: inline-block; }

nav.site-nav .pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border-radius: var(--chr-pill);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  min-height: 44px;
  transition: transform .15s ease, box-shadow .15s ease, background .2s ease;
}

nav.site-nav .pill-btn.primary {
  background: var(--chr-grad);
  color: #0a0e1a;
  box-shadow: 0 6px 24px rgba(124, 140, 240, .35);
}

nav.site-nav .pill-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(124, 140, 240, .5);
}

nav.site-nav .pill-btn.ghost {
  background: rgba(255, 255, 255, .06);
  color: #fff;
  border: 1px solid var(--chr-border);
}

nav.site-nav .pill-btn.ghost:hover { background: rgba(255, 255, 255, .11); }

/* hamburger */
nav.site-nav .hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  align-items: center;
  background: transparent;
  border: 1px solid var(--chr-border);
  border-radius: 12px;
  cursor: pointer;
}

@media (min-width: 860px) {
  nav.site-nav .hamburger { display: none; }
}

nav.site-nav .hamburger span {
  width: 18px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform .25s ease, opacity .25s ease;
}

nav.site-nav .hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
nav.site-nav .hamburger.open span:nth-child(2) { opacity: 0; }
nav.site-nav .hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

nav.site-nav .mobile-menu {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 8px var(--chr-pad-m) 20px;
  border-bottom: 1px solid var(--chr-border);
  background: rgba(8, 12, 24, .96);
  backdrop-filter: blur(20px);
}

nav.site-nav .mobile-menu.open { display: flex; }

@media (min-width: 860px) {
  nav.site-nav .mobile-menu { display: none !important; }
}

nav.site-nav .mobile-menu a {
  color: rgba(255, 255, 255, .85);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  padding: 14px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
  min-height: 44px;
  display: flex;
  align-items: center;
}

nav.site-nav .mobile-menu .pill-btn { margin-top: 14px; width: 100%; }

/* ---------- FOOTER ---------- */
footer.site-footer {
  border-top: 1px solid var(--chr-border);
  padding: 40px 0;
  text-align: center;
  color: var(--chr-muted);
  font-size: 14px;
  background: #080c18;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  line-height: 1.5;
  margin-top: 0;
}

/* The blog stylesheet carries a bare `p{color:#2D3A4A}` rule for body copy on
   its light background. Inheritance loses to any direct element rule, so
   without this the footer's paragraphs rendered dark-slate on #080c18 —
   1.68:1, effectively invisible. Caught by Lighthouse, not by eye.
   Same collision class as the `nav`/`footer`/`.container` cases at the top of
   this file, but in the opposite direction: the page's rules leaking INTO the
   chrome rather than the chrome leaking out. Any bare element selector the
   host page defines must be re-asserted here. */
footer.site-footer p { color: var(--chr-muted); }
footer.site-footer a { color: var(--chr-muted); text-decoration: none; }
footer.site-footer a:hover { color: #c7cdfb; }

footer.site-footer .foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  justify-content: center;
  margin-top: 14px;
  font-size: 12.5px;
}

/* ---------- PORTAL / DEMO MODALS ----------
   Required by the nav: the Demo button's onclick="openDemoModal(event)" and the
   a[href="/portal/"] interception in site-chrome.js both target this markup.
   No blog class collides with these names, so they stay unscoped. */
.portal-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 5, 12, .7);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s cubic-bezier(.16, 1, .3, 1);
}

.portal-modal-overlay.active { opacity: 1; visibility: visible; }

.portal-modal {
  width: min(1160px, 94vw);
  aspect-ratio: 4/3;
  max-height: 92vh;
  background: #0d1428;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 50px 120px -20px rgba(0, 0, 0, .7);
  transform: scale(.96);
  transition: transform .35s cubic-bezier(.16, 1, .3, 1);
  border: 1px solid var(--chr-border);
}

.portal-modal.resizable {
  resize: both;
  overflow: hidden;
  min-width: 320px;
  min-height: 360px;
  max-width: 96vw;
}

.portal-modal-overlay.active .portal-modal { transform: scale(1); }

.portal-modal-titlebar {
  height: 38px;
  background: #141d3a;
  border-bottom: 1px solid var(--chr-border);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  flex-shrink: 0;
}

.portal-modal-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  padding: 0;
}

.portal-modal-btn.close { background: #ff5f56; }
.portal-modal-btn.minimize { background: #ffbd2e; }
.portal-modal-btn:hover { filter: brightness(.9); }
.portal-modal iframe { flex: 1; width: 100%; border: none; background: #0f1623; }

.portal-restore {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: none;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: #0a0e1a;
  padding: 12px 20px;
  border-radius: var(--chr-pill);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
  z-index: 1001;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
}

.portal-restore::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--chr-emerald);
}

.portal-restore.show { display: flex; }

/* ---------------------------------------------------------------------------
   Article-body helpers for static/Blogs/*.
   Namespaced on purpose. Bare `table`, `th`, `td` selectors would collide with
   whatever the host page already defines — the same class of bug that made the
   blogs' bare `p{color:#2D3A4A}` override the shared footer colour and render
   it at 1.68:1. Every colour here is an explicit hex, not a var, because the
   blog pages and the marketing pages do not share a token set.
   --------------------------------------------------------------------------- */

.chrome-table-wrap { overflow-x: auto; margin: 1.5rem 0; }

table.chrome-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: .95rem;
}

table.chrome-table th,
table.chrome-table td {
  text-align: left;
  padding: .7rem .85rem;
  border-bottom: 1px solid #E2E8F0;
  vertical-align: top;
  color: #2D3A4A;
}

table.chrome-table th {
  background: #F2F6FA;
  color: #0A1628;
  font-weight: 600;
  border-bottom: 2px solid #00C2A8;
}

table.chrome-table tr:last-child td { border-bottom: none; }

/* Distinct from .highlight: .highlight promotes a claim, .caveat-box withholds
   one. Amber rather than teal so the two never read as the same kind of note. */
.caveat-box {
  background: #FFFBF0;
  border-left: 4px solid #D99A00;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 0 8px 8px 0;
  color: #2D3A4A;
}

.caveat-box strong { color: #7A5600; }

.sources {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #E2E8F0;
  font-size: .9rem;
  color: #5A6A7A;
}

.sources h2 {
  font-size: 1.1rem;
  border-bottom: none;
  margin-bottom: .6rem;
  padding-bottom: 0;
}

.sources ol { margin-left: 1.25rem; }
.sources li { margin-bottom: .55rem; }
.sources a { color: #0F6E62; }
