/* BB Financial Services — Design System
   Palette: pure black, pure white, brand grey #58595b
   Type: Newsreader (display), Inter Tight (UI/body), JetBrains Mono (data) */

:root {
  --bg: #000000;
  --bg-1: #0a0a0a;
  --bg-2: #141414;
  --bg-3: #1f1f1f;
  --line: #2a2a2c;
  --line-strong: #3a3a3c;
  --grey: #58595b;       /* brand grey */
  --grey-2: #8a8b8d;
  --grey-3: #b8b9bb;
  --fg-dim: #d4d4d6;
  --fg: #ffffff;

  --inv-bg: #ffffff;
  --inv-bg-1: #f4f4f5;
  --inv-line: #e3e3e5;
  --inv-fg: #000000;

  /* Brand: Deutschlander (display, condensed, all-caps) + Archivo (text). 
     Deutschlander has no Google Font; Oswald is the closest free analog. */
  --display: 'Oswald', 'Archivo Narrow', 'Helvetica Neue', sans-serif;
  --sans: 'Archivo', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --serif: var(--display); /* legacy alias for any remaining .h-display etc */

  --container: 1320px;
  --gutter: clamp(20px, 4vw, 64px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-feature-settings: 'ss01', 'cv11', 'tnum';
  font-variant-numeric: tabular-nums;
  line-height: 1.45;
  font-size: 16px;
  letter-spacing: -0.005em;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* layout */
.container { max-width: var(--container); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.section { padding-top: clamp(80px, 10vw, 160px); padding-bottom: clamp(80px, 10vw, 160px); }
.section-tight { padding-top: clamp(56px, 6vw, 96px); padding-bottom: clamp(56px, 6vw, 96px); }
.inv { background: var(--inv-bg); color: var(--inv-fg); }
.inv .rule { background: var(--inv-line); }
.inv .grey { color: var(--grey); }
.rule { height: 1px; background: var(--line); width: 100%; }
.rule-strong { height: 1px; background: var(--line-strong); }

/* type */
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--grey-2);
  font-weight: 500;
}
.inv .eyebrow { color: var(--grey); }
.h-display {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(56px, 9vw, 148px);
  line-height: 0.95;
  letter-spacing: -0.005em;
  text-transform: uppercase;
}
.h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(44px, 6vw, 88px);
  line-height: 1.0;
  letter-spacing: 0;
  text-transform: uppercase;
}
.h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(32px, 4vw, 56px);
  line-height: 1.05;
  letter-spacing: 0.005em;
  text-transform: uppercase;
}
/* When italic appears inside a display heading, drop to Archivo italic so
   it reads as a typographic counter-voice rather than condensed-italic. */
.h-display .italic, .h1 .italic, .h2 .italic {
  font-family: 'Archivo', sans-serif;
  font-weight: 300;
  font-style: italic;
  text-transform: none;
  letter-spacing: -0.015em;
}
.h3 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(20px, 1.6vw, 24px);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.lead {
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(16px, 1.2vw, 19px);
  line-height: 1.55;
  color: var(--fg-dim);
  max-width: 60ch;
}
.inv .lead { color: var(--grey); }
.italic { font-style: italic; }

.mono { font-family: var(--mono); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 22px;
  border: 1px solid var(--fg);
  background: var(--fg); color: var(--bg);
  font-family: var(--sans); font-weight: 500; font-size: 14px;
  letter-spacing: 0.01em;
  border-radius: 0;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-ghost {
  background: transparent; color: var(--fg); border-color: var(--line-strong);
}
.btn-ghost:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.inv .btn { background: var(--inv-fg); color: var(--inv-bg); border-color: var(--inv-fg); }
.inv .btn-ghost { background: transparent; color: var(--inv-fg); border-color: var(--inv-line); }
.inv .btn-ghost:hover { background: var(--inv-fg); color: var(--inv-bg); }

.btn .arrow {
  width: 14px; height: 14px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-top: -1px;
}

/* nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.nav-logo { display: flex; align-items: center; gap: 10px; font-family: var(--sans); font-weight: 600; letter-spacing: -0.01em; font-size: 15px; }
.nav-logo .mark { width: 28px; height: 28px; }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a { font-size: 14px; color: var(--grey-3); transition: color .15s ease; }
.nav-links a:hover, .nav-links a.active { color: var(--fg); }
.nav-cta { display: flex; align-items: center; gap: 14px; }
.nav-cta .btn { padding: 10px 16px; font-size: 13px; }

/* footer */
.footer { background: var(--bg); border-top: 1px solid var(--line); padding-top: 80px; padding-bottom: 32px; }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 48px; }
.footer h5 { font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--grey-2); font-weight: 500; margin: 0 0 18px; }
.footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer a { color: var(--fg-dim); font-size: 14px; }
.footer a:hover { color: var(--fg); }
.footer-bottom { display: flex; justify-content: space-between; padding-top: 32px; margin-top: 64px; border-top: 1px solid var(--line); font-size: 12px; color: var(--grey-2); }

/* utilities */
.row { display: flex; }
.col { display: flex; flex-direction: column; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; } .gap-32 { gap: 32px; } .gap-48 { gap: 48px; }
.between { justify-content: space-between; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-baseline { align-items: baseline; }
.tac { text-align: center; }
.tar { text-align: right; }

/* tweak panel */
.tweak-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 100;
  width: 280px;
  background: #0a0a0a; border: 1px solid var(--line-strong);
  padding: 16px; font-family: var(--sans);
  display: none;
}
.tweak-panel.open { display: block; }
.tweak-panel h4 { margin: 0 0 14px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--grey-2); font-weight: 500; }
.tweak-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.tweak-row:first-of-type { border-top: 0; }
.tweak-row label { color: var(--grey-3); }
.tweak-row select, .tweak-row button {
  background: #141414; color: var(--fg); border: 1px solid var(--line-strong); padding: 6px 10px; font-size: 12px; font-family: var(--sans); cursor: pointer;
}

/* responsive */
.logo-wordmark { display: flex; }
.nav-cities { display: inline; }
@media (max-width: 1180px) {
  .nav-cities { display: none; }
}
@media (max-width: 1040px) {
  .logo-wordmark { display: none; }
}
@media (max-width: 760px) {
  .nav-links { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* ==========================================================================
   Blog / Insights
   ========================================================================== */

.blog-card {
  cursor: pointer;
  display: block;
  text-decoration: none;
  color: inherit;
}
.blog-card:hover h2, .blog-card:hover h3 {
  color: var(--grey-3) !important;
}
.blog-card-featured:hover { background: rgba(255,255,255,0.02); }

/* Markdown body — rendered inside <article class="md-body"> */
.md-body {
  max-width: 68ch;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--fg-dim);
}
.md-body > * { margin-top: 0; margin-bottom: 1.25em; }
.md-body > :first-child { margin-top: 0; }
.md-body > :last-child { margin-bottom: 0; }

.md-body h2 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.1; letter-spacing: -0.02em;
  color: #fff;
  margin-top: 2em; margin-bottom: 0.6em;
  padding-top: 1em; border-top: 1px solid var(--line);
}
.md-body h2:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.md-body h3 {
  font-family: var(--sans); font-weight: 500;
  font-size: 20px; line-height: 1.3; letter-spacing: -0.01em;
  color: #fff;
  margin-top: 2em; margin-bottom: 0.5em;
}
.md-body h4 {
  font-family: var(--mono); font-weight: 500;
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--grey-2);
  margin-top: 1.8em; margin-bottom: 0.4em;
}
.md-body p { margin: 0 0 1.2em; }
.md-body p:has(+ ul), .md-body p:has(+ ol) { margin-bottom: 0.4em; }

.md-body strong { color: #fff; font-weight: 600; }
.md-body em { font-style: italic; color: var(--grey-3); }
.md-body a {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: var(--grey);
  text-underline-offset: 3px;
  transition: text-decoration-color .2s;
}
.md-body a:hover { text-decoration-color: #fff; }

.md-body code {
  font-family: var(--mono); font-size: 0.88em;
  background: var(--bg-2); border: 1px solid var(--line);
  padding: 1px 6px; border-radius: 2px;
  color: var(--fg);
}

.md-body ul, .md-body ol {
  margin: 0 0 1.4em; padding-left: 1.5em;
}
.md-body li {
  margin: 0.4em 0;
}
.md-body ul li::marker { color: var(--grey); }
.md-body ol li::marker { font-family: var(--mono); font-size: 0.85em; color: var(--grey-2); }

.md-body blockquote {
  margin: 1.6em 0;
  padding: 0 0 0 32px;
  border-left: 2px solid #fff;
  font-family: var(--display);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: #fff;
  font-style: normal;
}

.md-body hr {
  margin: 3em 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.md-table-wrap {
  margin: 1.8em 0;
  overflow-x: auto;
  border: 1px solid var(--line);
}
.md-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans); font-size: 13px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.md-table th {
  text-align: left;
  padding: 12px 16px;
  font-family: var(--mono); font-weight: 500;
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--grey-2);
  background: var(--bg-1);
  border-bottom: 1px solid var(--line-strong);
  vertical-align: top;
}
.md-table td {
  padding: 14px 16px;
  color: var(--fg-dim);
  border-top: 1px solid var(--line);
  vertical-align: top;
}
.md-table tr:first-child td { border-top: 0; }
.md-table td strong { color: #fff; }

@media (max-width: 900px) {
  .md-body { font-size: 16px; }
  section[style*="grid-template-columns: 240px 1fr"] { grid-template-columns: 1fr !important; }
}

/* ═══════════════════════════════════════════════════════════════════════
   Techy / professional animations
   ═══════════════════════════════════════════════════════════════════════ */
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(1.3); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes sweepLine {
  0%   { stroke-dashoffset: 1000; }
  100% { stroke-dashoffset: 0; }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes blinkCursor {
  0%, 50%   { opacity: 1; }
  51%, 100% { opacity: 0; }
}
@keyframes slideLeft {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.fade-in-up { animation: fadeInUp 900ms cubic-bezier(.2,.8,.2,1) both; }

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(28px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-28px); }
  to   { opacity: 1; transform: translateX(0); }
}
.slide-in-right { animation: slideInRight 420ms cubic-bezier(.2,.8,.2,1) both; }
.slide-in-left  { animation: slideInLeft 420ms cubic-bezier(.2,.8,.2,1) both; }
.animate-sweep path { stroke-dasharray: 1000; animation: sweepLine 2.4s ease-out forwards; }

/* Grid background — subtle technical grid for "terminal" feel */
.grid-bg {
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 24px 24px;
}
.grid-bg-light {
  background-image:
    linear-gradient(rgba(0,0,0,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.04) 1px, transparent 1px);
  background-size: 24px 24px;
}

.crosshair-card {
  position: relative;
}
.crosshair-card::before,
.crosshair-card::after {
  content: '';
  position: absolute;
  width: 10px; height: 10px;
  border-color: var(--grey-2);
  border-style: solid;
}
.crosshair-card::before {
  top: -1px; left: -1px;
  border-width: 1px 0 0 1px;
}
.crosshair-card::after {
  bottom: -1px; right: -1px;
  border-width: 0 1px 1px 0;
}
