/* =========================================================
   DA Agency — animated first screen (scroll-assembled scene)
   All selectors are prefixed with .hero- to stay isolated
   from css/style.css. Uses the site's CSS variables.
   ========================================================= */

:root {
  --hero-hdr: 75px;              /* fixed site header height; JS refines it */
  --hero-green-soft: #12260A;    /* dark green deal tint */
  --hero-line: #2A2C31;
  --hero-k: .55;                 /* explode factor (desktop) */
}
@media (max-width: 768px) { :root { --hero-hdr: 68px; } }
@media (max-width: 899.98px) { :root { --hero-k: .4; } }

.hero-scroll {
  position: relative;
  height: calc(100vh - var(--hero-hdr));
  height: calc(100svh - var(--hero-hdr));
  min-height: 520px;
  overflow: hidden;
  padding: 0;               /* override global section padding */
  background: var(--void);
}

.hero-grid {
  height: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 16px 28px 28px;
  display: grid;
  grid-template-columns: minmax(0, .74fr) minmax(0, 1.36fr);
  gap: 20px;
  align-items: center;
}

/* ---------- Text column ---------- */
.hero-text { position: relative; z-index: 3; }
.hero-text .eyebrow { margin-bottom: 18px; }
.hero-title {
  font-size: clamp(44px, 4.6vw, 72px);
  line-height: .94;
  margin: 0 0 22px;
}
.hero-title .accent { color: var(--green); }
.hero-lede {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 40ch;
  margin: 0 0 26px;
}
.hero-actions-row { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-actions-row .btn-primary,
.hero-actions-row .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  height: 50px; padding: 0 24px; font-size: 15px; line-height: 1;
  white-space: nowrap;
}
.hero-actions-row a:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.hero-text .hero-live { margin-top: 22px; }

/* ---------- Scroll hint ---------- */
.hero-hint {
  position: absolute; z-index: 5;
  left: max(28px, calc((100% - 1480px) / 2 + 28px));
  bottom: 24px;
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; font-weight: 600; color: var(--text-muted);
  pointer-events: none;
}
.hero-mouse {
  width: 20px; height: 30px; border: 2px solid currentColor; border-radius: 11px; position: relative;
}
.hero-mouse::after {
  content: ""; position: absolute; left: 50%; top: 6px; width: 3px; height: 6px; margin-left: -1.5px;
  border-radius: 2px; background: var(--green); animation: hero-wheel 1.4s ease-in-out infinite;
}
@keyframes hero-wheel {
  0% { opacity: 0; transform: translateY(-2px); }
  40% { opacity: 1; }
  100% { opacity: 0; transform: translateY(8px); }
}

/* ---------- Scene ---------- */
.hero-scene-box { position: relative; width: 100%; height: 100%; min-height: 0; align-self: stretch; }
.hero-scene {
  position: absolute; left: 50%; top: 50%;
  width: 600px; height: 560px;
  transform-origin: 50% 50%;
  transform: translate(-50%, -50%) scale(var(--hero-s, 1));
  perspective: 1400px;
  font-variant-numeric: tabular-nums;
}
.hero-glow {
  position: absolute; left: 40px; top: 150px; width: 520px; height: 380px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(83, 215, 11, .28), rgba(83, 215, 11, 0));
  filter: blur(10px);
}
.hero-team { position: absolute; left: 0; top: 137px; width: 600px; height: 423px; transform-origin: 50% 100%; }
.hero-team img { width: 100%; height: 100%; display: block; max-width: none; }

.hero-piece {
  position: absolute; z-index: 2;
  left: calc(var(--x) * 1px); top: calc(var(--y) * 1px);
  will-change: transform, opacity;
}
.hero-piece[style*="--w"] { width: calc(var(--w) * 1px); height: calc(var(--h) * 1px); }
.hero-float { width: 100%; height: 100%; }
.hero-card {
  width: 100%; height: 100%;
  background: var(--surface); border: 1px solid var(--hero-line); border-radius: 12px;
  box-shadow: 0 22px 44px -22px rgba(0, 0, 0, .9);
  color: var(--text); line-height: 1.3;
}

.hero-pill {
  height: 26px; padding: 0 11px; border-radius: 4px;
  background: var(--surface2); border: 1px solid var(--hero-line);
  font-size: 12px; font-weight: 700; color: #D7D9DD;
  display: inline-flex; align-items: center; white-space: nowrap;
}

/* Ad card */
.hero-ad .hero-card { padding: 12px; }
.hero-ad-head { display: flex; align-items: center; gap: 8px; }
.hero-ava {
  width: 24px; height: 24px; border-radius: 50%; background: var(--text); color: var(--void);
  font-size: 10px; font-weight: 700; display: grid; place-items: center; flex: none;
}
.hero-ad-head b { font-size: 12px; display: block; line-height: 1.15; }
.hero-ad-head small { font-size: 10px; color: var(--text-muted); }
.hero-ad-media {
  margin-top: 9px; height: 48px; overflow: hidden; border-radius: 6px;
  background: var(--green); color: var(--void); padding: 7px 10px;
}
.hero-ad-media b {
  display: block; white-space: nowrap; font-family: 'Oswald', Arial, sans-serif; font-weight: 700;
  text-transform: uppercase; font-size: 15px; letter-spacing: .01em; line-height: 1.1;
}
.hero-ad-media span { font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.hero-ad-cta {
  margin-top: 9px; height: 28px; border-radius: 4px; background: var(--surface2); border: 1px solid var(--hero-line);
  font-size: 11.5px; font-weight: 700; display: grid; place-items: center;
}

/* Lead card */
.hero-lead .hero-card { padding: 11px 12px; position: relative; }
.hero-lead-label { font-size: 10.5px; font-weight: 700; color: var(--green); display: flex; align-items: center; gap: 6px; }
.hero-live-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: hero-live 1.6s infinite; }
@keyframes hero-live {
  0% { box-shadow: 0 0 0 0 rgba(83, 215, 11, .6); }
  70%, 100% { box-shadow: 0 0 0 7px rgba(83, 215, 11, 0); }
}
.hero-lead-name { font-size: 14px; font-weight: 700; margin-top: 5px; }
.hero-lead-src { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.hero-face {
  position: absolute; right: 11px; top: 50%; width: 38px; height: 38px; margin-top: -19px;
  border-radius: 50%; object-fit: cover; border: 2px solid var(--green); max-width: none;
}

/* Deal card */
.hero-deal .hero-card { padding: 11px 12px; position: relative; overflow: hidden; }
.hero-deal-tint { position: absolute; inset: 0; background: var(--hero-green-soft); opacity: 0; }
.hero-deal .hero-card > :not(.hero-deal-tint) { position: relative; }
.hero-deal-row { display: flex; justify-content: space-between; align-items: center; }
.hero-status-wrap { position: relative; height: 15px; flex: 1; }
.hero-deal-status { font-size: 10.5px; font-weight: 700; color: var(--text-muted); white-space: nowrap; }
.hero-deal-status.is-done { position: absolute; left: 0; top: 0; color: var(--green); opacity: 0; }
.hero-stamp {
  width: 24px; height: 24px; border-radius: 50%; background: var(--green); color: var(--void);
  display: grid; place-items: center; transform: scale(0);
}
.hero-stamp svg { width: 13px; height: 13px; }
.hero-deal-item { font-size: 14px; font-weight: 700; margin-top: 7px; }
.hero-deal-team { display: flex; align-items: center; gap: 8px; margin-top: 9px; font-size: 10.5px; color: var(--text-muted); font-weight: 600; }
.hero-stack { display: flex; }
.hero-stack img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; border: 2px solid var(--surface); max-width: none; }
.hero-stack img + img { margin-left: -7px; }

/* Revenue panel */
.hero-rev .hero-card { padding: 14px 18px; display: grid; grid-template-columns: 1fr 130px; gap: 18px; align-items: end; }
.hero-rev-title { font-size: 11.5px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.hero-rev-num {
  font-family: 'Oswald', Arial, sans-serif; font-weight: 700; font-size: 32px; line-height: 1;
  margin-top: 8px; white-space: nowrap; letter-spacing: .01em;
}
.hero-rev-num small { font-size: .6em; color: var(--green); margin-left: 4px; }
.hero-bars { height: 52px; display: flex; align-items: flex-end; gap: 5px; }
.hero-bar { flex: 1; border-radius: 2px 2px 0 0; background: #2C2E34; transform-origin: 50% 100%; }
.hero-bar.is-hot { background: var(--green); }

/* Stickers */
.hero-sticker {
  height: 34px; padding: 0 14px; border-radius: 4px; font-size: 13.5px; font-weight: 700;
  display: inline-flex; align-items: center; white-space: nowrap;
  box-shadow: 0 14px 28px -14px rgba(0, 0, 0, .9);
}
.hero-sticker-roas { background: var(--green); color: var(--void); font-family: 'Oswald', Arial, sans-serif; font-size: 15px; letter-spacing: .02em; }
.hero-sticker-cpl { background: var(--text); color: var(--void); }

/* Connection lines (pathLength="1" → dash values are 0..1) */
.hero-links { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 1; }
.hero-links path { fill: none; stroke: var(--green); stroke-width: 2; stroke-linecap: butt; stroke-dasharray: 1; stroke-dashoffset: 1; }
.hero-links circle { fill: var(--green); }

/* ---------- Exploded start state, before hero.js takes over ----------
   Same values as the GSAP start state (order matches GSAP's transform output),
   so there is no jump when the script initialises.
   Only active when NOT in static mode (e.g. desktop). */
html:not(.hero-static) .hero-scene:not(.is-ready):not(.is-static) .hero-piece {
  transform: perspective(1400px)
    translate3d(calc(var(--fx) * var(--hero-k) * 1px), calc(var(--fy) * var(--hero-k) * 1px), calc(var(--fz) * var(--hero-k) * 1px))
    rotate(calc(var(--rz) * 1deg)) rotateY(calc(var(--ry) * 1deg)) rotateX(calc(var(--rx) * 1deg));
  opacity: .92;
}
html:not(.hero-static) .hero-scene:not(.is-ready):not(.is-static) .hero-piece.is-sticker { opacity: 0; }
html:not(.hero-static) .hero-scene:not(.is-ready):not(.is-static) .hero-team { transform: translateY(10px) scale(1.05); }
html:not(.hero-static) .hero-scene:not(.is-ready):not(.is-static) .hero-glow { opacity: .35; transform: scale(.85); }
html:not(.hero-static) .hero-scene:not(.is-ready):not(.is-static) .hero-bar { transform: scaleY(.08); }
html:not(.hero-static) .hero-scene:not(.is-ready):not(.is-static) .hero-links circle { opacity: 0; }

/* Static fallback (GSAP failed to load or mobile < 900px): fully assembled */
.hero-scene.is-static .hero-links path,
.hero-static .hero-scene .hero-links path { stroke-dashoffset: 0; }
.hero-scene.is-static .hero-piece.is-sticker,
.hero-static .hero-scene .hero-piece.is-sticker { transform: rotate(calc(var(--rot) * 1deg)); opacity: 1; }
.hero-scene.is-static .hero-deal-tint,
.hero-static .hero-scene .hero-deal-tint,
.hero-scene.is-static .hero-deal-status.is-done,
.hero-static .hero-scene .hero-deal-status.is-done { opacity: 1; }
.hero-scene.is-static .hero-deal-status:not(.is-done),
.hero-static .hero-scene .hero-deal-status:not(.is-done) { opacity: 0; }
.hero-scene.is-static .hero-stamp,
.hero-static .hero-scene .hero-stamp { transform: none; }
.hero-static .hero-hint { display: none !important; }

/* ---------- Reduced motion: assembled immediately, no hint ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero-hint { display: none; }
  .hero-mouse::after, .hero-live-pulse { animation: none; }
}

/* ---------- Mobile (< 900px) ---------- */
@media (max-width: 899.98px) {
  :root {
    --hero-s: clamp(0.44, calc((100vw - 36px) / 600 * 0.88), 0.85);
  }
  .hero-scene {
    --hero-s: clamp(0.44, calc((100vw - 36px) / 600 * 0.88), 0.85);
  }
  .hero-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 4px;
    padding: 14px 18px 52px;
    align-items: stretch;
  }
  .hero-title { font-size: clamp(40px, 12vw, 58px); margin-bottom: 12px; }
  .hero-text .eyebrow { margin-bottom: 10px; font-size: 10.5px; }
  .hero-lede { font-size: 14.5px; margin-bottom: 14px; }
  .hero-actions-row { flex-wrap: nowrap; gap: 8px; }
  .hero-actions-row .btn-primary,
  .hero-actions-row .btn-ghost { flex: 1 1 0; height: 46px; padding: 0 10px; font-size: 14px; }
  .hero-text .hero-live { display: none; }
  .hero-hint { bottom: 14px; left: 50%; transform: translateX(-50%); }
}
@media (max-width: 899.98px) and (max-height: 800px) { .hero-lede { display: none; } }
