/* «Näin nouto toimii» (lib/nouto.js, js/nouto.js). Auto = logon kerrokset; logon auto katsoo vasemmalle,
   joten studiolle (vasen) se ajaa eteenpäin ja kotiin palatessa se käännetään peilikuvaksi. */
.mc-nouto { padding: 40px 0 96px; }
.mc-nouto__yla { max-width: 720px; margin: 0 auto 32px; text-align: center; }
.mc-nouto__merkki {
  display: inline-block; margin-bottom: 12px; padding: 5px 14px; border-radius: 999px; font-size: 13px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--mc-on-primary, #111); background: var(--primary);
}
.mc-nouto__yla h2 { margin: 0 0 12px; font-size: clamp(30px, 4vw, 44px); line-height: 1.1; }
.mc-nouto__yla p { margin: 0; color: #cfcfcf; font-size: 18px; line-height: 1.6; }

/* ---------- Näyttämö ---------- */
.mc-nouto__nayttamo {
  --h: 320px; --tie: 262px; --aw: 320px; --sw: 210px; --kw: 150px;
  position: relative; width: 100%; height: var(--h); overflow: hidden; border-radius: 22px; isolation: isolate;
  background: linear-gradient(180deg, #161616 0%, #1d1a17 70%, #231d17 100%);
  border: 1px solid rgba(255, 255, 255, .07);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 18%, transparent), 0 14px 34px -12px color-mix(in srgb, var(--primary) 40%, transparent);
}
.mc-nouto__taivas { position: absolute; inset: 0; background: radial-gradient(60% 70% at 50% 110%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 70%); }
.mc-nouto__tie {
  position: absolute; left: 0; right: 0; top: var(--tie); bottom: 0; z-index: 1;
  background: linear-gradient(180deg, #2a2522, #1c1916);
  border-top: 2px solid color-mix(in srgb, var(--primary) 45%, transparent);
}
.mc-nouto__tie::after {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 3px; transform: translateY(-50%);
  background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--primary) 70%, transparent) 0 26px, transparent 26px 52px);
  opacity: .55;
}
[data-vaihe="2"] .mc-nouto__tie::after { animation: mc-tie-vasen .5s linear infinite; }
[data-vaihe="4"] .mc-nouto__tie::after { animation: mc-tie-oikea .5s linear infinite; }
@keyframes mc-tie-vasen { from { background-position: 0 0; } to { background-position: 52px 0; } }
@keyframes mc-tie-oikea { from { background-position: 52px 0; } to { background-position: 0 0; } }

.mc-nouto__studio, .mc-nouto__koti {
  position: absolute; bottom: calc(var(--h) - var(--tie) + 2px); z-index: 2; display: flex; flex-direction: column; align-items: center;
  color: color-mix(in srgb, var(--primary) 80%, #fff); transition: color .4s, filter .4s;
}
.mc-nouto__studio { left: 3%; width: var(--sw); }
.mc-nouto__koti { right: 3%; width: var(--kw); color: #cfcfcf; }
.mc-nouto__studio svg, .mc-nouto__koti svg { width: 100%; height: auto; display: block; }
.mc-nouto__vaihde { position: absolute; bottom: -38px; font-size: 13px; font-weight: 600; color: #9d9d9d; letter-spacing: .04em; }
[data-vaihe="3"] .mc-nouto__studio { filter: drop-shadow(0 0 14px color-mix(in srgb, var(--primary) 60%, transparent)); color: var(--primary); }
[data-vaihe="1"] .mc-nouto__koti, [data-vaihe="5"] .mc-nouto__koti { color: #fff; filter: drop-shadow(0 0 10px rgba(255, 255, 255, .25)); }
.mc-nouto__puhelin {
  position: absolute; top: -34px; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap;
  color: var(--mc-on-primary, #111); background: var(--primary); opacity: 0; transform: translateY(8px) scale(.8);
  transition: opacity .35s, transform .45s cubic-bezier(.3, 1.6, .5, 1);
}
[data-vaihe="1"] .mc-nouto__puhelin { opacity: 1; transform: none; }

/* ---------- Auto ---------- */
.mc-nouto__auto {
  position: absolute; z-index: 3; width: var(--aw); aspect-ratio: 1400 / 940;
  top: calc(var(--tie) - var(--aw) * .383);           /* pyörien alareuna tien pinnalla */
  left: calc(100% - 3% - var(--kw) - var(--aw) * .92);    /* kodin vieressä */
  transition: left 2.3s cubic-bezier(.55, .05, .3, 1);
}
.mc-nouto__auto img { position: absolute; inset: 0; width: 100%; height: 100%; }
.mc-nouto__runko { transition: filter .6s; }
.mc-nouto__pyora--etu { transform-origin: 42.75% 49.41%; }
.mc-nouto__pyora--taka { transform-origin: 82.54% 48.67%; }
/* Studiolla */
[data-vaihe="2"] .mc-nouto__auto, [data-vaihe="3"] .mc-nouto__auto { left: calc(3% + var(--sw) - var(--aw) * .02); }
/* Paluu: auto kääntyy ajosuuntaan */
[data-vaihe="4"] .mc-nouto__auto, [data-vaihe="5"] .mc-nouto__auto { transform: scaleX(-1); }
.mc-nouto__auto { transform-origin: 50% 50%; }
/* Pyörät pyörivät ajon aikana (soikeat pyörät oikaistaan ympyräksi pyörityksen ajaksi) */
[data-vaihe="2"] .mc-nouto__pyora--etu, [data-vaihe="4"] .mc-nouto__pyora--etu { animation: mc-n-etu .55s linear infinite; }
[data-vaihe="2"] .mc-nouto__pyora--taka, [data-vaihe="4"] .mc-nouto__pyora--taka { animation: mc-n-taka .55s linear infinite; }
@keyframes mc-n-etu { from { transform: scaleX(.953) rotate(0deg) scaleX(1.049); } to { transform: scaleX(.953) rotate(-360deg) scaleX(1.049); } }
@keyframes mc-n-taka { from { transform: scaleX(.808) rotate(0deg) scaleX(1.237); } to { transform: scaleX(.808) rotate(-360deg) scaleX(1.237); } }
/* Ennen pesua auto on himmeä, pesun jälkeen kiiltävä */
[data-vaihe="0"] .mc-nouto__runko, [data-vaihe="1"] .mc-nouto__runko, [data-vaihe="2"] .mc-nouto__runko { filter: grayscale(.85) brightness(.65); }
[data-vaihe="3"] .mc-nouto__runko { animation: mc-n-kiilto 3s ease-in-out forwards; }
[data-vaihe="4"] .mc-nouto__runko, [data-vaihe="5"] .mc-nouto__runko { filter: brightness(1.15) drop-shadow(0 0 10px color-mix(in srgb, var(--primary) 55%, transparent)); }
@keyframes mc-n-kiilto {
  0%, 30% { filter: grayscale(.85) brightness(.65); }
  75% { filter: brightness(1.5) drop-shadow(0 0 16px color-mix(in srgb, var(--primary) 80%, transparent)); }
  100% { filter: brightness(1.15) drop-shadow(0 0 10px color-mix(in srgb, var(--primary) 55%, transparent)); }
}

/* ---------- Pesu: vaahtokuplat ja tähdet ---------- */
.mc-nouto__vaahto { position: absolute; z-index: 4; left: calc(3% + var(--sw)); width: var(--aw); top: calc(var(--tie) - var(--aw) * .35); height: calc(var(--aw) * .3); pointer-events: none; }
.mc-nouto__vaahto i {
  position: absolute; bottom: 0; left: calc(8% + var(--i) * 10%); width: calc(10px + (var(--i) * 5px) % 16px); aspect-ratio: 1; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .7); background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .6), rgba(255, 255, 255, .05) 60%);
  opacity: 0;
}
[data-vaihe="3"] .mc-nouto__vaahto i { animation: mc-n-kupla 1.5s ease-out calc(var(--i) * .12s) 2; }
@keyframes mc-n-kupla { 0% { opacity: 0; transform: translateY(10px) scale(.4); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(-70px) scale(1.1); } }
.mc-nouto__tahdet { position: absolute; z-index: 4; left: calc(3% + var(--sw) + var(--aw) * .15); width: calc(var(--aw) * .7); top: calc(var(--tie) - var(--aw) * .58); display: flex; justify-content: space-between; pointer-events: none; }
.mc-nouto__tahdet b { font-size: 32px; color: var(--primary); opacity: 0; transform: scale(0) rotate(-90deg); text-shadow: 0 0 12px color-mix(in srgb, var(--primary) 70%, transparent); }
[data-vaihe="3"] .mc-nouto__tahdet b { animation: mc-n-tahti .5s cubic-bezier(.3, 1.6, .5, 1) forwards; }
[data-vaihe="3"] .mc-nouto__tahdet b:nth-child(1) { animation-delay: 1.7s; }
[data-vaihe="3"] .mc-nouto__tahdet b:nth-child(2) { animation-delay: 2s; }
[data-vaihe="3"] .mc-nouto__tahdet b:nth-child(3) { animation-delay: 2.3s; }
@keyframes mc-n-tahti { to { opacity: 1; transform: none; } }

/* ---------- Vaiheet ---------- */
.mc-nouto__vaiheet { width: 100%; list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; counter-reset: none; }
.mc-nouto__vaiheet li {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 20px 18px; border-radius: 16px; cursor: pointer;
  background: #1c1c1c; border: 1px solid rgba(255, 255, 255, .07); transition: border-color .4s, background-color .4s, box-shadow .4s, opacity .4s;
  box-shadow: var(--mc-varjo, none); opacity: .72;
}
.mc-nouto__vaiheet li strong { font-size: 18px; color: #fff; }
.mc-nouto__vaiheet li span:last-child { font-size: 15px; line-height: 1.55; color: #bdbdbd; }
.mc-nouto__nro {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 15px;
  color: var(--primary); border: 2px solid color-mix(in srgb, var(--primary) 60%, transparent); transition: background-color .4s, color .4s;
}
.mc-nouto__vaiheet li.tehty { opacity: .9; }
.mc-nouto__vaiheet li.tehty .mc-nouto__nro { background: color-mix(in srgb, var(--primary) 25%, transparent); }
.mc-nouto__vaiheet li.on { opacity: 1; border-color: color-mix(in srgb, var(--primary) 60%, transparent); background: color-mix(in srgb, var(--primary) 8%, #1c1c1c); box-shadow: var(--mc-varjo-nosto, none); }
.mc-nouto__vaiheet li.on .mc-nouto__nro { background: var(--primary); color: var(--mc-on-primary, #111); border-color: var(--primary); }

.mc-nouto__napit { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 24px; margin-top: 32px; }
.mc-nouto__linkki { color: var(--primary); font-weight: 600; text-decoration: none; }
.mc-nouto__linkki:hover { text-decoration: underline; }

/* ---------- Puhelin ---------- */
@media screen and (max-width: 991px) {
  .mc-nouto__vaiheet { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media screen and (max-width: 767px) {
  .mc-nouto { padding: 16px 0 64px; }
  .mc-nouto__yla p { font-size: 16px; }
  .mc-nouto__nayttamo { --h: 190px; --tie: 152px; --aw: 128px; --sw: 86px; --kw: 64px; border-radius: 16px; }
  .mc-nouto__studio { width: 86px; left: 2%; }
  .mc-nouto__koti { width: 64px; right: 2%; }
  .mc-nouto__auto { left: calc(100% - 2% - 64px - var(--aw) * .92); transition-duration: 1.9s; }
  [data-vaihe="2"] .mc-nouto__auto, [data-vaihe="3"] .mc-nouto__auto { left: calc(2% + 86px - var(--aw) * .06); }
  .mc-nouto__vaahto { left: calc(2% + 86px); }
  .mc-nouto__tahdet { left: calc(2% + 86px + var(--aw) * .1); }
  .mc-nouto__tahdet b { font-size: 18px; }
  .mc-nouto__vaihde { bottom: -30px; font-size: 11px; }
  .mc-nouto__puhelin { font-size: 11px; top: -28px; }
  .mc-nouto__vaiheet { grid-template-columns: 1fr; gap: 10px; }
  .mc-nouto__vaiheet li { flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 12px; padding: 14px 16px; }
  .mc-nouto__vaiheet li span:last-child { flex-basis: 100%; }
  .mc-nouto__napit .w-button { width: 100%; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  .mc-nouto__auto { transition: none; }
}

/* Esittelyteksti animaation yläpuolella (siirretty sivun tekstiosiosta) */
.mc-nouto { padding-top: 72px; }
.mc-nouto__yla { max-width: 860px; }
.mc-nouto__intro h2 { margin: 0 0 14px; font-size: clamp(30px, 4vw, 44px); line-height: 1.1; color: #fff; }
.mc-nouto__intro p { color: #cfcfcf; font-size: 18px; line-height: 1.65; margin: 0 0 10px; text-align: center !important; }
.mc-nouto__intro p strong { color: var(--primary); }
@media screen and (max-width: 767px) { .mc-nouto { padding-top: 40px; } .mc-nouto__intro p { font-size: 16px; } }
