/* ==========================================================================
   CodeBitMatrix — public site styles
   Layered on top of Bootstrap 5.3. Dark mode rides Bootstrap's
   [data-bs-theme] attribute so every component switches together.
   ========================================================================== */

/* --------------------------------- Tokens -------------------------------- */
:root {
  --cbm-primary: #6366f1;
  --cbm-primary-600: #4f46e5;
  --cbm-accent: #ec4899;
  --cbm-accent-2: #8b5cf6;
  --cbm-cyan: #06b6d4;

  --cbm-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  --cbm-gradient-soft: linear-gradient(135deg, rgba(99, 102, 241, .12), rgba(236, 72, 153, .10));

  /* Light theme: smoky white rather than pure white.
     Three levels, each a step darker, so cards still lift off the page:
       surface    cards, panels, nav, dropdowns
       surface-2  page background (must be darker than cards)
       surface-3  inset areas — inputs, chips, code, table hovers
     Kept a hair cool so it sits with the indigo/pink accents. */
  --cbm-surface: #f6f7f8;
  --cbm-surface-2: #eceef1;
  --cbm-surface-3: #e2e5ea;

  /* Borders need a touch more weight now the background is not white. */
  --cbm-border: rgba(15, 23, 42, .11);
  --cbm-border-strong: rgba(15, 23, 42, .18);

  --cbm-text: #0f172a;
  /* Darkened from #64748b: on #f6f7f8 that only reached 4.37:1, under the
     4.5:1 WCAG AA floor for body text. This is 5.5:1. */
  --cbm-muted: #5a6472;

  /* Glass panes tint to the surface, not to white — a white pane over a smoky
     page reads as a bright patch rather than frosted glass. */
  --cbm-glass-bg: rgba(246, 247, 248, .78);
  --cbm-glass-border: rgba(255, 255, 255, .55);
  --cbm-glass-blur: 18px;

  /* Bootstrap reads these for modals, dropdowns and offcanvas. Without them
     those components stay pure white and stand out against everything else. */
  --bs-body-bg: #eceef1;
  --bs-body-color: #0f172a;

  --cbm-shadow-sm: 0 2px 8px rgba(15, 23, 42, .05);
  --cbm-shadow: 0 10px 30px rgba(15, 23, 42, .08);
  --cbm-shadow-lg: 0 24px 60px rgba(15, 23, 42, .14);

  --cbm-radius: 18px;
  --cbm-radius-sm: 12px;
  --cbm-radius-lg: 26px;

  --cbm-ease: cubic-bezier(.22, 1, .36, 1);
  --cbm-header-h: 74px;
}

[data-bs-theme="dark"] {
  --cbm-surface: #0f1629;
  --cbm-surface-2: #0b1020;
  --cbm-surface-3: #161f38;
  --cbm-border: rgba(148, 163, 184, .16);
  --cbm-border-strong: rgba(148, 163, 184, .28);
  --cbm-text: #e8ecf6;
  --cbm-muted: #94a3b8;

  --cbm-glass-bg: rgba(22, 31, 56, .62);
  --cbm-glass-border: rgba(148, 163, 184, .18);

  --cbm-shadow-sm: 0 2px 8px rgba(0, 0, 0, .3);
  --cbm-shadow: 0 12px 34px rgba(0, 0, 0, .42);
  --cbm-shadow-lg: 0 28px 70px rgba(0, 0, 0, .55);

  --bs-body-bg: #0b1020;
  --bs-body-color: #e8ecf6;
}

/* --------------------------------- Base ---------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body.cbm-body {
  background: var(--cbm-surface-2);
  color: var(--cbm-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; height: auto; }

h1, h2, h3, h4, h5, h6 { font-weight: 700; letter-spacing: -.02em; line-height: 1.22; }

a { color: var(--cbm-primary); text-decoration-color: rgba(99, 102, 241, .35); text-underline-offset: 3px; }
a:hover { color: var(--cbm-primary-600); }

::selection { background: rgba(99, 102, 241, .25); }

:focus-visible {
  outline: 3px solid rgba(99, 102, 241, .55);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 2000;
  padding: 10px 18px; border-radius: 10px;
  background: var(--cbm-primary); color: #fff; font-weight: 600;
}

.cbm-main { min-height: 60vh; }

/* Reusable bits ------------------------------------------------------------ */
.glass {
  background: var(--cbm-glass-bg);
  border: 1px solid var(--cbm-glass-border);
  backdrop-filter: blur(var(--cbm-glass-blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--cbm-glass-blur)) saturate(150%);
}
@supports not (backdrop-filter: blur(1px)) {
  .glass { background: var(--cbm-surface); }
}

.cbm-gradient-text {
  background: var(--cbm-gradient);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

.cbm-card {
  background: var(--cbm-surface);
  border: 1px solid var(--cbm-border);
  border-radius: var(--cbm-radius);
  box-shadow: var(--cbm-shadow-sm);
  padding: 22px;
  transition: transform .45s var(--cbm-ease), box-shadow .45s var(--cbm-ease), border-color .3s;
}

.cbm-eyebrow {
  display: inline-block;
  font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--cbm-primary); text-decoration: none;
}

.cbm-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 16px; margin-bottom: 20px;
  font-size: .82rem; font-weight: 600;
  border-radius: 999px;
  background: var(--cbm-gradient-soft);
  border: 1px solid var(--cbm-border);
  color: var(--cbm-text);
}

.cbm-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .6);
  animation: cbm-pulse 2.4s infinite;
  display: inline-block;
}
@keyframes cbm-pulse {
  70%  { box-shadow: 0 0 0 9px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* --------------------------------- Buttons -------------------------------- */
.cbm-btn-gradient {
  position: relative; overflow: hidden;
  background: var(--cbm-gradient);
  background-size: 200% 200%;
  color: #fff !important;
  border: 0; border-radius: 12px;
  font-weight: 600;
  padding: .62rem 1.35rem;
  box-shadow: 0 8px 22px rgba(99, 102, 241, .32);
  transition: transform .3s var(--cbm-ease), box-shadow .3s, background-position .6s;
}
.cbm-btn-gradient:hover {
  background-position: 100% 0;
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(99, 102, 241, .42);
  color: #fff !important;
}
.cbm-btn-gradient:active { transform: translateY(0); }
/* Sheen sweep */
.cbm-btn-gradient::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .32) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .8s var(--cbm-ease);
}
.cbm-btn-gradient:hover::after { transform: translateX(120%); }

.cbm-btn-ghost {
  background: transparent;
  color: var(--cbm-text);
  border: 1px solid var(--cbm-border-strong);
  border-radius: 12px;
  font-weight: 600;
  padding: .6rem 1.25rem;
  transition: background .25s, border-color .25s, transform .3s var(--cbm-ease), color .25s;
}
.cbm-btn-ghost:hover {
  background: var(--cbm-surface-3);
  border-color: var(--cbm-primary);
  color: var(--cbm-primary);
  transform: translateY(-2px);
}

.cbm-btn-light { background: #fff; color: #4f46e5 !important; border: 0; border-radius: 12px; font-weight: 700; }
.cbm-btn-light:hover { background: #f1f5ff; transform: translateY(-2px); }
.cbm-btn-outline-light {
  background: transparent; color: #fff !important;
  border: 1px solid rgba(255, 255, 255, .5); border-radius: 12px; font-weight: 600;
}
.cbm-btn-outline-light:hover { background: rgba(255, 255, 255, .14); }

.cbm-icon-btn {
  display: inline-grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--cbm-surface-3);
  border: 1px solid var(--cbm-border);
  color: var(--cbm-text);
  transition: background .25s, color .25s, transform .3s var(--cbm-ease);
}
.cbm-icon-btn:hover { background: var(--cbm-primary); color: #fff; transform: translateY(-2px); }

/* Theme toggle icon swap */
.theme-icon-light { display: none; }
[data-bs-theme="dark"] .theme-icon-dark { display: none; }
[data-bs-theme="dark"] .theme-icon-light { display: inline; }

/* --------------------------------- Header --------------------------------- */
.cbm-header {
  position: sticky; top: 0; z-index: 1030;
  transition: box-shadow .35s, background .35s;
}
.cbm-nav {
  background: var(--cbm-glass-bg);
  /* The header is fixed while content moves behind it, so this blur is
     re-rasterised on every scroll frame. Kept modest for that reason. */
  backdrop-filter: blur(11px) saturate(140%);
  -webkit-backdrop-filter: blur(11px) saturate(140%);
  border-bottom: 1px solid var(--cbm-border);
  padding-block: .7rem;
  transition: padding .35s var(--cbm-ease);
}
.cbm-header.is-scrolled .cbm-nav { padding-block: .35rem; box-shadow: var(--cbm-shadow); }

.cbm-brand { display: inline-flex; align-items: center; gap: 10px; }
.cbm-brand-mark { display: inline-grid; place-items: center; }
.cbm-brand-text { font-weight: 800; font-size: 1.16rem; letter-spacing: -.03em; color: var(--cbm-text); }

.cbm-nav .nav-link {
  position: relative;
  font-weight: 600; color: var(--cbm-text);
  padding: .5rem .9rem; border-radius: 10px;
  transition: color .25s, background .25s;
}
.cbm-nav .nav-link::after {
  content: ""; position: absolute; left: 50%; bottom: 4px;
  width: 0; height: 2px; border-radius: 2px;
  background: var(--cbm-gradient);
  transform: translateX(-50%);
  transition: width .35s var(--cbm-ease);
}
.cbm-nav .nav-link:hover, .cbm-nav .nav-link.active { color: var(--cbm-primary); }
.cbm-nav .nav-link:hover::after, .cbm-nav .nav-link.active::after { width: 60%; }

.cbm-avatar-btn {
  background: none; border: 0; padding: 0;
  border-radius: 50%;
}
.cbm-avatar-btn::after { display: none; }
.cbm-avatar-btn img { border-radius: 50%; object-fit: cover; border: 2px solid var(--cbm-border); }

.cbm-avatar-initials {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; flex: 0 0 auto;
  border-radius: 50%;
  background: var(--cbm-gradient);
  color: #fff; font-weight: 700; font-size: .95rem;
  letter-spacing: .02em;
}
.cbm-avatar-initials.sm { width: 32px; height: 32px; font-size: .78rem; }
.cbm-avatar-initials.lg { width: 72px; height: 72px; font-size: 1.5rem; }
.cbm-avatar-initials.xl { width: 104px; height: 104px; font-size: 2.1rem; }

.cbm-dropdown {
  border: 1px solid var(--cbm-border);
  border-radius: var(--cbm-radius-sm);
  box-shadow: var(--cbm-shadow);
  background: var(--cbm-surface);
  padding: 6px;
  min-width: 232px;
}
.cbm-dropdown .dropdown-item { border-radius: 9px; font-size: .92rem; padding: .5rem .75rem; }

/* --------------------------- Tools nav dropdown ---------------------------
   Everything here is scoped to .cbm-tools-menu: .cbm-tool-name already exists
   as the heading on the tool cards, and unscoped rules would leak into it. */
.cbm-tools-menu { min-width: 304px; padding: 8px; }

.cbm-tools-menu .cbm-navtool { display: flex; align-items: flex-start; gap: .6rem; white-space: normal; }
.cbm-tools-menu .cbm-navtool > .bi {
  flex: 0 0 auto;
  display: inline-grid; place-items: center;
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--cbm-gradient-soft);
  color: var(--cbm-primary);
  font-size: .95rem;
}
.cbm-tools-menu .cbm-navtool-name { display: block; font-weight: 600; line-height: 1.25; }
.cbm-tools-menu .cbm-navtool-tag {
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: .78rem; line-height: 1.3; margin-top: .1rem;
  color: var(--cbm-muted);
}

/* Open on hover, but only where hovering is real. Touch and the collapsed
   mobile navbar keep Bootstrap's click behaviour, and :focus-within means the
   keyboard opens it too. */
@media (hover: hover) and (min-width: 992px) {
  .cbm-nav-drop > .dropdown-menu { margin-top: .4rem; }
  .cbm-nav-drop > .dropdown-menu::before {
    content: ""; position: absolute;
    top: -.4rem; left: 0; right: 0; height: .4rem;
  }
  .cbm-nav-drop:hover > .dropdown-menu,
  .cbm-nav-drop:focus-within > .dropdown-menu { display: block; }
}

/* ------------------------------ Progress bars ----------------------------- */
.cbm-progress, .cbm-read-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  z-index: 1080; pointer-events: none; background: transparent;
}
.cbm-progress span, .cbm-read-progress span {
  display: block; height: 100%; width: 0;
  background: var(--cbm-gradient);
  transition: width .15s linear;
}
.cbm-read-progress { top: var(--cbm-header-h); }

/* --------------------------------- Hero ----------------------------------- */
.cbm-hero { position: relative; padding: clamp(56px, 9vw, 108px) 0 clamp(64px, 10vw, 116px); overflow: hidden; }
.cbm-hero-bg, .cbm-page-header-bg {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
  /* Stops the orbs' blur from invalidating paint outside this box while
     the page scrolls. */
  contain: layout paint;
}

.cbm-orb {
  position: absolute; border-radius: 50%;
  filter: blur(70px); opacity: .5;
  /* will-change is applied by the parallax script only while it is actually
     animating. Leaving it on permanently keeps three large blurred layers
     on the GPU for the whole session, which costs more than it saves. */
}
.cbm-orb.orb-1 { width: 420px; height: 420px; top: -110px; left: -80px;  background: radial-gradient(circle, #6366f1, transparent 70%); }
.cbm-orb.orb-2 { width: 360px; height: 360px; top: 40px;   right: -70px; background: radial-gradient(circle, #ec4899, transparent 70%); }
.cbm-orb.orb-3 { width: 300px; height: 300px; bottom: -90px; left: 42%;  background: radial-gradient(circle, #06b6d4, transparent 70%); }
[data-bs-theme="dark"] .cbm-orb { opacity: .35; }

.cbm-grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, var(--cbm-border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--cbm-border) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 40%, transparent 100%);
  opacity: .6;
}

.cbm-hero-title {
  font-size: clamp(2.1rem, 5.2vw, 3.65rem);
  font-weight: 800; letter-spacing: -.035em;
  margin-bottom: 18px;
}
.cbm-hero-lede { font-size: clamp(1.02rem, 1.6vw, 1.16rem); color: var(--cbm-muted); max-width: 56ch; margin-bottom: 30px; }

.cbm-stats-row { display: flex; flex-wrap: wrap; gap: clamp(20px, 4vw, 44px); }
.cbm-stats-row.compact { gap: 24px; }
.cbm-stat { display: flex; flex-direction: column; }
.cbm-stat-value { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; line-height: 1.1;
  background: var(--cbm-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cbm-stat-label { font-size: .8rem; color: var(--cbm-muted); font-weight: 600; }

/* Hero carousel ----------------------------------------------------------- */
.cbm-hero-swiper {
  border-radius: var(--cbm-radius-lg);
  /* Slides sit outside this box before and after the active one, so the
     rounded corners need to clip them. */
  overflow: hidden;
}
.cbm-hero-swiper .swiper-slide {
  height: auto;
  /* No opacity rules here. An earlier version faded inactive slides out,
     which hid every slide when the effect changed to sliding. Swiper handles
     visibility itself. */
}

/* Controls sit below the card so they never cover the headline or the image. */
.cbm-hero-swiper-nav {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin-top: 16px;
}
.cbm-hero-prev, .cbm-hero-next {
  display: grid; place-items: center;
  width: 38px; height: 38px; flex: 0 0 auto;
  border-radius: 11px;
  background: var(--cbm-surface); border: 1px solid var(--cbm-border);
  color: var(--cbm-text); font-size: 1rem;
  box-shadow: var(--cbm-shadow-sm);
  transition: all .25s var(--cbm-ease);
}
.cbm-hero-prev:hover, .cbm-hero-next:hover {
  background: var(--cbm-gradient); color: #fff; border-color: transparent;
  transform: translateY(-2px);
}
.cbm-hero-prev.swiper-button-disabled,
.cbm-hero-next.swiper-button-disabled { opacity: .4; pointer-events: none; }

.cbm-hero-pagination { display: flex; align-items: center; gap: 7px; }
.cbm-hero-bullet {
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--cbm-border-strong); border: 0; padding: 0;
  cursor: pointer;
  transition: all .3s var(--cbm-ease);
}
.cbm-hero-bullet-active { width: 26px; background: var(--cbm-gradient); }

.cbm-hero-card { border-radius: var(--cbm-radius-lg); overflow: hidden; box-shadow: var(--cbm-shadow-lg); position: relative; }
.cbm-hero-media { display: block; aspect-ratio: 16 / 9; overflow: hidden; }
.cbm-hero-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--cbm-ease); }
.cbm-hero-card:hover .cbm-hero-media img { transform: scale(1.05); }
.cbm-hero-card-body { padding: 24px; }

.cbm-scroll-cue {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  width: 24px; height: 40px; border: 2px solid var(--cbm-border-strong); border-radius: 14px;
}
.cbm-scroll-cue span {
  position: absolute; top: 8px; left: 50%; width: 4px; height: 8px; border-radius: 2px;
  background: var(--cbm-primary); transform: translateX(-50%);
  animation: cbm-scroll 1.9s infinite;
}
@keyframes cbm-scroll { 0% { opacity: 0; top: 8px; } 40% { opacity: 1; } 80% { opacity: 0; top: 22px; } }

/* -------------------------------- Sections -------------------------------- */
.cbm-section { padding: clamp(52px, 7vw, 88px) 0; position: relative; }
.cbm-section-alt { background: var(--cbm-surface); border-block: 1px solid var(--cbm-border); }

.cbm-section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 34px;
}
.cbm-section-title { font-size: clamp(1.5rem, 3vw, 2.1rem); margin: 4px 0 0; }

.cbm-link-arrow { font-weight: 600; text-decoration: none; white-space: nowrap; }
.cbm-link-arrow i { transition: transform .3s var(--cbm-ease); display: inline-block; }
.cbm-link-arrow:hover i { transform: translateX(5px); }

/* --------------------------------- Cards ---------------------------------- */
.cbm-post-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; height: 100%; }
.cbm-post-card:hover { transform: translateY(-7px); box-shadow: var(--cbm-shadow-lg); border-color: rgba(99, 102, 241, .35); }

.cbm-post-media { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--cbm-surface-3); }
.cbm-post-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--cbm-ease); }
.cbm-post-card:hover .cbm-post-media img { transform: scale(1.07); }

.cbm-badge-featured, .cbm-badge-status {
  position: absolute; top: 12px; left: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  font-size: .72rem; font-weight: 700;
  background: var(--cbm-gradient); color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, .35);
}
.cbm-badge-featured.static { position: static; }
.cbm-badge-status { left: auto; right: 12px; background: #f59e0b; text-transform: capitalize; }

.cbm-post-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.cbm-post-title { font-size: 1.08rem; margin: 0 0 8px; line-height: 1.35; }
.cbm-post-title a { color: var(--cbm-text); text-decoration: none; background-image: var(--cbm-gradient);
  background-size: 0 2px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size .4s var(--cbm-ease); }
.cbm-post-title a:hover { background-size: 100% 2px; color: var(--cbm-primary); }
.cbm-post-excerpt { color: var(--cbm-muted); font-size: .92rem; flex: 1; margin-bottom: 14px; }

.cbm-post-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-top: 13px; border-top: 1px solid var(--cbm-border);
}
.cbm-author { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--cbm-text); font-size: .86rem; font-weight: 600; }
.cbm-author img { border-radius: 50%; object-fit: cover; }

.cbm-post-meta { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: .8rem; color: var(--cbm-muted); margin: 0; }
.cbm-post-meta span { display: inline-flex; align-items: center; gap: 5px; }

.cbm-chip {
  display: inline-flex; align-items: center;
  padding: 4px 12px; border-radius: 999px;
  font-size: .74rem; font-weight: 700; text-decoration: none;
  color: var(--chip-color, var(--cbm-primary));
  background: color-mix(in srgb, var(--chip-color, #6366f1) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--chip-color, #6366f1) 30%, transparent);
  transition: background .25s;
}
.cbm-chip:hover { background: color-mix(in srgb, var(--chip-color, #6366f1) 26%, transparent); color: var(--chip-color, var(--cbm-primary)); }

/* Compact card (sidebars) */
.cbm-post-compact { display: flex; gap: 12px; align-items: flex-start; }
.cbm-post-compact-media { flex: 0 0 88px; border-radius: 10px; overflow: hidden; }
.cbm-post-compact-media img { width: 88px; height: 66px; object-fit: cover; }
.cbm-post-compact-title { font-size: .9rem; margin: 3px 0 5px; line-height: 1.35; }
.cbm-post-compact-title a { color: var(--cbm-text); text-decoration: none; }
.cbm-post-compact-title a:hover { color: var(--cbm-primary); }

/* -------------------------------- Widgets --------------------------------- */
.cbm-sidebar { position: sticky; top: calc(var(--cbm-header-h) + 18px); display: grid; gap: 22px; }

.cbm-widget {
  background: var(--cbm-surface);
  border: 1px solid var(--cbm-border);
  border-radius: var(--cbm-radius);
  padding: 20px;
  box-shadow: var(--cbm-shadow-sm);
}
.cbm-widget-title { font-size: .95rem; font-weight: 700; margin-bottom: 14px; }
.cbm-widget-cta { background: var(--cbm-gradient-soft); border-color: rgba(99, 102, 241, .28); text-align: center; }
.cbm-widget-cta-icon { font-size: 1.9rem; color: var(--cbm-primary); }

.cbm-trending-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 15px; counter-reset: none; }
.cbm-trending-list li { display: flex; gap: 12px; align-items: flex-start; }
.cbm-trending-rank {
  flex: 0 0 30px; height: 30px; display: grid; place-items: center;
  border-radius: 9px; font-weight: 800; font-size: .84rem;
  background: var(--cbm-gradient-soft); color: var(--cbm-primary);
}
.cbm-trending-title { font-size: .9rem; margin: 0 0 3px; line-height: 1.35; }
.cbm-trending-title a { color: var(--cbm-text); text-decoration: none; }
.cbm-trending-title a:hover { color: var(--cbm-primary); }

.cbm-cat-list, .cbm-cat-sublist { list-style: none; margin: 0; padding: 0; }
.cbm-cat-list > li + li { margin-top: 4px; }
.cbm-cat-list a {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border-radius: 10px;
  color: var(--cbm-text); text-decoration: none; font-size: .9rem; font-weight: 600;
  transition: background .25s, transform .25s var(--cbm-ease);
}
.cbm-cat-list a:hover { background: var(--cbm-surface-3); transform: translateX(4px); color: var(--cbm-primary); }
.cbm-cat-sublist { margin: 2px 0 0 20px; }
.cbm-cat-sublist a { font-weight: 500; font-size: .85rem; padding: 6px 12px; }
.cbm-count { font-size: .74rem; color: var(--cbm-muted); background: var(--cbm-surface-3); padding: 2px 8px; border-radius: 999px; }

.cbm-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 999px;
  font-size: .78rem; font-weight: 600; text-decoration: none;
  background: var(--cbm-surface-3); color: var(--cbm-muted);
  border: 1px solid var(--cbm-border);
  transition: all .25s var(--cbm-ease);
  cursor: pointer;
}
.cbm-tag:hover { background: var(--cbm-gradient); color: #fff; border-color: transparent; transform: translateY(-2px); }

/* ------------------------------- Categories ------------------------------- */
.cbm-cat-card {
  display: block; height: 100%; text-align: center; text-decoration: none;
  padding: 26px 16px; border-radius: var(--cbm-radius);
  background: var(--cbm-surface); border: 1px solid var(--cbm-border);
  transition: transform .4s var(--cbm-ease), box-shadow .4s, border-color .3s;
}
.cbm-cat-card:hover { transform: translateY(-7px); box-shadow: var(--cbm-shadow); border-color: var(--cat-color); }
.cbm-cat-icon {
  display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 12px;
  border-radius: 16px; font-size: 1.4rem;
  color: var(--cat-color, var(--cbm-primary));
  background: color-mix(in srgb, var(--cat-color, #6366f1) 14%, transparent);
  transition: transform .4s var(--cbm-ease);
}
.cbm-cat-card:hover .cbm-cat-icon { transform: scale(1.12) rotate(-6deg); }
.cbm-cat-name { font-size: .95rem; margin: 0 0 3px; color: var(--cbm-text); }
.cbm-cat-count { font-size: .78rem; color: var(--cbm-muted); margin: 0; }

/* ---------------------------------- Tools --------------------------------- */
.cbm-tool-card {
  display: flex; flex-direction: column;
  padding: 24px; border-radius: var(--cbm-radius); text-decoration: none;
  transition: transform .4s var(--cbm-ease), box-shadow .4s, border-color .3s;
  height: 100%;
}
.cbm-tool-card:hover { transform: translateY(-7px); box-shadow: var(--cbm-shadow-lg); border-color: rgba(99, 102, 241, .38); }

.cbm-tool-icon {
  display: grid; place-items: center; width: 52px; height: 52px;
  border-radius: 15px; font-size: 1.35rem; margin-bottom: 14px;
  background: var(--cbm-gradient); color: #fff;
  box-shadow: 0 8px 20px rgba(99, 102, 241, .3);
  transition: transform .45s var(--cbm-ease);
  flex: 0 0 auto;
}
.cbm-tool-card:hover .cbm-tool-icon { transform: rotate(-8deg) scale(1.08); }
.cbm-tool-icon.lg { width: 68px; height: 68px; font-size: 1.8rem; border-radius: 19px; }
.cbm-tool-icon.sm { width: 36px; height: 36px; font-size: .95rem; border-radius: 11px; margin: 0; }

.cbm-tool-name { font-size: 1rem; margin: 0 0 6px; color: var(--cbm-text); }
.cbm-tool-tagline { font-size: .86rem; color: var(--cbm-muted); flex: 1; margin-bottom: 12px; }
.cbm-tool-uses { font-size: .76rem; color: var(--cbm-muted); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.cbm-badge-hot { background: rgba(245, 158, 11, .16); color: #b45309; padding: 2px 8px; border-radius: 999px; font-size: .68rem; }
[data-bs-theme="dark"] .cbm-badge-hot { color: #fbbf24; }

.cbm-tool-group + .cbm-tool-group { margin-top: 48px; }
.cbm-tool-search, .cbm-search-hero, .cbm-search-inline { position: relative; display: flex; align-items: center; gap: 10px; }
.cbm-tool-search > i, .cbm-search-hero > i, .cbm-search-inline > i {
  position: absolute; left: 16px; color: var(--cbm-muted); pointer-events: none; z-index: 2;
}
.cbm-tool-search input, .cbm-search-hero input, .cbm-search-inline input {
  padding-left: 44px; border-radius: 14px;
  background: var(--cbm-surface); border: 1px solid var(--cbm-border);
}
.cbm-search-inline { max-width: 100%; }
.cbm-search-inline input { flex: 1; min-width: 0; padding-block: .5rem; }
.cbm-search-hero { max-width: 620px; margin-top: 22px; }

.cbm-tool-panel { border-radius: var(--cbm-radius-lg); padding: clamp(20px, 3vw, 32px); box-shadow: var(--cbm-shadow); }
.cbm-tools-copy { max-width: 74ch; }

/* Tool widget internals ---------------------------------------------------- */
.cbm-tool-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 12px; }
.cbm-tool-stats.compact { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); }
.cbm-tool-stat {
  text-align: center; padding: 14px 8px; border-radius: var(--cbm-radius-sm);
  background: var(--cbm-surface-3); border: 1px solid var(--cbm-border);
}
.cbm-tool-stat span { display: block; font-size: 1.32rem; font-weight: 800; line-height: 1.15;
  background: var(--cbm-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cbm-tool-stat small { font-size: .72rem; color: var(--cbm-muted); font-weight: 600; }

.cbm-tool-textarea { border-radius: var(--cbm-radius-sm); font-size: .95rem; line-height: 1.7; resize: vertical; }
.cbm-tool-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.cbm-tool-note {
  display: flex; gap: 10px; align-items: flex-start;
  margin-top: 22px; padding: 14px 16px; border-radius: var(--cbm-radius-sm);
  background: var(--cbm-gradient-soft); border: 1px solid var(--cbm-border);
  font-size: .86rem; color: var(--cbm-muted);
}
.cbm-tool-note i { color: var(--cbm-primary); font-size: 1.05rem; margin-top: 2px; }

.cbm-tool-extra summary { cursor: pointer; font-weight: 600; }
.cbm-tool-extra-hint { font-weight: 400; color: var(--cbm-muted); font-size: .82rem; }
.cbm-density { margin-top: 12px; display: grid; gap: 7px; }
.cbm-density-row { display: flex; align-items: center; gap: 10px; font-size: .84rem; }
.cbm-density-bar { flex: 1; height: 7px; border-radius: 4px; background: var(--cbm-surface-3); overflow: hidden; }
.cbm-density-bar span { display: block; height: 100%; background: var(--cbm-gradient); }

.cbm-limits { display: grid; gap: 14px; }
.cbm-limit-bar { height: 7px; border-radius: 4px; background: var(--cbm-surface-3); overflow: hidden; }
.cbm-limit-bar span { display: block; height: 100%; background: var(--cbm-gradient); transition: width .3s var(--cbm-ease); }
.cbm-limit.over .cbm-limit-bar span { background: linear-gradient(135deg, #ef4444, #f97316); }
.cbm-limit.over .cbm-limit-count { color: #ef4444; font-weight: 700; }

.cbm-range-value { font-weight: 700; color: var(--cbm-primary); }

.cbm-qr-stage {
  display: grid; place-items: center;
  padding: 24px; border-radius: var(--cbm-radius);
  background: var(--cbm-surface-3); border: 1px dashed var(--cbm-border-strong);
  min-height: 260px;
}
.cbm-qr-canvas img, .cbm-qr-canvas canvas { max-width: 100%; height: auto; border-radius: 10px; }

.cbm-dropzone {
  display: grid; place-items: center; text-align: center;
  padding: 46px 20px; border-radius: var(--cbm-radius);
  border: 2px dashed var(--cbm-border-strong); background: var(--cbm-surface-3);
  cursor: pointer; transition: border-color .3s, background .3s, transform .3s var(--cbm-ease);
}
.cbm-dropzone:hover, .cbm-dropzone.is-dragging { border-color: var(--cbm-primary); background: var(--cbm-gradient-soft); transform: scale(1.01); }
.cbm-dropzone i { font-size: 2.4rem; color: var(--cbm-primary); margin-bottom: 10px; }

.cbm-tool-result { margin-top: 24px; }
.cbm-preview { margin: 0; border-radius: var(--cbm-radius-sm); overflow: hidden; background: var(--cbm-surface-3); }
.cbm-preview img { width: 100%; display: block; }

.cbm-compare {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px; border-radius: var(--cbm-radius-sm);
  background: var(--cbm-surface-3); margin-bottom: 14px;
}
.cbm-compare-label { display: block; font-size: .72rem; color: var(--cbm-muted); }
.cbm-saving { margin-left: auto; font-weight: 700; color: #16a34a; }

/* Date and time calculator */
.cbm-dtc-now {
  padding: 14px 18px; border-radius: var(--cbm-radius-sm);
  background: var(--cbm-surface-3); border: 1px solid var(--cbm-border);
}
.cbm-dtc-now strong { display: block; font-size: 1.02rem; }
.cbm-dtc-now small { font-size: .78rem; }

.cbm-dtc-result {
  margin-top: 26px; padding: clamp(20px, 3vw, 30px);
  border-radius: var(--cbm-radius); text-align: center;
  background: var(--cbm-gradient-soft); border: 1px solid rgba(99, 102, 241, .3);
  animation: cbm-dtc-in .45s var(--cbm-ease);
}
@keyframes cbm-dtc-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.cbm-dtc-label { font-size: .88rem; color: var(--cbm-muted); margin: 0 0 6px; font-weight: 600; }
.cbm-dtc-date {
  font-size: clamp(1.35rem, 3.6vw, 2.05rem); font-weight: 800; line-height: 1.2; margin: 0 0 4px;
  background: var(--cbm-gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.cbm-dtc-time { font-size: 1.08rem; color: var(--cbm-text); margin: 0 0 20px; font-variant-numeric: tabular-nums; }

.cbm-dtc-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 10px; text-align: left; margin-bottom: 4px;
}
.cbm-dtc-grid > div {
  padding: 10px 13px; border-radius: var(--cbm-radius-sm);
  background: var(--cbm-surface); border: 1px solid var(--cbm-border);
}
.cbm-dtc-grid span { display: block; font-size: .72rem; color: var(--cbm-muted); font-weight: 600; }
.cbm-dtc-grid strong {
  font-size: .95rem; word-break: break-all;
  font-variant-numeric: tabular-nums;
}
.cbm-dtc-wide { grid-column: 1 / -1; }
.cbm-dtc-result .cbm-tool-actions { justify-content: center; }

.cbm-case-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.cbm-case-buttons .btn { font-size: .84rem; padding: .45rem .9rem; }

.cbm-password-output { position: relative; display: flex; gap: 8px; }
.cbm-password-output input {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.05rem; letter-spacing: .04em;
  border-radius: var(--cbm-radius-sm);
}
.cbm-strength-bar { height: 8px; border-radius: 5px; background: var(--cbm-surface-3); overflow: hidden; }
.cbm-strength-bar span { display: block; height: 100%; width: 0; transition: width .35s var(--cbm-ease), background .35s; background: #ef4444; }
.cbm-strength-bar span.s-2 { background: #f97316; }
.cbm-strength-bar span.s-3 { background: #eab308; }
.cbm-strength-bar span.s-4 { background: #22c55e; }
.cbm-strength-bar span.s-5 { background: linear-gradient(135deg, #22c55e, #06b6d4); }

/* ------------------------------- Newsletter ------------------------------- */
.cbm-newsletter { padding: clamp(40px, 6vw, 72px) 0; }
.cbm-newsletter-inner {
  position: relative; overflow: hidden;
  border-radius: var(--cbm-radius-lg);
  padding: clamp(28px, 4vw, 48px);
  box-shadow: var(--cbm-shadow);
}
.cbm-newsletter-orb {
  position: absolute; width: 320px; height: 320px; right: -80px; top: -110px;
  border-radius: 50%; filter: blur(60px); opacity: .35;
  background: radial-gradient(circle, #8b5cf6, transparent 70%);
}
.cbm-newsletter-form .input-group-text { background: var(--cbm-surface-3); border-color: var(--cbm-border); }
.cbm-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------------------------------- CTA ----------------------------------- */
.cbm-cta { padding: 0 0 clamp(52px, 7vw, 88px); }
.cbm-cta-inner {
  position: relative; overflow: hidden; text-align: center;
  padding: clamp(38px, 6vw, 70px) clamp(20px, 4vw, 48px);
  border-radius: var(--cbm-radius-lg);
  background: var(--cbm-gradient);
  background-size: 200% 200%;
  animation: cbm-gradient-shift 14s ease infinite;
  color: #fff;
  box-shadow: 0 24px 60px rgba(99, 102, 241, .38);
}
@keyframes cbm-gradient-shift { 0%, 100% { background-position: 0 50%; } 50% { background-position: 100% 50%; } }
.cbm-cta-title { font-size: clamp(1.5rem, 3.4vw, 2.3rem); margin-bottom: 12px; }
.cbm-cta-text { max-width: 58ch; margin: 0 auto 26px; opacity: .92; }

/* --------------------------------- Footer --------------------------------- */
.cbm-footer { position: relative; background: var(--cbm-surface); border-top: 1px solid var(--cbm-border); overflow: hidden; }
.cbm-footer-glow {
  position: absolute; top: -140px; left: 50%; transform: translateX(-50%);
  width: 620px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, .22), transparent 70%);
  filter: blur(60px); pointer-events: none;
}
.cbm-footer-title { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 14px; color: var(--cbm-text); }
.cbm-footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cbm-footer-links a { color: var(--cbm-muted); text-decoration: none; font-size: .89rem; transition: color .25s, padding-left .25s; }
.cbm-footer-links a:hover { color: var(--cbm-primary); padding-left: 4px; }
.cbm-footer-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 20px 0; border-top: 1px solid var(--cbm-border);
}

.cbm-social {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--cbm-surface-3); border: 1px solid var(--cbm-border);
  color: var(--cbm-muted); text-decoration: none;
  transition: all .3s var(--cbm-ease);
}
.cbm-social:hover { background: var(--cbm-gradient); color: #fff; border-color: transparent; transform: translateY(-3px); }
.cbm-social.sm { width: 34px; height: 34px; font-size: .85rem; border-radius: 10px; }

/* ------------------------------ Page headers ------------------------------ */
.cbm-page-header { position: relative; padding: clamp(38px, 5vw, 62px) 0 clamp(26px, 4vw, 44px); overflow: hidden; }
.cbm-page-title { font-size: clamp(1.8rem, 4.2vw, 2.9rem); margin: 10px 0 12px; }
.cbm-page-lede { font-size: 1.05rem; color: var(--cbm-muted); max-width: 62ch; }

.cbm-breadcrumb .breadcrumb { font-size: .84rem; margin: 0; }
.cbm-breadcrumb a { color: var(--cbm-muted); text-decoration: none; }
.cbm-breadcrumb a:hover { color: var(--cbm-primary); }
.cbm-breadcrumb .breadcrumb-item.active { color: var(--cbm-text); font-weight: 600; }

/* --------------------------------- Article -------------------------------- */
.cbm-article-header { position: relative; padding: clamp(30px, 4vw, 52px) 0 26px; overflow: hidden; }
.cbm-article-title { font-size: clamp(1.85rem, 4.4vw, 3rem); margin: 12px 0 16px; max-width: 22ch; }
.cbm-article-lede { font-size: 1.1rem; color: var(--cbm-muted); max-width: 62ch; margin-bottom: 22px; }
.cbm-article-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cbm-meta-divider { width: 1px; height: 28px; background: var(--cbm-border-strong); }

.cbm-article-hero { margin: 0 auto 40px; }
.cbm-article-hero img { width: 100%; border-radius: var(--cbm-radius-lg); box-shadow: var(--cbm-shadow-lg); aspect-ratio: 16/9; object-fit: cover; }
.cbm-article-hero figcaption { text-align: center; font-size: .84rem; color: var(--cbm-muted); margin-top: 10px; }

/* Table of contents */
.cbm-toc {
  position: sticky; top: calc(var(--cbm-header-h) + 18px);
  padding: 20px; border-radius: var(--cbm-radius);
  background: var(--cbm-surface); border: 1px solid var(--cbm-border);
  max-height: calc(100vh - var(--cbm-header-h) - 40px); overflow-y: auto;
}
.cbm-toc-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--cbm-muted); margin-bottom: 12px; }
.cbm-toc ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.cbm-toc a {
  display: block; padding: 6px 10px; border-radius: 8px;
  font-size: .86rem; color: var(--cbm-muted); text-decoration: none;
  border-left: 2px solid transparent;
  transition: all .25s;
}
.cbm-toc a:hover { color: var(--cbm-primary); background: var(--cbm-surface-3); }
.cbm-toc a.active { color: var(--cbm-primary); border-left-color: var(--cbm-primary); background: var(--cbm-gradient-soft); font-weight: 600; }
.cbm-toc .toc-level-3 a { padding-left: 22px; font-size: .82rem; }
.cbm-toc .toc-level-4 a { padding-left: 34px; font-size: .8rem; }

/* Prose */
.cbm-prose { font-size: 1.06rem; line-height: 1.8; color: var(--cbm-text); max-width: 72ch; }
.cbm-prose > * + * { margin-top: 1.15em; }
.cbm-prose h2 { font-size: 1.65rem; margin-top: 2.1em; scroll-margin-top: calc(var(--cbm-header-h) + 20px); }
.cbm-prose h3 { font-size: 1.28rem; margin-top: 1.8em; scroll-margin-top: calc(var(--cbm-header-h) + 20px); }
.cbm-prose h4 { font-size: 1.1rem; margin-top: 1.6em; scroll-margin-top: calc(var(--cbm-header-h) + 20px); }
.cbm-prose p { color: var(--cbm-text); }
.cbm-prose ul, .cbm-prose ol { padding-left: 1.4em; }
.cbm-prose li + li { margin-top: .5em; }
.cbm-prose img { border-radius: var(--cbm-radius-sm); box-shadow: var(--cbm-shadow-sm); }
.cbm-prose a { font-weight: 500; }

.cbm-prose blockquote {
  margin: 1.6em 0; padding: 18px 24px;
  border-left: 4px solid var(--cbm-primary);
  border-radius: 0 var(--cbm-radius-sm) var(--cbm-radius-sm) 0;
  background: var(--cbm-gradient-soft);
  font-style: italic; color: var(--cbm-text);
}
.cbm-prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em; padding: .18em .45em; border-radius: 6px;
  background: var(--cbm-surface-3); color: var(--cbm-accent-2);
}
.cbm-prose pre {
  padding: 20px 22px; border-radius: var(--cbm-radius-sm); overflow-x: auto;
  background: #0f172a; color: #e2e8f0; border: 1px solid rgba(148, 163, 184, .2);
  font-size: .9rem; line-height: 1.65;
}
.cbm-prose pre code { background: none; color: inherit; padding: 0; font-size: inherit; }
/* Hardening for posts that carry code. `overflow-x` above makes a long line
   scroll inside the block; `max-width` stops the block itself widening the
   column on narrow screens. Inline code wraps rather than overflowing, since
   package names and commands are often longer than a phone is wide. */
.cbm-prose pre { max-width: 100%; tab-size: 4; }
.cbm-prose :not(pre) > code { overflow-wrap: anywhere; }
.cbm-prose table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.cbm-prose th, .cbm-prose td { padding: 10px 14px; border: 1px solid var(--cbm-border); text-align: left; }
.cbm-prose th { background: var(--cbm-surface-3); font-weight: 700; }
.cbm-prose hr { border: 0; border-top: 1px solid var(--cbm-border); margin: 2.2em 0; }

/* Article extras */
.cbm-gallery { margin-top: 42px; }
.cbm-gallery-item { margin: 0; border-radius: var(--cbm-radius-sm); overflow: hidden; background: var(--cbm-surface-3); }
.cbm-gallery-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; transition: transform .5s var(--cbm-ease); }
.cbm-gallery-item:hover img { transform: scale(1.06); }
.cbm-gallery-item figcaption { padding: 8px 10px; font-size: .78rem; color: var(--cbm-muted); }

.cbm-article-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 36px; }

.cbm-article-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 26px; padding: 16px 20px; border-radius: var(--cbm-radius);
}
.cbm-like-btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 20px; border-radius: 999px;
  border: 1px solid var(--cbm-border-strong); background: var(--cbm-surface);
  color: var(--cbm-text); font-weight: 700;
  transition: all .3s var(--cbm-ease);
}
.cbm-like-btn:hover { border-color: var(--cbm-accent); color: var(--cbm-accent); transform: translateY(-2px); }
.cbm-like-btn.is-liked { background: var(--cbm-accent); border-color: var(--cbm-accent); color: #fff; }
.cbm-like-btn.is-bumping i { animation: cbm-heart .6s var(--cbm-ease); }
@keyframes cbm-heart { 0%, 100% { transform: scale(1); } 35% { transform: scale(1.45); } }
.cbm-share { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.cbm-author-box {
  display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap;
  margin-top: 34px; padding: 24px; border-radius: var(--cbm-radius);
}
.cbm-author-box-avatar { border-radius: 50%; object-fit: cover; }

.cbm-author-hero { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; padding: 26px; border-radius: var(--cbm-radius-lg); }
.cbm-author-hero-avatar { border-radius: 50%; object-fit: cover; }

/* -------------------------------- Comments -------------------------------- */
.cbm-comments { margin-top: 52px; }
.cbm-comment-form { padding: 24px; border-radius: var(--cbm-radius); }
.cbm-comment-list, .cbm-comment-replies { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
.cbm-comment-replies { margin: 18px 0 0 clamp(16px, 4vw, 44px); padding-left: 18px; border-left: 2px solid var(--cbm-border); }
.cbm-comment-body { display: flex; gap: 14px; }
.cbm-comment-avatar { border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.cbm-comment-author { font-size: .93rem; }
.cbm-comment-author a { text-decoration: none; }
.cbm-comment-text { font-size: .95rem; color: var(--cbm-text); }
.cbm-badge-staff {
  padding: 2px 9px; border-radius: 999px; font-size: .68rem; font-weight: 700;
  background: var(--cbm-gradient); color: #fff;
}
.cbm-reply-btn {
  background: none; border: 0; padding: 0;
  font-size: .82rem; font-weight: 600; color: var(--cbm-muted);
  transition: color .25s;
}
.cbm-reply-btn:hover { color: var(--cbm-primary); }
.cbm-comment:target > .cbm-comment-body {
  background: var(--cbm-gradient-soft); border-radius: var(--cbm-radius-sm); padding: 12px; margin: -12px;
}

/* -------------------------------- Search UI ------------------------------- */
.cbm-search-modal .modal-content { border-radius: var(--cbm-radius-lg); border: 1px solid var(--cbm-glass-border); }
.cbm-search-field { position: relative; display: flex; align-items: center; }
.cbm-search-field > i { position: absolute; left: 18px; color: var(--cbm-muted); z-index: 2; }
.cbm-search-field input { padding-left: 48px; padding-right: 60px; border-radius: 14px; }
.cbm-kbd {
  position: absolute; right: 14px;
  font-size: .7rem; padding: 3px 8px; border-radius: 6px;
  background: var(--cbm-surface-3); border: 1px solid var(--cbm-border); color: var(--cbm-muted);
}

.cbm-suggestions { display: grid; gap: 6px; margin-top: 14px; max-height: 46vh; overflow-y: auto; }
.cbm-suggestion {
  display: flex; align-items: center; gap: 12px;
  padding: 10px; border-radius: var(--cbm-radius-sm);
  text-decoration: none; color: var(--cbm-text);
  transition: background .2s, transform .2s var(--cbm-ease);
}
.cbm-suggestion:hover, .cbm-suggestion.is-active { background: var(--cbm-surface-3); transform: translateX(4px); }
.cbm-suggestion img { width: 56px; height: 42px; border-radius: 8px; object-fit: cover; flex: 0 0 auto; }
.cbm-suggestion-title { font-weight: 600; font-size: .92rem; margin: 0; }
.cbm-suggestion-meta { font-size: .76rem; color: var(--cbm-muted); margin: 0; }

.cbm-search-skeleton { display: grid; gap: 8px; margin-top: 14px; }
.skeleton-row, .cbm-skeleton {
  height: 62px; border-radius: var(--cbm-radius-sm);
  background: linear-gradient(90deg, var(--cbm-surface-3) 25%, var(--cbm-border) 37%, var(--cbm-surface-3) 63%);
  background-size: 400% 100%;
  animation: cbm-shimmer 1.4s ease infinite;
}
@keyframes cbm-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.cbm-search-empty { text-align: center; padding: 32px 16px; }
.cbm-search-empty i { font-size: 2rem; color: var(--cbm-muted); }

/* --------------------------------- Empty ---------------------------------- */
.cbm-empty {
  text-align: center; padding: 52px 24px;
  border: 2px dashed var(--cbm-border-strong); border-radius: var(--cbm-radius);
  background: var(--cbm-surface);
}
.cbm-empty > i { font-size: 2.6rem; color: var(--cbm-muted); }

/* ------------------------------- Pagination ------------------------------- */
.cbm-pagination .page-link {
  border-radius: 11px; border: 1px solid var(--cbm-border);
  color: var(--cbm-text); font-weight: 600; margin: 0 2px;
  background: var(--cbm-surface);
  transition: all .25s var(--cbm-ease);
}
.cbm-pagination .page-link:hover { background: var(--cbm-surface-3); color: var(--cbm-primary); transform: translateY(-2px); }
.cbm-pagination .active .page-link { background: var(--cbm-gradient); border-color: transparent; color: #fff; }

/* ------------------------------- About page ------------------------------- */
.cbm-stats-panel {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 24px; padding: 34px; border-radius: var(--cbm-radius-lg); text-align: center;
}
.cbm-mission .cbm-tool-icon { margin-bottom: 0; }
.cbm-feature { display: flex; flex-direction: column; }
.cbm-feature-icon {
  display: grid; place-items: center; width: 46px; height: 46px;
  border-radius: 14px; font-size: 1.2rem;
  background: var(--cbm-gradient-soft); color: var(--cbm-primary);
}
.cbm-team-card { display: flex; flex-direction: column; align-items: flex-start; }
.cbm-team-avatar { border-radius: 50%; object-fit: cover; }

/* ------------------------------ Contact page ------------------------------ */
.cbm-contact-form { padding: 28px; }
.cbm-contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.cbm-contact-list li { display: flex; gap: 12px; align-items: flex-start; }
.cbm-contact-list a { text-decoration: none; font-weight: 600; }
.cbm-contact-icon {
  display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto;
  border-radius: 12px; background: var(--cbm-gradient-soft); color: var(--cbm-primary);
}
.cbm-map { width: 100%; height: 320px; display: block; }
.cbm-map-placeholder { text-align: center; padding: 42px 20px; }
.cbm-map-placeholder i { font-size: 2.2rem; color: var(--cbm-muted); display: block; margin-bottom: 10px; }

/* --------------------------------- Errors --------------------------------- */
.cbm-error { position: relative; padding: clamp(56px, 9vw, 110px) 0; overflow: hidden; }
.cbm-error-code { display: block; font-size: clamp(4.5rem, 16vw, 9rem); font-weight: 900; line-height: 1; letter-spacing: -.05em; }
.cbm-error-icon { font-size: 2.4rem; color: var(--cbm-muted); display: block; margin: 6px 0 14px; }
.cbm-error .cbm-page-lede { max-width: 52ch; }

/* --------------------------------- Flash ---------------------------------- */
.cbm-flash-stack {
  position: fixed; top: calc(var(--cbm-header-h) + 14px); right: 18px; z-index: 1090;
  display: grid; gap: 10px; max-width: min(420px, calc(100vw - 36px));
}
.cbm-flash {
  border: 1px solid var(--cbm-border);
  border-radius: var(--cbm-radius-sm);
  box-shadow: var(--cbm-shadow);
  animation: cbm-slide-in .5s var(--cbm-ease);
}
@keyframes cbm-slide-in { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }

/* ------------------------------ Back to top ------------------------------- */
.cbm-to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 1040;
  width: 48px; height: 48px; border-radius: 15px; border: 0;
  display: grid; place-items: center;
  background: var(--cbm-gradient); color: #fff; font-size: 1.1rem;
  box-shadow: 0 10px 26px rgba(99, 102, 241, .38);
  opacity: 0; visibility: hidden; transform: translateY(18px);
  transition: all .4s var(--cbm-ease);
}
.cbm-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.cbm-to-top:hover { transform: translateY(-4px); }

/* ---------------------------------- Swiper -------------------------------- */
.cbm-swiper { padding: 6px 4px 52px; }
.cbm-swiper .swiper-slide { height: auto; }
.cbm-swiper .swiper-pagination-bullet { background: var(--cbm-muted); opacity: .4; }
.cbm-swiper .swiper-pagination-bullet-active { background: var(--cbm-primary); opacity: 1; width: 22px; border-radius: 4px; }
.cbm-swiper .swiper-button-next, .cbm-swiper .swiper-button-prev {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--cbm-surface); border: 1px solid var(--cbm-border);
  color: var(--cbm-text); box-shadow: var(--cbm-shadow-sm);
  top: 42%;
}
.cbm-swiper .swiper-button-next::after, .cbm-swiper .swiper-button-prev::after { font-size: 1rem; font-weight: 800; }

.cbm-testimonial { padding: 26px; border-radius: var(--cbm-radius); height: 100%; display: flex; flex-direction: column; }
.cbm-testimonial blockquote { font-size: .98rem; line-height: 1.7; flex: 1; }
.cbm-testimonial figcaption { display: flex; align-items: center; gap: 10px; font-size: .88rem; }
.cbm-stars { color: #f59e0b; margin-bottom: 12px; letter-spacing: 2px; }

/* --------------------------------- FAQ ------------------------------------ */
.cbm-accordion .accordion-item {
  border: 1px solid var(--cbm-border); border-radius: var(--cbm-radius-sm) !important;
  margin-bottom: 10px; overflow: hidden; background: var(--cbm-surface);
}
.cbm-accordion .accordion-button { font-weight: 600; background: var(--cbm-surface); box-shadow: none; }
.cbm-accordion .accordion-button:not(.collapsed) { background: var(--cbm-gradient-soft); color: var(--cbm-primary); }

/* ---------------------------------- Auth ---------------------------------- */
.cbm-auth-body { background: var(--cbm-surface-2); }
.cbm-auth { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
@media (min-width: 992px) { .cbm-auth { grid-template-columns: 1fr 1fr; } }

.cbm-auth-aside { position: relative; display: none; overflow: hidden; background: var(--cbm-gradient); color: #fff; }
@media (min-width: 992px) { .cbm-auth-aside { display: block; } }
.cbm-auth-aside-bg { position: absolute; inset: 0; opacity: .5; }
.cbm-auth-aside-inner { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: space-between; padding: 48px; }
.cbm-auth-quote { font-size: 1.32rem; line-height: 1.6; font-weight: 500; max-width: 26ch; }
.cbm-auth-quote footer { font-size: .88rem; opacity: .82; margin-top: 14px; font-weight: 400; }
.cbm-auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: .92rem; }
.cbm-auth-points i { margin-right: 8px; }

.cbm-auth-main { display: grid; place-items: center; padding: clamp(24px, 5vw, 56px); }
.cbm-auth-card { width: 100%; max-width: 430px; }
.cbm-auth-back { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; text-decoration: none; color: var(--cbm-muted); margin-bottom: 26px; }
.cbm-auth-back:hover { color: var(--cbm-primary); }
.cbm-auth-title { font-size: 1.85rem; margin-bottom: 6px; }
.cbm-auth-sub { color: var(--cbm-muted); margin-bottom: 28px; }

.cbm-demo-note {
  margin-top: 28px; padding: 16px; border-radius: var(--cbm-radius-sm);
  background: var(--cbm-gradient-soft); border: 1px solid var(--cbm-border);
  font-size: .86rem;
}
.cbm-demo-note ul { padding-left: 18px; margin-bottom: 0; }
.cbm-demo-note code { font-size: .84em; }

/* --------------------------------- Forms ---------------------------------- */
.form-control, .form-select {
  border-radius: var(--cbm-radius-sm);
  border-color: var(--cbm-border);
  background: var(--cbm-surface);
  color: var(--cbm-text);
  padding: .6rem .9rem;
  transition: border-color .25s, box-shadow .25s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--cbm-primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, .14);
  background: var(--cbm-surface);
  color: var(--cbm-text);
}
.form-label { font-weight: 600; font-size: .88rem; margin-bottom: .35rem; }
.form-text { font-size: .8rem; color: var(--cbm-muted); }
.input-group-text { background: var(--cbm-surface-3); border-color: var(--cbm-border); color: var(--cbm-muted); border-radius: var(--cbm-radius-sm); }
.form-check-input:checked { background-color: var(--cbm-primary); border-color: var(--cbm-primary); }
.form-range::-webkit-slider-thumb { background: var(--cbm-primary); }
.form-range::-moz-range-thumb { background: var(--cbm-primary); }

/* ------------------------------- AOS fallback ----------------------------- */
/* If AOS never initialises (blocked CDN, JS off) content must still be visible. */
.no-js [data-aos] { opacity: 1 !important; transform: none !important; }

/* ---------------------------- Reduced motion ------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .cbm-orb, .cbm-scroll-cue span, .cbm-dot { animation: none !important; }
  [data-aos] { opacity: 1 !important; transform: none !important; }
}

/* -------------------------------- Responsive ------------------------------ */
@media (max-width: 991.98px) {
  :root { --cbm-header-h: 66px; }
  .cbm-nav .navbar-collapse { padding: 16px 0 8px; }
  .cbm-sidebar, .cbm-toc { position: static; max-height: none; }
  .cbm-article-title { max-width: none; }
  .cbm-flash-stack { right: 12px; left: 12px; max-width: none; }
}

@media (max-width: 767.98px) {
  .cbm-hero { padding: 42px 0 56px; }
  .cbm-orb { filter: blur(50px); }
  .cbm-orb.orb-1 { width: 260px; height: 260px; }
  .cbm-orb.orb-2 { width: 220px; height: 220px; }
  .cbm-orb.orb-3 { display: none; }
  .cbm-stats-row { gap: 20px; }
  .cbm-section-head { margin-bottom: 24px; }
  .cbm-hero-swiper-nav { margin-top: 14px; }
  .cbm-article-actions { flex-direction: column; align-items: stretch; }
  .cbm-share { justify-content: center; }
  .cbm-comment-replies { margin-left: 10px; padding-left: 12px; }
  .cbm-to-top { right: 14px; bottom: 14px; width: 44px; height: 44px; }
  .cbm-prose { font-size: 1rem; }
  /* Glass is expensive on low-end phones — flatten it below the fold. */
  .glass { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--cbm-surface); }
}

@media (min-width: 1600px) {
  .container { max-width: 1400px; }
  .cbm-hero-title { font-size: 4rem; }
}

/* --------------------------------- Print ---------------------------------- */
@media print {
  .cbm-header, .cbm-footer, .cbm-to-top, .cbm-article-actions,
  .cbm-comments, .cbm-sidebar, .cbm-newsletter, .cbm-toc, .cbm-progress { display: none !important; }
  body { background: #fff; color: #000; }
  .cbm-prose { max-width: none; font-size: 11pt; }
  a::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
}
