/* Product clip scenes — animated telemetry UIs, play on hover */

.clip {
  position: relative;
  aspect-ratio: 16/10;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #060607;
  border: 1px solid var(--line);
  cursor: pointer;
}
.clip-chrome {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent);
  z-index: 5;
}
.clip-chrome .dot-row { display: flex; gap: 5px; }
.clip-chrome .dot-row span { width: 8px; height: 8px; border-radius: 50%; background: #333; }
.clip-chrome .dot-row span:first-child { background: #e35252; }
.clip-chrome .dot-row span:nth-child(2) { background: #e3b452; }
.clip-chrome .dot-row span:nth-child(3) { background: #6effa2; }
.clip-chrome .title {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  color: var(--fg-3); text-transform: uppercase;
}
.clip-play-badge {
  position: absolute;
  bottom: 14px; right: 14px;
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em;
  color: var(--fg-2); text-transform: uppercase;
  z-index: 10;
  transition: 0.2s;
}
.clip:hover .clip-play-badge { background: var(--red); color: #fff; border-color: var(--red); }
.clip-play-badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 8px var(--red);
  animation: pulse 1.4s infinite;
}
.clip:hover .clip-play-badge::before { background: #fff; box-shadow: 0 0 8px #fff; }
@keyframes pulse { 0%,100% {opacity:1;} 50% {opacity:0.3;} }

.clip-canvas {
  position: absolute; inset: 0;
  padding: 36px 16px 16px;
  animation-play-state: paused;
}
.clip:hover .clip-canvas,
.clip:hover .clip-canvas * { animation-play-state: running !important; }

.clip-label {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 16px 18px 18px;
  background: linear-gradient(to top, rgba(0,0,0,0.98) 60%, rgba(0,0,0,0.85) 85%, transparent);
  z-index: 8;
  border-top: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.clip-label h3 { font-size: 17px; font-weight: 600; color: #fff; margin: 0 0 3px; letter-spacing: -0.01em; }
.clip-label p { font-size: 12.5px; color: rgba(255,255,255,0.6); margin: 0; line-height: 1.4; }
/* Reserve bottom space inside canvas so scene never collides with label */
.clip-canvas { padding-bottom: 92px; }

/* ========= Scene 1: Lap compare chart ========= */
.scene-lap {
  background: radial-gradient(ellipse at 50% 120%, #1a0508 0%, #060607 60%);
}
.scene-lap .axis {
  position: absolute; left: 16px; right: 16px; bottom: 102px; height: 1px;
  background: var(--line);
}
.scene-lap .gridline {
  position: absolute; left: 16px; right: 16px; height: 1px;
  background: rgba(255,255,255,0.04);
}
.scene-lap svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene-lap .trace { fill: none; stroke-width: 1.8; stroke-linecap: round; }
.scene-lap .trace-a { stroke: var(--red); filter: drop-shadow(0 0 4px var(--red)); stroke-dasharray: 600; stroke-dashoffset: 600; animation: draw 3s ease-out infinite; }
.scene-lap .trace-b { stroke: #6effa2; opacity: 0.7; stroke-dasharray: 600; stroke-dashoffset: 600; animation: draw 3s ease-out 0.3s infinite; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.scene-lap .scrub {
  position: absolute; top: 36px; bottom: 102px; width: 1px;
  background: rgba(255,255,255,0.4);
  animation: scrub 3s linear infinite;
}
.scene-lap .scrub::after {
  content: ""; position: absolute; top: -4px; left: -3px;
  width: 7px; height: 7px; background: var(--red); border-radius: 50%;
  box-shadow: 0 0 10px var(--red);
}
@keyframes scrub {
  0% { left: 16px; } 100% { left: calc(100% - 16px); }
}
.scene-lap .legend {
  position: absolute; top: 36px; right: 14px;
  display: flex; flex-direction: column; gap: 4px;
  font-family: var(--mono); font-size: 10px;
}
.scene-lap .legend div { display: flex; align-items: center; gap: 6px; color: var(--fg-2); }
.scene-lap .legend .sw { width: 10px; height: 2px; }
.scene-lap .delta {
  position: absolute; top: 40px; left: 16px;
  font-family: var(--mono); color: var(--fg-2);
}
.scene-lap .delta .big { display: block; font-size: 28px; color: var(--red); font-weight: 600; letter-spacing: -0.02em; }
.scene-lap .delta .sub { font-size: 10px; color: var(--fg-3); letter-spacing: 0.1em; text-transform: uppercase; }

/* ========= Scene 2: Track map ========= */
.scene-map {
  background: radial-gradient(ellipse at 30% 30%, #0f1016 0%, #060607 70%);
}
.scene-map svg.track { position: absolute; inset: 36px 16px 102px; width: calc(100% - 32px); height: calc(100% - 140px); }
.scene-map .trk-base { fill: none; stroke: rgba(255,255,255,0.08); stroke-width: 18; stroke-linejoin: round; stroke-linecap: round; }
.scene-map .trk-line { fill: none; stroke: rgba(255,255,255,0.25); stroke-width: 2; }
.scene-map .trk-color { fill: none; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 4 3; animation: trkdash 2s linear infinite; }
@keyframes trkdash { to { stroke-dashoffset: -14; } }
.scene-map .car {
  fill: var(--red); stroke: #fff; stroke-width: 0.5;
  filter: drop-shadow(0 0 6px var(--red));
  offset-path: path("M 60 180 C 60 100, 120 40, 220 40 S 380 80, 400 160 S 340 260, 240 260 S 80 260, 60 180 Z");
  offset-distance: 0%;
  animation: drive 5s linear infinite;
}
@keyframes drive { to { offset-distance: 100%; } }
.scene-map .stat-panel {
  position: absolute; left: 16px; bottom: 108px;
  display: flex; gap: 10px;
  font-family: var(--mono);
}
.scene-map .stat-panel .stat {
  background: rgba(20,20,24,0.8); border: 1px solid var(--line);
  padding: 6px 10px; border-radius: 6px; min-width: 62px;
}
.scene-map .stat-panel .k { font-size: 9px; color: var(--fg-3); letter-spacing: 0.1em; text-transform: uppercase; }
.scene-map .stat-panel .v { font-size: 16px; color: var(--fg); font-weight: 600; }
.scene-map .stat-panel .v.r { color: var(--red); }

/* ========= Scene 3: Throttle/brake bars ========= */
.scene-inputs {
  background: radial-gradient(ellipse at 70% 30%, #160509 0%, #060607 65%);
}
.scene-inputs .inputs-wrap {
  position: absolute; inset: 40px 20px 108px;
  display: grid; grid-template-rows: 1fr 1fr 1fr;
  gap: 12px;
}
.scene-inputs .ch { position: relative; }
.scene-inputs .ch-label {
  position: absolute; left: 0; top: 0;
  font-family: var(--mono); font-size: 10px;
  color: var(--fg-3); letter-spacing: 0.1em; text-transform: uppercase;
}
.scene-inputs .ch-val {
  position: absolute; right: 0; top: 0;
  font-family: var(--mono); font-size: 11px;
  color: var(--fg); font-weight: 600;
}
.scene-inputs .ch-bar {
  position: absolute; left: 0; right: 0; bottom: 0; top: 16px;
  background: rgba(255,255,255,0.04);
  border-radius: 4px;
  overflow: hidden;
}
.scene-inputs .ch-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  border-radius: 4px;
  animation: pump 2.4s ease-in-out infinite;
}
.scene-inputs .ch-fill.t { background: linear-gradient(90deg, #1a7a3e, #6effa2); animation-delay: 0s; }
.scene-inputs .ch-fill.b { background: linear-gradient(90deg, var(--red-dim), var(--red-2)); animation-delay: -0.8s; }
.scene-inputs .ch-fill.s { background: linear-gradient(90deg, #3a3a7a, #8a8aff); animation-delay: -1.4s; animation: wiggle 2.4s ease-in-out infinite; }
@keyframes pump {
  0%, 100% { width: 10%; } 30% { width: 95%; } 50% { width: 70%; } 70% { width: 40%; }
}
@keyframes wiggle {
  0%, 100% { width: 48%; } 25% { width: 60%; } 50% { width: 42%; } 75% { width: 55%; }
}

/* ========= Scene 4: Ghost car / 3D track ========= */
.scene-ghost {
  background:
    linear-gradient(to bottom, #0a0a0d 30%, #1f1015 70%, #060607);
}
.scene-ghost .horizon {
  position: absolute; left: 0; right: 0; top: 50%;
  height: 1px; background: var(--line);
}
.scene-ghost .road {
  position: absolute; left: 50%; top: 50%; bottom: 92px;
  width: 600px; transform: translateX(-50%);
  background:
    linear-gradient(to bottom, rgba(40,40,45,0.8), rgba(20,20,22,0.9));
  clip-path: polygon(42% 0, 58% 0, 100% 100%, 0 100%);
}
.scene-ghost .lane {
  position: absolute; left: 50%; top: 50%; bottom: 92px;
  width: 2px; background: repeating-linear-gradient(to bottom,
    rgba(255,255,255,0.4) 0 20px, transparent 20px 40px);
  transform-origin: top center;
  animation: rush 1.5s linear infinite;
}
@keyframes rush {
  0% { background-position: 0 0; }
  100% { background-position: 0 200px; }
}
.scene-ghost .car-me, .scene-ghost .car-ghost {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  border-radius: 6px 6px 10px 10px;
}
.scene-ghost .car-me {
  bottom: 100px; width: 60px; height: 80px;
  background: linear-gradient(to bottom, #1a1a1d, #0a0a0b);
  border: 1px solid var(--red);
  box-shadow: 0 0 24px var(--red), inset 0 -20px 20px rgba(227,6,19,0.3);
}
.scene-ghost .car-me::before, .scene-ghost .car-me::after {
  content: ""; position: absolute; top: 10px;
  width: 6px; height: 10px; background: var(--red); border-radius: 2px;
  box-shadow: 0 0 8px var(--red);
}
.scene-ghost .car-me::before { left: 8px; }
.scene-ghost .car-me::after { right: 8px; }
.scene-ghost .car-ghost {
  bottom: 160px; width: 40px; height: 55px;
  background: linear-gradient(to bottom, rgba(110,255,162,0.2), rgba(110,255,162,0.05));
  border: 1px solid rgba(110,255,162,0.5);
  opacity: 0.7;
  animation: ghostPulse 2s ease-in-out infinite;
}
@keyframes ghostPulse {
  0%, 100% { transform: translateX(-80%); }
  50% { transform: translateX(-20%); }
}
.scene-ghost .hud {
  position: absolute; top: 42px; left: 16px;
  display: flex; flex-direction: column; gap: 4px;
  font-family: var(--mono);
}
.scene-ghost .hud .speed {
  font-size: 36px; font-weight: 700; color: #fff; letter-spacing: -0.02em;
  line-height: 1;
}
.scene-ghost .hud .kph { font-size: 10px; color: var(--fg-3); letter-spacing: 0.2em; }
.scene-ghost .hud .lap {
  margin-top: 8px;
  font-size: 13px; color: var(--red); font-weight: 600;
}

/* ========= Scene 5: Heatmap ========= */
.scene-heat {
  background: #060607;
}
.scene-heat .cells {
  position: absolute; inset: 36px 16px 118px;
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: 2px;
}
.scene-heat .cells span { border-radius: 2px; animation: cellFlash 4s ease-in-out infinite; }
@keyframes cellFlash {
  0%, 100% { opacity: 0.4; } 50% { opacity: 1; }
}
.scene-heat .label-row {
  position: absolute; top: 40px; right: 14px;
  font-family: var(--mono); font-size: 10px; color: var(--fg-3);
  letter-spacing: 0.1em; text-transform: uppercase;
}
.scene-heat .scale {
  position: absolute; left: 16px; bottom: 110px; right: 16px; height: 4px;
  background: linear-gradient(90deg, #1a7a3e, #d4c93a, var(--red));
  border-radius: 2px;
}
.scene-heat .scale-lbl {
  position: absolute; left: 16px; bottom: 94px;
  display: flex; justify-content: space-between; width: calc(100% - 32px);
  font-family: var(--mono); font-size: 9px; color: var(--fg-3);
}

/* ========= Video-backed clips (real product captures) ========= */
.clip-video {
  background: #060607;
}
.clip-video video,
.clip-video .clip-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 1;
}
.clip-video .clip-chrome { z-index: 5; }
.clip-video .clip-label { z-index: 6; }
.clip-video .clip-play-badge { z-index: 6; }
/* Subtle gradients to keep chrome/label readable over footage */
.clip-video::before {
  content: "";
  position: absolute; inset: 0; z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(to top, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0) 38%),
    linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0) 22%);
}

/* ========= Scene 6: Tire / G-force gauge ========= */
.scene-gauge {
  background: radial-gradient(ellipse at center, #141418 0%, #060607 70%);
}
.scene-gauge .gauges {
  position: absolute; inset: 40px 16px 102px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 16px;
}
.scene-gauge .tires {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.scene-gauge .tire {
  position: relative;
  background: #0c0c0e;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px;
  font-family: var(--mono);
  display: flex; flex-direction: column; justify-content: space-between;
}
.scene-gauge .tire .t-row { display: flex; gap: 2px; height: 14px; }
.scene-gauge .tire .t-row span {
  flex: 1; border-radius: 1px;
  animation: tireHeat 3s ease-in-out infinite;
}
.scene-gauge .tire .t-lbl { font-size: 9px; color: var(--fg-3); letter-spacing: 0.1em; text-transform: uppercase; }
.scene-gauge .tire .t-val { font-size: 14px; color: #6effa2; font-weight: 600; }
@keyframes tireHeat {
  0%, 100% { background: #6effa2; }
  50% { background: var(--red); }
}
.scene-gauge .gcircle {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: radial-gradient(circle, #0c0c0e 0%, #060607 100%);
  align-self: stretch;
  overflow: hidden;
}
.scene-gauge .gcircle::before, .scene-gauge .gcircle::after {
  content: ""; position: absolute; background: rgba(255,255,255,0.1);
}
.scene-gauge .gcircle::before { left: 50%; top: 8%; bottom: 8%; width: 1px; }
.scene-gauge .gcircle::after { top: 50%; left: 8%; right: 8%; height: 1px; }
.scene-gauge .gdot {
  position: absolute; left: 50%; top: 50%; width: 10px; height: 10px;
  background: var(--red); border-radius: 50%;
  box-shadow: 0 0 12px var(--red);
  transform: translate(-50%, -50%);
  animation: gswing 3s ease-in-out infinite;
}
@keyframes gswing {
  0%, 100% { transform: translate(-50%, -50%); }
  25% { transform: translate(30%, -150%); }
  50% { transform: translate(150%, 30%); }
  75% { transform: translate(-120%, 80%); }
}
.scene-gauge .gcircle .glbl {
  position: absolute; top: 6px; left: 8px;
  font-family: var(--mono); font-size: 9px; color: var(--fg-3); letter-spacing: 0.1em;
}
