:root {
  --tp-blue: #02b7e8;
  --tp-navy: #020816;
  --tp-radius: 360px;
  --tp-speed: 12s;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--tp-navy); font-family: Arial, Helvetica, sans-serif; }

.tp-hero {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 72%, rgba(2,183,232,.22), transparent 30%),
    radial-gradient(circle at 50% 0%, rgba(26,91,135,.35), transparent 42%),
    linear-gradient(180deg, #03142a 0%, #020816 70%, #000 100%);
}

.tp-bg {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(1,8,20,.46), rgba(1,8,20,.76)), url("assets/freight-triptych.png");
  background-size: cover;
  background-position: center;
  filter: blur(18px) saturate(.9) brightness(.65);
  transform: scale(1.08);
  opacity: .45;
}

.tp-stage-wrap {
  position: relative;
  z-index: 2;
  width: min(94vw, 1180px);
  height: min(68vw, 660px);
  min-height: 520px;
  display: grid;
  place-items: center;
  perspective: 1500px;
}

.tp-stage {
  position: relative;
  width: min(92vw, 1040px);
  height: min(58vw, 560px);
  min-height: 430px;
  transform-style: preserve-3d;
}

.tp-carousel {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  animation: tpSpin var(--tp-speed) cubic-bezier(.62,.02,.38,1) infinite;
}

.tp-hero.is-paused .tp-carousel { animation-play-state: paused; }

.tp-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(30vw, 350px);
  height: min(48vw, 520px);
  min-width: 250px;
  min-height: 390px;
  margin-left: calc(min(30vw, 350px) / -2);
  margin-top: calc(min(48vw, 520px) / -2);
  overflow: hidden;
  border-radius: 28px;
  background-image: url("assets/freight-triptych.png");
  background-size: 300% 100%;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.38),
    inset 0 0 38px rgba(255,255,255,.08),
    0 30px 80px rgba(0,0,0,.55),
    0 0 28px rgba(2,183,232,.18);
  backface-visibility: hidden;
}

.tp-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,.2), transparent 24%, transparent 70%, rgba(255,255,255,.16));
  mix-blend-mode: screen;
  pointer-events: none;
}

.tp-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,.18) 100%);
}

.tp-card-air  { background-position: left center;   transform: rotateY(0deg) translateZ(var(--tp-radius)); }
.tp-card-sea  { background-position: center center; transform: rotateY(120deg) translateZ(var(--tp-radius)); }
.tp-card-rail { background-position: right center;  transform: rotateY(240deg) translateZ(var(--tp-radius)); }

.tp-ring {
  position: absolute;
  z-index: -1;
  bottom: 8%;
  width: min(90vw, 1050px);
  height: 145px;
  border-radius: 50%;
  border: 5px solid rgba(2,183,232,.7);
  box-shadow: 0 0 28px rgba(2,183,232,.9), inset 0 0 22px rgba(2,183,232,.55);
  transform: rotateX(70deg);
}

.tp-shadow {
  position: absolute;
  z-index: -2;
  bottom: 2%;
  width: min(88vw, 980px);
  height: 210px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0,0,0,.62), transparent 68%);
  transform: rotateX(70deg);
}

.tp-controls {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
}

.tp-btn, .tp-toggle {
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(3,15,34,.75);
  color: #fff;
  backdrop-filter: blur(14px);
  box-shadow: 0 0 20px rgba(2,183,232,.15);
  cursor: pointer;
}

.tp-btn {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  font-size: 36px;
  line-height: 1;
}

.tp-toggle {
  height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 12px;
}

@keyframes tpSpin {
  0%, 13%    { transform: rotateY(0deg); }
  30%, 46%   { transform: rotateY(-120deg); }
  63%, 79%   { transform: rotateY(-240deg); }
  100%       { transform: rotateY(-360deg); }
}

@media (max-width: 820px) {
  :root { --tp-radius: 245px; }
  .tp-stage-wrap { min-height: 510px; }
  .tp-stage { min-height: 410px; }
  .tp-card { width: 260px; height: 390px; margin-left: -130px; margin-top: -195px; border-radius: 22px; }
  .tp-ring { width: 620px; height: 105px; }
}

@media (prefers-reduced-motion: reduce) {
  .tp-carousel { animation: none; }
}
