/* ============================================================
   bigExpertLab — design tokens
   Palette derived from logo: orange + purple + charcoal on cream
   ============================================================ */

:root {
  /* Brand — orange (energy) + blue (trust/tech) */
  --bel-orange: #EF6A1F;
  --bel-orange-deep: #D35614;
  --bel-orange-soft: #FFEFE3;

  --bel-blue: #7845E9;
  --bel-blue-deep: #5523BD;
  --bel-blue-soft: #EAE0FF;
  --bel-cyan: #9B6EFF;

  /* Logo purple — accent only, used sparingly */
  --bel-purple: #6A1FCB;

  /* Neutrals — warm */
  --ink: #18181B;
  --ink-2: #2E2E33;
  --ink-soft: #5B5B63;
  --ink-mute: #8A8A92;
  --line: #E8E2D5;
  --line-2: #F1ECDF;
  --cream: #FAF6EC;
  --cream-2: #F5EFE0;
  --paper: #FFFFFF;

  /* Type */
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* Layout */
  --maxw: 1280px;
  --pad-x: clamp(20px, 4vw, 56px);
  --radius-sm: 6px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-xl: 32px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html, body { overflow-x: clip; }

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

/* ---------- Layout primitives ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: var(--pad-x);
}

/* ---------- Typography ---------- */
.display, .h1, .h2, .h3, .eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.04;
  color: var(--ink);
  text-wrap: balance;
}
.display { font-size: clamp(48px, 7.2vw, 104px); font-weight: 600; letter-spacing: -0.035em; }
.h1 { font-size: clamp(40px, 5.4vw, 72px); }
.h2 { font-size: clamp(32px, 3.8vw, 54px); }
.h3 { font-size: clamp(22px, 1.9vw, 30px); letter-spacing: -0.015em; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bel-blue);
}

.lead {
  font-size: clamp(17px, 1.3vw, 20px);
  color: var(--ink-soft);
  max-width: 56ch;
  text-wrap: pretty;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  background: var(--bel-orange-soft);
  border: 1px solid color-mix(in oklab, var(--bel-orange) 25%, transparent);
  color: var(--bel-orange-deep);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.kicker .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--bel-orange);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--bel-orange) 25%, transparent);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 50px;
  padding: 0 22px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.005em;
  transition: transform .15s ease, background .2s, color .2s, box-shadow .2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary {
  background: var(--ink);
  color: var(--cream);
}
.btn--primary:hover { background: var(--bel-blue); }
.btn--accent {
  background: var(--bel-orange);
  color: white;
  box-shadow: 0 8px 24px -10px color-mix(in oklab, var(--bel-orange) 60%, transparent);
}
.btn--accent:hover { background: var(--bel-orange-deep); }
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line);
}
.btn--ghost:hover { background: var(--paper); border-color: var(--ink); }
/* Ghost buttons placed on dark sections: invert cleanly to dark text on hover */
.btn--ghost.cta-ghost:hover { color: var(--ink) !important; border-color: var(--ink) !important; }

.btn .arrow {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  font-size: 12px;
}
.btn--ghost .arrow { background: var(--ink); color: var(--cream); }

/* ---------- Cards & surfaces ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.surface-cream { background: var(--cream); }
.surface-cream-2 { background: var(--cream-2); }
.surface-paper { background: var(--paper); }
.surface-ink { background: var(--ink); color: var(--cream); }
.surface-blue { background: var(--bel-blue); color: white; }
.surface-blue-deep { background: var(--bel-blue-deep); color: white; }

/* ---------- Sections ---------- */
section { padding-block: clamp(48px, 5vw, 88px); }
.section-tight { padding-block: clamp(32px, 4vw, 60px); }

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee__track {
  display: flex;
  gap: 56px;
  align-items: center;
  animation: marquee 38s linear infinite;
  width: max-content;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- Utility ---------- */
.divider { height: 1px; background: var(--line); width: 100%; }
.text-orange { color: var(--bel-orange); }
.text-blue { color: var(--bel-blue); }
.bg-orange { background: var(--bel-orange); }
.bg-blue { background: var(--bel-blue); }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-soft);
  font-weight: 500;
}
.tag .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--bel-orange); }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }

/* Focus ring */
*:focus-visible {
  outline: 2px solid var(--bel-blue);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ============================================================
   Mobile responsiveness
   ============================================================ */

/* Auto-stack on mobile via data-stack attribute */
[data-stack="2"] { display: grid; grid-template-columns: 1fr 1fr; }

@media (max-width: 880px) {
  /* Force every wrap to respect viewport with extra right padding safety */
  .wrap {
    max-width: 100% !important;
    box-sizing: border-box;
    padding-right: max(var(--pad-x), 20px) !important;
  }
  .wrap * { max-width: 100%; }
  .lead, p { word-break: break-word; overflow-wrap: anywhere; max-width: 100% !important; }
  /* Universal mobile stacking — any flex/grid with `data-stack` attr */
  .wrap [data-stack],
  .wrap [data-mob-stack] {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: 1fr !important;
    gap: 28px !important;
    align-items: stretch !important;
  }

  /* ---------- Typography ---------- */
  .h2 { font-size: clamp(26px, 6.5vw, 36px) !important; line-height: 1.12; }
  .h1, .display { font-size: clamp(32px, 8.5vw, 50px) !important; line-height: 1.08; }
  .h3 { font-size: 19px !important; }
  .lead { font-size: 15.5px !important; }
  .eyebrow { font-size: 11px !important; }

  /* ---------- Swipe carousels (Solutions / Capabilities / Industries) ---------- */
  .swipe-grid {
    display: flex !important;
    grid-template-columns: none !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 14px !important;
    padding: 4px 20px 22px !important;
    margin-left: calc(var(--pad-x) * -1);
    margin-right: calc(var(--pad-x) * -1);
    scrollbar-width: none;
    border: 0 !important;
  }
  .swipe-grid::-webkit-scrollbar { display: none; }
  .swipe-grid > * {
    flex: 0 0 78%;
    scroll-snap-align: start;
    min-height: 0;
  }
  .swipe-grid--solutions > * { min-height: 260px; }
  .swipe-grid--industries > * { min-height: 180px; }
  .swipe-grid--capabilities > * {
    border: 1px solid #2A2A2F !important;
    border-radius: 14px;
    background: #18181B;
    padding: 22px 20px 28px !important;
    min-height: 200px;
  }

  /* ---------- Section padding tightening ---------- */
  section { padding-block: clamp(40px, 7vw, 72px) !important; }

  /* ---------- Hero ---------- */
  #home > .wrap > div { grid-template-columns: 1fr !important; gap: 36px !important; }
  #home .display { font-size: clamp(34px, 9.5vw, 56px) !important; }
  #home [style*="aspect-ratio: 0.95"] { max-width: 360px; margin: 0 auto; }
  #home div[style*="flex: 0 0 50%"] { display: none; }

  /* Hero mini-stats row → wrap */
  #home div[style*="paddingTop: 24px"] { gap: 24px !important; flex-wrap: wrap !important; }

  /* ---------- TopBar ---------- */
  div[style*="background: var(--ink)"][style*="font-family: var(--font-mono)"]:first-child {
    font-size: 11px !important;
  }

  /* ---------- Pillars (3-col cards) ---------- */
  #services div[style*="repeat(3, 1fr)"]:not(.swipe-grid) {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  #services article[style*="minHeight: 480px"],
  #services article[style*="min-height: 480px"] {
    min-height: 0 !important;
  }

  /* ---------- Stats grid (4-col with vertical dividers) → stack 2x2 ---------- */
  section .wrap > div[style*="grid-template-columns: repeat(4, 1fr)"][style*="border-top"] {
    grid-template-columns: 1fr 1fr !important;
  }
  section .wrap > div[style*="grid-template-columns: repeat(4, 1fr)"][style*="border-top"] > div {
    border-right: 0 !important;
    border-bottom: 1px solid var(--line) !important;
    padding: 22px 14px 22px 0 !important;
  }

  /* ---------- All 2-col headers (eyebrow + lead) ---------- */
  section .wrap > div[style*="grid-template-columns: 1fr 1fr"][style*="align-items: end"],
  section .wrap > div[style*="grid-template-columns: 1fr 1fr"][style*="alignItems: end"] {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  section .wrap p[style*="justify-self: end"],
  section .wrap p[style*="justifySelf: end"] {
    justify-self: start !important;
  }

  /* ---------- WhyStrip 4-col → 2x2 ---------- */
  .section-tight .wrap > div[style*="grid-template-columns: repeat(4, 1fr)"][style*="border-top"] {
    grid-template-columns: 1fr 1fr !important;
  }
  .section-tight .wrap > div[style*="grid-template-columns: repeat(4, 1fr)"][style*="border-top"] > div {
    border-right: 0 !important;
    border-bottom: 1px solid var(--line) !important;
    padding: 22px 0 !important;
  }

  /* ---------- Integration / Method / BIGNMS / Trusted / Contact: 2-col → stack ---------- */
  section .wrap[style*="grid-template-columns: 1.15fr 1fr"],
  section .wrap[style*="grid-template-columns: 1.1fr 1fr"],
  section .wrap[style*="grid-template-columns: 1fr 1.1fr"],
  section .wrap[style*="grid-template-columns: 1.4fr 1fr"],
  section .wrap[style*="grid-template-columns: 1.2fr 1fr"],
  section .wrap[style*="grid-template-columns: 1fr 1.1fr"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }

  /* CTA inner box */
  section [style*="grid-template-columns: 1.4fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 22px !important;
    padding: 28px !important;
  }

  /* ---------- WE WORK ON ---------- */
  .wwo-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .wwo-cell { min-height: 90px !important; padding: 14px 10px !important; }
  .wwo-cell > * { transform: scale(0.68); transform-origin: center; }
  .wwo-cell:nth-child(4n), .wwo-cell:nth-child(3n) { border-right: 1px solid var(--line) !important; }
  .wwo-cell:nth-child(2n) { border-right: 0 !important; }
  .wwo-cell:nth-last-child(-n+4), .wwo-cell:nth-last-child(-n+3) { border-bottom: 1px solid var(--line) !important; }
  .wwo-cell:nth-last-child(-n+2) { border-bottom: 0 !important; }

  /* ---------- Testimonials ---------- */
  section[style*="background: var(--bel-blue)"] div[style*="grid-template-columns: 1fr 380px"],
  section [style*="grid-template-columns: 1fr 380px"] {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }

  /* ---------- Footer ---------- */
  footer .wrap > div[style*="grid-template-columns: 1.5fr 1fr 1fr 1fr 1.4fr"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 32px !important;
  }
  /* Make the logo + subscribe full-width */
  footer .wrap > div[style*="grid-template-columns: 1.5fr 1fr 1fr 1fr 1.4fr"] > div:first-child,
  footer .wrap > div[style*="grid-template-columns: 1.5fr 1fr 1fr 1fr 1.4fr"] > div:last-child {
    grid-column: 1 / -1;
  }
  /* Footer offices */
  footer div[style*="grid-template-columns: repeat(3, 1fr)"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  /* Footer bottom legal */
  footer .wrap > div[style*="justify-content: space-between"]:last-child {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  /* ---------- TrustedBanner mini metrics ---------- */
  section[style*="background: var(--ink)"] div[style*="grid-template-columns: repeat(3, 1fr)"] {
    gap: 12px !important;
  }

  /* ---------- BIGNMS visual sizing ---------- */
  .wrap div[style*="aspect-ratio: 0.95"] { max-width: 360px; margin: 0 auto; width: 100%; }

  /* ---------- WE DELIVER — already handles its own breakpoint, just sanity ---------- */
  .wd-hub { min-height: 0 !important; gap: 18px !important; }
  .wd-lines { display: none !important; }

  /* ---------- Sticky nav ---------- */
  header .wrap { height: 64px !important; }
}

@media (max-width: 600px) {
  :root { --pad-x: 18px; }

  /* Top bar shrink */
  div[style*="background: var(--ink)"][style*="padding: 10px 0"] {
    font-size: 10.5px !important;
    padding: 8px 0 !important;
  }
  /* TopBar content layout — stack inner two rows */
  div[style*="background: var(--ink)"][style*="padding: 10px 0"] > .wrap {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
  }
  /* Hide some elements at extra-small */
  header nav { display: none !important; }
  header a.btn--ghost { display: none !important; }

  /* Hero kicker can wrap */
  #home .kicker { font-size: 10.5px !important; }

  /* Tighter swipe peek on smallest */
  .swipe-grid > * { flex: 0 0 84% !important; }

  /* Footer — keep 2 columns on small mobile too */
  footer .wrap > div[style*="grid-template-columns: 1.5fr 1fr 1fr 1fr 1.4fr"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 28px 18px !important;
  }

  /* Stats 2x2 → 1 col if needed */
  section .wrap > div[style*="grid-template-columns: repeat(4, 1fr)"][style*="border-top"] {
    grid-template-columns: 1fr !important;
  }

  /* Buttons full width in stack groups */
  div[style*="flex-wrap: wrap"][style*="gap: 12px"] .btn,
  div[style*="display: flex"][style*="gap: 12px"] .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  /* Solutions/Capabilities/Industries — slightly larger card */
  .swipe-grid--solutions > * { min-height: 240px; }

  /* ---------- Method section week rail ---------- */
  /* Stack week label above title/description for full text width */
  section li[style*="grid-template-columns: 120px 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 4px !important;
    padding: 14px 0 !important;
  }
  section li[style*="grid-template-columns: 120px 1fr"] > div {
    min-width: 0 !important;
  }
  section li[style*="grid-template-columns: 120px 1fr"] > div:first-child {
    font-size: 11px !important;
    word-break: break-word;
  }
  section li[style*="grid-template-columns: 120px 1fr"] > div:last-child > div {
    word-break: break-word;
  }

  /* ---------- Decision Brief mockup card ---------- */
  /* The whole visual wrapper */
  div[style*="aspect-ratio: 0.92 / 1"][style*="max-width: 560px"] {
    aspect-ratio: auto !important;
    max-width: 100% !important;
    width: 100% !important;
    overflow: hidden;
  }
  /* The decision brief card itself — was inset 4% 4% 4% 0 (absolute), make it static */
  div[style*="aspect-ratio: 0.92 / 1"] > div[style*="position: absolute"][style*="background: var(--paper)"] {
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 16px !important;
    box-sizing: border-box !important;
    overflow: hidden;
  }
  /* Hide the decorative diagonal blue accent block on mobile */
  div[style*="aspect-ratio: 0.92 / 1"] > div[aria-hidden="true"] {
    display: none !important;
  }
  /* 3 options inside — keep horizontal but smaller */
  div[style*="grid-template-columns: 1fr 1fr 1fr"][style*="gap: 12px"] {
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 6px !important;
  }
  div[style*="grid-template-columns: 1fr 1fr 1fr"][style*="gap: 12px"] > div {
    padding: 8px 6px !important;
    min-width: 0 !important;
    overflow: hidden;
  }
  div[style*="grid-template-columns: 1fr 1fr 1fr"][style*="gap: 12px"] > div > span:first-child {
    font-size: 10px !important;
    line-height: 1.2 !important;
    word-break: break-word;
  }
  div[style*="grid-template-columns: 1fr 1fr 1fr"][style*="gap: 12px"] > div > span:nth-child(2) {
    font-size: 11.5px !important;
    white-space: nowrap;
  }
  div[style*="grid-template-columns: 1fr 1fr 1fr"][style*="gap: 12px"] > div > span:nth-child(3) {
    font-size: 8.5px !important;
    padding: 2px 5px !important;
  }
  /* Trade-off bullets — wrap and trim font */
  div[style*="aspect-ratio: 0.92 / 1"] div[style*="display: flex"][style*="align-items: flex-start"] {
    font-size: 12.5px !important;
    align-items: flex-start !important;
    word-break: break-word;
  }
  /* "Prepared by · BEL-DB" row should wrap */
  div[style*="border-top: 1px dashed var(--line)"][style*="margin-top: auto"],
  div[style*="borderTop: 1px dashed var(--line)"][style*="marginTop: auto"] {
    flex-wrap: wrap !important;
    gap: 4px !important;
    font-size: 10.5px !important;
  }

  /* ---------- BIGNMS — push floating chips off the content ---------- */
  div[style*="aspect-ratio: 0.95 / 1"] > div[style*="transform: rotate(3deg)"],
  div[style*="aspect-ratio: 0.95 / 1"] > div[style*="transform: rotate(-3deg)"] {
    position: relative !important;
    transform: none !important;
    margin-top: 12px !important;
    display: inline-flex !important;
  }

  /* ---------- CTA box copy / chips ---------- */
  section [style*="background: var(--ink)"][style*="borderRadius: 28"],
  section [style*="background: var(--ink)"][style*="border-radius: 28"] {
    padding: 26px 22px !important;
    border-radius: 20px !important;
  }
  section [style*="background: var(--ink)"][style*="borderRadius: 28"] .h2,
  section [style*="background: var(--ink)"][style*="border-radius: 28"] .h2 {
    font-size: 22px !important;
  }
  /* Make sure inner grid items don't blow out */
  section [style*="background: var(--ink)"][style*="borderRadius: 28"] > div,
  section [style*="background: var(--ink)"][style*="border-radius: 28"] > div {
    min-width: 0 !important;
  }
  /* CTA buttons inside dark card stretch full width */
  section [style*="background: var(--ink)"] .btn--accent,
  section [style*="background: var(--ink)"] a.btn[style*="border: 1px solid #3A3A40"] {
    width: 100% !important;
    justify-content: space-between !important;
    padding-inline: 22px !important;
  }

  /* ---------- Contact rows — values can wrap, push to next line ---------- */
  div[style*="paddingBlock: 12"][style*="border-top"] {
    flex-wrap: wrap !important;
    gap: 4px !important;
    padding: 10px 0 !important;
  }
  div[style*="paddingBlock: 12"][style*="border-top"] > span:last-child {
    font-size: 13.5px !important;
    word-break: break-word;
    text-align: left !important;
  }

  /* ---------- Contact form fields — 2-col → stack ---------- */
  form[class*="reveal"] > div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  form input, form textarea {
    width: 100% !important;
    max-width: 100% !important;
    font-size: 14px !important;
  }
  form { padding: 22px !important; }

  /* Form footer (submit row) stack */
  form > div[style*="justify-content: space-between"]:last-child {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  form > div[style*="justify-content: space-between"]:last-child .btn {
    width: 100%;
    justify-content: center;
  }
}
