/* ===========================================================
   MMD — BMW Coding / Tuning / Retrofit
   Dark premium, BMW.de-inspired. Brand palette from MMD logo,
   accents via the classic BMW M tricolor stripe (no muddy
   gradient fills on text / buttons / numbers).
   =========================================================== */

:root {
  /* brand (from logo) */
  --blue:      #2e9bd6;
  --blue-cta:  #1c69d4;      /* clean CTA blue */
  --blue-cta2: #1559b8;
  --red:       #e1232e;
  --silver:    #aeb6c2;

  /* M tricolor */
  --m1: #2e9bd6;  --m2: #1b3f8b;  --m3: #e1232e;

  /* surfaces */
  --bg:     #0a0f1f;
  --bg-alt: #0d1428;
  --panel:  #121b33;
  --panel2: #18233f;
  --line:   rgba(174,182,194,.14);
  --line2:  rgba(174,182,194,.26);

  /* text */
  --txt:     #eef1f7;
  --txt-dim: #9aa5b8;

  --radius:    14px;
  --radius-sm: 8px;
  --shadow: 0 22px 60px -28px rgba(0,0,0,.8);
  --maxw: 1240px;
  --z: 1;                    /* global UI zoom, raised per breakpoint below */
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg); color: var(--txt); line-height: 1.6;
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 26px; }

/* ===== page transitions (card-like) ===== */
@view-transition { navigation: auto; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
main.page { animation: pageIn .5s var(--ease) both; }
@keyframes vtOut { to { opacity: 0; transform: translateY(-8px) scale(.99); } }
@keyframes vtIn  { from { opacity: 0; transform: translateY(12px) scale(.99); } }
::view-transition-old(root) { animation: vtOut .28s var(--ease) both; }
::view-transition-new(root) { animation: vtIn .42s var(--ease) both; }

/* ===== M stripe accent ===== */
.mstripe { display: block; height: 4px; width: 100%;
  background: linear-gradient(90deg, var(--m1) 0 33.33%, var(--m2) 33.33% 66.66%, var(--m3) 66.66% 100%); }
.mstripe--header { position: absolute; left: 0; right: 0; bottom: -4px; height: 3px; opacity: .9; }
.mstripe--tab { width: 64px; height: 4px; border-radius: 2px; }

/* ===== buttons (solid, BMW-like) ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: "Manrope", sans-serif; font-weight: 700; letter-spacing: .2px; font-size: 15px;
  padding: 13px 26px; border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer;
  transition: transform .2s var(--ease), background .2s, border-color .2s, color .2s; white-space: nowrap;
}
.btn--sm { padding: 9px 18px; font-size: 14px; }
.btn--lg { padding: 16px 30px; font-size: 16px; }
.btn--block { width: 100%; }
.btn--primary { background: var(--blue-cta); color: #fff; }
.btn--primary:hover { background: var(--blue-cta2); transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--txt); border-color: var(--line2); }
.btn--ghost:hover { border-color: #fff; transform: translateY(-2px); }
.btn--dark { background: #0c1730; color: #fff; border-color: var(--line2); }
.btn--dark:hover { background: #0a1227; transform: translateY(-2px); }

/* ===== top bar ===== */
.topbar { background: #070c1a; border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--txt-dim); }
.topbar__inner { display: flex; justify-content: space-between; align-items: center; height: 40px; }
.topbar__left, .topbar__right { display: flex; align-items: center; gap: 20px; }
.topbar__item { display: inline-flex; align-items: center; gap: 6px; transition: color .2s; }
.topbar__item:hover { color: var(--txt); }
.ic { font-size: 14px; line-height: 1; }
.lang { display: flex; gap: 4px; margin-left: 6px; }
.lang__btn { background: transparent; border: 1px solid var(--line); color: var(--txt-dim);
  border-radius: 5px; padding: 3px 8px; font-size: 12px; font-weight: 700; cursor: pointer; transition: .2s; }
.lang__btn.is-active, .lang__btn:hover { color: #fff; border-color: var(--blue); }

/* ===== "Мои заявки" status badge (mobile header) ===== */
.mlbadge { display: none; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); color: var(--txt); font-size: 13px;
  font-weight: 700; text-decoration: none; white-space: nowrap; }
.mlbadge__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--txt-dim); flex: none; }
/* single-colour statuses: pulse in their colour */
.mlbadge__dot.new          { background: #9aa7b8; --pc: rgba(154,167,184,.55); animation: mld1 1.6s infinite; }
.mlbadge__dot.completed    { background: #22c55e; --pc: rgba(34,197,94,.55);   animation: mld1 1.6s infinite; }
.mlbadge__dot.rejected     { background: #ef4444; --pc: rgba(239,68,68,.55);   animation: mld1 1.6s infinite; }
/* two-colour statuses: alternate between the two bar colours */
.mlbadge__dot.negotiation  { animation: mld-neg   1.8s infinite; }  /* серый ↔ жёлтый */
.mlbadge__dot.in_work      { animation: mld-work  1.8s infinite; }  /* зелёный ↔ серый */
.mlbadge__dot.ready_unpaid { animation: mld-ready 1.8s infinite; }  /* зелёный ↔ оранжевый */
@keyframes mld1 { 0% { box-shadow: 0 0 0 0 var(--pc); } 70% { box-shadow: 0 0 0 8px rgba(0,0,0,0); } 100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); } }
@keyframes mld-neg {
  0%   { background: #9aa7b8; box-shadow: 0 0 0 0 rgba(154,167,184,.6); }
  25%  { background: #9aa7b8; box-shadow: 0 0 0 7px rgba(154,167,184,0); }
  50%  { background: #f59e0b; box-shadow: 0 0 0 0 rgba(245,158,11,.6); }
  75%  { background: #f59e0b; box-shadow: 0 0 0 7px rgba(245,158,11,0); }
  100% { background: #9aa7b8; box-shadow: 0 0 0 0 rgba(154,167,184,0); }
}
@keyframes mld-work {
  0%   { background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.6); }
  25%  { background: #22c55e; box-shadow: 0 0 0 7px rgba(34,197,94,0); }
  50%  { background: #9aa7b8; box-shadow: 0 0 0 0 rgba(154,167,184,.6); }
  75%  { background: #9aa7b8; box-shadow: 0 0 0 7px rgba(154,167,184,0); }
  100% { background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
@keyframes mld-ready {
  0%   { background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.6); }
  25%  { background: #22c55e; box-shadow: 0 0 0 7px rgba(34,197,94,0); }
  50%  { background: #f97316; box-shadow: 0 0 0 0 rgba(249,115,22,.6); }
  75%  { background: #f97316; box-shadow: 0 0 0 7px rgba(249,115,22,0); }
  100% { background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
/* show only on mobile, when JS marks it visible (cookie has leads) */
@media (max-width: 860px) { .mlbadge.is-visible { display: inline-flex; margin-left: auto; } }

/* ===== header ===== */
.header { --headh: 74px; position: sticky; top: 0; z-index: 50; background: rgba(10,15,31,.78);
  backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); transition: background .3s, box-shadow .3s; }
.header.is-scrolled { background: rgba(10,15,31,.95); box-shadow: var(--shadow); }
.header__inner { display: flex; align-items: center; justify-content: space-between; height: 74px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand__mark { --hlogo: 44px; position: relative; display: inline-flex; flex: none;
  margin-right: calc(var(--hlogo) * .42); }   /* reserve room for the roundel peeking out to the right */
.brand__logo { position: relative; z-index: 1; width: 44px; height: 44px; }
.brand__text { position: relative; z-index: 2; }   /* keep text above the peeking roundel */
/* header roundel — shares the mmdRoll / mmdSmoke animations with the intro splash;
   only the scale (--hlogo) and entry/rest geometry differ here */
.brand__bmw {
  --roll-enter: min(86vw, 640px);             /* enters from the right, capped to the screen width */
  --roll-skid: calc(var(--hlogo) * -0.3);     /* gentle skid that stays on-screen (incl. mobile) */
  --roll-rest: calc(var(--hlogo) * .5);       /* rests ~45% peeking to the RIGHT of the logo */
  position: absolute; z-index: 0; top: 50%; left: 0; transform-origin: 50% 50%;
  width: calc(var(--hlogo) * .86); height: calc(var(--hlogo) * .86);
  transform: translate(var(--roll-rest), -50%) rotate(var(--roll-tilt));
  pointer-events: none;
}
.brand--roll .brand__bmw { animation: mmdRoll calc(var(--roll-dur) * .8) var(--roll-ease) both; }
/* tyre smoke — constant wisps that always rise from the roundel (looping) */
.brand__smoke { position: absolute; z-index: 3; left: calc(var(--hlogo) * .98); top: calc(var(--hlogo) * .68);
  width: 0; height: 0; pointer-events: none; }
.brand__smoke .bpuff {
  filter: blur(4px); --smoke-peak: .55;
  width: calc(var(--hlogo) * .58); height: calc(var(--hlogo) * .5);
  animation: mmdSmoke 2.2s ease-out infinite;   /* always on */
}
.brand__smoke .bpuff:nth-child(1){ left: calc(var(--hlogo) * -.10); --dx: 6px;   --dy: -30px; --rot: 20deg;  animation-delay: -2.0s;  }
.brand__smoke .bpuff:nth-child(2){ left: calc(var(--hlogo) *  .10); --dx: 16px;  --dy: -38px; --rot: -18deg; animation-delay: -1.76s; width: calc(var(--hlogo) * .7); height: calc(var(--hlogo) * .6); }
.brand__smoke .bpuff:nth-child(3){ left: calc(var(--hlogo) * -.20); --dx: -8px;  --dy: -42px; --rot: 24deg;  animation-delay: -1.52s; }
.brand__smoke .bpuff:nth-child(4){ left: calc(var(--hlogo) *  .18); --dx: 22px;  --dy: -34px; --rot: -22deg; animation-delay: -1.28s; width: calc(var(--hlogo) * .5); height: calc(var(--hlogo) * .44); }
.brand__smoke .bpuff:nth-child(5){ left: 0;                          --dx: 4px;   --dy: -46px; --rot: 16deg;  animation-delay: -1.04s; }
.brand__smoke .bpuff:nth-child(6){ left: calc(var(--hlogo) *  .24); --dx: 18px;  --dy: -40px; --rot: -26deg; animation-delay: -0.80s; }
.brand__smoke .bpuff:nth-child(7){ left: calc(var(--hlogo) * -.14); --dx: -12px; --dy: -36px; --rot: 30deg;  animation-delay: -0.56s; width: calc(var(--hlogo) * .64); height: calc(var(--hlogo) * .56); }
.brand__smoke .bpuff:nth-child(8){ left: calc(var(--hlogo) *  .06); --dx: 10px;  --dy: -50px; --rot: -14deg; animation-delay: -0.32s; }
.brand__smoke .bpuff:nth-child(9){ left: calc(var(--hlogo) *  .20); --dx: 24px;  --dy: -30px; --rot: 22deg;  animation-delay: -0.08s; width: calc(var(--hlogo) * .48); height: calc(var(--hlogo) * .42); }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__text strong { font-family: "Manrope"; font-size: 22px; letter-spacing: 3px; }
.brand__text small { font-size: 10.5px; letter-spacing: 1.4px; color: var(--txt-dim); text-transform: uppercase; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav__link { position: relative; padding: 10px 14px; font-weight: 600; font-size: 15px; color: var(--txt-dim);
  transition: color .2s; }
.nav__link::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px;
  background: var(--blue); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease); }
.nav__link:hover { color: #fff; } .nav__link:hover::after { transform: scaleX(1); }
.nav__link.is-active { color: #fff; } .nav__link.is-active::after { transform: scaleX(1); background: var(--m3); }
.nav__cta { margin-left: 10px; }
.burger { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.burger span { width: 26px; height: 2.5px; background: #fff; border-radius: 2px; transition: .3s; }
.burger.is-open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.burger.is-open span:nth-child(2) { opacity: 0; }
.burger.is-open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ===== hero (home) ===== */
.hero { position: relative; min-height: 90vh; display: flex; align-items: center; overflow: hidden; }
.hero__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #0a0f1f; z-index: 0; }
/* crossfading video layers (data-hls-list) */
.videoxf { position: absolute; inset: 0; background: #0a0f1f; z-index: 0; overflow: hidden; }
.videoxf .xf-layer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 1s ease; }
.videoxf .xf-layer.is-on { opacity: 1; }
.card video { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.hero__slides { position: absolute; inset: 0; }
.hero__slide { position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: 0; transform: scale(1.06); transition: opacity 1.1s var(--ease), transform 6s linear; }
.hero__slide.is-active { opacity: 1; transform: scale(1); }
.hero__overlay { position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(8,12,26,.95) 0%, rgba(8,12,26,.7) 44%, rgba(8,12,26,.25) 100%),
              linear-gradient(0deg, rgba(8,12,26,.96) 1%, transparent 42%); }
.hero__content { position: relative; z-index: 2; padding: 90px 26px; }
.hero__eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; letter-spacing: .6px;
  color: var(--txt); margin-bottom: 22px; }
.hero__eyebrow .mstripe--tab { flex: none; }
.hero__title { font-family: "Manrope"; font-weight: 800; font-size: clamp(36px, 6vw, 68px);
  line-height: 1.03; letter-spacing: -1.2px; margin-bottom: 18px; }
.accent { color: var(--blue); }
.hero__sub { font-size: clamp(16px, 2vw, 20px); color: var(--txt-dim); max-width: 560px; margin-bottom: 32px;
  min-height: 30px; transition: opacity .5s; }
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 50px; }
.hero__stats { display: flex; gap: 0; flex-wrap: wrap; justify-content: center; border-top: 1px solid var(--line); padding-top: 26px; }
.stat { display: flex; flex-direction: column; padding-right: 40px; margin-right: 40px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.stat b { font-family: "Manrope"; font-weight: 800; font-size: clamp(26px, 3vw, 36px); color: #fff; line-height: 1; }
.stat span { font-size: 13px; color: var(--txt-dim); letter-spacing: .3px; margin-top: 6px; }
.hero__dots { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; gap: 9px; }
.hero__dots button { width: 30px; height: 4px; border-radius: 2px; border: 0; cursor: pointer;
  background: rgba(255,255,255,.28); transition: .3s; }
.hero__dots button.is-active { background: #fff; width: 46px; }

/* ===== page banner (sub-pages) ===== */
.banner { position: relative; min-height: 46vh; display: flex; align-items: flex-start; overflow: hidden;
  border-bottom: 1px solid var(--line); }
.banner__bg { position: absolute; inset: 0; background-size: cover; background-position: center; transform: scale(1.04); }
.banner__ov { position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(8,12,26,.92) 0%, rgba(8,12,26,.6) 55%, rgba(8,12,26,.4) 100%),
              linear-gradient(0deg, rgba(8,12,26,.7), rgba(8,12,26,.45)); }
.banner__in { position: relative; z-index: 2; padding: 52px 26px; width: 100%; max-width: var(--maxw); margin: 0 auto; }
.crumb { font-size: 13px; color: var(--txt-dim); margin-bottom: 14px; }
.crumb a:hover { color: #fff; }
.banner h1 { font-family: "Manrope"; font-weight: 800; font-size: clamp(30px, 5vw, 52px); letter-spacing: -.6px; line-height: 1.05; }
.banner p { color: var(--txt-dim); margin-top: 12px; max-width: 620px; font-size: 17px; }
.banner .mstripe--tab { margin-bottom: 18px; }

/* ===== sections ===== */
.section { padding: 92px 0; position: relative; }
.section--alt { background: var(--bg-alt); }
.section__head { max-width: 700px; margin: 0 auto 54px; text-align: center; }
.section__head--left { margin-left: 0; text-align: left; }
.kicker { display: inline-block; font-family: "Manrope"; font-weight: 800; font-size: 13px; letter-spacing: 3px;
  text-transform: uppercase; color: var(--blue); margin-bottom: 14px; }
.section__title { font-family: "Manrope"; font-weight: 800; font-size: clamp(28px, 4vw, 44px); letter-spacing: -.5px; line-height: 1.1; }
.section__lead { color: var(--txt-dim); margin-top: 14px; font-size: 17px; }

/* ===== why grid ===== */
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.why__card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 24px; transition: transform .3s var(--ease), border-color .3s; }
.why__card:hover { transform: translateY(-6px); border-color: var(--line2); }
.why__ic { width: 50px; height: 50px; display: grid; place-items: center; font-size: 23px; border-radius: 12px;
  background: #0c1730; border: 1px solid var(--line); margin-bottom: 18px; }
.why__card h3 { font-family: "Manrope"; font-size: 19px; margin-bottom: 8px; }
.why__card p { color: var(--txt-dim); font-size: 14.5px; }

/* ===== services ===== */
.service { position: relative; overflow: hidden; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 34px; transition: transform .3s var(--ease), border-color .3s; }
.service::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--m1), var(--m2), var(--m3)); opacity: 0; transition: opacity .3s; }
.service:hover { transform: translateY(-6px); border-color: var(--line2); }
.service:hover::before { opacity: 1; }
.service__num { font-family: "Manrope"; font-weight: 800; font-size: 38px; color: rgba(174,182,194,.18); line-height: 1; }
.service h3 { font-family: "Manrope"; font-size: 24px; margin: 6px 0 12px; }
.service p { color: var(--txt-dim); margin-bottom: 18px; }
.ticks { list-style: none; display: grid; gap: 9px; }
.ticks li { position: relative; padding-left: 26px; font-size: 14.5px; }
.ticks li::before { content: "✓"; position: absolute; left: 0; top: 1px; width: 18px; height: 18px;
  display: grid; place-items: center; font-size: 11px; color: #fff; border-radius: 50%; background: var(--blue-cta); }

/* ===== tools ===== */
.tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.tool { display: flex; flex-direction: column; gap: 4px; padding: 22px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius-sm); transition: transform .25s var(--ease), border-color .25s, background .25s; }
.tool:hover { transform: translateY(-5px); border-color: var(--blue); background: var(--panel2); }
.tool__ic { font-size: 26px; margin-bottom: 8px; }
.tool b { font-family: "Manrope"; font-size: 16px; }
.tool small { color: var(--txt-dim); font-size: 13px; }

/* ===== media banner (image + text) ===== */
.mediarow { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.mediarow__img { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.mediarow__img img { width: 100%; height: 100%; object-fit: cover; }
.mediarow h3 { font-family: "Manrope"; font-size: clamp(22px, 3vw, 32px); margin-bottom: 14px; }
.mediarow p { color: var(--txt-dim); margin-bottom: 12px; }

/* ===== gallery ===== */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; grid-auto-flow: dense; }
.card { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
  background: var(--panel); aspect-ratio: 4/3; }
.card--wide { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
.card img { width: 100%; height: 100%; object-fit: cover; object-position: center; transform: scale(1.02);
  transition: transform .6s var(--ease); filter: saturate(1.05) contrast(1.04) brightness(.98); }
.card:hover img { transform: scale(1.08); }
.card--tight img { transform: scale(1.22); }
.card--tight:hover img { transform: scale(1.3); }
.card::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  box-shadow: inset 0 0 90px rgba(8,12,26,.5);
  background: radial-gradient(120% 120% at 50% 28%, transparent 55%, rgba(8,12,26,.42) 100%); }
.card figcaption { position: absolute; inset: auto 0 0 0; padding: 18px 18px 16px; z-index: 2;
  background: linear-gradient(0deg, rgba(8,12,26,.95), rgba(8,12,26,.45) 55%, transparent); display: flex; flex-direction: column; }
.card figcaption b { font-family: "Manrope"; font-size: 17px; }
.card figcaption span { font-size: 13px; color: var(--silver); }
.card--wide figcaption b { font-size: 22px; }

/* ===== featured pills ===== */
.pills { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.pill { padding: 12px 22px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--panel);
  font-weight: 600; font-size: 15px; transition: .25s; }
.pill:hover { border-color: var(--blue); color: #fff; transform: translateY(-3px); background: var(--panel2); }

/* ===== reviews ===== */
.reviews { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.review { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px;
  display: flex; flex-direction: column; gap: 14px; transition: transform .3s var(--ease), border-color .3s; }
.review:hover { transform: translateY(-6px); border-color: var(--line2); }
.review__stars { color: #f6c945; letter-spacing: 2px; }
.review p { font-size: 15px; flex: 1; }
.review__author { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--txt-dim); }
.ava { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--blue-cta); }

/* ===== Lucide icons ===== */
svg.lucide { stroke-width: 1.9; vertical-align: middle; flex: none; }
.ic.lucide { width: 14px; height: 14px; }
.tool__ic.lucide { display: block; width: 26px; height: 26px; color: var(--blue); margin-bottom: 10px; }
.why__ic { color: var(--blue); }
.why__ic svg.lucide { width: 24px; height: 24px; }
.contact__list .ic.lucide { width: 18px; height: 18px; color: var(--blue); }
.fab svg.lucide { width: 24px; height: 24px; }

/* ===== steps / remote ===== */
.step__n { font-family: "Manrope"; font-weight: 800; font-size: 22px; color: var(--blue); }
.rdetails { margin-top: 30px; border-top: 1px solid var(--line); padding-top: 22px; }
.rdetails > summary { cursor: pointer; list-style: none; font-family: "Manrope"; font-weight: 700;
  color: var(--blue); display: inline-flex; align-items: center; gap: 8px; user-select: none; }
.rdetails > summary::-webkit-details-marker { display: none; }
.rdetails > summary::before { content: "▾"; transition: transform .25s; }
.rdetails[open] > summary::before { transform: rotate(180deg); }
.rdetails[open] > summary { margin-bottom: 16px; }
.rdetails .prose { max-width: 820px; }
.rdetails .prose p { color: var(--txt-dim); margin-bottom: 12px; }
/* split explanations into separated blocks */
.rprose { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px 40px; }
.rprose__item { padding-left: 16px; border-left: 2px solid var(--line2); }
.rprose__item h4 { font-family: "Manrope"; font-weight: 700; font-size: 16px; color: var(--blue); margin-bottom: 8px; }
.rprose__item p { color: var(--txt-dim); font-size: 14.5px; line-height: 1.6; }
@media (max-width: 768px) { .rprose { grid-template-columns: 1fr; gap: 22px; } }

/* ===== CTA band ===== */
.ctaband { position: relative; overflow: hidden; background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ctaband__in { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 56px 0; flex-wrap: wrap; }
.ctaband h2 { font-family: "Manrope"; font-weight: 800; font-size: clamp(24px, 3.4vw, 38px); letter-spacing: -.5px; }
.ctaband p { color: var(--txt-dim); margin-top: 8px; }

/* ===== contact ===== */
.contact__inner { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.contact__list { list-style: none; margin-top: 26px; display: grid; gap: 14px; }
.contact__list li { display: flex; align-items: center; gap: 12px; font-size: 16px; }
.contact__list .ic { font-size: 18px; }
.contact__form { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px; display: grid; gap: 16px; box-shadow: var(--shadow); }
.field { display: grid; gap: 7px; }
.field label { font-size: 13px; color: var(--txt-dim); font-weight: 600; }
.field input, .field textarea { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 13px 15px; color: var(--txt); font-family: inherit; font-size: 15px; resize: vertical; transition: border-color .2s, box-shadow .2s; }
.field input:focus, .field textarea:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(46,155,214,.18); }
.form__note { font-size: 14px; min-height: 18px; }
.form__note.ok { color: #5fd38a; }

/* ===== footer ===== */
.footer { background: #070c1a; border-top: 1px solid var(--line); }
.footer .mstripe { opacity: .85; }
.footer__bar { display: flex; align-items: center; justify-content: center; gap: 22px;
  flex-wrap: wrap; padding: 24px 0; }
.footer__bar .brand__logo { width: 38px; height: 38px; }
.footer__links { display: flex; gap: 20px; }
.footer__links a { color: var(--txt-dim); font-size: 14.5px; transition: color .2s; }
.footer__links a:hover { color: var(--blue); }
.footer__copy { color: var(--silver-2); font-size: 13px; }
.footer__inner { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 36px; padding: 56px 0 40px; }
.footer__brand p { color: var(--txt-dim); font-size: 14px; margin-top: 16px; max-width: 320px; }
.footer__col h4 { font-family: "Manrope"; font-size: 15px; margin-bottom: 16px; letter-spacing: .4px; }
.footer__col a { display: block; color: var(--txt-dim); font-size: 14.5px; padding: 5px 0; transition: color .2s; }
.footer__col a:hover { color: var(--blue); }
.footer__bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border-top: 1px solid var(--line); padding: 22px 0 26px; font-size: 13px; color: var(--silver); }

/* ===== FAB ===== */
.fab { position: fixed; right: 22px; bottom: 22px; z-index: 40; width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center; font-size: 24px; background: var(--blue-cta);
  box-shadow: 0 14px 30px -10px rgba(28,105,212,.7); transition: transform .25s var(--ease); }
.fab:hover { transform: scale(1.08) translateY(-2px); }

/* ===== reveal ===== */
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
[data-reveal].is-in { opacity: 1; transform: none; }

/* ===== responsive ===== */
@media (max-width: 1024px) {
  .grid4, .tools, .reviews { grid-template-columns: repeat(2, 1fr); }
  .grid3 { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .footer__inner { grid-template-columns: 1fr 1fr; }
  .mediarow { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .topbar__hours { display: none; }
  /* mobile menu unrolls from UNDER the header (clip reveal), not sliding over the top */
  .nav { position: fixed; inset: var(--headh, 74px) 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(10,15,31,.98); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line);
    padding: 12px 26px 22px; clip-path: inset(0 0 100% 0); pointer-events: none;
    transition: clip-path .35s var(--ease); }
  .nav.is-open { clip-path: inset(0 0 0 0); pointer-events: auto; }
  .nav__link { padding: 14px 6px; font-size: 17px; border-bottom: 1px solid var(--line); }
  .nav__link::after { display: none; }
  .nav__cta { margin: 14px 0 0; }
  .burger { display: flex; }
  .grid2 { grid-template-columns: 1fr; }
  .contact__inner { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 560px) {
  .grid4, .grid3, .tools, .gallery, .reviews { grid-template-columns: 1fr; }
  .card--wide { grid-column: span 1; grid-row: span 1; aspect-ratio: 4/3; }
  .stat { padding-right: 22px; margin-right: 22px; }
  .section { padding: 64px 0; }
  .footer__inner { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; }
}

/* =========================================================
   HOME — single screen (no scroll): text top, cards middle,
   stats bottom; rotating transparent glass cards.
   ========================================================= */
body.is-home { height: calc(100vh / var(--z, 1)); overflow: hidden; }
/* Home is one locked screen: keep the hero exactly one screen tall no matter the
   page zoom, so the stats row can't overflow past the clipped body and get cut. */
body.is-home .hero--full,
body.is-home .hero__layout { min-height: calc(100vh / var(--z, 1) - 114px); }
.hero--full { min-height: calc(100vh - 114px); }
.hero--full .hero__overlay {
  background: linear-gradient(180deg, rgba(8,12,26,.84) 0%, rgba(8,12,26,.5) 38%, rgba(8,12,26,.9) 100%);
}
.hero__layout {
  position: relative; z-index: 2; width: 100%; max-width: var(--maxw); margin: 0 auto;
  display: flex; flex-direction: column; justify-content: space-between; gap: 20px;
  min-height: calc(100vh - 114px); padding: 32px 26px 30px;
}
.hero--full .hero__eyebrow { margin-bottom: 14px; }
.hero--full .hero__title { font-size: clamp(26px, 4.4vw, 50px); margin-bottom: 12px; max-width: 20ch; }
.hero--full .hero__sub { margin-bottom: 18px; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }

.hgrid { flex: 0 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.hgrid--auto { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
/* media-background hero for sub-pages — same layout as home (index.html) */
.hero--page { min-height: calc(100vh - 114px); align-items: stretch; }
.hero__bg { position: absolute; inset: 0; background-size: cover; background-position: center;
  transform: scale(1.04); z-index: 0; }
.hero--page .crumb { margin-bottom: 14px; }
.hero--page h1 { font-family: "Manrope"; font-weight: 800; font-size: clamp(30px, 5vw, 52px);
  letter-spacing: -.6px; line-height: 1.05; margin-bottom: 12px; }
.hero--page .hero__lead { color: var(--txt-dim); max-width: 680px; font-size: 17px; margin-bottom: 26px; }
.hero__cta { display: flex; }
.hcard { padding: 20px 22px; border-radius: 14px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  transition: transform .25s var(--ease), border-color .25s, background .25s; }
.hcard:hover { transform: translateY(-4px); border-color: rgba(255,255,255,.32); background: rgba(255,255,255,.09); }
.hcard--accent { border-color: rgba(46,155,214,.5); background: rgba(46,155,214,.10); }
.hcard--accent:hover { border-color: var(--blue); background: rgba(46,155,214,.16); }
.hcard--accent h3 { color: #6cc0f0; }
.hcard--accent-red { border-color: rgba(239,68,68,.5); background: rgba(239,68,68,.10); }
.hcard--accent-red:hover { border-color: #ef4444; background: rgba(239,68,68,.16); }
.hcard--accent-red h3 { color: #ff9b9b; }
.hcard__ic { color: var(--blue); margin-bottom: 10px; line-height: 0; }
.hcard__ic svg.lucide { width: 24px; height: 24px; }
.hcard__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.hcard__top .hcard__ic { margin-bottom: 0; }
.hcard__num { font-family: "Manrope"; font-weight: 800; font-size: 22px; line-height: 1; color: rgba(174,182,194,.42); }
.badge-online { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600;
  letter-spacing: .3px; color: #5fd38a; }
.badge-online::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #5fd38a;
  box-shadow: 0 0 0 3px rgba(95,211,138,.18); }
.tools-legend { display: block; color: var(--txt-dim); font-size: 14px; line-height: 1.55; margin-bottom: 24px;
  padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(95,211,138,.06); }
.tools-legend .badge-online { vertical-align: middle; margin-right: 2px; }
.hcard h3 { font-family: "Manrope"; font-size: 18px; margin-bottom: 7px; }
.hcard p { color: rgba(233,237,247,.82); font-size: 13.5px; line-height: 1.5; }

/* expandable cards (hover / click reveals details) */
.hcard--exp { cursor: pointer; position: relative; }
.hcard__chev { position: absolute; right: 16px; bottom: 14px; color: var(--txt-dim);
  transition: transform .3s var(--ease), color .3s; line-height: 0; }
.hcard__chev svg.lucide { width: 18px; height: 18px; }
.hcard--exp:hover, .hcard--exp.is-open { border-color: rgba(46,155,214,.5); background: rgba(255,255,255,.09);
  border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.hcard--exp:hover .hcard__chev, .hcard--exp.is-open .hcard__chev { transform: rotate(180deg); color: var(--blue); }
/* details as a popover — doesn't change card height, so siblings don't move */
.hcard__more { list-style: none; position: absolute; left: 0; right: 0; top: calc(100% - 1px);
  background: rgba(18,27,51,.97); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(46,155,214,.5); border-top: none; border-radius: 0 0 14px 14px;
  box-shadow: 0 22px 44px -18px rgba(0,0,0,.7); padding: 0 22px; z-index: 20;
  max-height: 0; overflow: hidden; opacity: 0; pointer-events: none;
  transition: max-height .35s var(--ease), opacity .25s, padding .25s; }
.hcard--exp:hover .hcard__more, .hcard--exp.is-open .hcard__more {
  max-height: 320px; opacity: 1; padding: 6px 22px 18px; pointer-events: auto; }
.hcard__more li { position: relative; padding-left: 18px; font-size: 13px; color: var(--txt-dim); margin-bottom: 7px; line-height: 1.5; }
.hcard__more li::before { content: ""; position: absolute; left: 0; top: 7px; width: 5px; height: 5px;
  border-radius: 50%; background: var(--blue); }
/* phones: expand in-flow (push cards down) instead of overlapping popover */
@media (max-width: 768px) {
  .hcard__more { position: static; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none;
    border: none; box-shadow: none; border-radius: 0; padding: 0; }
  .hcard--exp:hover .hcard__more, .hcard--exp.is-open .hcard__more { max-height: 360px; padding: 0; margin-top: 12px; }
  .hcard--exp:hover, .hcard--exp.is-open { border-radius: 14px; background: rgba(255,255,255,.07); }
  .hcard__chev { position: static; display: flex; justify-content: flex-end; margin-top: 12px; }
}
.is-home .hero__stats { flex: 0 0 auto; }
.brand__logo--lg { width: 52px; height: 52px; }

/* transparent cards across the site */
.why__card, .service, .tool, .review, .pill {
  background: rgba(255,255,255,.045); border-color: rgba(255,255,255,.10);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.why__card:hover, .service:hover, .review:hover, .tool:hover { background: rgba(255,255,255,.075); }

/* short/mobile screens: allow the home to scroll instead of clipping */
@media (max-width: 920px) { .hgrid { grid-template-columns: repeat(2, 1fr); } }
@media (max-height: 820px), (max-width: 860px) {
  body.is-home { height: auto; overflow: auto; }
  .hero--full, .hero__layout { min-height: calc(100svh - 114px); }
}
@media (max-width: 560px) { .hgrid { grid-template-columns: 1fr; } }

/* =========================================================
   Phone adaptation
   ========================================================= */
@media (max-width: 768px) {
  .container { padding: 0 18px; }

  /* vertical scrim so the video/photo background stays visible on phones */
  .hero__overlay {
    background: linear-gradient(180deg, rgba(8,12,26,.82) 0%, rgba(8,12,26,.44) 34%, rgba(8,12,26,.72) 100%);
  }

  /* Online legend: flowing block (not a pill) so multi-line reads cleanly */
  .tools-legend { display: block; border-radius: 12px; padding: 12px 16px; font-size: 13px; line-height: 1.55; }
  .tools-legend .badge-online { vertical-align: middle; margin-right: 2px; }

  /* heroes grow with content (no clipping) and stack top-down */
  .hero, .hero--full, .hero--page { min-height: auto; overflow: visible; }
  .hero__layout { min-height: auto !important; justify-content: flex-start; gap: 22px; padding: 28px 18px 38px; }
  .hero--page .hero__content { padding: 30px 18px !important; }
  body.is-home { height: auto; overflow: auto; }

  /* full-width buttons */
  .hero__actions { width: 100%; }
  .hero__actions .btn { flex: 1 1 auto; justify-content: center; }

  .section { padding: 52px 0; }
  .section__head { margin-bottom: 34px; }
  .ctaband__in { padding: 40px 0; }
  .mediarow { gap: 26px; }
}

@media (max-width: 560px) {
  /* trim top bar: keep phone + language, hide extra links */
  .topbar { font-size: 12.5px; }
  .topbar__right .topbar__item { display: none; }
  .topbar__left { gap: 12px; }

  .header { --headh: 64px; }
  .header__inner { height: 64px; }
  html { scroll-padding-top: 64px; }
  .brand__mark { --hlogo: 38px; }
  .brand__logo { width: 38px; height: 38px; }

  .hero--full .hero__title, .hero--page h1 { font-size: clamp(25px, 7.5vw, 34px); }
  .hero__lead, .hero--full .hero__sub { font-size: 15.5px; }

  /* stats: two per row, no dividers */
  .hero__stats { padding-top: 18px; gap: 16px 0; }
  .stat { flex: 1 0 42%; border-right: 0; margin-right: 0; padding-right: 0; }
  .stat b { font-size: 22px; }

  .hcard { padding: 17px 18px; }
  .btn--lg { padding: 14px 20px; font-size: 15px; }
  .fab { width: 50px; height: 50px; right: 16px; bottom: 16px; }
  .contact__form { padding: 22px; }
}

@media (max-width: 380px) {
  .brand__text small { display: none; }   /* logo only on very small screens */
}

/* ============================================================
   Rolling-roundel animation — shared by the intro splash AND the header.
   These four knobs drive BOTH; each context only overrides its scale
   (--logo / --hlogo) and entry/rest geometry (--roll-enter/-skid/-rest).
   ============================================================ */
:root {
  --roll-tilt: 45deg;                         /* resting tilt of the roundel */
  --roll-dur:  2.3s;                           /* intro duration; header uses 55% of it */
  --roll-ease: cubic-bezier(.16,.68,.3,1);
  --roll-spin: 1080deg;                        /* how much it spins on entry */
}

/* ============================================================
   Intro splash — BMW roundel rolls in behind the MMD logo,
   then the "BMW Coding · Tuning · Retrofit" tagline appears.
   ============================================================ */
.intro {
  --logo: clamp(120px, 26vw, 168px);   /* shared size so MMD and BMW match */
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 26px; background: var(--bg);
  /* Clip the roundel's off-screen entry (translate 70vw, amplified by page zoom)
     so a fixed splash can't create horizontal page scroll. */
  overflow: hidden;
  transition: opacity .5s var(--ease), visibility .5s var(--ease);
}
.intro.is-hiding { opacity: 0; visibility: hidden; pointer-events: none; }
.intro { cursor: pointer; }
.intro__skip {
  position: absolute; bottom: clamp(20px, 6vh, 48px); left: 0; right: 0; text-align: center;
  font-size: 13px; letter-spacing: .04em; color: var(--txt-dim); opacity: 0;
  animation: introTag .5s var(--ease) 1.4s forwards;
}

/* pause all CSS animations while the browser tab is hidden (battery/CPU saver) */
html.anim-paused *, html.anim-paused *::before, html.anim-paused *::after {
  animation-play-state: paused !important;
}

.intro__stage { position: relative; display: flex; align-items: center; justify-content: center;
  /* The BMW roundel peeks 45% of its width past MMD's right edge, so the visual
     MMD+BMW group sits right of the stage's layout center. Shift the stage left
     by half that peek so the composite is centered over the tagline below. */
  --peek: calc(var(--logo) * 0.86 * 0.45);
  transform: translateX(calc(var(--peek) / -2));
}
.intro__mmd {
  position: relative; z-index: 2; width: var(--logo); height: auto;
  filter: drop-shadow(0 12px 30px rgba(0,0,0,.5));
  animation: introMmd .6s var(--ease) both;
}
/* BMW roundel: same size as MMD, sits behind it, 45% peeks out past MMD's right edge */
.intro__bmw {
  --bw: calc(var(--logo) * 0.86);   /* MMD png has transparent padding; shrink BMW to match visually */
  --roll-enter: 70vw;
  /* skids ~2x its width left of MMD, but never past the left screen edge (mobile-safe).
     max() picks whichever is closer to 0: the desired skid, or the on-screen limit.
     The limit accounts for the stage's centering shift (var(--peek) / 2). */
  --roll-skid: max(calc(-1 * (var(--logo) + var(--bw) * 1.7)), calc(var(--bw) / 2 - 48vw + var(--peek, 0px) / 2));
  --roll-rest: 0px;                                          /* right: peek is handled by `right` below */
  position: absolute; z-index: 1; top: 50%;
  width: var(--bw); height: var(--bw);   /* square roundel; explicit H so SVG-as-img can't collapse to 0 */
  right: calc(var(--bw) * -0.45);   /* 45% of the roundel sticks out to the right */
  transform-origin: 50% 50%;
  animation: mmdRoll var(--roll-dur) var(--roll-ease) .35s both;
}
.intro__tag {
  font-family: Manrope, Inter, sans-serif; font-weight: 700;
  font-size: clamp(14px, 2.6vw, 19px); letter-spacing: .06em;
  color: var(--txt-dim); text-transform: none; text-align: center;
  opacity: 0; transform: translateY(8px);
  animation: introTag .55s var(--ease) 2.75s both;   /* after the roll finishes */
}

/* tyre smoke — trails along the bottom of the roundel from the right as it rolls
   in, thickening where it brakes/skids to the left */
.intro__smoke { position: absolute; z-index: 0; left: 50%; top: calc(50% + var(--logo) * .42);
  width: 0; height: 0; pointer-events: none; }
/* shared smoke look (intro + header); only size/blur/timing differ per context */
.intro__smoke .puff, .brand__smoke .bpuff {
  position: absolute; top: 0;
  /* irregular blob, not a perfect circle -> reads as smoke */
  border-radius: 46% 54% 58% 42% / 55% 48% 52% 45%;
  transform: translate(-50%, -50%) scale(.15) rotate(0deg); opacity: 0;
  background:
    radial-gradient(60% 60% at 40% 45%, rgba(232,236,244,.55), rgba(200,208,222,0) 72%),
    radial-gradient(55% 65% at 65% 60%, rgba(206,214,228,.4),  rgba(206,214,228,0) 70%);
}
.intro__smoke .puff {
  filter: blur(10px);
  width: calc(var(--logo) * .5); height: calc(var(--logo) * .44);
  animation: mmdSmoke 1.5s ease-out both;
}
/* right -> left trail; earlier delays on the right, thicker/later at the skid */
.intro__smoke .puff:nth-child(1){ left: calc(var(--logo) * .85);      --dx: -14px; --dy: -46px; --rot: 22deg;  animation-delay: .62s;  width: calc(var(--logo) * .4);  height: calc(var(--logo) * .36); }
.intro__smoke .puff:nth-child(2){ left: calc(var(--logo) * .45);      --dx: -18px; --dy: -52px; --rot: -16deg; animation-delay: .82s;  border-radius: 55% 45% 48% 52% / 50% 55% 45% 50%; }
.intro__smoke .puff:nth-child(3){ left: calc(var(--logo) * .05);      --dx: -22px; --dy: -58px; --rot: 28deg;  animation-delay: 1.0s; }
.intro__smoke .puff:nth-child(4){ left: calc(-1 * var(--logo) * .4);  --dx: -26px; --dy: -50px; --rot: -24deg; animation-delay: 1.18s; width: calc(var(--logo) * .64); height: calc(var(--logo) * .56); border-radius: 52% 48% 60% 40% / 58% 50% 50% 42%; }
.intro__smoke .puff:nth-child(5){ left: calc(-1 * var(--logo) * .9);  --dx: -34px; --dy: -64px; --rot: 18deg;  animation-delay: 1.34s; width: calc(var(--logo) * .68); height: calc(var(--logo) * .6); }
.intro__smoke .puff:nth-child(6){ left: calc(-1 * var(--logo) * 1.35);--dx: -44px; --dy: -54px; --rot: -30deg; animation-delay: 1.5s;  border-radius: 48% 52% 44% 56% / 52% 46% 54% 48%; }
.intro__smoke .puff:nth-child(7){ left: calc(-1 * var(--logo) * 1.8); --dx: -50px; --dy: -66px; --rot: 34deg;  animation-delay: 1.66s; width: calc(var(--logo) * .48); height: calc(var(--logo) * .42); }
.intro__smoke .puff:nth-child(8){ left: calc(-1 * var(--logo) * 1.1); --dx: -20px; --dy: -74px; --rot: -20deg; animation-delay: 1.82s; width: calc(var(--logo) * .46); height: calc(var(--logo) * .4); }

/* shared smoke keyframe (intro + header); drift/tilt via --dx/--dy/--rot */
@keyframes mmdSmoke {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(.18) rotate(0deg); }
  24%  { opacity: var(--smoke-peak, .62); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx, -30px)), calc(-50% + var(--dy, -40px))) scale(2) rotate(var(--rot, 18deg)); }
}

@keyframes introMmd {
  from { opacity: 0; transform: scale(.86); }
  to   { opacity: 1; transform: scale(1); }
}
/* shared wheel roll used by BOTH the intro and the header. Geometry comes from
   per-context vars: --roll-enter (start X), --roll-skid (overshoot X), --roll-rest
   (final X); tilt/spin/duration/ease come from the :root knobs above. */
@keyframes mmdRoll {
  0%   { transform: translate(var(--roll-enter, 70vw), -50%) rotate(var(--roll-spin, 1080deg)); opacity: 0; }
  10%  { opacity: 1; }
  62%  { transform: translate(var(--roll-skid, -100%), -50%) rotate(-200deg); opacity: 1; }   /* skids past MMD */
  100% { transform: translate(var(--roll-rest, 0px), -50%) rotate(var(--roll-tilt, 45deg)); opacity: 1; } /* rest, tilted */
}
@keyframes introTag {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .intro__mmd, .intro__bmw, .intro__tag { animation-duration: .01ms; animation-delay: 0s; }
  .intro__tag { opacity: 1; transform: none; }
  .intro__smoke, .brand__smoke { display: none; }
  .brand--roll .brand__bmw { animation-duration: .01ms; }
}

/* Scale up on wider viewports. Zoom is intentionally gentle: the home page is a
   single locked screen (height-bound), so anything above ~1.3 no longer fits a
   1440px-tall screen. --z is read by the is-home height/min-height rules above so
   the layout tracks the zoom instead of overflowing. Breakpoints are on CSS px
   (post OS-scaling), low enough that a 1920 monitor at 125% Windows scale
   (~1536 CSS px) still lands on a meaningful step.
   On ultrawide screens the container widens and the 6 service cards drop to a
   single row so the hero fills the width and stays short enough to fit. */
@media (min-width: 1280px) {
  :root { --z: 1.05; }
  html { zoom: var(--z); }
}
@media (min-width: 1600px) {
  :root { --z: 1.10; }
}
@media (min-width: 1920px) {
  :root { --z: 1.15; --maxw: 1360px; }
}
@media (min-width: 2560px) {
  :root { --z: 1.22; --maxw: 1680px; }
  body.is-home .hgrid { grid-template-columns: repeat(6, 1fr); }
}
@media (min-width: 3440px) {
  :root { --z: 1.30; --maxw: 2080px; }
  body.is-home .hgrid { grid-template-columns: repeat(6, 1fr); }
}
