/*!
 * KogBee - product case study page (product/kogbee/)
 * Loaded after vaultZero.css, whose product-page layout it shares (ab-hero, ab-section, ab-band, ab-tabbar, ab-tale...).
 * This file only sets the KogBee look: honey brand colour, the particle swarm canvas, and the page's own widgets
 * (module explorer, workflow / BYOK / local-first tabs, the swarm playground, FAQ).
 * Shapes stay alfuix (al-corner, al-hexa); no border-radius.
 *
 * © 2026 Mohammad Azad
 */
:root {
  --ab-brand: #ffb800;
  --ab-brand-rgb: 255, 184, 0;
  --ab-brand-light: #ffd45c;
  --ab-brand-light-rgb: 255, 212, 92;
  --bs-primary: var(--ab-brand);
  --bs-primary-rgb: var(--ab-brand-rgb);
  --bs-success: var(--ab-brand);
  --bs-success-rgb: var(--ab-brand-rgb);
  --bs-link-color: var(--ab-brand);
  --bs-link-color-rgb: var(--ab-brand-rgb);
  --bs-link-hover-color: var(--ab-brand-light);
  --bs-link-hover-color-rgb: var(--ab-brand-light-rgb);
  --kb-ink: #07080c;
  --kb-accent: #ffb800; /* the colour of the section on screen (set by kogbee.js from data-kb-theme) */
}
body.kb-page { background-color: var(--kb-ink); }

/* ---------------------------------------------------------------- the swarm: one fixed WebGL canvas behind the page */
.kb-swarm {
  position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%;
  pointer-events: none; opacity: 0; transition: opacity 1.2s ease;
}
.kb-swarm.is-ready { opacity: 1; }
/* below lg the scenes sit behind the text: keep them as a soft backdrop */
@media (max-width: 991.98px) { .kb-swarm.is-ready { opacity: 0.38; } }
.kb-no-webgl .kb-swarm { display: none; }
/* a warm aura that follows the section colour */
.kb-aura {
  position: fixed; z-index: -2; inset: 0; pointer-events: none;
  background:
    radial-gradient(60vw 60vh at 72% 45%, color-mix(in srgb, var(--kb-accent) 12%, transparent), transparent 70%),
    radial-gradient(40vw 40vh at 15% 85%, rgba(var(--bs-primary-rgb), 0.05), transparent 70%);
  transition: background 0.8s ease;
}

/* ---------------------------------------------------------------- loader mark */
.kb-loader-queen { width: 34%; height: auto; }

/* ---------------------------------------------------------------- hero */
.kb-hero-copy { position: relative; z-index: 1; }
/* the hero's right half belongs to the particle honeycomb; a hint sits under it */
.kb-hero-stage { position: relative; min-height: 420px; }
.kb-swarm-hint {
  position: absolute; right: 0; bottom: 0;
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.kb-swarm-hint i { animation: kb-nudge 2.4s ease-in-out infinite; }
@keyframes kb-nudge { 50% { transform: translateY(-3px); } }
@media (max-width: 991.98px) { .kb-hero-stage { display: none; } }

/* text over the swarm: a quiet glass card */
.kb-card {
  background-color: rgba(var(--bs-body-bg-rgb), 0.55);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.kb-copy { position: relative; z-index: 1; }

/* section colour chip in eyebrows */
.kb-dot { display: inline-block; width: 8px; height: 8px; background: var(--kb-accent); clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }

/* ---------------------------------------------------------------- module explorer */
.kb-mod-tab {
  opacity: 0.6; transition: opacity 0.3s ease, background-color 0.3s ease;
  --mc: var(--bs-primary);
}
.kb-mod-tab:hover, .kb-mod-tab[aria-selected="true"] { opacity: 1; }
.kb-mod-tab[aria-selected="true"] { background-color: color-mix(in srgb, var(--mc) 12%, transparent) !important; }
.kb-mod-tab img { width: 100%; height: auto; display: block; }
/* module icon in an alfuix cut-corner frame with a 1px line in the module's colour */
.kb-mod-ico {
  width: 42px; flex: none; padding: 3px;
  --al-border-bg: color-mix(in srgb, var(--mc) 40%, transparent);
  background-color: color-mix(in srgb, var(--mc) 10%, transparent);
  transition: --al-border-bg 0.3s ease;
}
.kb-mod-ico img { clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px), 0 6px); }
.kb-mod-tab[aria-selected="true"] .kb-mod-ico { --al-border-bg: var(--mc); }
.kb-mod-tab .ab-tale-progress { background: var(--mc); box-shadow: 0 0 10px color-mix(in srgb, var(--mc) 60%, transparent); }
.kb-mod-num { color: var(--mc); }
.kb-mod-stage { display: grid; }
.kb-mod-stage > [role="tabpanel"] { grid-area: 1 / 1; transition: opacity 0.45s ease, transform 0.45s ease; }
.kb-mod-stage > [aria-hidden="true"] { visibility: hidden; opacity: 0; transform: translateY(10px); }
.kb-mod-shot { aspect-ratio: 1360 / 860; background: #0b0d12; }
.kb-mod-shot img { width: 100%; height: 100%; object-fit: cover; object-position: top left; display: block; }
.kb-pill {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.3rem 0.7rem; font-size: 0.75rem;
  /* alfuix cut corners; the 1px line is al-border, drawn in the module's colour */
  --al-border-bg: color-mix(in srgb, var(--mc, var(--bs-primary)) 55%, transparent);
  background-color: color-mix(in srgb, var(--mc, var(--bs-primary)) 8%, transparent);
  color: color-mix(in srgb, var(--mc, var(--bs-primary)) 80%, #fff);
}
.kb-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.kb-list li { display: flex; gap: 0.6rem; align-items: baseline; }
.kb-list li::before { content: ""; flex: none; width: 7px; height: 7px; transform: translateY(-1px); background: var(--mc, var(--bs-primary)); clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }

/* ---------------------------------------------------------------- segmented tabs (workflow, BYOK, local-first) */
.kb-seg .nav-link { color: rgba(var(--bs-white-rgb), 0.7); }
.kb-seg .nav-link.active, .kb-seg .nav-link[aria-selected="true"] { background-color: rgba(var(--bs-primary-rgb), 0.16); color: var(--bs-primary); }
.kb-pane { display: grid; }
.kb-pane > [role="tabpanel"] { grid-area: 1 / 1; transition: opacity 0.4s ease, transform 0.4s ease; }
.kb-pane > [aria-hidden="true"] { visibility: hidden; opacity: 0; transform: translateY(8px); }

/* BYOK steps */
.kb-step { counter-increment: kbstep; }
.kb-step-num { width: 44px; flex: none; }

/* ---------------------------------------------------------------- the swarm playground */
.kb-play-btn {
  --mc: var(--bs-primary);
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem;
  padding: 0.65rem 0.8rem; text-align: start; color: #fff;
  background-color: rgba(var(--bs-white-rgb), 0.04);
  transition: background-color 0.25s ease, transform 0.25s ease;
}
.kb-play-btn small { opacity: 0.55; font-size: 0.72rem; }
.kb-play-btn:hover { background-color: color-mix(in srgb, var(--mc) 14%, transparent); transform: translateY(-2px); }
.kb-play-btn[aria-pressed="true"] { background-color: color-mix(in srgb, var(--mc) 22%, transparent); }
.kb-play-btn[aria-pressed="true"] b { color: var(--mc); }
.kb-meter { height: 4px; background: rgba(var(--bs-white-rgb), 0.08); }
.kb-meter > span { display: block; height: 100%; width: 0; background: var(--bs-primary); transition: width 0.6s ease; }

/* ---------------------------------------------------------------- FAQ */
.kb-faq details { border-bottom: 1px solid rgba(var(--bs-white-rgb), 0.08); }
.kb-faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 1rem; padding: 1.1rem 0; font-weight: 600; }
.kb-faq summary::-webkit-details-marker { display: none; }
.kb-faq summary i { transition: transform 0.3s ease; color: var(--bs-primary); }
.kb-faq details[open] summary i { transform: rotate(45deg); }
.kb-faq details p { padding-bottom: 1.1rem; margin: 0; }

/* ---------------------------------------------------------------- reveals (kogbee.js adds .ab-gsap; without GSAP all is shown) */
.ab-gsap [data-ab-reveal] { opacity: 0; transform: translateY(24px); }

@media (prefers-reduced-motion: reduce) {
  .kb-swarm-hint i { animation: none; }
  .kb-mod-stage > [role="tabpanel"], .kb-pane > [role="tabpanel"] { transition: none; }
}

/* header / tab bar pills: honey instead of the site's default mint */
.kb-page .nav-pills { --bs-nav-pills-link-active-bg: var(--bs-primary); --bs-nav-pills-link-active-color: #0a0a0a; }

/* phones and tablets: the module list becomes one sideways row above the module */
@media (max-width: 991.98px) {
  .kb-mod-rail [role="tablist"] { flex-direction: row !important; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
  .kb-mod-rail [role="tablist"]::-webkit-scrollbar { display: none; }
  .kb-mod-rail .kb-mod-tab { width: auto !important; flex: none; white-space: nowrap; scroll-snap-align: start; }
}

/* ---------------------------------------------------------------- module chips (overview): alfuix cut corners + a line
   in the module's colour; the icon sits in its own small cut-corner frame */
.kb-chip {
  --al-border-bg: color-mix(in srgb, var(--mc) 35%, transparent);
  background-color: color-mix(in srgb, var(--mc) 6%, transparent);
  transition: background-color 0.25s ease, --al-border-bg 0.25s ease;
}
.kb-chip:hover, .kb-chip:focus-visible { --al-border-bg: var(--mc); background-color: color-mix(in srgb, var(--mc) 16%, transparent); color: #fff; }
.kb-mod-ico img { width: 100%; height: auto; display: block; }
.kb-mod-ico-sm { width: 28px; padding: 2px; }
.kb-mod-ico-sm img { clip-path: polygon(4px 0, calc(100% - 4px) 0, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 0 calc(100% - 4px), 0 4px); }
.kb-chip:hover .kb-mod-ico { --al-border-bg: var(--mc); }

/* ---------------------------------------------------------------- KogBee's effects (from the landing's _background.scss)
   honey bee cursor: a small hexagon marks the real pointer, a bee flies after it (mouse / pen only) */
.cursor-dot, .cursor-bee { position: fixed; left: 0; top: 0; pointer-events: none; opacity: 0; transition: opacity .25s; will-change: transform; }
html.cursor-on .cursor-dot, html.cursor-on .cursor-bee { opacity: 1; }
.cursor-dot { z-index: 3001; width: 22px; height: 22px; margin: -11px 0 0 -11px; }
.cursor-dot svg { display: block; width: 100%; height: 100%; overflow: visible; transition: scale .2s ease; }
.cursor-dot__ring { fill: rgba(255, 184, 0, 0.08); stroke: #FFB800; stroke-width: 1.5; stroke-opacity: .5; }
.cursor-dot__core { fill: #FFB800; filter: drop-shadow(0 0 3px #FFB800); }
html.cursor-down .cursor-dot svg { scale: .8; }
.cursor-bee {
  z-index: 3000; width: 50px; height: 50px; margin: -25px 0 0 -25px; display: grid; place-items: center;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .45)) drop-shadow(0 0 8px rgba(255, 184, 0, .35));
}
.cursor-bee .bee { width: 100%; height: 100%; transform: rotate(var(--angle, 0deg)) scale(var(--bee-scale, 1)); transition: scale .2s; overflow: visible; }
.cursor-bee .bee__wing { transform-box: fill-box; animation: bee-flap .07s ease-in-out infinite alternate; }
.cursor-bee .bee__wing--l { transform-origin: right center; }
.cursor-bee .bee__wing--r { transform-origin: left center; animation-delay: -.035s; animation-name: bee-flap-r; }
.cursor-bee.is-fast .bee__wing { animation-duration: .045s; }
.cursor-bee__label {
  position: absolute; left: 50%; top: 100%; transform: translate(-50%, 4px) scale(.6); opacity: 0;
  padding: .15rem .5rem; font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: #06070b; background: #FFB800; white-space: nowrap; transition: opacity .2s, transform .2s;
}
.cursor-bee.is-hot, .hero-hot .cursor-bee, .section-hot .cursor-bee { --bee-scale: 1.3; }
.cursor-bee.is-zoom { --bee-scale: 1.25; }
.cursor-bee.is-zoom .cursor-bee__label { opacity: 1; transform: translate(-50%, 6px) scale(1); }
.cursor-bee.is-text { opacity: .2 !important; }
.cursor-bee.is-down { --bee-scale: .85; }
@keyframes bee-flap { from { transform: scaleX(1) scaleY(1); } to { transform: scaleX(.35) scaleY(.9); } }
@keyframes bee-flap-r { from { transform: scaleX(1) scaleY(1); } to { transform: scaleX(.35) scaleY(.9); } }
.cursor-pollen {
  position: fixed; left: 0; top: 0; z-index: 2999; width: 4px; height: 4px; margin: -2px 0 0 -2px;
  background: #FFD54A; box-shadow: 0 0 6px #FFB800; pointer-events: none; opacity: 0;
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
}
.cursor-pollen.is-live { animation: pollen-fade .9s ease-out forwards; }
@keyframes pollen-fade { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: translateY(10px) scale(.2); } }
/* pollen trail + click sparks and worker bees; the hero hive network and the section tiles: above the particles,
   under the page's text and controls */
#kb-pollen, #hero-fx, #section-fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.kb-page main, .kb-page footer { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) { .cursor-bee .bee__wing { animation: none; } }
