/* JUST GRAPHICS — Motorsport category, visual reference on Website Design System 1.0.
   Shares the category system in personal-cars.css (.pc-*); this file holds only what makes Motorsport its own page:
   a full-width photo with a black "pit wall" band under it, typographic livery options with mono prices (price-list style),
   a print → install → track story, and a mirrored mosaic. Brand OS elements as approved 21.10.2026. */

/* ---------- HERO: photo band + black band with the headline ---------- */
.ms-hero {
  position: relative;
  background: var(--jg-black);
}

.ms-hero__media {
  position: relative;
  z-index: 2;
  height: min(66svh, 46rem);
  min-height: 24rem;
  margin: 0;
  overflow: hidden;
}

.ms-hero__media picture {
  display: block;
  height: 100%;
}

.ms-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 58%;
}

.ms-hero__media::after {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 5, 5, 0.65) 0%, transparent 22%),
    linear-gradient(0deg, var(--jg-black) 0%, rgba(5, 5, 5, 0.6) 22%, transparent 48%);
  content: "";
}

.ms-hero__media figcaption {
  position: absolute;
  z-index: 1;
  top: calc(var(--header-height) + 1.25rem);
  right: var(--pc-pad);
  color: rgba(255, 255, 255, 0.8);
  font-family: var(--font-technical);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

[dir="rtl"] .ms-hero__media figcaption {
  right: auto;
  left: var(--pc-pad);
  font-family: var(--font-ar);
  letter-spacing: 0;
}

/* The one technical corner on this page: on the hero photo. */
.ms-hero__media::before {
  position: absolute;
  z-index: 2;
  top: calc(var(--header-height) + 3.25rem);
  right: var(--pc-pad);
  width: 1.5rem;
  height: 1.5rem;
  border-top: 2px solid var(--jg-lime);
  border-right: 2px solid var(--jg-lime);
  content: "";
}

[dir="rtl"] .ms-hero__media::before {
  right: auto;
  left: var(--pc-pad);
  border-right: 0;
  border-left: 2px solid var(--jg-lime);
}

/* Black band: engineering grid (0.035) and one purple ambient field; starts below the photo, never over it. */
.ms-hero__band {
  position: relative;
  display: flow-root; /* stops the headline's negative margin from pulling the band (grid, glow) up over the photo */
  padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
  background: radial-gradient(circle at 12% 70%, rgba(109, 56, 201, 0.16), transparent 30rem);
}

[dir="rtl"] .ms-hero__band {
  background: radial-gradient(circle at 88% 70%, rgba(109, 56, 201, 0.16), transparent 30rem);
}

.ms-hero__band::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 90%);
  mask-image: linear-gradient(to bottom, #000, transparent 90%);
  content: "";
  pointer-events: none;
}

.ms-hero__inner {
  position: relative;
  z-index: 3;
  display: grid;
  gap: var(--space-5);
  margin-top: clamp(-7.5rem, -9vw, -4rem);
}

.ms-hero .pc-label {
  margin-bottom: var(--space-4);
}

html:not(#pc):not(#pc-b) body .pc .ms-hero h1 {
  max-width: none;
  margin: 0;
  font-size: clamp(2.2rem, 9.4vw, 8.4rem);
  line-height: 0.86;
  white-space: nowrap;
  letter-spacing: -0.055em;
}

html[lang="ru"]:not(#pc):not(#pc-b) body .pc .ms-hero h1 {
  font-size: clamp(2.2rem, 9.6vw, 8.6rem);
  letter-spacing: -0.045em;
}

html[lang="ar"]:not(#pc):not(#pc-b) body .pc .ms-hero h1 {
  font-size: clamp(2.6rem, 1rem + 5vw, 5.6rem);
  line-height: 1.1;
}

.ms-hero h1 .pc-dot {
  color: var(--jg-lime);
}

.ms-hero__side {
  display: grid;
  gap: var(--space-5);
  align-content: end;
}

@media (min-width: 64rem) {
  .ms-hero__inner {
    grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
    align-items: end;
    column-gap: var(--space-7);
  }

  /* One-word headline runs the full width; text and buttons sit under it on the right. */
  .ms-hero__inner > div:first-child {
    grid-column: 1 / -1;
  }

  .ms-hero__side {
    grid-column: 2;
  }
}

/* ---------- LIVERY OPTIONS: typographic cards, mono prices (price-list language) ---------- */
.ms-opts {
  display: grid;
  gap: var(--pc-gap);
}

.ms-opt {
  position: relative;
  display: grid;
  align-content: start;
  gap: var(--space-3);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border: 1px solid var(--pc-line);
  background: var(--pc-panel);
}

.ms-opt::before {
  position: absolute;
  inset: -1px -1px auto -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--jg-lime), var(--jg-purple) 60%, rgba(109, 56, 201, 0));
  content: "";
}

[dir="rtl"] .ms-opt::before {
  background: linear-gradient(270deg, var(--jg-lime), var(--jg-purple) 60%, rgba(109, 56, 201, 0));
}

.ms-opt .pc-label {
  margin: 0;
}

html:not(#pc):not(#pc-b) body .pc .ms-opt h3 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.35rem, 1.1rem + 0.8vw, 1.85rem);
}

.ms-opt__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.6rem;
  margin: var(--space-2) 0 0;
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--pc-line);
}

.ms-opt__price b {
  color: var(--jg-lime);
  font-family: var(--font-technical);
  font-size: clamp(2.4rem, 1.6rem + 2.6vw, 3.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.ms-opt__price small {
  color: var(--pc-muted);
  font-family: var(--font-technical);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

html[lang="ar"] .ms-opt__price small {
  font-family: var(--font-ar);
  letter-spacing: 0;
}

.ms-opt__line {
  margin: var(--space-2) 0 0;
  color: #fff !important;
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.15rem);
}

.ms-opt ul {
  display: grid;
  gap: 0.45rem;
  margin: var(--space-2) 0 var(--space-3);
  padding: 0;
  list-style: none;
}

.ms-opt li {
  position: relative;
  padding-inline-start: 1.4rem;
  color: var(--pc-muted);
}

.ms-opt li::before {
  position: absolute;
  inset-inline-start: 0;
  color: var(--jg-lime);
  content: "✓";
}

.ms-note {
  margin: var(--space-5) 0 0;
  color: var(--pc-muted);
  font-size: 0.85rem;
}

@media (min-width: 48rem) {
  .ms-opts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .ms-opt--custom {
    margin-top: 3rem;
  }
}

/* ---------- STORY: print → install → track, three equal stages ---------- */
.ms-stages {
  display: grid;
  gap: var(--space-6) var(--pc-gap);
}

.ms-stage .pc-step__img {
  aspect-ratio: 4 / 5;
}

.ms-stage--ready .pc-step__img {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--pc-graphite), var(--pc-graphite)) padding-box,
    linear-gradient(115deg, var(--jg-lime) 0%, var(--jg-lime) 20%, var(--jg-purple) 82%, var(--jg-purple) 100%) border-box;
}

@media (min-width: 48rem) {
  .ms-stages {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------- MOSAIC: five real projects, 8+4 / 4+4+4 ---------- */
.ms-mosaic {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5) var(--pc-gap);
}

.ms-mosaic .pc-shot:first-child {
  grid-column: 1 / -1;
}

.ms-mosaic .pc-shot__img {
  aspect-ratio: 4 / 3;
}

.ms-mosaic .pc-shot__img img {
  object-position: 50% 50%;
}

/* archive frames: keep the car / kart in frame, crop the floor clutter */
.ms-shot--ferrari-racing-stripe .pc-shot__img img {
  object-position: 50% 28%;
}

.ms-shot--zed-racing-decals .pc-shot__img img {
  object-position: 50% 48%;
}

@media (min-width: 64rem) {
  .ms-mosaic {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: start;
  }

  .ms-mosaic .pc-shot {
    grid-column: span 4;
  }

  .ms-mosaic .pc-shot:first-child {
    grid-column: span 8;
  }

  .ms-mosaic .pc-shot:first-child .pc-shot__img {
    aspect-ratio: 16 / 10;
  }

  .ms-mosaic .pc-shot:nth-child(2) .pc-shot__img {
    aspect-ratio: 4 / 5;
  }
}

/* ---------- TEAM SERVICES: compact list beside one real print photo ---------- */
.ms-extra__grid {
  display: grid;
  gap: var(--space-6) var(--space-8);
  align-items: center;
}

.ms-extra__img {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--pc-graphite);
  aspect-ratio: 4 / 5;
}

.ms-extra__img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ms-extra__img figcaption {
  position: absolute;
  inset-inline-start: var(--space-3);
  bottom: var(--space-3);
  padding: 0.3rem 0.55rem;
  border-radius: 4px;
  background: rgba(5, 5, 5, 0.82);
  color: #fff;
  font-family: var(--font-technical);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

html[lang="ar"] .ms-extra__img figcaption {
  font-family: var(--font-ar);
  letter-spacing: 0;
}

.ms-extra__body h2 {
  margin-bottom: var(--space-5) !important;
}

.ms-extra__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--pc-line);
  list-style: none;
}

.ms-extra__list li {
  display: grid;
  align-content: start;
  gap: 0.4rem;
  padding: var(--space-4) var(--space-4) var(--space-4) 0;
  border-bottom: 1px solid var(--pc-line);
  color: #fff;
  font-size: 0.95rem;
  line-height: 1.4;
}

.ms-extra__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-5);
  margin: var(--space-5) 0 0;
}

.ms-extra__quote {
  color: var(--pc-muted);
  font-family: var(--font-technical);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

html[lang="ar"] .ms-extra__quote {
  font-family: var(--font-ar);
  letter-spacing: 0;
}

@media (min-width: 64rem) {
  .ms-extra__grid {
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  }
}

@media (max-width: 47.999rem) {
  .ms-extra__img {
    aspect-ratio: 4 / 3;
  }

  .ms-extra__list {
    grid-template-columns: 1fr;
  }
}

/* ---------- PHONE ---------- */
@media (max-width: 47.999rem) {
  .ms-hero__media {
    height: min(46svh, 22rem);
    min-height: 0;
  }

  .ms-hero__media img {
    object-position: 46% 60%;
  }

  .ms-hero__media figcaption {
    display: none;
  }

  .ms-hero__media::before {
    top: calc(var(--header-height) + 1rem);
  }

  .ms-hero__inner {
    margin-top: -4.6rem;
  }

  html:not(#pc):not(#pc-b) body .pc .ms-hero h1 {
    font-size: 10vw;
  }

  html[lang="ru"]:not(#pc):not(#pc-b) body .pc .ms-hero h1 {
    font-size: 10.2vw;
  }

  html[lang="ar"]:not(#pc):not(#pc-b) body .pc .ms-hero h1 {
    font-size: clamp(2.4rem, 12vw, 3.2rem);
  }

  /* Readability: the lede sits on solid black, the grid stays behind the headline only. */
  .ms-hero__band::before {
    -webkit-mask-image: linear-gradient(to bottom, #000 0, transparent 5.5rem);
    mask-image: linear-gradient(to bottom, #000 0, transparent 5.5rem);
  }

  .ms-hero__band {
    background: radial-gradient(circle at 10% 8%, rgba(109, 56, 201, 0.16), transparent 14rem);
  }

  [dir="rtl"] .ms-hero__band {
    background: radial-gradient(circle at 90% 8%, rgba(109, 56, 201, 0.16), transparent 14rem);
  }

  .ms-hero .pc-hero__lede {
    color: #fff !important;
    font-size: 1.06rem;
    line-height: 1.55;
  }

  .ms-hero .pc-hero__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }

  html:not(#pc):not(#pc-b) body .pc .ms-hero .pc-hero__actions .button {
    width: 100%;
    min-height: 3.25rem;
    padding-inline: 0.75rem;
    justify-content: center;
    font-size: 0.74rem;
  }

  html[lang="ru"]:not(#pc):not(#pc-b) body .pc .ms-hero .pc-hero__actions .button {
    font-size: 0.68rem;
    letter-spacing: 0.02em;
  }
}

/* Phone mosaic: first project full width, then pairs (overrides the shared "last item full width" rule). */
@media (max-width: 47.999rem) {
  .ms-mosaic .pc-shot:last-child {
    grid-column: auto;
  }

  .ms-mosaic .pc-shot:last-child .pc-shot__img {
    aspect-ratio: 4 / 3;
  }
}
