/* ==========================================================================
   BantuNomics Equations — BTS-E100 registry
   Enterprise "standards registry" system. Unified with the gateway palette
   (navy #003087 / blue #005ea6), Inter + JetBrains Mono, restrained shadows,
   and the equation formula treated as an authoritative specimen plate.
   ========================================================================== */
:root {
  --navy: #003087;
  --blue: #005ea6;
  --light: #0070ba;
  --ink: #07142d;
  --slate: #33425d;
  --muted: #55637d;
  --line: #dbe6f4;
  --line2: #eaf0f8;
  --wash: #eef5ff;
  --panel: #ffffff;
  --bg: #f6f9fd;
  --bg2: #f0f5fb;
  --green: #0b6e4d;
  --gold: #86611b;
  --violet: #574bbd;
  --reserved: #64708a;
  --body: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --math: 'Cambria Math', 'STIX Two Math', 'Latin Modern Math', Cambria, Georgia, ui-serif, serif;
  --shadow: 0 1px 2px rgba(7,20,45,.04), 0 12px 28px -18px rgba(0,48,135,.22);
  --shadow-lg: 0 2px 6px rgba(7,20,45,.05), 0 30px 60px -32px rgba(0,48,135,.30);
  --radius: 14px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body);
  color: var(--slate);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
::selection { background: rgba(0,94,166,.16); }

/* ---- header ---- */
.bn-header {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 34px;
  background: rgba(255,255,255,.9);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand, .top-nav, .user-pill { display: flex; align-items: center; gap: 12px; }
.brand { font-weight: 900; font-size: 16px; letter-spacing: .02em; color: var(--navy); }
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}
.top-nav { flex-wrap: wrap; justify-content: center; }
.top-nav a {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate);
  padding: 8px 12px;
  border-radius: 999px;
  transition: background .15s, color .15s;
}
.top-nav a:hover { background: var(--wash); color: var(--navy); }
.user-pill { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.user-pill a {
  color: #fff;
  background: var(--blue);
  border-radius: 999px;
  padding: 9px 15px;
  font-weight: 700;
  transition: background .15s;
}
.user-pill a:hover { background: var(--navy); }
.subbar {
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  background: #fbfdff;
}
.subbar span:first-child {
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 11px;
}

/* ---- hero ---- */
.hero, .detail-hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 68px 24px 48px;
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(320px, .58fr);
  gap: 32px;
  align-items: center;
}
.detail-hero { padding-top: 48px; align-items: start; }
.eyebrow {
  margin: 0 0 14px;
  color: var(--light);
  text-transform: uppercase;
  letter-spacing: .15em;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--light);
  display: inline-block;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  color: var(--navy);
  font-size: clamp(38px, 5.2vw, 62px);
  line-height: 1.02;
  letter-spacing: -.035em;
  font-weight: 800;
  margin-bottom: 20px;
}
h2 {
  color: var(--navy);
  font-size: clamp(25px, 2.7vw, 36px);
  line-height: 1.08;
  letter-spacing: -.03em;
  font-weight: 800;
  margin-bottom: 12px;
}
h3 { color: var(--navy); font-size: 19px; letter-spacing: -.02em; font-weight: 700; margin-bottom: 8px; }
.lead {
  color: var(--slate);
  font-size: 18px;
  line-height: 1.62;
  max-width: 60ch;
  font-weight: 400;
}
.lead.muted { color: var(--muted); }
.muted { color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 28px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  min-height: 44px;
  padding: 0 20px;
  font-size: 13.5px;
  font-weight: 700;
  border: 1.5px solid transparent;
  transition: background .15s, border-color .15s, transform .15s, box-shadow .15s;
  cursor: pointer;
}
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--navy); }
.btn.secondary { background: #fff; color: var(--navy); border-color: var(--line); }
.btn.secondary:hover { border-color: var(--blue); color: var(--blue); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 12.5px; }
.btn.full { width: 100%; margin-top: 18px; }
.back-link {
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
}
.back-link:hover { color: var(--navy); }
.back-link::before { content: "\2190"; }

/* ---- panels (shared shell) ---- */
.hero-panel, .equation-card, .set-card, .family-block, .formula-panel,
.side-panel, .info-panel, .empty-panel, .run-panel, .notation-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.hero-panel {
  padding: 30px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--navy), var(--light));
}
.panel-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--light);
  font-family: var(--mono);
  font-weight: 700;
  margin-bottom: 12px;
}
.big-stat { font-size: 68px; line-height: .9; color: var(--navy); font-weight: 800; letter-spacing: -.04em; }
.big-stat.small { font-size: 54px; }
.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
  margin-top: 22px;
}
.metric-grid div {
  border: 1px solid var(--line2);
  border-radius: 11px;
  padding: 14px;
  background: var(--bg2);
}
.metric-grid strong { display: block; color: var(--navy); font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.metric-grid span { display: block; color: var(--muted); font-size: 11.5px; font-weight: 600; margin-top: 3px; }

/* ---- section scaffolding ---- */
.section, .band, .equation-detail {
  max-width: 1200px;
  margin: 0 auto;
  padding: 52px 24px;
}
.band {
  max-width: none;
  background: #fff;
  border-block: 1px solid var(--line);
}
.band > * { max-width: 1200px; margin-inline: auto; }
.section-head { margin-bottom: 28px; max-width: 65ch; }
.section-head p { color: var(--muted); line-height: 1.62; font-weight: 400; font-size: 15.5px; }
.section-head.split {
  max-width: none;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
}

/* ---- set cards ---- */
.set-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.set-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 24px;
  box-shadow: var(--shadow);
  position: relative;
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
a.set-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #c2d8f2; }
.set-card h3 { margin: 4px 0 0; }
.set-card p { color: var(--muted); line-height: 1.55; font-weight: 400; font-size: 14.5px; margin: 0; flex: 1; }
.set-card .status { margin-top: 4px; }

/* monospace id / template chips */
.set-id, .eq-id, .template {
  display: inline-flex;
  width: fit-content;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .02em;
  border-radius: 7px;
  padding: 5px 9px;
}
.set-id, .eq-id { color: var(--blue); background: var(--wash); border: 1px solid var(--line); }
.template { color: #33425d; background: #f1f5fa; border: 1px solid #e2e9f2; }
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  border: 1px solid;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.blue, .set-card.blue { border-color: #bcd8f6; }
.status.blue { color: var(--blue); background: #eef6ff; }
.status.green, .set-card.green { border-color: #b9e4cf; }
.status.green { color: var(--green); background: #eefaf4; }
.status.gold, .set-card.gold { border-color: #ecd29a; }
.status.gold { color: var(--gold); background: #fdf7e7; }
.status.violet, .set-card.violet { border-color: #d2ccf5; }
.status.violet { color: var(--violet); background: #f3f1fe; }
.status.reserved, .set-card.reserved { border-color: #d8dfea; }
.status.reserved { color: var(--reserved); background: #f6f8fb; }

/* ---- equation cards ---- */
.equation-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.equation-card {
  padding: 22px 26px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  grid-template-rows: auto auto 1fr;
  grid-template-areas:
    "top    formula"
    "title  formula"
    "meta   example";
  column-gap: 30px;
  align-items: start;
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.equation-card .card-top { grid-area: top; }
.equation-card h3 { grid-area: title; }
.equation-card .formula { grid-area: formula; align-self: center; }
.equation-card .example { grid-area: example; }
.equation-card .eq-meta { grid-area: meta; align-self: end; }
a.equation-card:hover, .equation-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #c2d8f2; }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.equation-card h3 { margin-bottom: 14px; }

/* formula specimen plate — the centerpiece */
.formula {
  font-family: var(--math);
  font-size: 24px;
  line-height: 1.28;
  color: var(--navy);
  background:
    linear-gradient(180deg, #fbfdff, #f4f8fe);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 22px;
  overflow-wrap: anywhere;
  position: relative;
  text-align: center;
  letter-spacing: .01em;
}
.formula::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--navy), var(--light));
}
.formula.huge {
  font-size: clamp(30px, 3.6vw, 50px);
  margin: 22px 0 18px;
  padding: 40px 32px;
  text-align: center;
  background:
    radial-gradient(120% 140% at 50% 0%, #0b3d86 0%, #072a63 55%, #05204d 100%);
  color: #eaf2ff;
  border-color: #0a2f66;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 20px 44px -24px rgba(0,32,77,.7);
}
.formula-panel .formula.huge::before {
  content: "FORMULA";
  position: absolute;
  left: 22px;
  top: 16px;
  width: auto;
  bottom: auto;
  background: none;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  font-weight: 700;
  color: rgba(190,214,247,.62);
}
.formula.huge::after {
  content: "";
  position: absolute;
  right: 16px;
  bottom: 14px;
  width: 26px;
  height: 26px;
  border-right: 1px solid rgba(190,214,247,.28);
  border-bottom: 1px solid rgba(190,214,247,.28);
  border-radius: 0 0 6px 0;
}
.example { color: var(--muted); margin: 14px 0 0; font-size: 14px; line-height: 1.5; font-weight: 500; font-family: var(--math); }
.notation-hint { color: var(--muted); margin-top: 14px; font-size: 12.5px; line-height: 1.6; }
.notation-hint b { color: var(--navy); font-family: var(--math); font-weight: 700; }
.notation-hint a { color: var(--light); font-weight: 700; }
.example.large { font-size: 18px; color: var(--slate); text-align: center; }
.eq-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 16px; }
.eq-meta span {
  color: var(--slate);
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
}

/* ---- notation ---- */
.notation-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.notation-card { padding: 18px; box-shadow: none; transition: border-color .15s, box-shadow .15s; }
.notation-card:hover { border-color: #c2d8f2; box-shadow: var(--shadow); }
.notation-card strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 46px;
  padding: 0 10px;
  color: var(--navy);
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: var(--math);
  font-size: 24px;
  margin-bottom: 12px;
}
.notation-card span { display: block; color: var(--muted); line-height: 1.5; font-weight: 400; font-size: 13.5px; }

/* ---- equation families (catalog) ---- */
.family-list { display: grid; gap: 18px; }
.family-block { padding: 24px; box-shadow: var(--shadow); }
.family-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line2);
}
.family-head h3 { margin: 8px 0 0; }
.family-head p { color: var(--muted); font-weight: 400; font-size: 14px; margin: 6px 0 0; max-width: 70ch; }
.compact-list { display: grid; gap: 8px; }
.compact-row {
  display: grid;
  grid-template-columns: 132px minmax(160px, .7fr) minmax(280px, 1.3fr);
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line2);
  background: #fff;
  border-radius: 11px;
  padding: 13px 14px;
  transition: border-color .14s, background .14s;
}
.compact-row:hover { border-color: #c2d8f2; background: #fafcff; }
.compact-row > span { font-family: var(--mono); color: var(--blue); font-weight: 700; font-size: 12.5px; }
.compact-row strong { color: var(--ink); font-weight: 600; font-size: 14.5px; }
.compact-row code { font-family: var(--math); font-size: 17px; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reserved-note { color: var(--reserved); font-weight: 600; }

/* ---- detail (equation.html) ---- */
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(290px, .65fr);
  gap: 18px;
  align-items: start;
}
.formula-panel, .side-panel, .info-panel, .empty-panel, .run-panel { padding: 28px; }
.formula-panel { box-shadow: var(--shadow-lg); }
.formula-panel h1 { font-size: clamp(28px, 3.2vw, 40px); margin-bottom: 0; }
.side-panel { box-shadow: var(--shadow); }
.side-panel dl { display: grid; gap: 0; margin: 16px 0 0; }
.side-panel dl div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--line2);
  padding: 12px 0;
}
.side-panel dl div:first-child { border-top: none; }
dt { color: var(--muted); font-size: 12.5px; font-weight: 600; }
dd { margin: 0; text-align: right; color: var(--ink); font-weight: 700; font-size: 13.5px; }
.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.info-panel { box-shadow: var(--shadow); }
.info-panel .eyebrow { margin-bottom: 10px; }
.info-panel h2 { font-size: 22px; margin-bottom: 12px; }
.info-panel p { color: var(--slate); line-height: 1.66; font-weight: 400; font-size: 15px; }
.empty-panel { box-shadow: none; background: var(--bg2); text-align: center; color: var(--muted); }

/* ---- lab ---- */
.run-panel { box-shadow: var(--shadow-lg); }
.lab-form {
  display: grid;
  grid-template-columns: minmax(180px, .5fr) 170px auto auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 22px;
}
.lab-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.lab-form input, .lab-form select {
  min-height: 46px;
  border-radius: 11px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--navy);
  padding: 0 14px;
  font-weight: 700;
  font-family: var(--body);
  transition: border-color .15s, box-shadow .15s;
}
.lab-form input:focus, .lab-form select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,94,166,.14);
}
.surface {
  color: var(--navy);
  font-size: clamp(40px, 6.4vw, 82px);
  line-height: .94;
  font-weight: 800;
  letter-spacing: -.03em;
  font-family: var(--math);
}
.parts { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.parts span {
  border: 1px solid var(--line);
  background: var(--wash);
  color: var(--navy);
  border-radius: 10px;
  padding: 9px 14px;
  font-weight: 700;
  font-family: var(--mono);
  font-size: 14px;
}
.steps { color: var(--slate); line-height: 1.7; font-weight: 400; padding-left: 20px; }
.steps li { margin-bottom: 6px; }

/* ---- responsive ---- */
@media (max-width: 1000px) {
  .hero, .detail-hero, .detail-grid, .two-col { grid-template-columns: 1fr; }
  .set-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .notation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compact-row { grid-template-columns: 1fr; gap: 6px; }
  .compact-row code { white-space: normal; }
  .section-head.split, .family-head { display: block; }
  .section-head.split .btn, .family-head .btn { margin-top: 16px; }
}
@media (max-width: 720px) {
  .bn-header { align-items: flex-start; flex-direction: column; padding: 14px 18px; }
  .top-nav { justify-content: flex-start; }
  .user-pill { width: 100%; justify-content: space-between; }
  .hero, .detail-hero { padding-top: 40px; }
  .equation-grid, .set-grid, .notation-grid, .metric-grid, .lab-form { grid-template-columns: 1fr; }
  .equation-card {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-template-areas:
      "top"
      "title"
      "formula"
      "example"
      "meta";
  }
  .formula.huge { padding: 28px 20px; }
}
