/* „So bauen wir.“ (Schritt Hero 4) – übernommen aus schritt-leistungen (sbw.css und handy.css). Desktop: drei Teile, je ein echter
   interaktiver Moment, normales Scrollen, keine Scroll-Effekte: 1 Ranking zum Ziehen (Platz 8 → 1), 2 Jarvis' Station aus Licht
   (three.js, Modell aus Blender), 3 Abo-Werkzeuge werden zu einem eigenen Programm. Handy bis 900 px: die drei Teile nebeneinander
   zum Wischen, oben eine Leiste für den Daumen. Nur Kobalt, Neongrün, Tiefsee, Weiß. */
#so-bauen-wir.sbw { position: relative; z-index: 2; max-width: 1480px; margin: 0 auto; overflow-x: clip; padding: clamp(64px, 11svh, 120px) var(--rand) clamp(80px, 14svh, 160px); color: var(--papier); }
/* Sprungziel für alte Links („Ablauf“ auf Impressum und Datenschutz) */
#so-bauen-wir #so-laeuft-es { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: 0; padding: 0; pointer-events: none; }
/* Desktop: die drei Teile untereinander, die Leiste gibt es nur am Handy */
.sbw-reiter { display: none; }
.sbw-bahn { display: contents; }
.sbw-titel { margin: 0; max-width: none; font: 500 clamp(44px, 5.2vw, 92px)/1 'Familjen Grotesk', sans-serif; letter-spacing: -.05em; width: fit-content; }
.sbw-teil { position: relative; margin-top: clamp(56px, 9vh, 110px); }
.sbw h3 { margin: 0 0 14px; font: 500 clamp(28px, 2.7vw, 44px)/1.05 'Familjen Grotesk', sans-serif; letter-spacing: -.035em; text-wrap: balance; }
.sbw p { margin: 0; }
.sbw-hinweis { position: absolute; right: 14px; bottom: 12px; padding: 3px 8px; border-radius: 6px; background: #040b18b3; color: #f4f4efcc; font-size: 11px; }
.sbw-knopf { min-height: 46px; padding: 0 20px; border: 0; border-radius: 99px; background: var(--neon); color: var(--tinte); font: 600 14.5px/1 'Instrument Sans', sans-serif; cursor: pointer;
  transition: transform .16s var(--ease), background-color .2s; }
.sbw-knopf:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .sbw-knopf:hover { background: #e4ff52; } }
.sbw-link { display: inline-flex; align-items: center; min-height: 46px; padding: 0 4px; color: var(--papier); font-weight: 500; text-decoration: underline; text-decoration-color: #d7f52a99; text-underline-offset: 5px; text-decoration-thickness: 2px; }
.rang-knoepfe { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 24px; }

/* ================= 1 · Ranking ================= */
.sbw-rang { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: clamp(36px, 5.5vw, 96px); align-items: center; }
.rang-geraet { position: relative; padding: 16px 16px 40px; border-radius: 26px; background: linear-gradient(180deg, #fbfcfe 0%, #eef2f8 100%); color: var(--tinte);
  box-shadow: 0 0 0 1px #ffffff26, 0 50px 90px -40px #000000f2, 0 18px 40px -20px #000000b3, 0 0 120px -40px #2442eb80; transform: perspective(1400px) rotateY(5deg) rotateX(2deg); transform-origin: 70% 50%; }
.rang-suche { display: flex; align-items: center; gap: 10px; height: 44px; margin-bottom: 10px; padding: 0 16px; border-radius: 99px; background: #fff; box-shadow: 0 0 0 1px #20211f1f, 0 6px 16px -10px #20211f59; font-size: 14px; color: #20211fcc; }
.rang-suche i { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 2px #20211f99; position: relative; }
.rang-suche i::after { content: ''; position: absolute; right: -4px; bottom: -3px; width: 6px; height: 2px; background: #20211f99; transform: rotate(45deg); }
.rang-suche b { margin-left: auto; width: 26px; height: 26px; border-radius: 50%; background: var(--kobalt); }
.rang-liste { position: relative; margin: 0; padding: 0 0 62px; list-style: none; }
.rang-e { position: relative; height: 62px; padding: 9px 14px 0 46px; border-radius: 12px; transform: translateY(var(--ty, 0px)); transition: transform .32s var(--ease); counter-increment: rang; }
.rang-e::before { content: attr(data-n); position: absolute; left: 14px; top: 13px; width: 22px; text-align: center; font: 600 13px/1 'Familjen Grotesk', sans-serif; color: #20211f73; }
.rang-liste { counter-reset: rang; }
.rang-url { font-size: 11.5px; color: #1d36c9b3; }
.rang-t { margin-top: 2px !important; font: 500 15.5px/1.2 'Instrument Sans', sans-serif; color: #1b2a8f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rang-z { display: block; width: 72%; height: 5px; margin-top: 7px; border-radius: 3px; background: #20211f17; }
.rang-du { position: absolute; left: 0; right: 0; top: calc(7 * 62px); z-index: 5; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
  background: var(--kobalt); color: #fff; box-shadow: 0 0 0 1px #ffffff33 inset, 0 10px 24px -12px #2442ebcc; transition: transform .38s var(--ease), box-shadow .3s var(--ease); }
.rang-du::before { content: none; }
.rang-du .rang-url { color: #ffffffb3; }
.rang-du .rang-t { color: #fff; font-weight: 600; padding-right: 84px; }
.rang-griff { position: absolute; left: 16px; top: 50%; display: grid; gap: 3px; transform: translateY(-50%); }
.rang-griff i { width: 14px; height: 2px; border-radius: 1px; background: #ffffffcc; }
.rang-platz { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); padding: 5px 10px; border-radius: 99px; background: #040b1840; font-size: 12px; white-space: nowrap; }
.rang-platz b { font: 600 15px/1 'Familjen Grotesk', sans-serif; }
.rang-du.zieht { cursor: grabbing; transition: box-shadow .3s var(--ease); box-shadow: 0 0 0 1px #ffffff40 inset, 0 30px 50px -18px #000000b3, 0 0 0 6px #2442eb2e; }
.rang-du:focus-visible { outline: 3px solid var(--neon); outline-offset: 3px; }
.rang-du.ist-oben { background: linear-gradient(110deg, #2442eb 0%, #3557ff 60%, #2442eb 100%); }
.rang-du.ist-oben .rang-platz { background: var(--neon); color: var(--tinte); }
/* Höhepunkt Platz 1: Druckwelle und Pixel */
.rang-welle { position: absolute; z-index: 4; left: 50%; top: 31px; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 3px #d7f52a, 0 0 30px 6px #d7f52a99; opacity: 0; }
.rang-ki { position: absolute; z-index: 6; left: -30px; top: -64px; width: 330px; padding: 14px 16px 15px; border-radius: 18px; background: linear-gradient(170deg, #142356, #0a1430 70%);
  color: #fff; box-shadow: inset 0 0 0 1px #4d6bff59, 0 30px 60px -24px #000000f2, 0 0 50px -18px #2442eb; opacity: 0; transform: translate3d(0, 14px, 0) scale(.96); pointer-events: none;
  transition: opacity .45s var(--ease), transform .6s var(--ease); }
.rang-ki.is-da { opacity: 1; transform: none; }
.rang-ki-kopf { display: flex; align-items: center; gap: 8px; margin-bottom: 7px !important; font-size: 11.5px; color: #d7f52a; font-weight: 600; }
.rang-ki-kopf i { width: 8px; height: 8px; border-radius: 50%; background: var(--neon); box-shadow: 0 0 0 4px #d7f52a33; }
.rang-ki-text { font-size: 15px; line-height: 1.35; }
.rang-ki-quelle { margin-top: 9px !important; display: inline-block; padding: 4px 9px; border-radius: 99px; background: #2442eb; font-size: 11.5px; }
.rang-geraet .sbw-hinweis { background: #20211f14; color: #20211fa6; }

.rang-text > p:first-of-type { font-size: 17px; line-height: 1.5; color: #f4f4efd9; max-width: 46ch; }
.rang-mass { display: grid; gap: 8px; margin: 22px 0 0; padding: 0; list-style: none; }
.rang-mass li { display: grid; grid-template-columns: 22px 1fr; column-gap: 12px; align-items: start; opacity: .56; transition: opacity .4s var(--ease); }
.rang-mass li::before { content: ''; grid-row: 1 / 3; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px #f4f4ef80;
  transition: background-color .35s var(--ease), box-shadow .35s var(--ease); }
.rang-mass b { font-weight: 600; font-size: 15px; }
.rang-mass span { font-size: 14px; color: #f4f4efb3; }
.rang-mass li.is-an { opacity: 1; }
.rang-mass li.is-an::before { background: var(--neon) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 6.2 5.1 8.2 9 4' fill='none' stroke='%2320211f' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 15px no-repeat; box-shadow: 0 0 16px -2px #d7f52a99; }
.rang-mass li.is-neu { animation: mass-an .6s var(--ease); }
@keyframes mass-an { from { transform: translateX(-6px); } to { transform: none; } }
.rang-preis { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 22px !important; font-size: 14.5px; color: #f4f4efd9; }
.rang-preis b { color: #fff; font: 600 17px/1 'Familjen Grotesk', sans-serif; }
.rang-ehrlich { margin-top: 8px !important; font-size: 13px; color: #f4f4ef99; }

/* ================= 2 · Station ================= */
.st-buehne { position: relative; height: clamp(560px, 84svh, 780px); border-radius: 34px; overflow: hidden;
  background: radial-gradient(70% 70% at 55% 58%, #0d1f55 0%, #06102a 45%, #030814 100%); box-shadow: inset 0 0 0 1px #4d6bff33, 0 40px 90px -40px #000; }
.st-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.st-ersatz { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s var(--ease); }
html.st-ohne-gl .st-ersatz { opacity: 1; }
.st-text { position: absolute; z-index: 3; left: clamp(24px, 3.4vw, 54px); top: clamp(24px, 4.5vh, 52px); max-width: 470px; }
.st-text p { font-size: 16.5px; line-height: 1.5; color: #f4f4efd9; text-shadow: 0 2px 18px #030814; }
.st-knoepfe button { position: absolute; z-index: 4; left: 0; top: 0; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 12px; border: 0; border-radius: 99px;
  background: #06102ae6; color: #f4f4ef; font: 500 14px/1 'Instrument Sans', sans-serif; cursor: pointer; white-space: nowrap;
  box-shadow: inset 0 0 0 1px #4d6bff66, 0 10px 24px -12px #000; transform: translate3d(var(--bx, 0px), var(--by, 0px), 0) translate(-50%, -50%); transition: background-color .25s, color .25s, box-shadow .25s; }
.st-knoepfe button::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: #4d6bff; box-shadow: 0 0 0 4px #4d6bff33; transition: background-color .25s, box-shadow .25s; }
.st-knoepfe button[aria-pressed='true'] { background: var(--papier); color: var(--tinte); }
.st-knoepfe button[aria-pressed='true']::before { background: var(--kobalt); box-shadow: 0 0 0 4px #2442eb33; }
@media (hover: hover) and (pointer: fine) { .st-knoepfe button:hover { box-shadow: inset 0 0 0 1px #d7f52a, 0 10px 24px -12px #000; } }
.st-erklaerung { position: absolute; z-index: 3; left: clamp(24px, 3.4vw, 54px); bottom: clamp(24px, 4.5vh, 48px); max-width: 430px; padding: 14px 18px; border-radius: 16px;
  background: #030814d9; box-shadow: inset 0 0 0 1px #4d6bff40; font-size: 15px; line-height: 1.45; color: #f4f4efe6; opacity: 0; transform: translateY(6px); transition: opacity .35s var(--ease), transform .45s var(--ease); }
.st-erklaerung.is-da { opacity: 1; transform: none; }
.st-erklaerung b { display: block; margin-bottom: 4px; color: var(--neon); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .rang-e, .rang-du, .rang-ki { transition: none !important; }
}

/* Motion aus Code (Tim, 28.10.): Pixel-Schmetterling bei Platz 1, Pixel-Blume an der Code-Station */
.rang-falter { position: absolute; z-index: 8; left: 34%; top: -150px; width: 300px; height: 300px; pointer-events: none; opacity: 0; transition: opacity .5s var(--ease); }
.rang-falter.is-da { opacity: 1; }
.st-blume { position: absolute; z-index: 3; left: 5%; top: 31%; width: 240px; height: 280px; border-radius: 22px; overflow: hidden;
  background: radial-gradient(70% 55% at 50% 38%, #3557ff 0%, #2442eb 48%, #1b33c6 100%);
  box-shadow: inset 0 0 0 1px #ffffff33, 0 40px 70px -30px #000000f0, 0 0 70px -14px #2442ebcc;
  opacity: 0; transform: translate3d(0, 18px, 0) rotate(-3deg) scale(.94); transition: opacity .5s var(--ease), transform .7s var(--ease); }
.st-blume.is-da { opacity: 1; transform: rotate(-3deg); }
.st-blume canvas { display: block; width: 100%; height: 100%; }
@media (prefers-reduced-motion: reduce) { .rang-falter, .st-blume { transition: none; } }

/* ================= Handy und Hochformat bis 900 px: drei Teile zum Wischen ================= */
@media (max-width: 900px) {
  #so-bauen-wir.sbw { padding: 34px 0 24px; }
  .sbw-titel { margin-left: 20px; font-size: 40px; }
  .sbw-reiter { position: sticky; max-width: 430px; top: 0; z-index: 20; display: flex; gap: 4px; width: calc(100% - 24px); margin: 18px auto 0; padding: 4px; border-radius: 99px; background: #050c1ce6; box-shadow: inset 0 0 0 1px #ffffff1f; }
  .sbw-reiter button { flex: 1; min-height: 44px; border: 0; border-radius: 99px; background: none; color: #f4f4efb3; font: 500 13px/1 'Instrument Sans', sans-serif; -webkit-tap-highlight-color: transparent; }
  .sbw-reiter button[aria-pressed='true'] { background: #ffffff1f; color: #fff; box-shadow: inset 0 0 0 1px #ffffff2e; }
  .sbw-bahn { display: flex; touch-action: pan-x pan-y; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px; padding: 18px 16px 8px; scrollbar-width: none; overscroll-behavior-x: contain; }
  .sbw-bahn::-webkit-scrollbar { display: none; }
  .sbw-teil { flex: 0 0 calc(100vw - 32px); margin: 0; scroll-snap-align: start; scroll-snap-stop: always; }
  .sbw h3 { font-size: 27px; margin-bottom: 10px; }

  /* 1 · Ranking */
  .sbw-rang { display: flex; flex-direction: column; gap: 0; }
  .rang-text { display: contents; }
  .rang-text > h3 { order: -2; }
  .rang-satz { order: -1; margin-bottom: 18px !important; font-size: 15px !important; }
  .rang-geraet { order: 0; margin-bottom: 44px; }
  .rang-mass { order: 1; }
  .rang-preis { order: 2; }
  .rang-ehrlich { order: 3; }
  .rang-knoepfe { order: 4; }
  .rang-geraet { padding: 10px 10px 34px; border-radius: 20px; transform: none; }
  .rang-suche { height: 38px; font-size: 13px; }
  .rang-e { height: 50px; padding: 6px 10px 0 36px; }
  .rang-e::before { left: 8px; top: 10px; }
  .rang-url { font-size: 10px; } .rang-t { font-size: 13.5px; }
  .rang-z { height: 4px; margin-top: 5px; }
  .rang-liste { padding-bottom: 50px; }
  .rang-du { top: calc(7 * 50px); }
  .rang-griff { left: 11px; }
  .rang-ki { left: 8px; right: 8px; width: auto; top: auto; bottom: -26px; }
  .rang-mass { gap: 6px; margin-top: 2px; grid-template-columns: 1fr 1fr; }
  .rang-mass li { grid-template-columns: 18px 1fr; column-gap: 8px; }
  .rang-mass li::before { width: 18px; height: 18px; }
  .rang-mass li.is-an::before { background-size: 12px; }
  .rang-mass b { font-size: 12.5px; line-height: 1.25; } .rang-mass span { display: none; }
  .rang-preis { margin-top: 14px !important; font-size: 13.5px; }
  .rang-knoepfe { margin-top: 14px; }
  .rang-du .rang-t { padding-right: 66px; }

  /* 2 · Station */
  .st-buehne { height: 620px; border-radius: 24px; }
  /* ohne WebGL: das Standbild sitzt tiefer, oben bleibt der dunkle Grund für den Text */
  .st-ersatz { object-position: 50% 64%; mask-image: linear-gradient(180deg, transparent 16%, #000 50%); }
  .st-text { left: 18px; right: 18px; top: 18px; }
  .st-text p { font-size: 14.5px; }
  .st-knoepfe { position: absolute; z-index: 4; left: 12px; right: 12px; bottom: 120px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .st-knoepfe button { position: static; transform: none; justify-content: center; min-height: 44px; font-size: 13.5px; }
  .st-erklaerung { left: 12px; right: 12px; bottom: 12px; max-width: none; font-size: 13.5px; padding: 10px 14px; min-height: 76px; }
  .st-buehne .sbw-hinweis { top: auto; bottom: 238px; right: 14px; font-size: 10px; }

  /* 3 · Programm */

  .sbw-knopf { min-height: 48px; }

  .st-blume { left: auto; right: 14px; top: 132px; width: 150px; height: 176px; border-radius: 16px; }
  .rang-falter { left: 20%; top: -90px; width: 220px; height: 220px; }
}
