/* ==========================================================================
   BeeProton AI — home page presentation layer.
   Loaded only on "/" so the rest of the site stays lean. Every animation is
   transform/opacity only (no layout thrash), and all of it stops under
   prefers-reduced-motion, which main.css already enforces globally.
   ========================================================================== */

/* ---------- hero shell ---------- */
.hx { position: relative; overflow: hidden; padding: clamp(40px, 6vw, 80px) 0 clamp(44px, 5vw, 72px);
  background: var(--hero-bg); isolation: isolate; }
.hx-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(28px, 4vw, 60px); align-items: center; }

/* animated aurora blobs behind the hero */
.hx-aurora { position: absolute; inset: -20% -10% auto -10%; height: 130%; z-index: -2; pointer-events: none; filter: blur(60px); opacity: .55; }
.hx-aurora span { position: absolute; display: block; border-radius: 50%; mix-blend-mode: normal; }
.hx-aurora span:nth-child(1) { width: 46vw; height: 46vw; left: -6vw; top: 2vw; background: radial-gradient(circle at 30% 30%, rgba(245,165,36,.55), transparent 65%); animation: hx-drift1 22s ease-in-out infinite; }
.hx-aurora span:nth-child(2) { width: 40vw; height: 40vw; right: -4vw; top: -6vw; background: radial-gradient(circle at 60% 40%, rgba(42,60,102,.45), transparent 65%); animation: hx-drift2 26s ease-in-out infinite; }
.hx-aurora span:nth-child(3) { width: 30vw; height: 30vw; left: 42%; bottom: -10vw; background: radial-gradient(circle at 50% 50%, rgba(255,207,92,.40), transparent 65%); animation: hx-drift3 30s ease-in-out infinite; }
:root[data-theme="dark"] .hx-aurora { opacity: .42; }
@keyframes hx-drift1 { 0%,100% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(6%, 4%, 0) scale(1.12); } }
@keyframes hx-drift2 { 0%,100% { transform: translate3d(0,0,0) scale(1.05); } 50% { transform: translate3d(-5%, 6%, 0) scale(.95); } }
@keyframes hx-drift3 { 0%,100% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(-8%, -6%, 0) scale(1.15); } }

/* faint moving grid */
.hx-grid-lines { position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background-image: linear-gradient(to right, rgba(107,127,168,.10) 1px, transparent 1px),
                    linear-gradient(to bottom, rgba(107,127,168,.10) 1px, transparent 1px);
  background-size: 48px 48px; mask-image: radial-gradient(70% 60% at 50% 30%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(70% 60% at 50% 30%, #000 40%, transparent 100%);
  animation: hx-pan 40s linear infinite; }
@keyframes hx-pan { to { background-position: 48px 48px; } }

/* ---------- hero copy ---------- */
.hx-badge { display: inline-flex; align-items: center; gap: 9px; padding: 7px 14px 7px 8px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); font-size: .84rem;
  font-weight: 600; color: var(--text-2); text-decoration: none; transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.hx-badge:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.hx-badge b { background: var(--brand-grad); color: var(--on-accent); padding: 3px 9px; border-radius: 999px; font-size: .74rem; letter-spacing: .02em; }
.hx-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(14,159,110,.55); animation: hx-pulse 2.4s infinite; }
@keyframes hx-pulse { 70% { box-shadow: 0 0 0 9px rgba(14,159,110,0); } 100% { box-shadow: 0 0 0 0 rgba(14,159,110,0); } }

.hx h1 { font-size: clamp(2.1rem, 4.6vw, 3.5rem); line-height: 1.12; letter-spacing: -.03em; margin: 18px 0 0; }
/* rotating word: fixed height so nothing shifts while it cycles */
.hx-rotator { display: inline-grid; vertical-align: bottom; overflow: hidden; height: 1.12em; }
.hx-rotator span { grid-area: 1 / 1; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text;
  color: transparent; opacity: 0; transform: translateY(60%); animation: hx-roll 12s cubic-bezier(.2,.8,.2,1) infinite;
  white-space: nowrap; }
.hx-rotator span:nth-child(2) { animation-delay: 3s; }
.hx-rotator span:nth-child(3) { animation-delay: 6s; }
.hx-rotator span:nth-child(4) { animation-delay: 9s; }
@keyframes hx-roll {
  0%   { opacity: 0; transform: translateY(60%); }
  3%, 24% { opacity: 1; transform: translateY(0); }
  27%, 100% { opacity: 0; transform: translateY(-60%); }
}
.hx-lead { font-size: clamp(1rem, 1.35vw, 1.12rem); color: var(--text-2); max-width: 56ch; margin: 18px 0 26px; line-height: 1.65; }
.hx-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hx-cta .btn-primary { position: relative; overflow: hidden; }
.hx-cta .btn-primary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 20%, rgba(255,255,255,.55) 45%, transparent 70%);
  transform: translateX(-120%); animation: hx-sheen 4.5s ease-in-out 1.5s infinite; }
@keyframes hx-sheen { 0% { transform: translateX(-120%); } 55%, 100% { transform: translateX(160%); } }

/* counters */
.hx-stats { display: flex; gap: clamp(18px, 3vw, 40px); margin-top: 34px; flex-wrap: wrap; }
.hx-stats div { min-width: 78px; }
.hx-stats b { display: block; font-size: clamp(1.5rem, 2.6vw, 2rem); letter-spacing: -.02em; line-height: 1.1;
  font-variant-numeric: tabular-nums; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hx-stats span { font-size: .8rem; color: var(--muted); }

/* ---------- hero terminal ---------- */
.hx-stage { position: relative; }
.hx-term { background: var(--code-bg); border: 1px solid rgba(255,255,255,.08); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); overflow: hidden; transform: perspective(1200px) rotateY(-7deg) rotateX(3deg);
  transition: transform .5s var(--ease); will-change: transform; }
.hx-stage:hover .hx-term { transform: perspective(1200px) rotateY(-2deg) rotateX(1deg) translateY(-4px); }
.hx-term-bar { display: flex; align-items: center; gap: 8px; padding: 11px 14px; background: rgba(255,255,255,.05); border-bottom: 1px solid rgba(255,255,255,.07); }
.hx-term-bar i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.hx-term-bar i:nth-child(1) { background: #ff5f57; } .hx-term-bar i:nth-child(2) { background: #febc2e; } .hx-term-bar i:nth-child(3) { background: #28c840; }
.hx-term-bar span { margin-left: 6px; color: #8FA0C0; font: 500 .76rem/1 var(--mono); }
.hx-code { margin: 0; padding: 18px 18px 20px; font: 400 .82rem/1.75 var(--mono); color: var(--code-text);
  min-height: 268px; white-space: pre-wrap; word-break: break-word; }
.hx-code .k { color: #FFBE2E; } .hx-code .s { color: #7EE2A8; } .hx-code .c { color: #6B7FA8; } .hx-code .f { color: #79B8FF; }
.hx-caret { display: inline-block; width: 8px; height: 1.05em; vertical-align: -2px; background: var(--amber-400); animation: hx-blink 1s step-end infinite; }
@keyframes hx-blink { 50% { opacity: 0; } }
.hx-out:not([hidden]) { display: block; }
.hx-out { border-top: 1px dashed rgba(255,255,255,.12); margin-top: 12px; padding-top: 12px; color: #9FB4D6; }
.hx-out b { color: #7EE2A8; }

/* floating glass chips around the terminal */
.hx-chip { position: absolute; display: flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(8px);
  border: 1px solid var(--border); box-shadow: var(--shadow); font-size: .8rem; font-weight: 600; white-space: nowrap; }
.hx-chip small { color: var(--muted); font-weight: 500; }
.hx-chip.c1 { top: -30px; left: -10%; animation: hx-float 7s ease-in-out infinite; }
.hx-chip.c2 { bottom: -24px; left: -7%; animation: hx-float 9s ease-in-out .8s infinite; }
.hx-chip.c3 { bottom: -26px; right: -6%; animation: hx-float 8s ease-in-out .4s infinite; }
@keyframes hx-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-11px); } }

/* ---------- tech marquee ---------- */
.hx-marquee { position: relative; overflow: hidden; padding: 18px 0; border-block: 1px solid var(--border); background: var(--surface); }
.hx-marquee::before, .hx-marquee::after { content: ""; position: absolute; top: 0; bottom: 0; width: 90px; z-index: 2; pointer-events: none; }
.hx-marquee::before { left: 0; background: linear-gradient(90deg, var(--surface), transparent); }
.hx-marquee::after { right: 0; background: linear-gradient(270deg, var(--surface), transparent); }
.hx-track { display: flex; gap: 48px; width: max-content; animation: hx-scroll 38s linear infinite; }
.hx-marquee:hover .hx-track { animation-play-state: paused; }
.hx-track span { font: 600 .95rem/1 var(--font); color: var(--muted); letter-spacing: .01em; opacity: .85;
  display: inline-flex; align-items: center; gap: 8px; }
@keyframes hx-scroll { to { transform: translateX(-50%); } }

/* ---------- privacy diagram ---------- */
.hx-flow { display: grid; grid-template-columns: 1.02fr .98fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.hx-svg { width: 100%; height: auto; }
.hx-svg .dash { stroke-dasharray: 7 7; animation: hx-dash 1.4s linear infinite; }
@keyframes hx-dash { to { stroke-dashoffset: -28; } }
.hx-svg .pulse { transform-box: fill-box; transform-origin: center; animation: hx-beat 2.6s ease-in-out infinite; }
@keyframes hx-beat { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.06); opacity: .88; } }

/* ---------- process line ---------- */
.hx-steps { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 12px; }
.hx-steps::before { content: ""; position: absolute; left: 6%; right: 6%; top: 26px; height: 2px; background: var(--border); }
.hx-steps::after { content: ""; position: absolute; left: 6%; top: 26px; height: 2px; width: 0; background: var(--brand-grad);
  transition: width 1.4s var(--ease); }
.hx-steps.in::after { width: 88%; }
.hx-step { position: relative; text-align: center; padding-top: 0; }
.hx-step i { position: relative; z-index: 1; display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 14px;
  border-radius: 50%; background: var(--surface); border: 2px solid var(--border); font: 700 1rem/1 var(--font); color: var(--muted);
  font-style: normal; transition: .4s var(--ease); }
.hx-steps.in .hx-step i { border-color: transparent; background: var(--brand-grad); color: var(--on-accent); box-shadow: 0 8px 20px -8px rgba(245,165,36,.8); }
.hx-steps.in .hx-step:nth-child(2) i { transition-delay: .25s; }
.hx-steps.in .hx-step:nth-child(3) i { transition-delay: .5s; }
.hx-steps.in .hx-step:nth-child(4) i { transition-delay: .75s; }
.hx-step h3 { font-size: 1rem; margin: 0 0 6px; }
.hx-step p { font-size: .86rem; color: var(--muted); margin: 0; }

/* ---------- card polish shared by home sections ---------- */
.hx-lift { transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease); }
.hx-lift:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
html.bp-anim .hx-reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
html.bp-anim .hx-reveal.in { opacity: 1; transform: none; }
.hx-reveal[data-delay="1"] { transition-delay: .09s; }
.hx-reveal[data-delay="2"] { transition-delay: .18s; }
.hx-reveal[data-delay="3"] { transition-delay: .27s; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .hx-grid, .hx-flow { grid-template-columns: 1fr; }
  .hx-stage { margin-top: 8px; }
  .hx-term { transform: none; }
  .hx-chip.c1 { left: auto; right: 2%; top: -14px; }
  .hx-chip.c2 { left: 2%; bottom: -16px; }
  .hx-chip.c3 { display: none; }
  .hx-steps { grid-template-columns: repeat(2, 1fr); gap: 26px 16px; }
  .hx-steps::before, .hx-steps::after { display: none; }
}
@media (max-width: 560px) {
  .hx-code { min-height: 210px; font-size: .74rem; padding: 14px; }
  .hx-chip { font-size: .74rem; padding: 7px 10px; }
  .hx-stats { gap: 16px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .hx-rotator { height: auto; }
  .hx-rotator span { position: static; opacity: 1; transform: none; }
  .hx-rotator span + span { display: none; }
  .hx-reveal { opacity: 1; transform: none; }
  .hx-steps::after { width: 88%; }
}


/* ---------- home sections ---------- */
.hx-sec .eyebrow { position: relative; }
.hx-sec .section-head h2 { letter-spacing: -.025em; }

/* service cards: gradient cap, gradient icon tile, sliding arrow */
.hx-svc { position: relative; overflow: hidden; }
.hx-svc::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--brand-grad);
  transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease); }
.hx-svc:hover::before { transform: scaleX(1); }
.card.hx-svc .card-icon, .hx-sec .card.hx-svc .card-icon { background: var(--brand-grad); color: var(--on-accent);
  box-shadow: 0 10px 22px -12px rgba(245,165,36,.9); transition: transform .35s var(--ease); }
.hx-svc:hover .card-icon { transform: translateY(-2px) rotate(-6deg); }
.hx-svc .price-tease .more { transition: gap .3s var(--ease); }
.hx-svc:hover .price-tease .more { gap: 10px; }

/* tool category rows */
.hx-tools .tool-card { transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease); }
.hx-tools .tool-card:hover { transform: translateX(4px); box-shadow: var(--shadow); }
.hx-tools .tool-card .ti { transition: transform .3s var(--ease); }
.hx-tools .tool-card:hover .ti { transform: scale(1.08); }
.hx-tools .grid.g-auto > * { transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.hx-tools .grid.g-auto > *:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }

/* stagger helpers used by the card loops */
.hx-reveal[data-delay="4"] { transition-delay: .36s; }
.hx-reveal[data-delay="5"] { transition-delay: .45s; }
.hx-reveal[data-delay="6"] { transition-delay: .5s; }
.hx-reveal[data-delay="7"] { transition-delay: .55s; }


/* ---------- home: service grid ---------- */
.hx-svcgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.hx-svccard { display: grid; grid-template-rows: auto 1fr; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; text-decoration: none; color: inherit; position: relative;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .4s var(--ease); }
.hx-svccard:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.hx-svccard::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--brand-grad);
  transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease); z-index: 2; }
.hx-svccard:hover::before { transform: scaleX(1); }
.hx-svcart { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 9%, var(--surface)), var(--surface));
  padding: 18px 18px 0; display: grid; place-items: center; }
.hx-svcart .sv-art { max-height: 190px; width: auto; max-width: 100%; }
.hx-svcbody { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 8px; }
.hx-svcbody h3 { margin: 0; font-size: 1.22rem; letter-spacing: -.02em; }
.hx-svcbody p { margin: 0; color: var(--text-2); font-size: .93rem; flex: 1; }
.hx-svcfoot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px;
  padding-top: 14px; border-top: 1px dashed var(--border); }
.hx-svclink { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; font-size: .9rem; color: var(--accent-strong);
  transition: gap .3s var(--ease); }
.hx-svccard:hover .hx-svclink { gap: 11px; }

/* ---------- home: why band ---------- */
.hx-why { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(24px, 4vw, 56px); align-items: center; }

@media (max-width: 900px) {
  .hx-svcgrid { grid-template-columns: 1fr; }
  .hx-why { grid-template-columns: 1fr; }
  .hx-svcart .sv-art { max-height: 160px; }
}

/* ---------- measured-outcomes band -------------------------------------------------
   Sits between the header and the hero. It says what a client actually gets, in their
   language, and keeps moving so the eye catches it — but slowly, and it stops on hover
   and under prefers-reduced-motion, so it never fights with the headline below.
   ---------------------------------------------------------------------------------- */
.mband { position: relative; z-index: 1; border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, var(--accent-bg) 0%, var(--surface) 42%, var(--surface) 100%); }
.mband-in { display: flex; align-items: center; gap: clamp(12px, 2vw, 22px); padding: 9px 0; min-width: 0; }

.mband-head { flex-shrink: 0; margin: 0; display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: .82rem; letter-spacing: -.01em; color: var(--text); white-space: nowrap;
  padding-right: clamp(12px, 2vw, 22px); border-right: 1px solid var(--border); }
.mband-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(245,165,36,.65); animation: mband-pulse 2.6s ease-out infinite; }
@keyframes mband-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(245,165,36,.6); }
  70%  { box-shadow: 0 0 0 9px rgba(245,165,36,0); }
  100% { box-shadow: 0 0 0 0 rgba(245,165,36,0); }
}

/* the moving rail: two identical lists side by side, translated by exactly half, so the
   loop has no visible seam */
.mband-track { position: relative; flex: 1; min-width: 0; display: flex; overflow: hidden;
  /* a wide fade at both ends, so a phrase entering or leaving reads as movement rather than as
     text that has been cut off */
  mask-image: linear-gradient(to right, transparent 0, #000 72px, #000 calc(100% - 84px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 72px, #000 calc(100% - 84px), transparent 100%); }
.mband-list { display: flex; align-items: center; gap: clamp(18px, 3vw, 38px); flex-shrink: 0;
  list-style: none; margin: 0; padding: 0 clamp(9px, 1.5vw, 19px); animation: mband-roll 46s linear infinite; }
.mband-list li { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  font-size: .82rem; font-weight: 500; color: var(--muted); }
.mband-list li + li::before { content: "·"; margin-right: clamp(18px, 3vw, 38px); color: var(--border-strong); }
.mband-list li svg { color: var(--accent); flex-shrink: 0; }
@keyframes mband-roll { from { transform: translate3d(0,0,0); } to { transform: translate3d(-100%,0,0); } }
.mband:hover .mband-list, .mband:focus-within .mband-list { animation-play-state: paused; }

.mband-cta { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-size: .8rem; font-weight: 700; color: var(--accent);
  padding-left: clamp(12px, 2vw, 22px); border-left: 1px solid var(--border); }
.mband-cta:hover { color: var(--accent-strong); }
.mband-cta svg { transition: transform .18s ease; }
.mband-cta:hover svg { transform: translateX(3px); }

:root[data-theme="dark"] .mband {
  background: linear-gradient(90deg, rgba(245,165,36,.10) 0%, var(--surface) 46%, var(--surface) 100%); }

@media (max-width: 900px) { .mband-cta { display: none; } }
@media (max-width: 900px) {
  /* the promise is the point, so it stays — it moves onto its own line and the phrases run under it */
  .mband-in { flex-wrap: wrap; row-gap: 6px; }
  .mband-head { flex-basis: 100%; border-right: 0; padding-right: 0; }
  .mband-track { flex-basis: 100%; }
}
@media (max-width: 620px) {
  .mband-head { font-size: .82rem; }
  .mband-track { mask-image: linear-gradient(to right, transparent 0, #000 40px, #000 calc(100% - 40px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 40px, #000 calc(100% - 40px), transparent 100%); }
  .mband-list li { font-size: .76rem; }
  .mband-in { padding: 8px 0; }
}
@media (prefers-reduced-motion: reduce) {
  .mband-list { animation: none; }
  .mband-pulse { animation: none; }
}
