/* =========================================================
   AcquihireTech — Scroll-driven 3D stage
   Layers a fixed WebGL canvas behind the page and gives the
   content the "acts" rhythm the scene is choreographed to.
   Pairs with js/scene3d.js.
   ========================================================= */

/* ---- The fixed stage ---- */
#scene-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 620px at 18% 12%, rgba(249,115,22,0.07), transparent 62%),
    radial-gradient(820px 560px at 82% 22%, rgba(59,130,246,0.08), transparent 62%),
    radial-gradient(760px 620px at 50% 92%, rgba(16,185,129,0.06), transparent 64%),
    linear-gradient(180deg, #fbfbfd 0%, #f6f7fa 55%, #fbfbfd 100%);
}
#scene-stage canvas { display: block; width: 100% !important; height: 100% !important; }

/* If WebGL is unavailable / reduced-motion, the gradient above is
   the whole experience — still branded, just still. */
#scene-stage.scene-fallback::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(680px 480px at 50% 40%, rgba(168,85,247,0.05), transparent 70%);
}

/* ---- 3D-projected HTML labels ---- */
#scene-labels {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.scene-label {
  position: absolute;
  top: 0; left: 0;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c, #1d1d1f);
  white-space: nowrap;
  opacity: 0;
  transition: opacity .35s ease;
  text-shadow: 0 1px 10px rgba(255,255,255,0.9);
}
.scene-label::before {
  content: "";
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 7px;
  vertical-align: middle;
}
.scene-label--station {
  color: #6e6e73;
  font-size: 10px;
  letter-spacing: 0.12em;
}

/* ---- Content sits above the stage ---- */
.site-header,
main,
.site-footer,
#scroll-progress { position: relative; z-index: 2; }
.site-header { z-index: 9999; }
#scroll-progress { z-index: 10000; }
.wa-float { z-index: 9998; }

/* =========================================================
   ACT RHYTHM
   Each act gets real scroll distance so the 3D timeline has
   room to breathe. Content is pinned centre-stage while the
   scene moves behind it.
   ========================================================= */
.act {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 96px 0;
}
.act--tall { min-height: 165vh; }
.act--short { min-height: auto; padding: 88px 0; }

/* Glass content panels — readable over a live 3D scene without
   killing the depth behind them. */
.glass {
  background: rgba(255,255,255,0.72);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  backdrop-filter: blur(22px) saturate(1.5);
  border: 1px solid rgba(255,255,255,0.85);
  border-radius: 24px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.9) inset,
    0 30px 70px -40px rgba(20,22,30,0.35);
}
.glass--pad { padding: 44px 40px; }
@media (max-width: 734px) { .glass--pad { padding: 30px 22px; border-radius: 18px; } }

/* Solid panels for dense reading blocks (FAQ, cases) — full
   opacity so long-form text never fights the scene. */
.solid-panel {
  background: rgba(255,255,255,0.94);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-light);
  border-radius: 24px;
  box-shadow: 0 30px 70px -45px rgba(20,22,30,0.3);
}

/* ---- Act 1: hero ---- */
.act-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  text-align: center;
}
.act-hero .display {
  font-size: clamp(38px, 6.2vw, 82px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  max-width: 19ch;
  margin: 0 auto 20px;
}
.act-hero .lead { max-width: 60ch; margin: 0 auto 30px; }

/* Scroll cue */
.scroll-cue {
  position: absolute;
  bottom: 34px; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-secondary);
}
.scroll-cue i {
  display: block; width: 1px; height: 40px;
  background: linear-gradient(180deg, transparent, var(--text-secondary));
  animation: cueDrop 2.1s ease-in-out infinite;
}
@keyframes cueDrop {
  0%, 100% { opacity: .25; transform: scaleY(.55); transform-origin: top; }
  50%      { opacity: 1;   transform: scaleY(1);   transform-origin: top; }
}

/* ---- Act 3: pipeline caption rail ---- */
.pipe-rail {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-top: 34px;
}
.pipe-step {
  text-align: center;
  padding: 16px 10px;
  border-radius: 14px;
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(0,0,0,0.05);
}
.pipe-step b {
  display: block;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  margin-bottom: 4px;
}
.pipe-step span {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  color: var(--text-secondary);
  letter-spacing: .04em;
}
@media (max-width: 820px) {
  .pipe-rail { grid-template-columns: repeat(2, 1fr); }
  .pipe-rail .pipe-step:last-child { grid-column: 1 / -1; }
}

/* ---- Motion-layer interplay ----
   When the 3D scene is live the flat CSS blobs are redundant
   noise — the scene IS the ambient motion. Suppress them. */
body.scene-on .blob-field { display: none; }
body.scene-on .hero-3d { background: transparent; }
body.scene-on #hero-canvas { display: none; }

/* Sections that previously painted their own solid background
   would occlude the scene — make them transparent so the 3D
   reads continuously top-to-bottom. */
body.scene-on .act,
body.scene-on .act > .container { background: transparent; }

/* =========================================================
   SUBTLE MODE — inner pages
   Inner pages paint opaque section backgrounds (var(--bg),
   var(--bg-tint), #fff). Because #scene-stage is a positioned
   fixed layer, content must sit above it — which means those
   opaque backgrounds would hide the scene completely: all the
   GPU cost, none of the effect. Here we make the large surfaces
   translucent so the scene reads through, while keeping every
   text-bearing surface opaque enough to stay comfortably
   readable (body copy never drops below ~92% opaque backing).
   ========================================================= */
body[data-scene="subtle"] .page-hero {
  background: transparent;
}

/* Broad section surfaces → frosted instead of solid */
body[data-scene="subtle"] main > section {
  background-color: transparent !important;
  position: relative;
  z-index: 2;
}

/* Re-establish readable backing for the content column only */
body[data-scene="subtle"] main > section > .container,
body[data-scene="subtle"] main > section > .container-wide {
  position: relative;
  z-index: 1;
}

/* Text-dense components keep near-solid backing for legibility */
body[data-scene="subtle"] .faq-list,
body[data-scene="subtle"] .eng-row,
body[data-scene="subtle"] .vx-case,
body[data-scene="subtle"] .insight-card,
body[data-scene="subtle"] .offer-card,
body[data-scene="subtle"] .post-card,
body[data-scene="subtle"] .audit-form,
body[data-scene="subtle"] article {
  background-color: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

/* Long-form article bodies stay fully solid — never make
   paragraph-length reading compete with a moving backdrop. */
body[data-scene="subtle"] .post-body,
body[data-scene="subtle"] .article-body,
body[data-scene="subtle"] .legal-body {
  background: #fff;
  border-radius: 20px;
}

/* Footer stays solid — it is the visual floor of the page */
body[data-scene="subtle"] .site-footer { position: relative; z-index: 2; }

/* Calmer backdrop tint on inner pages */
body[data-scene="subtle"] #scene-stage {
  background:
    radial-gradient(760px 520px at 15% 8%, rgba(249,115,22,0.045), transparent 62%),
    radial-gradient(700px 480px at 85% 18%, rgba(59,130,246,0.05), transparent 62%),
    linear-gradient(180deg, #fbfbfd 0%, #f7f8fa 60%, #fbfbfd 100%);
}
body[data-scene="subtle"] .scene-label { opacity: 0 !important; }

/* =========================================================
   REVIEW ENGINE — visible client outcomes
   Generated by scripts/build-reviews.js. Visible attribution is
   not decoration: unsupported rating markup with no on-page
   reviews is exactly what caused the removed 4.9/12 problem.
   ========================================================= */
.rv-section { padding: 90px 0; }
.rv-note {
  font-size: 14.5px;
  color: var(--text-secondary);
  max-width: 60ch;
  margin: 12px 0 0;
}
.rv-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 34px;
}
.rv-card {
  margin: 0;
  padding: 28px;
  background: rgba(255,255,255,0.95);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-light);
  border-radius: var(--r-card);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.rv-quote {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
}
.rv-quote::before { content: "\201C"; }
.rv-quote::after  { content: "\201D"; }
.rv-meta { display: flex; flex-direction: column; gap: 3px; margin-top: auto; }
.rv-author { font-weight: 700; font-size: 14px; color: var(--text); }
.rv-role { font-size: 13px; color: var(--text-dim); }
.rv-context {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: .03em;
}
.rv-outcome {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
  font-size: 13px;
  color: var(--text-dim);
}
/* Disclosure on founder-owned entries — visible, not hidden in a
   tooltip. It is the reason the aggregate excludes them. */
.rv-disclosure {
  margin-top: 8px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-secondary);
  font-style: italic;
}
.rv-card[data-first-party="true"] { border-style: dashed; }
@media (max-width: 900px) { .rv-grid { grid-template-columns: 1fr; } }

/* ---- Engine cards (Act 4) ---- */
.eng-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 34px;
}
.eng-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 30px 28px;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s ease;
}
.eng-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--e, #1d1d1f);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .45s cubic-bezier(.2,.8,.2,1);
}
.eng-card:hover::before, .eng-card:focus-visible::before { transform: scaleX(1); }
.eng-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 40px 80px -45px rgba(20,22,30,0.45);
}
.eng-card-tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--e, #1d1d1f);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.eng-card-tag::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--e, #1d1d1f);
}
.eng-card h3 {
  font-family: var(--font);
  font-size: clamp(20px, 2.1vw, 26px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 0;
}
.eng-card p {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-dim);
  margin: 0;
}
.eng-card-go {
  margin-top: auto;
  padding-top: 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}
@media (max-width: 820px) { .eng-cards { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  .scroll-cue i { animation: none; opacity: .6; }
  .act, .act--tall { min-height: auto; padding: 72px 0; }
  .eng-card:hover { transform: none; }
}
