/* Agentic Labs hero: CSS 3D scene modeled on the "Deploy AI Agents for Your
   Business" concept art. Glass cube with the Agentic mark on a three-tier lit
   pedestal, six thick glass agent cards angled toward it, flowing data links,
   and a night-city room painted on canvas. hero-3d.js adds pointer tilt,
   the room and the sparks; without JS the scene is still complete. */

@property --h3-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

.hero--3d {
  --rx: 0deg; --ry: 0deg;
  grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr);
  align-items: center;
  min-height: min(820px, calc(100svh - 72px));
  padding-top: clamp(32px, 4vw, 56px);
  padding-bottom: clamp(40px, 4vw, 64px);
  gap: clamp(12px, 2vw, 32px);
  overflow: hidden;
  background: #070818;
}

/* ── Backdrop (canvas room: sky, skyline, window frames, plants, lamps) ─ */
.hero__sky { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.hero__sky canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero__sky::after {
  /* keep the copy side readable, and ground the scene */
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(6, 6, 20, .72) 0%, rgba(6, 6, 20, .45) 36%, rgba(6, 6, 20, 0) 60%),
    linear-gradient(180deg, rgba(6, 6, 20, 0) 62%, rgba(6, 6, 20, .7) 100%);
}

/* ── Copy ────────────────────────────────────────────────────────────── */
.hero--3d .hero__copy { padding-top: 0; }
.hero__brand { display: inline-flex; align-items: center; gap: 14px; margin: 0 0 22px; font: 600 clamp(1.4rem, 2vw, 1.9rem)/1 var(--font-display); letter-spacing: -.03em; color: #fff; }
.hero__mark { width: clamp(40px, 3.2vw, 50px); height: clamp(36px, 2.9vw, 45px); flex: 0 0 auto; filter: drop-shadow(0 0 10px rgba(79, 216, 255, .55)); }
.hero--3d h1 { font-size: clamp(2.7rem, 4.3vw, 4.7rem); font-weight: 700; letter-spacing: -.045em; line-height: 1.04; text-shadow: 0 2px 30px rgba(0, 0, 0, .5); }
.hero--3d h1 .grad {
  background: linear-gradient(100deg, #8fb8ff 0%, #7f8cff 30%, #9d6bff 65%, #c27bff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 20px rgba(150, 100, 255, .4));
}
.hero--3d .lead { max-width: 31rem; margin-top: 22px; font-size: clamp(1.02rem, 1.35vw, 1.2rem); line-height: 1.5; color: #d8dae8; }
.btn--glow {
  color: #fff; border: 0;
  background: linear-gradient(100deg, #6a5cff, #8b5cf6 48%, #b25cff);
  box-shadow: 0 10px 34px rgba(124, 92, 255, .5), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.btn--glow:hover { transform: translateY(-2px); box-shadow: 0 14px 44px rgba(124, 92, 255, .65), inset 0 1px 0 rgba(255, 255, 255, .34); }
.hero--3d .btn--ghost { border: 1.5px solid rgba(255, 255, 255, .85); color: #fff; background: rgba(6, 6, 20, .25); }
.hero--3d .btn--ghost:hover { background: rgba(255, 255, 255, .08); }
.hero__call { margin: 22px 0 0; font-size: .9rem; color: var(--ink-dim); }
.hero__call a { display: inline-flex; align-items: center; gap: 10px; color: #e8e9f5; text-decoration: none; font-weight: 500; }
.hero__call a:hover span { text-decoration: underline; text-underline-offset: 3px; }
.hero__call i { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #5ef0b0; box-shadow: 0 0 10px #5ef0b0; }
.hero__call i::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 1px solid #5ef0b0; animation: h3-ping 2s ease-out infinite; }
.hero__call small { display: block; margin-top: 3px; padding-left: 18px; color: var(--ink-faint); font-size: .78rem; font-weight: 400; }

/* ── Stage ───────────────────────────────────────────────────────────── */
.hero--3d .hero__stage { height: clamp(440px, 37vw, 560px); perspective: 1600px; perspective-origin: 50% 35%; }
.hero--3d .hero__stage::before { display: none; }
.scene__rig { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(var(--rx)) rotateY(var(--ry)); }

/* data links: card → core */
.scene__links { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; transform: translateZ(-30px); }
.scene__links path { fill: none; stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.scene__links .link-base { stroke: rgba(110, 170, 255, .3); }
.scene__links .link-flow { stroke: url(#h3-flow); stroke-width: 2.2; stroke-dasharray: 7 93; stroke-linecap: round; animation: h3-flow 2.8s linear infinite; filter: drop-shadow(0 0 4px rgba(120, 210, 255, .95)); }
.scene__links .link-flow:nth-of-type(2n) { animation-delay: -.9s; }
.scene__links .link-flow:nth-of-type(3n) { animation-delay: -1.9s; }

/* ── Agent cards: thick glass slabs angled toward the cube ───────────── */
.scene__cards { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; transform-style: preserve-3d; }
.agent-card {
  --tilt: 26deg; --z: 40px; --bob: 0s;
  position: absolute; width: 30%; max-width: 250px;
  transform: translate3d(0, 0, var(--z)) rotateY(var(--tilt));
  animation: h3-bob 6.5s ease-in-out infinite var(--bob);
}
.agent-card__in {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 12px; min-height: 78px;
  padding: 12px 14px; border-radius: 16px;
  background: linear-gradient(150deg, rgba(92, 84, 190, .5) 0%, rgba(40, 34, 104, .58) 45%, rgba(26, 20, 72, .66) 100%);
  border: 1.5px solid rgba(175, 170, 255, .55);
  box-shadow:
    0 7px 0 -1px rgba(44, 34, 120, .85),
    0 7px 0 0 rgba(150, 130, 255, .45),
    0 22px 40px rgba(0, 0, 0, .5),
    0 0 28px rgba(120, 100, 255, .3),
    inset 0 1px 0 rgba(255, 255, 255, .35),
    inset 0 0 24px rgba(140, 120, 255, .2);
  -webkit-backdrop-filter: blur(8px) saturate(1.3); backdrop-filter: blur(8px) saturate(1.3);
}
.agent-card__in::before {
  content: ''; position: absolute; inset: 0 0 55% 0; border-radius: 16px 16px 40% 40% / 16px 16px 20px 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .16), transparent); pointer-events: none;
}
.agent-card__in::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .14), transparent);
  transform: skewX(-18deg); animation: h3-sheen 7s ease-in-out infinite var(--bob);
}
.agent-card__icon { flex: 0 0 auto; width: 42px; height: 42px; display: grid; place-items: center; }
.agent-card__icon svg { width: 40px; height: 40px; fill: rgba(80, 150, 255, .16); stroke: url(#h3-icon); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 6px rgba(90, 170, 255, .9)) drop-shadow(0 0 14px rgba(130, 100, 255, .6)); }
.agent-card__in > span:last-child { flex: 1 1 auto; min-width: 0; }
.agent-card strong { display: block; font: 600 clamp(.92rem, 1.1vw, 1.06rem)/1.15 var(--font-display); letter-spacing: -.02em; color: #fff; text-shadow: 0 0 12px rgba(160, 150, 255, .35); }
.agent-card small { display: block; margin-top: 3px; font-size: .72rem; color: #c3c6e6; white-space: nowrap; }

.agent-card[data-side="l"] { left: 1%; --tilt: 26deg; }
.agent-card[data-side="r"] { right: 1%; --tilt: -26deg; }
.agent-card[data-row="1"] { top: 7%; }
.agent-card[data-row="2"] { top: 34%; --z: 50px; }
.agent-card[data-row="3"] { top: 59%; }
.agent-card[data-side="l"][data-row="2"] { left: -2%; }
.agent-card[data-side="r"][data-row="2"] { right: -2%; }

/* ── Core: glass cube on a three-tier pedestal ───────────────────────── */
.core { --s: clamp(150px, 12.5vw, 205px); position: absolute; left: 50%; top: 41%; width: 0; height: 0; transform-style: preserve-3d; }
.core__float { position: absolute; transform-style: preserve-3d; animation: h3-hover 6s ease-in-out infinite; }

.cube { position: absolute; width: var(--s); height: var(--s); left: calc(var(--s) / -2); top: calc(var(--s) / -2); transform-style: preserve-3d; transform: rotateX(-17deg) rotateY(-28deg); animation: h3-sway 9s ease-in-out infinite; }
.cube__face {
  position: absolute; inset: 0; border-radius: 12px;
  background:
    radial-gradient(circle at 50% 40%, rgba(140, 120, 255, .28), transparent 65%),
    linear-gradient(155deg, rgba(110, 90, 230, .55), rgba(48, 26, 130, .62) 55%, rgba(30, 16, 90, .72));
  border: 2px solid rgba(200, 185, 255, .95);
  box-shadow: 0 0 22px rgba(140, 100, 255, .85), 0 0 50px rgba(110, 80, 255, .45), inset 0 0 28px rgba(160, 120, 255, .65), inset 0 0 3px rgba(255, 255, 255, .9);
}
.cube__face::before {
  content: ''; position: absolute; inset: 9%; border-radius: 8px;
  border: 1px solid rgba(120, 220, 255, .4);
  background:
    linear-gradient(90deg, transparent 24.5%, rgba(120, 220, 255, .25) 24.5% 25.5%, transparent 25.5% 74.5%, rgba(120, 220, 255, .25) 74.5% 75.5%, transparent 75.5%),
    linear-gradient(0deg, transparent 24.5%, rgba(120, 220, 255, .2) 24.5% 25.5%, transparent 25.5% 74.5%, rgba(120, 220, 255, .2) 74.5% 75.5%, transparent 75.5%);
}
.cube__face--f { transform: translateZ(calc(var(--s) / 2)); background: radial-gradient(circle at 50% 42%, rgba(150, 140, 255, .45), transparent 62%), linear-gradient(155deg, rgba(100, 84, 230, .5), rgba(44, 24, 128, .6) 60%, rgba(28, 14, 86, .7)); }
.cube__face--f::before { opacity: .45; }
.cube__face--b { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.cube__face--l { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.cube__face--r { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.cube__face--t { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); background: linear-gradient(155deg, rgba(170, 150, 255, .6), rgba(90, 60, 200, .55)); }
.cube__face--d { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }
.cube__face--t::before { inset: 22%; border-radius: 50%; border: 2px solid rgba(140, 230, 255, .7); background: none; box-shadow: 0 0 14px rgba(120, 220, 255, .7), inset 0 0 14px rgba(120, 220, 255, .5); }

.cube__label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; transform: translateZ(2px); }
.cube__label svg { width: 46%; height: 41%; filter: drop-shadow(0 0 8px rgba(90, 200, 255, .95)) drop-shadow(0 0 22px rgba(110, 120, 255, .7)); }
.cube__label span { font: 700 calc(var(--s) * .15)/.98 var(--font-display); letter-spacing: -.02em; text-align: center; color: #fff; text-shadow: 0 0 10px rgba(150, 190, 255, .95), 0 0 26px rgba(140, 100, 255, .8); }

.core__glow { position: absolute; width: 360px; height: 360px; left: -180px; top: -180px; border-radius: 50%; background: radial-gradient(circle, rgba(140, 110, 255, .45), rgba(90, 110, 255, .16) 42%, transparent 68%); animation: h3-breathe 4.5s ease-in-out infinite; }

/* pedestal: three lit cylinders, drawn in 2D so the edges stay crisp */
.pedestal { position: absolute; width: 540px; height: 220px; left: -270px; top: calc(var(--s) * .56 - 78px); transform-origin: 50% 78px; transform: scale(var(--k, .88)); }
.tier { position: absolute; left: 50%; border-radius: 50% / var(--er); translate: -50% 0;
  background: linear-gradient(90deg, #0d0b26, #2b2766 22%, #4a4796 48%, #23205a 76%, #0b0a22);
  box-shadow: 0 0 0 1px rgba(150, 150, 255, .25);
}
.tier::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: calc(var(--er) * 2); border-radius: 50%; }
.tier::after { content: ''; position: absolute; left: 1%; right: 1%; bottom: 0; height: calc(var(--er) * 2); border-radius: 50%; border-bottom: 2px solid rgba(120, 200, 255, .9); filter: drop-shadow(0 0 6px rgba(100, 180, 255, .95)); }
.tier--base { --er: 58px; width: 540px; height: 144px; top: 70px; }
.tier--base::before { background: radial-gradient(ellipse, #1a1844 0 50%, #26235e 62%, #3a3683 74%, #161438 76%); box-shadow: inset 0 0 0 2px rgba(130, 140, 255, .45), 0 0 24px rgba(120, 100, 255, .35); }
.tier__lights { position: absolute; left: 6%; right: 6%; top: 6px; height: 104px; border-radius: 50%; background: repeating-conic-gradient(from 0deg, rgba(255, 196, 120, 1) 0 1.4deg, transparent 1.4deg 14deg); -webkit-mask: radial-gradient(closest-side, transparent 93%, #000 94%, #000 99%, transparent 100%); mask: radial-gradient(closest-side, transparent 93%, #000 94%, #000 99%, transparent 100%); filter: drop-shadow(0 0 3px rgba(255, 190, 110, 1)); z-index: 1; }
.tier--mid { --er: 44px; width: 410px; height: 108px; top: 50px; }
.tier--mid::before { background: radial-gradient(closest-side, #2a2670 0 78%, transparent 80%), conic-gradient(from var(--h3-a), #4fd8ff, #8f63ff, rgba(80, 60, 200, .2) 35%, #4f8dff 55%, #c06bff 75%, #4fd8ff); box-shadow: 0 0 24px rgba(120, 160, 255, .7); animation: h3-orbit 6s linear infinite; }
.tier--pad { --er: 30px; width: 270px; height: 74px; top: 38px; }
.tier--pad::before { background: radial-gradient(closest-side, rgba(235, 225, 255, 1) 0 20%, rgba(170, 140, 255, .95) 45%, rgba(110, 80, 240, .9) 72%, #3a2f9a 95%); box-shadow: 0 0 34px rgba(160, 130, 255, .9), inset 0 0 0 2px rgba(140, 230, 255, .8); animation: h3-breathe 4.5s ease-in-out infinite; }
.core__beam { position: absolute; left: 50%; top: -150px; width: 230px; height: 230px; translate: -50% 0; background: radial-gradient(ellipse 50% 60% at 50% 100%, rgba(170, 140, 255, .55), transparent 70%); filter: blur(6px); pointer-events: none; }
.core__floorglow { position: absolute; left: -10%; right: -10%; top: 120px; height: 160px; border-radius: 50%; background: radial-gradient(ellipse, rgba(110, 80, 255, .45), transparent 65%); filter: blur(10px); }

.scene__sparks { position: absolute; inset: -12% -6% 0; width: 112%; height: 112%; pointer-events: none; }

/* ── Keyframes ───────────────────────────────────────────────────────── */
@keyframes h3-sway { 0%, 100% { transform: rotateX(-17deg) rotateY(-34deg); } 50% { transform: rotateX(-14deg) rotateY(-20deg); } }
@keyframes h3-hover { 0%, 100% { transform: translateY(-7px); } 50% { transform: translateY(5px); } }
@keyframes h3-bob { 0%, 100% { transform: translate3d(0, -5px, var(--z)) rotateY(var(--tilt)); } 50% { transform: translate3d(0, 6px, var(--z)) rotateY(var(--tilt)); } }
@keyframes h3-orbit { to { --h3-a: 360deg; } }
@keyframes h3-breathe { 0%, 100% { opacity: .8; } 50% { opacity: 1; } }
@keyframes h3-flow { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes h3-sheen { 0%, 62% { left: -60%; } 80%, 100% { left: 130%; } }
@keyframes h3-ping { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }

.hero--3d.is-idle *, .hero--3d.is-idle *::before, .hero--3d.is-idle *::after { animation-play-state: paused !important; }

@media (prefers-reduced-motion: reduce) {
  .hero--3d *, .hero--3d *::before, .hero--3d *::after { animation: none !important; }
  .agent-card { transform: translate3d(0, 0, var(--z)) rotateY(var(--tilt)); }
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (min-width: 901px) and (max-width: 1180px) {
  .hero--3d { grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); }
  .agent-card__in { padding: 10px 12px; gap: 8px; min-height: 66px; }
  .agent-card__icon { width: 34px; height: 34px; }
  .agent-card__icon svg { width: 30px; height: 30px; }
  .agent-card strong { font-size: .86rem; }
  .agent-card small { display: none; }
}

@media (max-width: 900px) {
  .hero--3d { min-height: 0; grid-template-columns: 1fr; padding-top: 36px; gap: 0; }
  .hero--3d h1 { font-size: clamp(2.5rem, 10.5vw, 4rem); }
  .hero--3d .hero__stage { width: 100%; height: auto; perspective: none; margin-top: 12px; }
  .scene__rig { position: relative; inset: auto; transform: none; width: 100%; display: flex; flex-direction: column; align-items: center; }
  .scene__links { display: none; }
  .core { --s: 150px; position: relative; left: auto; top: auto; width: 100%; height: 330px; order: 1; }
  .core__float { left: 50%; top: 135px; }
  .pedestal { left: calc(50% - 270px); top: calc(135px + var(--s) * .56 - 78px); }
  .scene__cards { position: relative; inset: auto; order: 2; width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; transform-style: flat; }
  .agent-card, .agent-card[data-side] { position: relative; left: auto; right: auto; top: auto; width: auto; max-width: none; transform: none; animation: none; }
  .agent-card__in { padding: 12px; gap: 9px; height: 100%; min-height: 64px; }
  .agent-card__icon { width: 32px; height: 32px; }
  .agent-card__icon svg { width: 28px; height: 28px; }
  .agent-card strong { font-size: .88rem; }
  .agent-card small { display: none; }
  .scene__sparks { inset: 0; width: 100%; height: 330px; }
}
@media (max-width: 380px) { .scene__cards { grid-template-columns: 1fr; } }

/* ── Nova demo: the previous hero, now below "Want a person?" ───────── */
.hero--demo { padding-top: clamp(72px, 8vw, 112px); padding-bottom: clamp(72px, 8vw, 112px); }
.hero--demo h2 { font-size: clamp(2.8rem, 5.4vw, 4.7rem); font-weight: 600; }
@media (max-width: 900px) { .hero--demo { padding-top: 64px; } .hero--demo h2 { font-size: clamp(2.8rem, 7.5vw, 4.7rem); } }
@media (max-width: 380px) { .hero--demo h2 { font-size: 2.45rem; } }

/* Nova demo played by scroll (nova-scroll.js adds .nova-scroll on desktop) */
.nova-scroll #nova-demo .bubble.is-held { display: none; }
.nova-scroll #nova-demo .bubble { animation: nova-bubble .42s cubic-bezier(.16, 1, .3, 1) both; }
.nova-scroll #nova-demo .hero__replay { display: none; }
@keyframes nova-bubble { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.nova-scroll #nova-demo .phone:not(.is-live) .phone__thread::before {
  content: 'Scroll to answer the call ↓';
  margin: auto; padding: 10px 16px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--ink-dim);
  font: 500 .72rem/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase;
  animation: nova-hint 1.8s ease-in-out infinite;
}
@keyframes nova-hint { 0%, 100% { opacity: .55; transform: translateY(0); } 50% { opacity: 1; transform: translateY(4px); } }
