/* 3D touches (owner, 2026-10-16: phones in 3D, tilting cards, a 3D family map).
   Everything here is decoration: with no script, or with "reduce motion" on,
   the page shows the same content flat and still. Red stays SOS only. */

/* ---------- A: three app screens in 3D (home page, "See Zone Tick in action") ---------- */
.depth-stage {
  perspective: 1400px;
  height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 18px 0 30px;
  overflow: hidden;
}
.depth-stack {
  position: relative;
  width: 270px;
  height: 540px;
  transform-style: preserve-3d;
  transform: rotateX(8deg) rotateY(-18deg);
  transition: transform .3s var(--ease-out);
}
.depth-phone {
  position: absolute;
  inset: 0;
  padding: 8px;
  border-radius: 38px;
  background: #0A1016;
  border: 2px solid #34495A;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
}
.depth-phone img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 30px;
}
.depth-phone.is-left { transform: translateX(-180px) translateZ(-150px) rotateY(14deg); opacity: .88; }
.depth-phone.is-right { transform: translateX(180px) translateZ(-150px) rotateY(-14deg); opacity: .88; }
.depth-phone.is-front { transform: translateZ(40px); }
.depth-ring {
  position: absolute;
  left: 50%;
  top: 44%;
  width: 120px;
  height: 120px;
  margin: -60px 0 0 -60px;
  border-radius: 50%;
  border: 3px solid rgba(229, 57, 53, 0.75);
  transform: translateZ(90px) scale(.6);
  animation: depth-ring 2.4s ease-out infinite;
  pointer-events: none;
}
.depth-ring:nth-of-type(2) { animation-delay: .8s; }
.depth-ring:nth-of-type(3) { animation-delay: 1.6s; }
@keyframes depth-ring {
  from { transform: translateZ(90px) scale(.5); opacity: .9; }
  to { transform: translateZ(160px) scale(2.2); opacity: 0; }
}
.depth-chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}
.depth-chip .i { font-size: 16px; }
.depth-chip.is-arrived { left: -44px; top: 70px; transform: translateZ(130px); color: #A5E3A8; }
.depth-chip.is-distance { right: -54px; top: 310px; transform: translateZ(110px); color: #8FE3EE; }

@media (max-width: 700px) {
  .depth-stage { height: 470px; }
  .depth-stack { width: 200px; height: 410px; }
  .depth-phone { border-radius: 30px; }
  .depth-phone img { border-radius: 23px; }
  .depth-phone.is-left { transform: translateX(-110px) translateZ(-150px) rotateY(14deg); }
  .depth-phone.is-right { transform: translateX(110px) translateZ(-150px) rotateY(-14deg); }
  .depth-chip.is-arrived { left: -8px; }
  .depth-chip.is-distance { right: -8px; }
}

/* ---------- Download page: the three screens as a fan, and a floating icon ---------- */
.depth-fan-stage { perspective: 1200px; padding: 12px 0 4px; }
.dl-shots.depth-fan {
  transform-style: preserve-3d;
  transform: rotateX(6deg) rotateY(0deg);
  transition: transform .3s var(--ease-out);
}
.dl-shots.depth-fan img { transition: transform .3s var(--ease-out); box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45); }
.dl-shots.depth-fan img:nth-child(1) { transform: translateX(14px) translateZ(-60px) rotateY(18deg); }
.dl-shots.depth-fan img:nth-child(2) { transform: translateZ(40px) scale(1.04); }
.dl-shots.depth-fan img:nth-child(3) { transform: translateX(-14px) translateZ(-60px) rotateY(-18deg); }

.depth-float {
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
  animation: depth-float 5s ease-in-out infinite;
}
@keyframes depth-float {
  0%, 100% { transform: perspective(400px) translateY(0) rotateY(-10deg) rotateX(4deg); }
  50% { transform: perspective(400px) translateY(-6px) rotateY(10deg) rotateX(-4deg); }
}

/* ---------- B: cards that lean toward the pointer ---------- */
.depth-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, 0.14), transparent 55%);
  opacity: 0;
  transition: opacity .25s ease;
}
.depth-tilt { position: relative; will-change: transform; }
.depth-tilt:hover .depth-glare { opacity: 1; }
.depth-lean { transition: transform .7s var(--ease-out) !important; }

/* ---------- C: the family on a 3D map (home page) ---------- */
.depth-map-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 36px;
  align-items: center;
}
.depth-map {
  position: relative;
  height: 420px;
  perspective: 900px;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: radial-gradient(circle at 50% 120%, #22423A, #121A23 70%);
}
.depth-plane {
  position: absolute;
  left: 50%;
  top: 52%;
  width: 860px;
  height: 860px;
  margin: -430px 0 0 -430px;
  border-radius: 50%;
  transform: rotateX(62deg);
  transform-style: preserve-3d;
  animation: depth-drift 48s linear infinite;
  background-image:
    linear-gradient(rgba(77, 208, 225, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77, 208, 225, 0.16) 1px, transparent 1px);
  background-size: 60px 60px;
}
@keyframes depth-drift { to { transform: rotateX(62deg) rotateZ(360deg); } }
.depth-road { position: absolute; height: 10px; border-radius: 6px; background: rgba(169, 188, 203, 0.25); }
.depth-pin { position: absolute; transform-style: preserve-3d; }
.depth-pin .stem {
  position: absolute;
  left: -2px;
  bottom: 0;
  width: 4px;
  height: 70px;
  background: linear-gradient(var(--c), transparent);
  transform-origin: bottom;
  transform: rotateX(-90deg);
}
.depth-pin .face {
  position: absolute;
  left: -22px;
  bottom: 70px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 3px solid var(--c);
  background: #1E2A36;
  color: #fff;
  font-weight: 800;
  transform-origin: bottom;
  transform: rotateX(-90deg) translateY(-70px);
}
.depth-pin .dot { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%; background: var(--c); opacity: .5; }
.depth-pin .sos {
  position: absolute;
  left: -60px;
  top: -60px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--sos);
  animation: depth-ripple 2s ease-out infinite;
}
@keyframes depth-ripple { from { transform: scale(.3); opacity: 1; } to { transform: scale(2.4); opacity: 0; } }
.depth-map-note { position: absolute; left: 16px; bottom: 12px; margin: 0; font-size: 13px; color: var(--muted); }

@media (max-width: 860px) {
  .depth-map-grid { grid-template-columns: 1fr; }
  .depth-map { height: 340px; }
}

/* ---------- Everywhere: section icons float, the logo turns ---------- */
.sticker { animation: depth-sticker 6s ease-in-out infinite; }
@keyframes depth-sticker {
  0%, 100% { transform: perspective(300px) rotateY(-14deg) rotateX(6deg); }
  50% { transform: perspective(300px) rotateY(14deg) rotateX(-6deg) translateY(-3px); }
}
.logo-img { transition: transform .7s var(--ease-out); }
.brand:hover .logo-img { transform: perspective(300px) rotateY(360deg); }

@media (prefers-reduced-motion: reduce) {
  .depth-ring, .depth-plane, .depth-pin .sos, .depth-float, .sticker { animation: none; }
  .brand:hover .logo-img { transform: none; }
  .depth-ring { opacity: 0; }
  .depth-stack, .depth-lean { transition: none !important; }
}
