/* ==========================================================================
   BML X | WhatsApp Group Links
   Original layout on a black ground. No gradients. Hero: big soft logo
   watermark plus an animated network graph of the five groups.
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  /* Grounds */
  --bg: #0B0E11;
  --bg-raised: #101418;      /* alternate sections */
  --card: #141A1F;           /* cards */
  --card-hover: #182027;
  --line: rgba(255,255,255,.08);
  --line-strong: rgba(255,255,255,.18);

  /* Brand */
  --mark-blue: #3A87AB;
  --mark-teal: #67C6B7;
  --mark-indigo: #312B70;
  --mark-pink: #EC6F90;

  /* Text */
  --text-strong: #F4F5F6;
  --text-body: #C9CFD4;
  --text-muted: #8FA0AE;     /* 6.6:1 on --bg */

  /* Type */
  --font-display: "Red Hat Display", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Space, radius, shadow, motion */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
  --r-xs: 3px; --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-pill: 999px;
  --shadow-md: 0 8px 24px rgba(0,0,0,.35);
  --shadow-lg: 0 16px 40px rgba(0,0,0,.5);
  --ease: cubic-bezier(.2,0,0,1);

  --container: 1200px;
  --gutter: 20px;
  --header-h: 64px;
}
@media (min-width: 768px)  { :root { --gutter: 40px; --header-h: 72px; } }
@media (min-width: 1100px) { :root { --gutter: 80px; } }

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-body);
  font: 400 16px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; color: var(--text-strong); }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--text-strong); }
button { font: inherit; }

.container {
  position: relative; z-index: 1;
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}

.icon {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

:focus-visible { outline: 2px solid var(--mark-teal); outline-offset: 3px; border-radius: var(--r-sm); }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: #fff; color: var(--bg); padding: 10px 16px;
  border-radius: var(--r-sm); text-decoration: none; font-weight: 600;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; }

/* ---------- 3. Type helpers ---------- */
.eyebrow {
  font: 600 13px/1.2 var(--font-body);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--mark-teal);
  margin-bottom: var(--s4);
}

/* ---------- 4. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px;
  border: 1px solid transparent; border-radius: var(--r-sm);
  font: 600 16px/1 var(--font-body);
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .18s var(--ease), color .18s var(--ease),
              border-color .18s var(--ease), transform .12s var(--ease);
  user-select: none; -webkit-user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn .icon { width: 18px; height: 18px; }
.btn--sm { min-height: 40px; padding: 0 16px; font-size: 15px; }

.btn--primary { background: #fff; color: var(--bg); }
.btn--ghost { color: #fff; border-color: var(--line-strong); background: transparent; }

@media (hover: hover) {
  .btn--primary:hover { background: #E2E6EA; }
  .btn--ghost:hover { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.4); }
}

.link-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--text-strong); font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: var(--line-strong);
}
@media (hover: hover) { .link-btn:hover { color: var(--mark-teal); text-decoration-color: currentColor; } }

/* ---------- 5. Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11,14,17,.78);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
          backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .24s var(--ease);
  padding-top: env(safe-area-inset-top);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header__inner { height: var(--header-h); display: flex; align-items: center; gap: var(--s5); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; }
.brand__mark { width: 34px; height: 34px; }
.brand__word {
  display: block; width: 82px; height: 18px;
  background: #fff;
  -webkit-mask: url("../img/logo/bmlx-wordmark.svg") no-repeat left center / contain;
          mask: url("../img/logo/bmlx-wordmark.svg") no-repeat left center / contain;
}
.site-nav { display: none; gap: var(--s6); }
.site-nav a {
  color: var(--text-muted); text-decoration: none; font-weight: 500; font-size: 15px;
  transition: color .18s var(--ease);
}
@media (hover: hover) { .site-nav a:hover { color: #fff; } }
@media (min-width: 900px) { .site-nav { display: flex; } }

/* ---------- 7. Hero ---------- */
.hero { position: relative; overflow: hidden; isolation: isolate; padding: var(--s7) 0 var(--s8); }
.hero__inner { display: grid; gap: var(--s6); align-items: center; }

/* Big, soft logo watermark */
.hero__watermark {
  position: absolute; z-index: 0; pointer-events: none;
  width: min(150vw, 980px); aspect-ratio: 1;
  right: -55%; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.028);
  -webkit-mask: url("../img/logo/bmlx-mark.svg") no-repeat center / contain;
          mask: url("../img/logo/bmlx-mark.svg") no-repeat center / contain;
}
@media (min-width: 900px)  { .hero__watermark { right: -18%; } }
@media (min-width: 1300px) { .hero__watermark { right: -8%; } }

/* Network graph */
.net { margin: 0; width: 100%; max-width: 440px; justify-self: center; }
.net svg { width: 100%; height: auto; overflow: visible; }
.net__orbit { fill: none; stroke: rgba(255,255,255,.10); stroke-width: 1; }
.net__orbit--outer { stroke-dasharray: 2 7; transform-box: fill-box; transform-origin: center; }
.net__orbit--inner { stroke: rgba(255,255,255,.06); }
.net__lines line { stroke: rgba(255,255,255,.22); stroke-width: 1.25; stroke-dasharray: 100; stroke-dashoffset: 0; }
.net__pulses line {
  stroke: var(--mark-teal); stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 12 200; stroke-dashoffset: 12; opacity: 0;
  filter: drop-shadow(0 0 4px rgba(103,198,183,.9));
}
.net__hub { fill: var(--bg); stroke: rgba(255,255,255,.14); }
.net__hubring { fill: none; stroke: rgba(103,198,183,.35); stroke-width: 1; }
.net__ripple { fill: none; stroke: rgba(103,198,183,.35); transform-box: fill-box; transform-origin: center; opacity: 0; }
.net__dot { fill: #141A1F; stroke: rgba(255,255,255,.6); stroke-width: 1.5; transition: fill .2s var(--ease), stroke .2s var(--ease); }
.net__ring { fill: none; stroke: var(--mark-teal); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; opacity: 0; }
.net__node { cursor: pointer; }
.net__node text { fill: #D5DBE0; font: 600 15px var(--font-body); letter-spacing: .01em; transition: fill .2s var(--ease); }
.net__node:hover .net__dot, .net__node:focus-visible .net__dot { fill: var(--mark-teal); stroke: var(--mark-teal); }
.net__node:hover text, .net__node:focus-visible text { fill: #fff; }
.net__node:focus-visible { outline: none; }

@media (prefers-reduced-motion: no-preference) {
  .net__orbit--outer { animation: spin 60s linear infinite; }
  .net__lines line { stroke-dashoffset: 100; animation: draw .9s var(--ease) forwards; animation-delay: calc(.25s + var(--i) * .1s); }
  .net__pulses line { animation: pulse 3.5s cubic-bezier(.5,0,.3,1) infinite; animation-delay: calc(1.4s + var(--i) * .7s); }
  .net__ring { animation: ring 3.5s ease-out infinite; animation-delay: calc(1.4s + var(--i) * .7s); }
  .net__dot { animation: hit 3.5s ease-out infinite; animation-delay: calc(1.4s + var(--i) * .7s); }
  .net__ripple { animation: ripple 3.5s ease-out 1.2s infinite; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pulse {
  0%   { stroke-dashoffset: 12;   opacity: 1; }
  45%  { stroke-dashoffset: -100; opacity: 1; }
  46%, 100% { stroke-dashoffset: -100; opacity: 0; }
}
@keyframes ring {
  0%, 42% { opacity: 0; transform: scale(1); }
  46%     { opacity: .9; transform: scale(1); }
  80%, 100% { opacity: 0; transform: scale(2.6); }
}
@keyframes hit {
  0%, 42% { fill: #141A1F; stroke: rgba(255,255,255,.6); }
  47%     { fill: var(--mark-teal); stroke: var(--mark-teal); }
  75%, 100% { fill: #141A1F; stroke: rgba(255,255,255,.6); }
}
@keyframes ripple {
  0%   { opacity: .7; transform: scale(1); }
  60%, 100% { opacity: 0; transform: scale(1.5); }
}

.hero__title {
  color: #fff;
  font: 800 clamp(38px, 5.4vw, 64px)/1.06 var(--font-display);
  letter-spacing: -0.015em;
  max-width: 12em;
  text-wrap: balance;
}
.hero__lead {
  margin-top: var(--s5);
  max-width: 30rem;
  font-size: clamp(17px, 1.7vw, 19px);
  color: var(--text-muted);
}
.hero__actions { margin-top: var(--s6); display: flex; flex-wrap: wrap; gap: var(--s3); }

@media (min-width: 900px) {
  .hero { padding: var(--s9) 0; }
  .hero__inner { grid-template-columns: 1.15fr 1fr; gap: var(--s7); }
  .net { max-width: 500px; justify-self: end; }
  .hero__actions { flex-wrap: nowrap; }
}
@media (max-width: 479px) {
  .hero__actions .btn { flex: 1 1 100%; }
}

/* ---------- 8. Sections ---------- */
.section { padding: var(--s8) 0; border-top: 1px solid var(--line); }
.section--raised { background: var(--bg-raised); }
@media (min-width: 768px) { .section { padding: var(--s9) 0; } }

.section-head { max-width: 40rem; margin-bottom: var(--s6); }
.section-head h2, .showcase h2 {
  font: 800 clamp(32px, 5.4vw, 52px)/1.06 var(--font-display);
  letter-spacing: -0.01em;
}
.section-head__intro { margin-top: var(--s4); font-size: 18px; color: var(--text-muted); }
@media (min-width: 768px) { .section-head { margin-bottom: var(--s7); } }

/* ---------- 9. Groups ---------- */
.groups { display: grid; gap: var(--s3); }
.group {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "num body" "cta cta";
  align-items: center;
  gap: var(--s4);
  padding: var(--s5);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: transform .24s var(--ease), box-shadow .24s var(--ease), border-color .24s var(--ease), background-color .24s var(--ease);
}
.group__num {
  grid-area: num;
  display: grid; place-items: center;
  width: 48px; height: 48px;
  border-radius: var(--r-sm);
  background: var(--bg); border: 1px solid var(--line);
  color: var(--mark-teal);
  font: 700 15px/1 var(--font-display); letter-spacing: .04em;
}
.group__body { grid-area: body; min-width: 0; }
.group__name { font: 800 22px/1.15 var(--font-display); }
.group__area {
  display: flex; align-items: center; gap: 6px;
  margin-top: 4px; color: var(--text-muted); font-size: 15px;
}
.group__area .icon { width: 16px; height: 16px; }
.group__cta { grid-area: cta; width: 100%; }

@media (hover: hover) {
  .group:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--line-strong); background: var(--card-hover); }
}
@media (min-width: 640px) {
  .group { grid-template-columns: auto 1fr auto; grid-template-areas: "num body cta"; }
  .group__cta { width: auto; }
}
@media (min-width: 1040px) {
  .groups { grid-template-columns: repeat(5, 1fr); gap: var(--s4); }
  .group {
    grid-template-columns: 1fr;
    grid-template-areas: "num" "body" "cta";
    align-items: start;
    gap: var(--s5);
  }
  .group__cta { width: 100%; margin-top: auto; }
  .group__name { font-size: 24px; }
  .group__area { font-size: 14px; white-space: nowrap; }
}

.groups__note {
  margin-top: var(--s6);
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  color: var(--text-muted); font-size: 15px;
}
.groups__note .icon { width: 18px; height: 18px; }

/* ---------- 10. Steps ---------- */
.steps { display: grid; gap: var(--s4); counter-reset: step; }
.step {
  position: relative;
  padding: var(--s5);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
}
.step__icon {
  display: grid; place-items: center;
  width: 48px; height: 48px; margin-bottom: var(--s5);
  border-radius: var(--r-sm);
  background: var(--bg); border: 1px solid var(--line);
  color: var(--mark-teal);
}
.step__icon .icon { width: 22px; height: 22px; }
.step h3 { font: 800 21px/1.2 var(--font-display); margin-bottom: var(--s2); }
.step p { color: var(--text-muted); }
.step::after {
  counter-increment: step;
  content: "0" counter(step);
  position: absolute; top: var(--s5); right: var(--s5);
  font: 700 13px/1 var(--font-body); letter-spacing: .12em; color: var(--text-muted);
}
@media (min-width: 820px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: var(--s5); }
  .step { padding: var(--s6); }
  .step::after { top: var(--s6); right: var(--s6); }
}

/* ---------- 11. Tags ---------- */
.tags { display: flex; flex-wrap: wrap; gap: var(--s3); }
.tag {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 18px 0 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: rgba(255,255,255,.03); color: #fff;
  font: 700 17px/1 var(--font-display);
  cursor: pointer;
  transition: background-color .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease), transform .12s var(--ease);
}
.tag .icon { width: 16px; height: 16px; color: var(--text-muted); transition: color .18s var(--ease); }
.tag:active { transform: translateY(1px); }
.tag.is-copied { background: #fff; border-color: #fff; color: var(--bg); }
.tag.is-copied .icon { color: var(--bg); }
@media (hover: hover) {
  .tag:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.4); }
  .tag:hover .icon { color: #fff; }
  .tag.is-copied:hover { background: #fff; }
  .tag.is-copied:hover .icon { color: var(--bg); }
}
@media (min-width: 768px) {
  .tag { min-height: 56px; padding: 0 22px 0 24px; font-size: 20px; }
}

/* ---------- 12. Rules ---------- */
.rules { display: grid; gap: var(--s3); }
.rule {
  display: flex; gap: var(--s4); align-items: flex-start;
  padding: var(--s5);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.rule > .icon { width: 24px; height: 24px; color: var(--mark-teal); margin-top: 2px; }
.rule h3 { font: 800 19px/1.25 var(--font-display); margin-bottom: 4px; }
.rule p { font-size: 15px; color: var(--text-muted); }
@media (min-width: 820px) { .rules { grid-template-columns: repeat(2, 1fr); gap: var(--s4); } }

.notice {
  margin-top: var(--s5);
  display: grid; gap: var(--s4);
  padding: var(--s5);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
}
.notice__item { display: flex; gap: var(--s3); align-items: flex-start; color: var(--text-body); font-size: 15px; }
.notice__item .icon { width: 20px; height: 20px; color: var(--text-muted); margin-top: 1px; }
@media (min-width: 820px) { .notice { grid-template-columns: 1fr 1fr; gap: var(--s6); } }

/* ---------- 13. Closing CTA ---------- */
.cta-band { padding: var(--s8) 0; border-top: 1px solid var(--line); }
.cta-band__inner { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s5); }
.cta-band h2 {
  font: 800 clamp(30px, 5vw, 48px)/1.08 var(--font-display);
  letter-spacing: -0.01em; max-width: 16ch;
}
@media (min-width: 820px) {
  .cta-band { padding: var(--s9) 0; }
  .cta-band__inner { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* ---------- 14. Footer ---------- */
.site-footer {
  background: #080A0C; color: var(--text-muted);
  border-top: 1px solid var(--line);
  padding: var(--s7) 0 calc(var(--s7) + env(safe-area-inset-bottom));
}
.site-footer__inner { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s4); }
.site-footer__logo { width: 72px; height: auto; margin-bottom: var(--s2); }
.site-footer__meta { font: 600 12px/1.2 var(--font-body); letter-spacing: .12em; text-transform: uppercase; }
.site-footer__copy { font-size: 14px; }
@media (min-width: 768px) {
  .site-footer__inner { flex-direction: row; align-items: center; gap: var(--s6); }
  .site-footer__logo { margin: 0 auto 0 0; }
}

/* ---------- 15. Toast ---------- */
.toast {
  position: fixed; left: 50%; z-index: 80;
  bottom: calc(24px + env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  background: #fff; color: var(--bg);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  font-weight: 600; font-size: 15px;
  transform: translate(-50%, 8px); opacity: 0;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.toast .icon { width: 18px; height: 18px; color: var(--bg); }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 16. Reveal motion ---------- */
.js .reveal { opacity: 0; transform: translateY(8px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- 17. Phone showcase ---------- */
.net__node:hover .net__dot, .net__node:focus-visible .net__dot { animation: none; }

.showcase { display: grid; gap: var(--s7); align-items: center; }
.showcase__copy .btn { margin-top: var(--s6); }
.showcase h2 { max-width: 14ch; }
.showcase__note { margin-top: var(--s4); font-size: 13px; color: var(--text-muted); }
@media (min-width: 900px) {
  .showcase { grid-template-columns: 1fr 1fr; gap: var(--s8); }
  .showcase .section-head__intro { max-width: 30rem; }
}

.phone { justify-self: center; width: min(340px, 82vw); }
.phone__frame {
  position: relative;
  aspect-ratio: 9 / 18.5;
  border-radius: 44px;
  background: #050607;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 0 0 6px #14191E, 0 30px 80px rgba(0,0,0,.55);
  padding: 12px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.phone__notch {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  width: 86px; height: 24px; border-radius: 20px; background: #000; z-index: 3;
}
.phone__bar {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 10px;
  padding: 48px 14px 12px;
  background: #141A1F;
  border-radius: 32px 32px 0 0;
  border-bottom: 1px solid var(--line);
}
.phone__bar img { width: 34px; height: 34px; border-radius: 50%; background: var(--bg); padding: 5px; }
.phone__title { color: #fff; font: 700 14px/1.2 var(--font-body); }
.phone__sub { color: var(--text-muted); font-size: 12px; }
.phone__chat {
  position: relative; flex: 1; overflow: hidden;
  background: #0E1317;
  border-radius: 0 0 32px 32px;
  padding: 12px 12px 0;
}
.phone__track { display: flex; flex-direction: column; gap: 12px; will-change: transform; }
.msg {
  width: 82%;
  background: #1C252C;
  border-radius: 12px 12px 12px 4px;
  padding: 5px;
}
.msg img { width: 100%; height: auto; border-radius: 9px; display: block; }
.msg__cap { display: flex; justify-content: space-between; align-items: center; padding: 6px 4px 2px; font-size: 13px; }
.msg__tag { color: var(--mark-teal); font-weight: 600; }
.msg__time { color: var(--text-muted); font-size: 11px; }

@media (prefers-reduced-motion: reduce) {
  .phone__chat { overflow-y: auto; }
}

/* Odd number of rules: centre the last one (same width as the others) */
@media (min-width: 820px) { .rule:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc(50% - var(--s4) / 2); } }
