/* =====================================================
   QRENNT — PROJECT PREVIEWS (общие для главной и «Проекты»)
   Анимированные превью проектов. Подключается на index.html
   и projects.html. Анимации: rotate / scale / translate,
   поэтому не конфликтуют со старыми transform.
   ===================================================== */

.project-visual {
  --green: #8cffb0;
  --display: var(--fx-sans, "Onest", Arial, sans-serif);
}

.visual-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.project-visual {
  height: 300px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: #08130c;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.project-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at 50% 45%, rgba(62,255,129,.15), transparent 60%);
}
.visual-top {
  position: absolute;
  z-index: 4;
  top: 20px;
  left: 22px;
  right: 22px;
  color: rgba(214,255,224,.55);
  font: 10px var(--display);
  letter-spacing: 1.5px;
}
.visual-caption {
  position: absolute;
  bottom: 20px;
  left: 22px;
  color: rgba(217,255,226,.58);
  font: 9px var(--display);
  letter-spacing: 2px;
}

/* AUTO LINE LAB */
.visual-auto { background: linear-gradient(135deg, #101b18, #07100c 60%, #142e20); }
.auto-window {
  position: absolute;
  inset: 65px 12% 45px;
  border: 1px solid rgba(174,255,193,.2);
  background: linear-gradient(135deg, rgba(255,255,255,.1), rgba(255,255,255,.015));
  backdrop-filter: blur(10px);
  overflow: hidden;
}
.auto-label {
  position: absolute;
  top: 35px;
  left: 30px;
  font: 500 20px var(--display);
  letter-spacing: 4px;
}
.auto-label b { color: var(--green); font-size: 35px; }
.auto-lines {
  position: absolute;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(140,255,176,.3);
  border-radius: 50%;
  right: 15%;
  top: -30px;
  box-shadow: 0 0 0 20px rgba(140,255,176,.025), 0 0 0 40px rgba(140,255,176,.025);
  animation: pvSpin 20s linear infinite;
}
.auto-circle {
  position: absolute;
  right: 28px;
  bottom: 22px;
  color: var(--green);
  font: 600 13px var(--display);
  letter-spacing: 5px;
}

/* KLINE */
.visual-barber { background: radial-gradient(circle at 50% 45%, #29382e, #0b100d 65%); }
.barber-emblem {
  position: absolute;
  width: 125px;
  height: 125px;
  left: 50%;
  top: 48%;
  transform: translate(-50%,-50%);
  display: grid;
  place-items: center;
  border: 1px solid rgba(208,255,217,.45);
  border-radius: 50%;
  box-shadow: 0 0 50px rgba(140,255,176,.1), inset 0 0 30px rgba(140,255,176,.08);
}
.barber-emblem span { font: 500 70px var(--display); color: #e0f5e5; }
.barber-emblem i {
  position: absolute;
  width: 145px;
  height: 1px;
  background: var(--green);
  transform: rotate(-45deg);
  opacity: .7;
}
.barber-type {
  position: absolute;
  right: 12%;
  bottom: 48px;
  text-align: right;
  font: 600 19px var(--display);
  letter-spacing: 5px;
}
.barber-type small { color: var(--green); font-size: 8px; }

/* PATTERNS */
.visual-pattern { background: #15140e; }
.pattern-art {
  position: absolute;
  inset: 65px 12% 45px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(234,204,129,.2);
  background: radial-gradient(circle, rgba(190,151,76,.14), transparent 65%);
}
.pattern-art > span {
  z-index: 2;
  font: 600 29px var(--display);
  letter-spacing: 9px;
  color: #e9d5a3;
}
.pattern-shape {
  position: absolute;
  width: 145px;
  height: 145px;
  border: 1px solid rgba(231,196,125,.65);
  transform: rotate(45deg);
}
.shape-b { width: 105px; height: 105px; transform: rotate(0deg); }
.shape-c { width: 185px; height: 185px; border-radius: 50%; border-style: dashed; animation: pvSpin 35s linear infinite; }

/* NEON CARD */
.visual-card { background: radial-gradient(circle, #123b2b, #07100c 70%); }
.neon-card {
  position: absolute;
  width: 230px;
  height: 145px;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%) rotate(-7deg);
  padding: 18px;
  border: 1px solid rgba(143,255,183,.8);
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(255,255,255,.16), rgba(25,85,52,.3));
  box-shadow: 0 0 25px rgba(90,255,145,.22), inset 0 0 20px rgba(140,255,176,.08);
  backdrop-filter: blur(15px);
  animation: pvCardFloat 5s ease-in-out infinite;
}
.neon-small, .neon-bottom { display: block; font: 8px var(--display); letter-spacing: 2px; color: #a8e8b8; }
.neon-card strong { display: block; margin: 12px 0; font: 700 27px/.9 var(--display); letter-spacing: 2px; }
.neon-card strong i { color: var(--green); font-style: normal; }
.neon-bottom { display: flex; justify-content: space-between; }
.neon-bottom b { color: var(--green); }

/* RUNNER */
.visual-runner { background: linear-gradient(160deg, #11132a, #090b17 65%, #13251d); }
.runner-screen {
  position: absolute;
  inset: 65px 10% 45px;
  overflow: hidden;
  border: 1px solid rgba(148,255,187,.25);
  background: linear-gradient(#14172e, #1b2441 65%, #101c22);
}
.runner-sun {
  position: absolute;
  width: 70px;
  height: 70px;
  top: 20px;
  right: 22%;
  border-radius: 50%;
  background: #9bffc1;
  box-shadow: 0 0 40px #63ff9a;
  opacity: .8;
}
.runner-moon { position: absolute; top: 28px; left: 25px; color: #c5ffda; }
.runner-ground {
  position: absolute;
  bottom: 30px;
  width: 100%;
  height: 3px;
  background: #8cffb0;
  box-shadow: 0 0 20px #8cffb0;
}
.runner-player {
  position: absolute;
  width: 22px;
  height: 34px;
  bottom: 33px;
  left: 28%;
  background: var(--green);
  box-shadow: 0 0 20px #8cffb0;
  animation: pvJump 1.6s ease-in-out infinite;
}
.runner-title {
  position: absolute;
  top: 42%;
  left: 0;
  width: 100%;
  text-align: center;
  font: 700 23px var(--display);
  letter-spacing: 4px;
  text-shadow: 0 0 20px #8cffb0;
}
.runner-start {
  position: absolute;
  bottom: 10px;
  width: 100%;
  text-align: center;
  color: #a5ffc0;
  font: 8px var(--display);
  letter-spacing: 3px;
}

/* QRENNT LAB */
.visual-lab { background: radial-gradient(circle, #153d29, #07100a 70%); }
.lab-core {
  position: absolute;
  width: 190px;
  height: 190px;
  left: 50%;
  top: 48%;
  transform: translate(-50%,-50%);
  display: grid;
  place-items: center;
}
.lab-ring {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(140,255,176,.45);
  border-radius: 50%;
  box-shadow: 0 0 25px rgba(140,255,176,.08);
  animation: pvSpin 18s linear infinite;
}
.ring-inner { inset: 25px; border-style: dashed; animation-direction: reverse; }
.lab-center {
  width: 80px;
  height: 80px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #b5ffca, #17683b);
  color: #06130a;
  font: 700 45px var(--display);
  box-shadow: 0 0 50px rgba(140,255,176,.35);
}
.lab-center span { color: #fff; }
.lab-tag {
  position: absolute;
  color: #a9eabb;
  font: 8px var(--display);
  letter-spacing: 2px;
}
.tag-a { top: -8px; }
.tag-b { bottom: 0; left: -20px; }
.tag-c { bottom: 25px; right: -20px; }
@keyframes pvCardFloat { 0%,100% { margin-top: 0; } 50% { margin-top: -12px; } }
@keyframes pvJump { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-25px); } }

/* =====================================================
   ANIMATED PROJECT PREVIEWS
   Только CSS. Используются свойства rotate / scale / translate,
   поэтому анимации не конфликтуют со старыми transform.
   ===================================================== */

/* общий блик, пробегающий по превью */
.project-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 38%, rgba(190, 255, 215, .13) 50%, transparent 62%);
  translate: -130% 0;
  animation: pvShine 6s ease-in-out infinite;
}

.project-card:nth-child(2n) .project-visual::before { animation-delay: 1.5s; }
.project-card:nth-child(3n) .project-visual::before { animation-delay: 3s; }

/* 01 — BLACK PANAMERA: едущая машина */
.visual-car { background: radial-gradient(ellipse at 50% 85%, #17442b, #09130d 55%, #050907); }

.pv-car { position: absolute; inset: 0; overflow: hidden; }

.pv-glow {
  position: absolute;
  left: 50%;
  bottom: 58px;
  width: 340px;
  height: 160px;
  margin-left: -170px;
  background: radial-gradient(ellipse, rgba(80, 230, 140, .28), transparent 68%);
  filter: blur(10px);
  animation: pvBreath 4s ease-in-out infinite;
}

.pv-road {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 74px;
  background: linear-gradient(180deg, #0c1612, #050a07);
  border-top: 1px solid rgba(160, 255, 193, .22);
}

.pv-road::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 44px;
  height: 3px;
  background: repeating-linear-gradient(90deg, rgba(190, 255, 215, .75) 0 34px, transparent 34px 86px);
  animation: pvRoad .7s linear infinite;
}

.pv-speed i {
  position: absolute;
  right: -120px;
  height: 1px;
  width: 90px;
  background: linear-gradient(90deg, transparent, rgba(190, 255, 215, .7));
  animation: pvSpeed 1.6s linear infinite;
}

.pv-speed i:nth-child(1) { top: 92px; animation-delay: 0s; }
.pv-speed i:nth-child(2) { top: 132px; width: 140px; animation-delay: -.5s; animation-duration: 1.2s; }
.pv-speed i:nth-child(3) { top: 172px; width: 70px; animation-delay: -1s; }
.pv-speed i:nth-child(4) { top: 210px; width: 110px; animation-delay: -.3s; animation-duration: 1.9s; }

.pv-reflect {
  position: absolute;
  left: 50%;
  bottom: 52px;
  width: 230px;
  height: 18px;
  margin-left: -115px;
  border-radius: 50%;
  background: rgba(112, 230, 160, .32);
  filter: blur(14px);
}

.pv-body {
  position: absolute;
  left: 50%;
  bottom: 66px;
  width: 240px;
  height: 76px;
  margin-left: -120px;
  animation: pvBob 1.1s ease-in-out infinite;
}

.pv-hull {
  position: absolute;
  left: 0;
  bottom: 12px;
  width: 240px;
  height: 30px;
  border-radius: 14px 30px 8px 8px;
  background: linear-gradient(180deg, #f1f8f3 0%, #a4b8ab 34%, #2b3830 100%);
  box-shadow: 0 0 34px rgba(112, 230, 160, .25);
}

.pv-cabin {
  position: absolute;
  left: 52px;
  bottom: 38px;
  width: 134px;
  height: 34px;
  clip-path: polygon(0 100%, 20% 10%, 72% 0, 100% 100%);
  background: linear-gradient(180deg, #e4f0e8, #86998d);
}

.pv-cabin::after {
  content: "";
  position: absolute;
  inset: 5px 8px 0 14px;
  clip-path: polygon(0 100%, 20% 8%, 72% 0, 100% 100%);
  background: linear-gradient(180deg, #0f1c16, #1d3a2b);
}

.pv-light {
  position: absolute;
  right: -2px;
  bottom: 26px;
  width: 16px;
  height: 7px;
  border-radius: 4px 6px 6px 4px;
  background: #f4fff7;
  box-shadow: 0 0 14px 3px rgba(210, 255, 225, .9);
}

.pv-tail {
  position: absolute;
  left: -1px;
  bottom: 28px;
  width: 9px;
  height: 5px;
  border-radius: 3px;
  background: #ff5273;
  box-shadow: 0 0 12px 2px rgba(255, 82, 115, .8);
}

.pv-beam {
  position: absolute;
  left: 232px;
  bottom: 18px;
  width: 260px;
  height: 52px;
  clip-path: polygon(0 38%, 100% 0, 100% 100%, 0 62%);
  background: linear-gradient(90deg, rgba(214, 255, 228, .5), transparent);
  animation: pvBeam 3s ease-in-out infinite;
}

.pv-wheel {
  position: absolute;
  bottom: -2px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #040706;
  box-shadow: 0 0 0 2px #1d2923;
}

.pv-wheel.w1 { left: 36px; }
.pv-wheel.w2 { right: 34px; }

.pv-wheel::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: repeating-conic-gradient(#cfe5d8 0 12deg, #101915 12deg 60deg);
  animation: pvRotate .45s linear infinite;
}

/* 02 — AUTO LINE LAB */
.visual-auto .auto-circle { animation: pvPulse 3s ease-in-out infinite; }
.visual-auto .auto-lines { animation: pvBreath 3.5s ease-in-out infinite; }
.visual-auto .auto-label b { animation: pvGlowText 3.5s ease-in-out infinite; }

/* 03 — KLINE: барбер-полюс */
.pv-pole {
  position: absolute;
  right: 28px;
  top: 58px;
  bottom: 54px;
  width: 22px;
  z-index: 3;
  border-radius: 12px;
  border: 1px solid rgba(220, 240, 228, .5);
  background: rgba(8, 14, 10, .6);
  overflow: hidden;
}

.pv-pole i {
  position: absolute;
  inset: -40px 0;
  background: repeating-linear-gradient(135deg, #f2f7f4 0 8px, #70e6a0 8px 16px, #e8eeea 16px 24px, #1a3a2a 24px 32px);
  animation: pvPole 1.8s linear infinite;
}

.visual-barber .barber-emblem { animation: pvFloatY 6s ease-in-out infinite; }

/* 04 — узоры */
.visual-pattern .pattern-shape { animation: pvRotate 26s linear infinite; }
.visual-pattern .pattern-shape.shape-b { animation-duration: 38s; animation-direction: reverse; }
.visual-pattern .pattern-shape.shape-c { animation-duration: 18s; }

/* 05 — NEON CYBER */
.visual-card .neon-card strong i { animation: pvFlicker 4.5s infinite; }
.visual-card .neon-bottom b { animation: pvBlink 1.4s steps(2) infinite; }

/* 06 — NEON RUNNER */
.pv-obstacle {
  position: absolute;
  z-index: 3;
  right: -20px;
  bottom: 58px;
  width: 14px;
  height: 26px;
  border-radius: 3px;
  background: #70e6a0;
  box-shadow: 0 0 14px rgba(112, 230, 160, .8);
  animation: pvObstacle 2.2s linear infinite;
}

.visual-runner .runner-ground { animation: pvGround .5s linear infinite; }
.visual-runner .runner-start { animation: pvBlink 1.2s steps(2) infinite; }

/* 07 — LAB */
.visual-lab .lab-tag { animation: pvFloatY 5s ease-in-out infinite; }
.visual-lab .lab-tag.tag-b { animation-delay: -1.7s; }
.visual-lab .lab-tag.tag-c { animation-delay: -3.2s; }
.visual-lab .lab-center { animation: pvPulse 3.5s ease-in-out infinite; }

/* keyframes */
@keyframes pvShine { 0%, 55% { translate: -130% 0; } 85%, 100% { translate: 130% 0; } }
@keyframes pvRoad { to { background-position-x: -86px; } }
@keyframes pvSpeed { from { translate: 0 0; opacity: 0; } 15% { opacity: 1; } to { translate: -620px 0; opacity: 0; } }
@keyframes pvBob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -2px; } }
@keyframes pvRotate { to { rotate: 360deg; } }
@keyframes pvBeam { 0%, 100% { opacity: .85; } 50% { opacity: .5; } }
@keyframes pvBreath { 0%, 100% { opacity: .65; } 50% { opacity: 1; } }
@keyframes pvPulse { 0%, 100% { scale: 1; } 50% { scale: 1.06; } }
@keyframes pvGlowText { 0%, 100% { text-shadow: none; } 50% { text-shadow: 0 0 22px rgba(112, 230, 160, .75); } }
@keyframes pvPole { to { translate: 0 32px; } }
@keyframes pvFloatY { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes pvFlicker { 0%, 92%, 100% { opacity: 1; } 93% { opacity: .35; } 95% { opacity: 1; } 97% { opacity: .5; } }
@keyframes pvBlink { 50% { opacity: .25; } }
@keyframes pvObstacle { from { translate: 0 0; } to { translate: -460px 0; } }
@keyframes pvGround { to { background-position-x: -24px; } }

@media (prefers-reduced-motion: reduce) {
  .project-visual *, .project-visual::before { animation: none !important; }
}


/* =====================================================
   ДОПОЛНИТЕЛЬНЫЕ ОБЪЕКТЫ НА КАЖДОМ СЛАЙДЕ
   уголки, частицы, сканирующая линия, HUD-счётчики, чипы
   ===================================================== */

.pv-extras { position: absolute; inset: 0; z-index: 4; pointer-events: none; }

.pv-corner {
  position: absolute;
  width: 13px;
  height: 13px;
  border: 0 solid rgba(190, 255, 215, .5);
}

.pv-corner.tl { top: 9px; left: 9px; border-top-width: 1px; border-left-width: 1px; }
.pv-corner.tr { top: 9px; right: 9px; border-top-width: 1px; border-right-width: 1px; }
.pv-corner.bl { bottom: 9px; left: 9px; border-bottom-width: 1px; border-left-width: 1px; }
.pv-corner.br { bottom: 9px; right: 9px; border-bottom-width: 1px; border-right-width: 1px; }

.pv-scan {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(190, 255, 215, .55), transparent);
  animation: pvScan 6s linear infinite;
}

.pv-dot {
  position: absolute;
  bottom: -8px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #c8ffdb;
  box-shadow: 0 0 9px rgba(140, 255, 176, .9);
  opacity: 0;
  animation: pvRise 8s linear infinite;
}

.pv-dot:nth-child(1) { left: 7%; animation-delay: 0s; animation-duration: 7s; }
.pv-dot:nth-child(2) { left: 18%; animation-delay: -2.4s; animation-duration: 9s; }
.pv-dot:nth-child(3) { left: 29%; animation-delay: -5s; animation-duration: 8s; }
.pv-dot:nth-child(4) { left: 41%; animation-delay: -1s; animation-duration: 10s; }
.pv-dot:nth-child(5) { left: 58%; animation-delay: -3.6s; animation-duration: 7.5s; }
.pv-dot:nth-child(6) { left: 69%; animation-delay: -6s; animation-duration: 9.5s; }
.pv-dot:nth-child(7) { left: 82%; animation-delay: -4s; animation-duration: 8.5s; }
.pv-dot:nth-child(8) { left: 93%; animation-delay: -7s; animation-duration: 7s; }

.pv-hud {
  position: absolute;
  right: 22px;
  bottom: 20px;
  color: rgba(217, 255, 226, .6);
  font: 500 9px var(--fx-mono, monospace);
  letter-spacing: .16em;
  white-space: nowrap;
}

.pv-hud b { color: var(--green); font-weight: 600; }

.pv-tag {
  position: absolute;
  padding: 5px 10px;
  border: 1px solid rgba(190, 255, 215, .26);
  border-radius: 20px;
  background: rgba(8, 16, 12, .55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: rgba(214, 255, 224, .8);
  font: 500 8px var(--fx-mono, monospace);
  letter-spacing: .16em;
  white-space: nowrap;
  animation: pvFloatY 6s ease-in-out infinite;
}

.pv-tag.t1 { left: 22px; top: 52px; }
.pv-tag.t2 { left: 22px; bottom: 50px; animation-delay: -2.6s; }

/* внутри карточки на главной тот же размер */
.featured-card .project-visual { border-bottom: 0; }

@keyframes pvScan { from { translate: 0 0; } to { translate: 0 320px; } }
@keyframes pvRise {
  0% { translate: 0 0; opacity: 0; }
  12% { opacity: .9; }
  100% { translate: 0 -330px; opacity: 0; }
}
@keyframes pvSpin { to { transform: rotate(360deg); } }

@media (max-width: 680px) {
  .project-visual { height: 250px; }
  .pv-body { scale: .82; }
  .pv-tag.t2 { display: none; }
  .pv-hud { right: 18px; bottom: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .pv-extras *, .pv-extras { animation: none !important; }
  .pv-dot { display: none; }
}
