/* ===========================================================
   Corofy — 3D depth layer
   Perspective tilt, layered parallax, glass slabs, float motion.
   Everything is transform/opacity only, so it stays cheap to paint.
   =========================================================== */

/* ---------------- Perspective scene ---------------- */

.scene { perspective: 1400px; perspective-origin: 50% 45%; }

/* Element that tilts toward the pointer. JS sets --rx / --ry / --mx / --my. */
.tilt {
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translate3d(0, 0, 0);
  transform-style: preserve-3d;
  transition: transform 620ms var(--ease-out);
  will-change: transform;
}
.tilt.is-tilting { transition: transform 90ms linear; }

/* Layers lifted off the card face, so tilting produces real parallax */
.z-1 { transform: translateZ(18px); }
.z-2 { transform: translateZ(38px); }
.z-3 { transform: translateZ(64px); }

/* Specular sweep that follows the cursor */
.glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(
    circle at var(--mx, 50%) var(--my, 50%),
    rgba(255, 255, 255, 0.26) 0%,
    rgba(255, 255, 255, 0.06) 34%,
    transparent 62%
  );
  opacity: 0;
  transition: opacity 380ms var(--ease-out);
  z-index: 3;
  mix-blend-mode: soft-light;
}
.tilt:hover .glare, .tilt:focus-within .glare { opacity: 1; }

/* ---------------- Elevation: layered, brand-tinted ---------------- */

.elev-3d {
  box-shadow:
    0 2px 4px rgba(12, 22, 87, 0.06),
    0 8px 16px -6px rgba(12, 22, 87, 0.10),
    0 24px 40px -14px rgba(12, 22, 87, 0.16),
    0 56px 90px -30px rgba(24, 48, 208, 0.24);
}
.elev-3d-lg {
  box-shadow:
    0 4px 8px rgba(12, 22, 87, 0.07),
    0 16px 28px -8px rgba(12, 22, 87, 0.13),
    0 40px 68px -20px rgba(12, 22, 87, 0.20),
    0 90px 130px -50px rgba(24, 48, 208, 0.30);
}

/* ---------------- Glass slab ---------------- */

.glass {
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.05) 52%, rgba(255, 255, 255, 0.09) 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05),
    0 30px 60px -22px rgba(3, 6, 20, 0.7);
}

/* Tinted variant — keeps text legible when it floats over busy photography */
.glass--ink {
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.13) 0%, rgba(255, 255, 255, 0.03) 55%, rgba(255, 255, 255, 0.08) 100%),
    linear-gradient(160deg, rgba(9, 14, 42, 0.86) 0%, rgba(6, 10, 29, 0.78) 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 34px 68px -24px rgba(3, 6, 20, 0.82);
}

/* ---------------- Ambient orbs (atmospheric depth) ---------------- */

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  z-index: -1;
}
.orb--brand  { background: radial-gradient(circle, rgba(24, 48, 208, 0.55) 0%, rgba(24, 48, 208, 0) 70%); }
.orb--accent { background: radial-gradient(circle, rgba(152, 88, 200, 0.45) 0%, rgba(152, 88, 200, 0) 70%); }
.orb--soft   { background: radial-gradient(circle, rgba(24, 48, 208, 0.16) 0%, rgba(24, 48, 208, 0) 70%); filter: blur(70px); }

/* ---------------- Float / drift motion ---------------- */

@keyframes float-y {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(0, -16px, 0); }
}
@keyframes float-y-sm {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(0, -9px, 0); }
}
.float    { animation: float-y 7s var(--ease-in-out) infinite; }
.float-sm { animation: float-y-sm 5.5s var(--ease-in-out) infinite; }
.float-delay-1 { animation-delay: -1.8s; }
.float-delay-2 { animation-delay: -3.6s; }

/* ===========================================================
   HERO — 3D product scene
   =========================================================== */

.hero__layout {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: clamp(2rem, 1rem + 4vw, 4.5rem);
  align-items: center;
  width: 100%;
}
@media (max-width: 1180px) {
  .hero__layout { grid-template-columns: 1fr; }
  .hero-scene { display: none; }
}

.hero-scene {
  position: relative;
  height: 520px;
  transform-style: preserve-3d;
}

/* The floating product cards */
.spec-card {
  position: absolute;
  width: 240px;
  padding: var(--s-5);
  border-radius: var(--r-lg);
  transform-style: preserve-3d;
}
.spec-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}
.spec-card__tag {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-300);
}
.spec-card__mark {
  width: 30px; height: 30px;
  border-radius: 9px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
}
.spec-card__mark svg { width: 15px; height: 15px; }
.spec-card h3 {
  color: #fff;
  font-size: 1.16rem;
  line-height: 1.24;
  margin-bottom: var(--s-2);
}
.spec-card p {
  color: rgba(255, 255, 255, 0.62);
  font-size: var(--fs-xs);
  line-height: 1.55;
}
.spec-card__rows {
  margin-top: var(--s-4);
  padding-top: var(--s-4);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  gap: var(--s-2);
}
.spec-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
}
.spec-card__row span:first-child { color: rgba(255, 255, 255, 0.5); }
.spec-card__row span:last-child { color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Placement in 3D space — laid out so no card occludes another's text.
   Left column: card A (top) and card C (bottom). Right column: pill (top), card B (bottom). */
.spec-card--a {
  top: 34px; left: 0;
  transform: translateZ(72px) rotateY(-12deg) rotateX(5deg);
  z-index: 3;
}
.spec-card--b {
  bottom: 0; right: 0;
  transform: translateZ(30px) rotateY(-12deg) rotateX(5deg);
  z-index: 2;
}
.spec-card--c {
  bottom: 10px; left: 0;
  transform: translateZ(-26px) rotateY(-12deg) rotateX(5deg);
  z-index: 1;
  opacity: 0.94;
}

/* Floating certification pill */
.hero-pill {
  position: absolute;
  top: 0; right: 6px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  padding: 0.7rem 1.1rem;
  border-radius: var(--r-full);
  transform: translateZ(100px) rotateY(-12deg);
  white-space: nowrap;
}
.hero-pill svg { width: 17px; height: 17px; color: var(--accent-300); }
.hero-pill span { color: #fff; font-size: var(--fs-xs); font-weight: 600; }

/* ===========================================================
   Cards upgraded to 3D
   =========================================================== */

/* Industry cards: image sits back, copy floats forward */
.industry-card { transform-style: preserve-3d; }
.industry-card .industry-card__body > * { transform: translateZ(30px); }
.industry-card__num { transform: translateZ(46px) !important; }
.industry-card h3 { transform: translateZ(42px) !important; }

.industry-card.tilt:hover {
  box-shadow:
    0 20px 40px -16px rgba(12, 22, 87, 0.32),
    0 50px 90px -30px rgba(24, 48, 208, 0.36);
}

/* Feature cards get a lifted icon and a gradient rim on hover */
.feature-card { position: relative; overflow: hidden; transform-style: preserve-3d; }
.feature-card .icon-box {
  transform: translateZ(34px);
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.feature-card:hover .icon-box {
  transform: translateZ(50px) translateY(-3px);
  box-shadow: 0 14px 26px -10px rgba(24, 48, 208, 0.5);
}
.feature-card h3, .feature-card p { transform: translateZ(16px); }
.feature-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, rgba(24,48,208,0.5), rgba(152,88,200,0.4), transparent 62%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--dur) var(--ease-out);
  pointer-events: none;
}
.feature-card:hover::after { opacity: 1; }

/* Post cards lift with depth */
.post-card { transform-style: preserve-3d; }
.post-card:hover {
  box-shadow:
    0 14px 26px -12px rgba(12, 22, 87, 0.18),
    0 34px 60px -24px rgba(24, 48, 208, 0.26);
}

/* ---------------- Stat bar as a floating 3D slab ---------------- */

.stat-bar .stat-bar__inner {
  box-shadow:
    0 2px 4px rgba(12, 22, 87, 0.05),
    0 10px 22px -8px rgba(12, 22, 87, 0.12),
    0 30px 54px -20px rgba(12, 22, 87, 0.20),
    0 70px 110px -46px rgba(24, 48, 208, 0.32);
}
.stat-bar .stat__value {
  background: linear-gradient(140deg, var(--heading) 12%, var(--brand-600) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------------- Split media: layered depth ---------------- */

.split__media.scene { perspective: 1200px; }
.split__media .tilt img { border-radius: var(--r-lg); }
.split__media--3d img {
  box-shadow:
    0 8px 18px -8px rgba(12, 22, 87, 0.16),
    0 30px 56px -18px rgba(12, 22, 87, 0.24),
    0 70px 110px -44px rgba(24, 48, 208, 0.30);
}
.media-badge { transform: translateZ(58px); }

/* ---------------- Parallax (JS sets --py) ---------------- */

.parallax { will-change: transform; }
.parallax img { transform: translate3d(0, var(--py, 0px), 0) scale(1.12); }

/* ---------------- Section transition wedge ---------------- */

.statement { border-radius: var(--r-xl) var(--r-xl) 0 0; margin-top: -1px; }
.cta-band__inner { transform-style: preserve-3d; }

/* ---------------- Reduced motion & touch ---------------- */

@media (prefers-reduced-motion: reduce) {
  .float, .float-sm { animation: none; }
  .tilt { transition: none; }
  .parallax img { transform: none; }
}

/* Pointer-less devices: drop the tilt/glare entirely */
@media (hover: none) {
  .tilt { transform: none !important; }
  .glare { display: none; }
}
