/* ============================================================
   CarsMotion — v3
   Hero = fullscreen slider, minimalism, sportowe akcenty.
   ============================================================ */

:root {
  --bg:        #0a0a0a;
  --bg-2:      #111111;
  --fg:        #ffffff;
  --muted:     #6a6a6a;
  --muted-2:   #3d3d3d;
  --line:      #1f1f1f;
  --line-2:    #2a2a2a;

  --font-sans: "SF Pro Display", -apple-system, "DM Sans", system-ui, sans-serif;

  --r-mainpad: 80px;

  --t-fast:    .25s cubic-bezier(.2,.7,.2,1);
  --t-med:     .55s cubic-bezier(.2,.7,.2,1);
  --t-slow:    .85s cubic-bezier(.2,.7,.2,1);
}

* { margin:0; padding:0; box-sizing:border-box; }
html { background: var(--bg); }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  font-feature-settings: "ss01","ss02","cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button { font-family: inherit; }

/* Grain noise overlay */
.grain {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: .055;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ============================================================
   NAVBAR
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 22px var(--r-mainpad);
  background: linear-gradient(to bottom, rgba(10,10,10,.85) 0%, rgba(10,10,10,.5) 60%, rgba(10,10,10,0) 100%);
}
.nav__inner {
  display: flex;
  align-items: center;
  gap: 36px;
  width: 100%;
}
.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.nav__brand img {
  width: 52px;
  height: auto;
  filter: drop-shadow(0 1px 8px rgba(0,0,0,.4));
  transition: opacity var(--t-fast), transform var(--t-med);
}
.nav__brand-name {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--fg);
  transition: opacity var(--t-fast);
}
.nav__brand:hover img { opacity: .85; transform: scale(1.04); }
.nav__brand:hover .nav__brand-name { opacity: .85; }

.nav__menu {
  display: flex;
  gap: 28px;
  align-items: center;
  margin-left: 12px;
}

.nav__item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 4px;
  font-size: 15.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--fg);
  overflow: hidden;
}

/* Mała ikonka logo wjeżdża z lewej na hover */
.nav__icon-mini {
  display: inline-flex;
  align-items: center;
  width: 0;
  overflow: hidden;
  transition: width var(--t-med);
}
.nav__icon-mini img {
  width: 18px;
  height: auto;
  filter: brightness(0) invert(1);
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity var(--t-med), transform var(--t-med);
}

.nav__label {
  position: relative;
  transition: transform var(--t-fast);
}

.nav__item:hover .nav__icon-mini { width: 22px; }
.nav__item:hover .nav__icon-mini img { opacity: 1; transform: translateX(0); }

.nav__right {
  display: inline-flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
}
.nav__rating {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.nav__rating-stars {
  display: inline-block;
  color: var(--fg);
  font-size: 12.5px;
  letter-spacing: 1.5px;
}
.nav__rating-meta { font-variant-numeric: tabular-nums; }
.nav__rating-meta strong { color: var(--fg); font-weight: 600; }
.nav__rating-sep { color: var(--muted-2); margin: 0 1px; }

.btn-sport__icon {
  width: 14px;
  height: auto;
  filter: brightness(0) invert(1);
  margin-right: -1px;
}
.btn-sport--solid .btn-sport__icon { filter: none; }

/* ============================================================
   SPORT BUTTONS (parallelogram, ostre)
   ============================================================ */
.btn-sport {
  --pad-x: 18px;
  --pad-y: 11px;
  --skew: 8px;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: var(--pad-y) calc(var(--pad-x) + 4px);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg);
  background: transparent;
  border: none;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  clip-path: polygon(var(--skew) 0, 100% 0, calc(100% - var(--skew)) 100%, 0 100%);
  transition: transform var(--t-fast);
}
.btn-sport svg { transition: transform var(--t-med); }
.btn-sport:hover svg { transform: translateX(4px); }
.btn-sport:active { transform: scale(.98); }

/* Solid: białe wypełnienie, dark text */
.btn-sport--solid {
  background: var(--fg);
  color: var(--bg);
}
.btn-sport--solid:hover {
  background: #e6e6e6;
}

/* Outline: 1px border z clip-path (potrzebuje wrappera-tła) */
.btn-sport--outline,
.btn-sport--ghost {
  background: transparent;
  color: var(--fg);
  position: relative;
}
.btn-sport--outline::before,
.btn-sport--ghost::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--fg);
  clip-path: polygon(
    var(--skew) 0,
    100% 0,
    calc(100% - var(--skew)) 100%,
    0 100%,
    var(--skew) 0,
    calc(var(--skew) + 1px) 1px,
    1px calc(100% - 1px),
    calc(100% - var(--skew) - 1px) calc(100% - 1px),
    calc(100% - 1px) 1px,
    var(--skew) 0
  );
  transition: opacity var(--t-fast);
}
.btn-sport--outline:hover::before { opacity: .55; }

/* Ghost (navbar) — mniejszy padding, lżejsza obwódka */
.btn-sport--ghost {
  --pad-x: 14px;
  --pad-y: 9px;
  font-size: 10px;
}
.btn-sport--ghost::before { opacity: .55; }
.btn-sport--ghost:hover::before { opacity: 1; }

/* ============================================================
   HERO + SLIDER
   ============================================================ */
.hero {
  position: relative;
  height: 100vh;
  min-height: 760px;
  overflow: hidden;
  isolation: isolate;
}

.slider {
  position: absolute;
  inset: 0;
}

.slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: 72% center;
  background-repeat: no-repeat;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-slow), visibility var(--t-slow);
}
.slide.is-active {
  opacity: 1;
  visibility: visible;
}

/* Placeholder slides — ciemne tło z znakiem CarsMotion */
.slide--placeholder {
  background: radial-gradient(ellipse at 65% center, #1a1a1a 0%, #0a0a0a 70%);
}
.slide__placeholder-mark {
  position: absolute;
  top: 50%; left: 65%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  z-index: 1;
}
.slide__placeholder-mark img {
  width: 100px;
  opacity: .08;
  filter: brightness(0) invert(1);
}
.slide__placeholder-mark span {
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 500;
}

/* Overlay gradientu — subtelne ramowanie, auto wyraźnie widoczne */
.slide__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(100deg,
      rgba(10,10,10,.82) 0%,
      rgba(10,10,10,.55) 22%,
      rgba(10,10,10,.18) 46%,
      rgba(10,10,10,.05) 70%,
      rgba(10,10,10,.12) 100%),
    linear-gradient(180deg,
      rgba(10,10,10,.35) 0%,
      rgba(10,10,10,0) 14%,
      rgba(10,10,10,0) 68%,
      rgba(10,10,10,.72) 100%);
}

.slide__inner {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100%;
  padding: 130px var(--r-mainpad) 100px;
  width: 100%;
}

/* Head: kategoria sport · premium */
.slide__head {
  display: flex;
  align-items: flex-start;
  padding-top: 14px;
}
.slide__cat {
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  position: relative;
  padding-left: 38px;
  display: inline-flex;
  align-items: center;
  height: 16px;
}
.slide__cat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 26px;
  height: 1px;
  background: var(--fg);
  opacity: .35;
  transform: translateY(-.5px);
}

/* Foot: model po lewej, specs+ctas po prawej (specs nad buttonami) */
.slide__foot {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 38px 56px;
  align-items: end;
}

.slide__title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}
.slide__model {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  font-size: clamp(18px, 1.8vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--fg);
  max-width: 720px;
}
.slide__model-brand {
  width: auto;
  height: 9px;
  opacity: .85;
  display: block;
}
.slide__model-name {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
}
.slide__model-soft {
  display: block;
  font-weight: 400;
  opacity: .55;
  font-size: .78em;
  letter-spacing: -0.015em;
  margin-top: 2px;
}
.slide__line {
  display: block;
  width: 64px;
  height: 1px;
  background: var(--fg);
  opacity: .45;
}

/* Prawa kolumna: specs nad buttonami */
.slide__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

/* Specs — małe pille pod tytułem, wyrównane do lewej */
.slide__specs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
}
.spec {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.55);
  border-radius: 6px;
  white-space: nowrap;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.spec svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  opacity: .75;
  margin-right: 1px;
}
.spec__val {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.spec__key {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--fg);
}

/* CTAs */
.slide__ctas {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Animacje entrance slidu */
.slide.is-active .slide__cat      { animation: rise .9s cubic-bezier(.2,.7,.2,1) .15s both; }
.slide.is-active .slide__model    { animation: rise 1.05s cubic-bezier(.2,.7,.2,1) .25s both; }
.slide.is-active .slide__line     { animation: rise .9s cubic-bezier(.2,.7,.2,1) .4s both; }
.slide.is-active .slide__specs    { animation: rise .9s cubic-bezier(.2,.7,.2,1) .5s both; }
.slide.is-active .slide__ctas     { animation: rise .9s cubic-bezier(.2,.7,.2,1) .6s both; }

/* ============================================================
   HOTSPOTY — analiza auta
   ============================================================ */
.hotspots {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
.hotspot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  pointer-events: auto;
  z-index: 1;
  opacity: 0;
  animation: hotspotIn .6s cubic-bezier(.2,.7,.2,1) forwards;
}
.slide.is-active .hotspot:nth-child(1) { animation-delay: .9s; }
.slide.is-active .hotspot:nth-child(2) { animation-delay: 1.05s; }
.slide.is-active .hotspot:nth-child(3) { animation-delay: 1.2s; }
.slide.is-active .hotspot:nth-child(4) { animation-delay: 1.35s; }
.hotspot:hover { z-index: 6; }

/* Punkt */
.hotspot__dot {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--fg);
  box-shadow: 0 0 0 1px rgba(0,0,0,.35), 0 2px 8px rgba(0,0,0,.4);
  transition: transform var(--t-fast);
}
/* Pulsujący ring */
.hotspot__dot::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.6);
  animation: hotspotPulse 2.4s ease-out infinite;
}
.hotspot:hover .hotspot__dot { transform: translate(-50%, -50%) scale(1.25); }

/* Card z opisem */
.hotspot__card {
  position: absolute;
  top: 50%;
  width: 248px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: rgba(12,12,12,.82);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 16px 50px rgba(0,0,0,.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-fast), visibility var(--t-fast), transform var(--t-fast);
  text-align: left;
  pointer-events: none;
}
.hotspot[data-side="right"] .hotspot__card {
  left: 26px;
  transform: translateY(-50%) translateX(-8px);
}
.hotspot[data-side="left"] .hotspot__card {
  right: 26px;
  transform: translateY(-50%) translateX(8px);
}
.hotspot:hover .hotspot__card {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}
/* Linia łącząca punkt z cardem */
.hotspot__card::before {
  content: "";
  position: absolute;
  top: 50%;
  width: 18px;
  height: 1px;
  background: rgba(255,255,255,.3);
}
.hotspot[data-side="right"] .hotspot__card::before { left: -18px; }
.hotspot[data-side="left"] .hotspot__card::before { right: -18px; }

.hotspot__title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.hotspot__desc {
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  letter-spacing: -0.005em;
}

/* ============================================================
   SLIDER CONTROLS
   ============================================================ */
.slider-controls {
  position: absolute;
  z-index: 5;
  bottom: 38px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 22px;
  padding: 10px 16px;
  background: rgba(10,10,10,.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  border: 1px solid rgba(255,255,255,.12);
}
.slider-arrow {
  background: transparent;
  border: none;
  color: var(--fg);
  cursor: pointer;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: .7;
  transition: opacity var(--t-fast), transform var(--t-fast);
}
.slider-arrow:hover { opacity: 1; }
.slider-arrow[data-dir="-1"]:hover { transform: translateX(-3px); }
.slider-arrow[data-dir="1"]:hover  { transform: translateX(3px); }

.slider-counter {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
}
.slider-counter__sep { opacity: .35; }
.slider-counter__total { opacity: .5; }

/* Progress bar przy dolnej krawędzi */
.slider-progress {
  position: absolute;
  z-index: 4;
  left: 0; right: 0;
  bottom: 0;
  height: 1px;
  background: rgba(255,255,255,.07);
}
.slider-progress__bar {
  display: block;
  height: 100%;
  background: var(--fg);
  width: 0%;
  transition: width .12s linear;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes rise {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes hotspotIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.4); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes hotspotPulse {
  0%   { transform: scale(1); opacity: .8; }
  70%  { transform: scale(2.4); opacity: 0; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
