/* =============================================================
   CitlaliBridge design system
   ----------------------------------------------------------------
   Every new rule is prefixed .cb-* so it can coexist with legacy
   inline <style> blocks in index.html and library.html while those
   pages are still running on the old classes. The original
   layout-styles.css content is preserved verbatim at the bottom of
   this file under LEGACY — do not remove until the homepage and
   library rewrites (execution steps 4 and 7) ship.
   ============================================================= */

/* -- Tokens ---------------------------------------------------- */
:root {
  /* Brand (locked) */
  --navy: #0a1f44;
  --blue: #1f4aa8;
  --red:  #b22234;

  /* Ink + neutrals */
  --ink:   #0f172a;
  --ink-2: #334155;
  --ink-3: #64748b;
  --muted: #475569;
  --line:        #e2e8f0;
  --line-strong: #d7e1f0;
  --bg:           #f7f8fb;
  --bg-legal:     #fbfaf6;
  --card:         #ffffff;
  --surface-soft: #f8fbff;
  --accent-soft:  #eef2ff;

  /* Status */
  --success: #15803d;
  --warn:    #b45309;

  /* Radius */
  --radius-sm:   8px;
  --radius:      14px;
  --radius-lg:   20px;
  --radius-pill: 999px;

  /* Shadow */
  --shadow-1: 0 1px 2px rgba(15,23,42,.05), 0 1px 3px rgba(15,23,42,.05);
  --shadow-2: 0 8px 24px rgba(15,23,42,.08);
  --shadow-3: 0 20px 48px rgba(15,23,42,.12);

  /* Spacing (4px base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* Typography */
  --text-xs:  12px;
  --text-sm:  13px;
  --text-base:15px;
  --text-md:  17px;
  --text-lg:  19px;
  --text-xl:  24px;
  --text-2xl: 30px;
  --text-3xl: 36px;

  /* Z-index */
  --z-nav:    40;
  --z-drawer: 9999;

  /* Nav */
  --nav-h: 64px;
}

/* -- Base (applies only where legacy doesn't override) ---------- */
body {
  font-size: var(--text-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.cb-page--legal { background: var(--bg-legal); }
strong { color: var(--ink); font-weight: 700; }

/* -- Typography helpers ---------------------------------------- */
.cb-eyebrow {
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #6077a7;
  margin: 0 0 var(--space-3);
}
.cb-lead {
  font-size: clamp(15px, 1.3vw, var(--text-md));
  color: var(--ink-2);
  line-height: 1.55;
  max-width: 68ch;
  margin: 0 0 var(--space-4);
}
.cb-h1 { color: var(--navy); font-weight: 900; line-height: 1.15; font-size: clamp(24px, 3.6vw, var(--text-3xl));  margin: 0 0 var(--space-3); }
.cb-h2 { color: var(--navy); font-weight: 900; line-height: 1.2;  font-size: clamp(20px, 2.4vw, var(--text-xl));   margin: 0 0 var(--space-3); }
.cb-h3 { color: var(--navy); font-weight: 800; line-height: 1.25; font-size: clamp(16px, 1.8vw, var(--text-md));   margin: 0 0 var(--space-2); }
.cb-muted { color: var(--muted); }

/* -- Layout primitives ----------------------------------------- */
.cb-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--space-5);
}
.cb-section          { padding: var(--space-8) 0; }
.cb-section--tight   { padding: var(--space-6) 0; }
.cb-section--tinted  { background: #fff; }
.cb-section--dark    { background: var(--navy); color: #cbd5e1; }
.cb-section--dark h1,
.cb-section--dark h2,
.cb-section--dark h3,
.cb-section--dark .cb-h1,
.cb-section--dark .cb-h2,
.cb-section--dark .cb-h3 { color: #fff; }
.cb-section--dark p,
.cb-section--dark li { color: #cbd5e1; }
.cb-section[id]      { scroll-margin-top: calc(var(--nav-h) + 16px); }

.cb-flagbar {
  height: 4px;
  background: linear-gradient(90deg, var(--red) 0 33%, #fff 33% 66%, var(--navy) 66% 100%);
}

.cb-grid-2, .cb-grid-3, .cb-grid-4 { display: grid; gap: var(--space-4); grid-template-columns: 1fr; }
@media (min-width: 720px)  { .cb-grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 720px)  { .cb-grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px)  { .cb-grid-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 720px)  { .cb-grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .cb-grid-4 { grid-template-columns: repeat(4, 1fr); } }

/* -- Nav -------------------------------------------------------- */
.cb-nav {
  position: sticky; top: 0; z-index: var(--z-nav);
  background: #0b1b3b;
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 10px 30px rgba(10,31,68,.12);
}
.cb-nav__inner {
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-3);
}
.cb-nav__brand {
  display: inline-flex; align-items: baseline; gap: 10px;
  color: #fff;
  font-weight: 900;
  font-size: var(--text-md);
  letter-spacing: .01em;
}
.cb-nav__links {
  display: none;
  gap: 2px; align-items: center;
  margin: 0 auto;
}
@media (min-width: 960px) { .cb-nav__links { display: flex; } }
.cb-nav__links a {
  font-size: var(--text-sm);
  color: rgba(255,255,255,.82);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: background .15s, color .15s;
}
.cb-nav__links a:hover,
.cb-nav__links a[aria-current="page"] {
  color: #fff;
  background: rgba(255,255,255,.08);
}

.cb-nav__cta { display: none; gap: var(--space-2); align-items: center; }
@media (min-width: 960px) { .cb-nav__cta { display: inline-flex; } }

.cb-nav__burger {
  display: inline-flex; flex-direction: column; gap: 4px;
  cursor: pointer; padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.06);
}
@media (min-width: 960px) { .cb-nav__burger { display: none; } }
.cb-nav__burger span { width: 20px; height: 2px; background: #fff; border-radius: 2px; }

/* Drawer (mobile) */
.cb-drawer {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: var(--z-drawer);
}
.cb-drawer[aria-hidden="false"] { display: block; }
.cb-drawer__sheet {
  position: fixed; right: 0; top: 0; bottom: 0;
  width: min(86vw, 360px);
  background: #fff;
  box-shadow: -2px 0 12px rgba(0,0,0,.15);
  display: flex; flex-direction: column;
}
.cb-drawer__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.cb-drawer__brand  { font-weight: 900; color: var(--navy); }
.cb-drawer__close  {
  background: none; border: 0; cursor: pointer;
  font-size: 22px; color: var(--ink-2);
  padding: 4px 10px;
}
.cb-drawer__links  { display: flex; flex-direction: column; padding: 10px; }
.cb-drawer__links a {
  padding: 12px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-weight: 600;
}
.cb-drawer__links a:hover { background: var(--accent-soft); }
.cb-drawer__sep    { height: 1px; background: var(--line); margin: 8px 10px; }
body.cb-drawer-open { overflow: hidden; }

/* -- Buttons ---------------------------------------------------- */
.cb-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--space-2);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-weight: 800; font-size: var(--text-sm);
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .05s;
  white-space: nowrap;
}
.cb-btn:active { transform: translateY(1px); }
.cb-btn--primary {
  background: var(--blue); color: #fff;
  border-color: var(--blue);
  box-shadow: 0 6px 18px rgba(31,74,168,.25);
}
.cb-btn--primary:hover { background: #1a3e90; border-color: #1a3e90; }
.cb-btn--secondary {
  background: #fff; color: var(--navy);
  border-color: var(--line-strong);
}
.cb-btn--secondary:hover { border-color: #b8c5df; }
.cb-btn--ghost {
  background: transparent; color: #fff;
  border-color: rgba(255,255,255,.28);
}
.cb-btn--ghost:hover { background: rgba(255,255,255,.08); }
.cb-btn--dark {
  background: var(--navy); color: #fff;
  border-color: var(--navy);
}
.cb-btn--dark:hover { background: #0b2354; }
.cb-btn--lg { padding: 14px 22px; font-size: var(--text-base); }

/* -- Pills / chips / tags --------------------------------------- */
.cb-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--navy);
  font-weight: 700; font-size: var(--text-xs);
}
.cb-pill-row { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.cb-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  border: 1px solid #dbeafe;
  color: var(--navy);
  font-weight: 800; font-size: var(--text-xs);
}
.cb-tag {
  display: inline-flex; align-items: center;
  padding: 4px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  color: var(--ink-2);
  font-weight: 600; font-size: var(--text-xs);
}
.cb-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  border: 1px solid #dbeafe;
  color: var(--navy);
  font-weight: 800; font-size: var(--text-xs);
  letter-spacing: .02em;
  text-transform: uppercase;
}
.cb-badge--ok   { background: #dcfce7; border-color: #bbf7d0; color: #166534; }
.cb-badge--warn { background: #fef3c7; border-color: #fde68a; color: #92400e; }

/* -- Cards ------------------------------------------------------ */
.cb-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: var(--space-5);
}
.cb-card--feature { padding: var(--space-5) var(--space-5) var(--space-6); }
.cb-card--feature .cb-card__icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--blue);
  margin-bottom: var(--space-4);
}
.cb-card__title {
  color: var(--navy);
  font-weight: 800;
  font-size: var(--text-md);
  margin: 0 0 var(--space-2);
}
.cb-card__desc { color: var(--muted); margin: 0; font-size: var(--text-base); }

.cb-card--link {
  display: block;
  transition: border-color .15s, box-shadow .15s, transform .05s;
}
.cb-card--link:hover {
  border-color: #c7d2fe;
  box-shadow: var(--shadow-2);
}
.cb-card--link:active { transform: translateY(1px); }

.cb-card--hero {
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fd 100%);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
}
.cb-card--hero h1,
.cb-card--hero .cb-h1 { max-width: 22ch; }
.cb-card--hero .cb-lead { max-width: 74ch; }

.cb-card--stat {
  background: linear-gradient(180deg, #0b1b3b 0%, var(--navy) 100%);
  color: #fff;
  border-color: var(--navy);
}
.cb-card--stat .cb-card__title { color: #fff; }
.cb-card--stat .cb-card__desc  { color: rgba(255,255,255,.78); }

/* -- Prose (legal + blog body) --------------------------------- */
.cb-prose-shell {
  display: grid; gap: var(--space-4);
  margin-top: var(--space-5);
}
.cb-prose-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 14px 40px rgba(15,23,42,.06);
  padding: var(--space-6);
}
.cb-prose-card h2 { font-size: var(--text-lg); margin: 0 0 var(--space-3); color: var(--navy); }
.cb-prose-card h3 { font-size: var(--text-md); margin: var(--space-5) 0 var(--space-2); color: var(--navy); }
.cb-prose-card p,
.cb-prose-card li { color: #5b6472; font-size: var(--text-base); line-height: 1.7; }
.cb-prose-card ul { margin: 0 0 var(--space-4); padding-left: 20px; }
.cb-prose-card li { margin: 4px 0; }
.cb-prose-card p + p { margin-top: var(--space-3); }
.cb-prose-card a  {
  color: var(--blue); font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}
.cb-prose-card a:hover { color: var(--navy); }

.cb-meta-strip {
  margin-top: var(--space-4);
  display: flex; flex-wrap: wrap; gap: var(--space-2);
}

.cb-contact-box {
  margin-top: var(--space-3);
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}
.cb-contact-box a { color: var(--navy); font-weight: 800; }

.cb-legal-shell { padding: var(--space-6) 0 var(--space-8); }
.cb-legal-shell .cb-card--hero h1 { max-width: 20ch; }
.cb-legal-shell .cb-card--hero .cb-lead { max-width: 74ch; }

/* -- Forms ------------------------------------------------------ */
.cb-form            { display: grid; gap: var(--space-4); }
.cb-form__row       { display: grid; gap: var(--space-4); grid-template-columns: 1fr; }
@media (min-width: 720px) { .cb-form__row { grid-template-columns: 1fr 1fr; } }
.cb-form__field     { display: flex; flex-direction: column; gap: 6px; }
.cb-form__label {
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.cb-form__input,
.cb-form__select,
.cb-form__textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  font: inherit;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.cb-form__textarea { min-height: 140px; resize: vertical; }
.cb-form__input:focus,
.cb-form__select:focus,
.cb-form__textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(31,74,168,.15);
}
.cb-form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cb-form__submit-row { display: flex; align-items: center; gap: var(--space-3); }
.cb-form__error { color: #b91c1c; font-size: var(--text-sm); }
.cb-form__ok    { color: #166534; font-size: var(--text-sm); }

/* -- Footer ----------------------------------------------------- */
.cb-footer {
  background: #0b1b3b;
  color: #cbd5e1;
  padding: var(--space-7) 0 var(--space-6);
}
.cb-footer__grid {
  display: grid; gap: var(--space-6);
  grid-template-columns: 1fr;
}
@media (min-width: 720px) { .cb-footer__grid { grid-template-columns: 1.3fr 1fr 1fr 1fr; } }
.cb-footer__brand     { font-weight: 900; color: #fff; font-size: var(--text-md); }
.cb-footer__sub       { color: rgba(255,255,255,.62); font-size: var(--text-xs); margin-top: 6px; }
.cb-footer__tagline   { color: rgba(255,255,255,.78); font-size: var(--text-sm); margin-top: 10px; max-width: 36ch; }
.cb-footer__col-title { font-weight: 800; color: #fff; font-size: var(--text-xs); letter-spacing: .1em; text-transform: uppercase; margin-bottom: var(--space-3); }
.cb-footer__list      { list-style: none; padding: 0; margin: 0; }
.cb-footer__list li   { margin: 6px 0; color: rgba(255,255,255,.78); font-size: var(--text-sm); }
.cb-footer__list a    { color: inherit; opacity: .92; }
.cb-footer__list a:hover { opacity: 1; text-decoration: underline; }
.cb-footer__bottom {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid rgba(255,255,255,.12);
  display: flex; flex-wrap: wrap; gap: var(--space-3);
  justify-content: space-between; align-items: center;
  font-size: var(--text-xs);
  color: rgba(255,255,255,.62);
}
.cb-footer__icons    { display: inline-flex; gap: 12px; }
.cb-footer__icons a {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.06);
  color: #fff;
}
.cb-footer__icons a:hover { background: rgba(255,255,255,.14); }

/* -- Accessibility --------------------------------------------- */
.cb-sr-only {
  position: absolute !important;
  width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important;
  overflow: hidden !important; clip: rect(0,0,0,0) !important;
  white-space: nowrap !important; border: 0 !important;
}
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 4px;
}

/* =============================================================
   LEGACY — preserved verbatim from the original layout-styles.css
   Do not edit. Retained so index.html and library.html continue
   rendering with their existing markup until execution steps 4
   and 7 rewrite them to use .cb-* classes.
   ============================================================= */

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color:var(--ink);
  background:var(--bg);
}
a{color:inherit;text-decoration:none}
img,svg{max-width:100%;height:auto;display:block}

.container{max-width:1120px;margin:0 auto;padding:0 18px}
.section{padding:56px 0}

.flagbar{height:6px;background:linear-gradient(90deg,#b22234 0 33%,#fff 33% 66%,#0a1f44 66% 100%)}
.ribbon{background:var(--navy);color:#fff;text-align:center;padding:10px 12px;font-size:13px;letter-spacing:.06em}

h1{margin:0 0 10px;font-size:clamp(28px,6vw,44px);line-height:1.15;font-weight:900;color:var(--navy)}
h2{margin:0 0 10px;font-size:clamp(22px,4.8vw,30px);line-height:1.2;font-weight:900;color:var(--navy)}
h3{margin:0 0 8px;font-size:clamp(16px,3.6vw,18px);line-height:1.25;font-weight:800;color:var(--navy)}
p,li{color:var(--muted);font-size:clamp(14px,3.5vw,16px);line-height:1.6}

.lead{margin-top:10px;color:var(--muted);font-size:clamp(16px,4vw,18px)}
.pill{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border:1px solid var(--line);border-radius:999px;background:#fff;color:var(--navy);font-weight:700;font-size:12px}
.pill-row{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}

/* NAV */
header{position:sticky;top:0;z-index:40;background:#fff;border-bottom:1px solid var(--line)}
.nav{height:64px;display:flex;align-items:center;justify-content:space-between;gap:12px}
.brand{display:flex;align-items:center;gap:10px}
.logo{width:34px;height:34px;border-radius:10px;background:linear-gradient(145deg,var(--navy),var(--blue));color:#fff;display:grid;place-items:center;font-weight:900}
.nav-links{display:none;gap:10px;align-items:center}
.nav-links a{font-size:14px;color:var(--muted);padding:8px 10px;border-radius:8px}
.nav-links a:hover{color:var(--navy);background:#f3f6ff}
.burger{display:inline-flex;flex-direction:column;gap:4px;cursor:pointer;padding:8px;margin-left:6px;border-radius:8px;border:1px solid var(--line);background:#fff}
.burger span{width:20px;height:2px;background:#334155;border-radius:2px}

/* DRAWER */
.drawer{display:none;position:fixed;inset:0;background:rgba(0,0,0,.35)}
.drawer .sheet{position:absolute;right:0;top:0;bottom:0;width:min(86vw,360px);background:#fff;box-shadow:-2px 0 12px rgba(0,0,0,.15);display:flex;flex-direction:column}
.sheet-header{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid var(--line)}
.sheet-links{display:flex;flex-direction:column;padding:10px}
.sheet-links a{padding:12px 10px;border-radius:10px;color:#334155}
.sheet-links a:hover{background:#f3f6ff}

/* HERO */
.hero{background:radial-gradient(1200px 400px at 10% 0%, #eaf0ff 0, #fff 60%, #fff 100%)}
.hero .wrap{padding:56px 0;display:grid;gap:20px}
@media(min-width:880px){.hero .wrap{grid-template-columns:1.1fr .9fr;gap:32px;align-items:center}}

/* CARDS / GRIDS */
.panel{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:0 2px 6px rgba(0,0,0,.04)}
.panel .hd{padding:14px 16px 6px;font-weight:800;font-size:16px;color:var(--navy)}
.panel .bd{padding:0 16px 16px}
.list{list-style:none;padding:0;margin:0}
.list li{display:flex;gap:10px;margin:8px 0}
.bullet{color:var(--blue);font-weight:900}
.grid-2{display:grid;gap:12px;grid-template-columns:1fr}
.grid-3{display:grid;gap:12px;grid-template-columns:1fr}
@media(min-width:720px){.grid-2{grid-template-columns:repeat(2,1fr)}}
@media(min-width:1024px){.grid-3{grid-template-columns:repeat(3,1fr)}}

/* FOOTER */
footer{background:#0b1b3b;color:#cbd5e1}
.footer{display:grid;gap:16px;padding:28px 0}
@media(min-width:900px){.footer{grid-template-columns:1fr 1fr 1fr}}
