/* BM Studio.es – main styles */

/* ---------------------------------------------------------------------------
   Design tokens
   --------------------------------------------------------------------------- */
:root {
  /* Typography */
  --font-sans: "Figtree", ui-sans-serif, system-ui, sans-serif;

  /* Filters */
  --glass-filter: url(#glass-filter) blur(3px);
  --glass-filter-rgb: url(#glass-filter-rgb) blur(3px);

  /* Debug / validation */
  --color-white-18: rgba(255, 255, 255, 0.18);

  /* Neutrals – from Figma */
  --color-white: #ffffff;
  --color-black: #121212;
  --color-gray-50: #fafafa;
  --color-gray-100: #f4f4f5;
  --color-gray-200: #e4e4e7;
  --color-gray-300: #d4d4d8;
  --color-gray-400: #a1a1aa;
  --color-gray-500: #71717a;
  --color-gray-600: #52525b;
  --color-gray-700: #3f3f46;
  --color-gray-800: #27272a;
  --color-gray-900: #18181b;

  /* Accents (refined per section) */
  --color-accent-blue: #3b82f6;
  --color-accent-red: #dc2626;
  --color-accent-green: #16a34a;
  --color-accent-orange: #ea580c;

  /* Semantic */
  --color-text: var(--color-black);
  --color-text-muted: var(--color-gray-600);
  --color-bg: var(--color-white);
  --color-border: var(--color-gray-200);
}

/* ---------------------------------------------------------------------------
   Base
   --------------------------------------------------------------------------- */
html {
  font-family: var(--font-sans);
  font-size: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
}

/* ---------------------------------------------------------------------------
   Header – only what Tailwind cannot express
   --------------------------------------------------------------------------- */

/* Hamburger bars */
.header-menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--color-text);
  border-radius: 2px;
  transform-origin: center;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease,
    width 0.3s ease;
}

/* Hamburger → X animation (nth-child not expressible in Tailwind) */
.header-menu-toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.header-menu-toggle.is-open span:nth-child(2) {
  opacity: 0;
  width: 0;
}
.header-menu-toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Header CTA icon color is unchanged on hover (icon swap handles the effect) */

/* Text reveal – mask injected programmatically by _prepareTextReveal() */
.text-reveal-mask {
  overflow: hidden;
  padding-bottom: 0.06em; /* room for descenders (g, y, p…) */
}

/* Clip mask – injected by clip-up ANIM_TYPE for non-text elements */
.clip-mask {
  overflow: hidden;
}

/* In a vertical flex container (mobile nav drawer), clip-mask must fill full width
   so that nav items with w-full / border-bottom span the entire drawer. */
@media (max-width: 768px) {
  .header-nav .clip-mask {
    width: 100vw;
  }
}

/* Overlay – display+opacity transition not expressible cleanly in Tailwind */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(18, 18, 18, 0.4);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.nav-overlay.is-open {
  display: block;
  opacity: 1;
}

/* ---------------------------------------------------------------------------
   section-business-needs – fluid typography & spacing via clamp()
   (Tailwind CDN cannot parse commas inside arbitrary-value brackets)
   --------------------------------------------------------------------------- */
.bn-eyebrow {
  font-size: clamp(0.875rem, 1.6vw, 1.3125rem);
}
.bn-heading {
  font-size: clamp(2rem, 3.3vw, 3.3vw);
}
.bn-card-title {
  font-size: clamp(1.5rem, 2.1vw, 2.1vw);
}
.bn-card {
  padding-left: clamp(1rem, 2.1vw, 2.1vw);
  padding-right: clamp(1rem, 2.1vw, 2.1vw);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: var(--glass-filter-rgb, blur(3px));
  -webkit-backdrop-filter: var(--glass-filter-rgb, blur(3px));
  border: none;
  position: relative;
}

.bn-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 30px;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.6) 30%,
    rgba(255, 255, 255, 0) 50%,
    rgba(255, 255, 255, 0.6) 70%
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.bn-pill {
  font-size: clamp(0.875rem, 1.02vw, 1.02vw);
  padding-left: clamp(1.25rem, 4vw, 3.125rem);
  padding-right: clamp(1.25rem, 4vw, 3.125rem);
}

/* ---------------------------------------------------------------------------
   section-about
   --------------------------------------------------------------------------- */

.about-image {
  box-shadow: 0px 60px 75px 0px rgba(0, 0, 0, 0.3);
  border-radius: 30px;
  overflow: hidden;
  flex-shrink: 0;
}

/* ---------------------------------------------------------------------------
   section-machines-at-work
   --------------------------------------------------------------------------- */

/* overflow:hidden prevents card content from bleeding outside the clip-path
   during the entrance animation */
.maw-card {
  overflow: hidden;
}

/* ── Action card pill (veiled accent background) ── */
.maw-pill {
  border-radius: 99px;
  padding: 15px 30px;
  overflow: hidden;
}
.maw-pill::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--maw-pill-accent);
}
.maw-pill::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.9);
}

/* ── Diagram scaling ──
   justify-content:center centers the 1664px layout box symmetrically, so the
   scaled diagram is always visually centered regardless of viewport width. */
#maw-diagram-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
}

/* Dashed vertical line bridging the action cards above to the AI symbol center.
   height:50% = 507/1016 of the diagram height → lands on the AI symbol at any scale.
   repeating-linear-gradient replicates a 3px-dash / 4px-gap dashed pattern. */
.maw-diagram-connector {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  z-index: 0;
  width: 1px;
  height: 50%;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(18, 18, 18, 0.2) 0px,
    rgba(18, 18, 18, 0.2) 3px,
    transparent 3px,
    transparent 7px
  );
}
#maw-diagram {
  width: 1664px;
  height: 1016px;
  position: relative;
  flex-shrink: 0;
  transform-origin: top center;
}

/* Keep strokes visually at 1px regardless of the diagram's CSS scale transform */
#maw-diagram svg path,
#maw-diagram svg line,
#maw-diagram-mobile svg path,
#maw-diagram-mobile svg line {
  vector-effect: non-scaling-stroke;
}

/* ── Dashed line flowing animation ──
   Both left and right dashed paths start at the CENTER endpoint and draw
   outward toward the edge. Increasing stroke-dashoffset makes the pattern
   move against the path direction → visually flows inward toward center.
   dasharray = 3+6 = 9 px per cycle. */
@keyframes maw-dash-flow {
  from {
    stroke-dashoffset: 0;
  }
  to {
    stroke-dashoffset: 9;
  }
}
.maw-dash {
  animation: maw-dash-flow 0.3s linear infinite;
}

/* ── Process elements (injected by JS) ── */
/* z-index 5 keeps processes below the AI symbol (z-index 10) so they
   disappear naturally behind it when they reach the center. */
.maw-process {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  offset-rotate: 0deg;
  offset-anchor: 50% calc(100% - 19.5px);
  pointer-events: none;
  z-index: 5;
}

/* AI symbol sits on top of process elements */
#maw-diagram > img,
#maw-ai-symbol,
#maw-ai-symbol-mobile {
  z-index: 10;
}

/* Bubble: veiled accent background via ::before / ::after */
.maw-process-bubble {
  position: relative;
  border-radius: 99px;
  padding: 6px 12px;
  overflow: hidden;
  white-space: nowrap;
}
.maw-process-bubble::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--maw-accent);
}
.maw-process-bubble::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.9);
}
.maw-process-bubble span {
  position: relative;
  z-index: 1;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--maw-accent);
}

/* Connector line */
.maw-process-connector {
  width: 1px;
  height: 30px;
  background: var(--maw-accent);
  opacity: 0.5;
  transform-origin: bottom center;
  flex-shrink: 0;
}

/* Icon circle */
.maw-process-icon {
  width: 39px;
  height: 39px;
  border-radius: 50%;
  background: var(--maw-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}
.maw-process-icon svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
}

/* ── Mobile / tablet vertical funnel diagram ── */
#maw-diagram-wrapper-mobile {
  position: relative;
  display: flex;
  justify-content: center;
}

/* 751×676px canvas: 616px SVG height + 60px for bottom half of AI symbol */
#maw-diagram-mobile {
  width: 751px;
  height: 676px;
  position: relative;
  flex-shrink: 0;
  transform-origin: top center;
}

/* Center the 334px dashed SVG in the 751px container: (751-334)/2 = 208.5px */
.maw-dashed-svg-mobile {
  left: 208.5px;
}

/* AI symbol: centered at the funnel tip (375.5, 615.273) */
#maw-ai-symbol-mobile {
  position: absolute;
  left: 315.5px;
  top: 555px;
  width: 120px;
  height: 120px;
  pointer-events: none;
}

/* ── section-services ─────────────────────────────────────────────────────── */

/* Blue dot on the timeline */
.services-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--color-accent-blue);
  flex-shrink: 0;
}

/* Dashed vertical connector between timeline steps */
.services-vline {
  flex: 1;
  width: 1px;
  min-height: 20px;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(18, 18, 18, 0.2) 0px,
    rgba(18, 18, 18, 0.2) 3px,
    transparent 3px,
    transparent 7px
  );
}

/* Spacer between steps with a centered horizontal separator */
.services-hline {
  height: 100px;
  display: flex;
  align-items: center;
}
.services-hline::after {
  content: "";
  display: block;
  width: 100%;
  height: 1px;
  background: rgba(18, 18, 18, 0.1);
}

/* Start / delivery pill */
.services-pill {
  background: rgba(55, 132, 255, 0.03);
  border: 1px solid rgba(55, 132, 255, 0.3);
  border-radius: 9px;
  padding: 20px 39px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.services-pill svg {
  width: 20px;
  height: 20px;
  color: var(--color-accent-blue);
  stroke: var(--color-accent-blue);
  flex-shrink: 0;
}
.services-pill p {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-accent-blue);
}

/* ── section-enterprise-oriented ──────────────────────────────────────────── */

/* Scope bubbles (pills) for service cards */
.eo-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.2;
  color: rgba(18, 18, 18, 0.6);
  background:
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.96) 0%,
      rgba(255, 255, 255, 0.96) 100%
    ),
    linear-gradient(90deg, rgba(18, 18, 18, 0.6) 0%, rgba(18, 18, 18, 0.6) 100%);
  white-space: nowrap;
}

/* Logo cards infinite scroll strip */
#eo-logo-strip {
  height: 300px;
  position: relative;
}

#eo-logo-track {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  will-change: transform;
}

/* Individual logo card (390x300 base, scales 0.8-1.0) */
.eo-logo-card {
  position: relative;
  width: 390px;
  height: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0px 60px 60px 0px rgba(0, 0, 0, 0.18);
}

/* Card background (SVG gradient) */
.eo-card-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  z-index: 0;
}

/* Card logo (centered above text) */
.eo-card-logo {
  position: relative;
  z-index: 1;
  max-width: 140px;
  max-height: 140px;
  object-fit: contain;
}

/* Card label text */
.eo-card-label {
  position: relative;
  z-index: 1;
  font-size: 21px;
  font-weight: 600;
  line-height: normal;
  color: white;
  text-align: center;
  padding: 0 20px;
}

/* Specific cards with black text (light backgrounds) */
.eo-logo-card[data-logo="chatgpt"] .eo-card-label,
.eo-logo-card[data-logo="google-drive"] .eo-card-label,
.eo-logo-card[data-logo="ollama"] .eo-card-label,
.eo-logo-card[data-logo="gmail"] .eo-card-label {
  color: var(--color-black);
}

/* ── section-contact ───────────────────────────────────────────────────── */
/* (All button styling now handled by Tailwind classes in HTML) */
