/* =============================================================
   Cam Elite Boost — 3D article layer (loads on top of style.css)
   Premium depth: perspective hero, floating shapes, glass panels,
   cursor-tracked tilt. Self-contained, fast, reduced-motion aware.
   ============================================================= */

:root {
  --z-ease: cubic-bezier(.22, .61, .36, 1);
  --glass: rgba(20, 20, 30, 0.55);
  --glass-brd: rgba(255, 255, 255, 0.10);
}

/* ---------- 3D HERO ---------- */
.hero3d {
  position: relative;
  padding: 92px 0 70px;
  overflow: hidden;
  perspective: 1300px;
  perspective-origin: 50% 30%;
  isolation: isolate;
}
.hero3d-bg {
  position: absolute;
  inset: -10% -10% 0 -10%;
  z-index: 0;
  transform-style: preserve-3d;
  pointer-events: none;
}
/* receding wireframe floor */
.grid-floor {
  position: absolute;
  left: 50%;
  bottom: -6%;
  width: 180%;
  height: 62%;
  transform: translateX(-50%) rotateX(74deg);
  transform-origin: 50% 100%;
  background-image:
    linear-gradient(rgba(139, 92, 246, .28) 1px, transparent 1px),
    linear-gradient(90deg, rgba(236, 72, 153, .22) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 60% 80% at 50% 100%, #000 10%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 60% 80% at 50% 100%, #000 10%, transparent 72%);
  opacity: .55;
}
/* blurred gradient orbs at different depths */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(46px);
  opacity: .55;
  will-change: transform;
}
.orb.o1 { width: 340px; height: 340px; top: -60px; right: 8%;
  background: radial-gradient(circle at 30% 30%, #8b5cf6, transparent 70%); }
.orb.o2 { width: 300px; height: 300px; top: 120px; left: 2%;
  background: radial-gradient(circle at 40% 40%, #ec4899, transparent 70%); opacity: .40; }
.orb.o3 { width: 220px; height: 220px; bottom: -40px; left: 44%;
  background: radial-gradient(circle at 50% 50%, #6d5cff, transparent 70%); opacity: .35; }

/* floating glass shards that catch the eye without stealing it */
.floaty {
  position: absolute;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(139, 92, 246, .16), rgba(236, 72, 153, .10));
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .14);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  will-change: transform;
}
.floaty.f1 { width: 128px; height: 128px; top: 44px; right: 13%; transform: rotate(-14deg); animation: bob 7s var(--z-ease) infinite; }
.floaty.f2 { width: 92px; height: 92px; bottom: 40px; right: 30%; border-radius: 26px; transform: rotate(10deg); animation: bob 9s var(--z-ease) infinite reverse; }
.floaty.f3 { width: 74px; height: 74px; top: 120px; left: 12%; border-radius: 16px; transform: rotate(8deg); animation: bob 8s var(--z-ease) 1s infinite; }

/* a real CSS cube, slowly turning */
.cube-wrap { position: absolute; top: 70px; left: 22%; width: 84px; height: 84px; transform-style: preserve-3d; animation: spin 18s linear infinite; }
.cube { position: absolute; inset: 0; transform-style: preserve-3d; }
.cube span {
  position: absolute; width: 84px; height: 84px;
  background: linear-gradient(135deg, rgba(139, 92, 246, .22), rgba(236, 72, 153, .14));
  border: 1px solid rgba(255, 255, 255, .18);
}
.cube .fr { transform: translateZ(42px); }
.cube .bk { transform: rotateY(180deg) translateZ(42px); }
.cube .ri { transform: rotateY(90deg) translateZ(42px); }
.cube .le { transform: rotateY(-90deg) translateZ(42px); }
.cube .tp { transform: rotateX(90deg) translateZ(42px); }
.cube .bt { transform: rotateX(-90deg) translateZ(42px); }

@keyframes bob { 0%, 100% { transform: translate3d(0, 0, 0) rotate(var(--r, 0deg)); } 50% { transform: translate3d(0, -18px, 0) rotate(var(--r, 0deg)); } }
@keyframes spin { to { transform: rotateX(360deg) rotateY(360deg); } }

/* the hero content itself, lifted above the scene */
.hero3d-inner {
  position: relative;
  z-index: 3;
  transform-style: preserve-3d;
}
.hero3d .article-hero { padding: 0; }
.hero3d h1 {
  font-size: clamp(32px, 5.4vw, 56px);
  letter-spacing: -.03em;
  max-width: 20ch;
  text-shadow: 0 20px 50px rgba(0, 0, 0, .5);
}
.hero3d .article-meta { margin-top: 18px; }

/* parallax: JS feeds --mx/--my in the range -1..1 on .hero3d */
.hero3d { --mx: 0; --my: 0; }
.orb.o1 { transform: translate3d(calc(var(--mx) * 26px), calc(var(--my) * 20px), 0); }
.orb.o2 { transform: translate3d(calc(var(--mx) * -30px), calc(var(--my) * -16px), 0); }
.orb.o3 { transform: translate3d(calc(var(--mx) * 18px), calc(var(--my) * 22px), 0); }
.hero3d-inner {
  transform: rotateY(calc(var(--mx) * 4deg)) rotateX(calc(var(--my) * -4deg));
  transition: transform .2s var(--z-ease);
}
.cube-wrap { transform: translate3d(calc(var(--mx) * 40px), calc(var(--my) * 30px), 0); }

/* ---------- 3D prose accents ---------- */
.prose-3d { position: relative; z-index: 2; }

/* pull-quote as a lifted glass card */
.pullquote3d {
  margin: 40px 0;
  padding: 30px 32px 30px 34px;
  border-radius: 20px;
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .85), inset 0 1px 0 rgba(255, 255, 255, .10);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
  transform: perspective(900px) rotateX(3deg);
}
.pullquote3d::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--grad);
}
.pullquote3d::after {
  content: "\201C";
  position: absolute; right: 20px; top: 2px;
  font-family: var(--font-display); font-size: 90px; line-height: 1;
  color: rgba(236, 72, 153, .16);
}
.pullquote3d p {
  font-family: var(--font-display);
  font-size: clamp(19px, 2.6vw, 24px);
  font-weight: 600;
  color: var(--text);
  margin: 0;
  position: relative; z-index: 1;
}

/* section number chips floating over the column */
.prose-3d h2 { position: relative; }

/* ---------- 3D tilt (cursor-tracked) — used on cards/quotes ---------- */
.tilt { transform-style: preserve-3d; transition: transform .25s var(--z-ease), box-shadow .25s var(--z-ease); will-change: transform; }
.tilt:hover { box-shadow: 0 50px 90px -40px rgba(0, 0, 0, .9); }

/* ---------- 3D FAQ ---------- */
.faq-3d .faq-item {
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  box-shadow: 0 24px 50px -34px rgba(0, 0, 0, .8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform .25s var(--z-ease), box-shadow .25s var(--z-ease);
}
.faq-3d .faq-item:hover { transform: translateY(-2px); }
.faq-3d .faq-item.open { box-shadow: 0 34px 70px -34px rgba(236, 72, 153, .35); }

/* ---------- 3D closing CTA band ---------- */
.cta3d {
  position: relative;
  margin: 60px auto 0;
  max-width: 860px;
  padding: 56px 40px;
  border-radius: 26px;
  text-align: center;
  overflow: hidden;
  perspective: 900px;
  background:
    radial-gradient(120% 140% at 50% -20%, rgba(139, 92, 246, .22), transparent 60%),
    linear-gradient(180deg, rgba(24, 18, 34, .9), rgba(12, 12, 18, .9));
  border: 1px solid rgba(236, 72, 153, .3);
  box-shadow: 0 60px 120px -50px rgba(236, 72, 153, .4);
}
.cta3d::before {
  content: "";
  position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 40px 40px;
  transform: perspective(500px) rotateX(60deg) translateY(30%);
  transform-origin: 50% 100%;
  mask-image: linear-gradient(#000, transparent 70%);
  -webkit-mask-image: linear-gradient(#000, transparent 70%);
}
.cta3d > * { position: relative; z-index: 1; }
.cta3d h2 { font-size: clamp(24px, 3.6vw, 36px); margin-bottom: 12px; }
.cta3d p { color: var(--text-soft); font-size: 17.5px; margin-bottom: 12px; }
.cta3d .ctaLine { color: var(--text); font-weight: 500; margin-bottom: 26px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .cube-wrap, .floaty.f3 { display: none; }
  .orb.o1 { width: 240px; height: 240px; }
  .orb.o2 { width: 210px; height: 210px; }
}
@media (max-width: 720px) {
  .hero3d { padding: 60px 0 48px; }
  .floaty.f1, .floaty.f2 { opacity: .6; }
  .floaty.f1 { width: 92px; height: 92px; right: 6%; }
  .floaty.f2 { display: none; }
  .grid-floor { height: 46%; }
  .pullquote3d { transform: none; padding: 24px; margin: 30px 0; }
  .cta3d { padding: 40px 22px; }
  /* kill parallax rotation on small screens to avoid layout wobble */
  .hero3d-inner { transform: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .floaty, .cube-wrap { animation: none !important; }
  .hero3d-inner, .orb, .cube-wrap { transform: none !important; transition: none !important; }
  .pullquote3d { transform: none; }
}

/* touch devices: no hover tilt, no mouse parallax (JS also guards this) */
@media (hover: none) {
  .hero3d-inner { transform: none !important; }
  .tilt:hover { transform: none; }
}

/* ---------- answer-first TL;DR (AI citeability) ---------- */
.tldr {
  max-width: 760px; margin: 0 auto 6px; padding: 20px 24px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(139,92,246,.10), rgba(236,72,153,.07));
  border: 1px solid var(--glass-brd); border-left: 3px solid var(--pink);
}
.tldr .lbl { font-family: var(--font-mono, ui-monospace, monospace); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--pink); display: block; margin-bottom: 8px; }
.tldr p { margin: 0; color: var(--text); font-size: 17px; line-height: 1.62; }
.tldr strong { color: #fff; }
