/* KOVA Immobilien · Ein Schlüssel auf seinem Weg (Immobilien-Runde 3, Stufe 3; Logik schluesselweg.js; ersetzt „Diskret“). Grundzustand (ohne
   Skript, ruhig, Telefon, schmale Fenster): die fünf Halte untereinander an einer silbernen Linie, je mit Zeichen, Titel, Satz und Tor, darunter
   das ganze Schlüsselbuch. Ab 1180 × 720 mit Skript eine gehaltene Bühne: oben die Route mit den Halten als Sechsecke, der Schlüssel wandert
   beim Scrollen mit (Lage über --x, --y), die Linie hinter ihm wird Graphit, jeder erreichte Halt bekommt sein Tor; darunter links der Halt, der
   dran ist, rechts das Schlüsselbuch, das Zeile für Zeile mitschreibt. Hellgrau, Papier, Graphit, Silber. Bewegt werden transform, opacity und
   stroke-dashoffset. */

.sw-abschnitt{overflow-x:clip;background:radial-gradient(45% 60% at 100% 100%,rgba(216,221,226,.2),rgba(216,221,226,0) 70%),var(--struktur),var(--leinen2,#E4E7EA)}
.sw-weg{display:none}
.sw-buehne{display:grid;gap:clamp(34px,5svh,52px);margin-top:clamp(40px,6svh,64px)}

/* Liste */
.sw-halte{position:relative;margin:0;padding:0;list-style:none;display:grid;gap:30px}
.sw-halte::before{content:"";position:absolute;left:27px;top:20px;bottom:20px;width:2px;background:linear-gradient(180deg,#6E757D,rgba(142,149,157,.25))}
.sw-p{position:relative;display:grid;grid-template-columns:56px minmax(0,1fr);gap:22px;align-items:start}
.sw-zi{display:grid;place-items:center;width:56px;height:64px;clip-path:var(--sechs,polygon(50% 0,100% 25%,100% 75%,50% 100%,0 75%,0 25%));
  background:linear-gradient(160deg,#5A6168,#30363B)}
.sw-zi svg{width:30px;height:30px;fill:none;stroke:#EEF1F4;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round;--zi-a:#C9CED4;overflow:visible}
.sw-text h3{font-weight:300;font-size:clamp(22px,2vw,30px);line-height:1.12;letter-spacing:-.03em;color:var(--tinte)}
.sw-text p{margin-top:8px;max-width:36em;font-size:15.5px;line-height:1.65;color:var(--t2)}
.sw-tor-t{display:inline-flex;align-items:center;gap:8px;margin-top:12px;padding:5px 12px 4px 8px;border-radius:99px;font-size:12px;color:#1F2326;
  background:linear-gradient(160deg,#F4F6F8,#C9CED4);box-shadow:inset 0 0 0 1px rgba(110,117,125,.35)}
.sw-tor-t::before{content:"";width:12px;height:12px;border-radius:50%;background:#3B4147 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 6.3l2 2L9 4' fill='none' stroke='%23EEF1F4' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat}

/* Schlüsselbuch */
.sw-buch{position:relative;max-width:760px;padding:22px 24px 18px;border-radius:18px;color:var(--tinte);
  background:radial-gradient(rgba(38,41,43,.03) 1px,transparent 1.3px) 0 0/6px 6px,linear-gradient(180deg,#FBFBFC,#EFF1F3);
  box-shadow:inset 0 0 0 1px rgba(142,149,157,.32),0 40px 70px -46px rgba(20,24,28,.45)}
.sw-buch::before{content:"";position:absolute;inset:7px;border-radius:12px;box-shadow:inset 0 0 0 1px rgba(142,149,157,.28);pointer-events:none}
.sw-buch-kopf{display:flex;align-items:center;gap:10px;padding-bottom:12px;border-bottom:1px solid rgba(110,117,125,.45)}
.sw-buch-kopf .kr{width:16px;height:auto}
.sw-buch-kopf b{font-weight:300;font-size:22px;letter-spacing:-.02em}
.sw-buch-kopf .mono{margin-left:auto;padding:3px 8px 2px;border-radius:99px;font-size:9.5px;letter-spacing:.08em;text-transform:uppercase;color:#555B62;box-shadow:inset 0 0 0 1px rgba(142,149,157,.6)}
.sw-eintraege{margin:4px 0 0;padding:0;list-style:none}
.sw-eintraege li{display:grid;grid-template-columns:72px minmax(0,1fr) auto;gap:14px;align-items:baseline;padding:10px 0;border-bottom:1px dashed rgba(110,117,125,.3);font-size:14px;line-height:1.45;color:var(--t1)}
.sw-eintraege li .mono{font-size:11px;color:var(--t3)}
.sw-eintraege li b{font-weight:500;font-family:var(--mono);font-size:11.5px;color:#3B4147;white-space:nowrap}

@media (max-width:760px){
  .sw-halte::before{left:21px}
  .sw-p{grid-template-columns:44px minmax(0,1fr);gap:16px}
  .sw-zi{width:44px;height:50px}.sw-zi svg{width:24px;height:24px}
  .sw-text p{font-size:14.5px}
  .sw-buch{padding:16px 16px 12px}
  .sw-eintraege li{grid-template-columns:58px minmax(0,1fr);gap:4px 10px;font-size:13.5px}
  .sw-eintraege li b{grid-column:2}
}

/* ── Gehaltene Bühne ──────────────────────────────────────────────────────────────────────────────────────────────────────── */
@media (min-width:1180px) and (min-height:720px){
  html.js:not(.ruhig) .sw-abschnitt .kopfzeile{margin-bottom:0}
  html.js:not(.ruhig) .sw-strecke{position:relative;height:calc(var(--bh) * 4.2);margin:calc(-1 * var(--kopf)) calc(-1 * var(--rand)) 0}
  html.js:not(.ruhig) .sw-buehne{position:sticky;top:0;height:var(--bh);overflow:hidden;margin:0;gap:0 clamp(40px,5vw,96px);
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;
    padding:calc(var(--kopf) + clamp(14px,2.4svh,30px)) max(var(--rand),calc((100% - 1320px) / 2)) clamp(26px,4svh,48px)}
  html.js:not(.ruhig) .sw-weg{position:relative;display:block;grid-column:1 / -1;align-self:center}
  .sw-karte{display:block;width:100%;height:auto;overflow:visible}
  .sw-pfad{fill:none;stroke:rgba(110,117,125,.35);stroke-width:3;stroke-dasharray:2 9;stroke-linecap:round}
  .sw-pfad-an{fill:none;stroke:#3B4147;stroke-width:3.2;stroke-linecap:round;stroke-dasharray:1 1;stroke-dashoffset:calc(1 - var(--p,0))}
  .sw-hex{fill:#F9FAFB;stroke:rgba(110,117,125,.38);stroke-width:1.5;transition:fill .3s ease,stroke .3s ease}
  .sw-halt use{fill:none;stroke:#8E959D;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round;--zi-a:#B4BAC1;transition:stroke .3s ease}
  .sw-name{font:500 15px/1 "Geist",system-ui,sans-serif;fill:#6E757D;text-anchor:middle;transition:fill .3s ease}
  .sw-tor{font:500 12px/1 "Geist Mono",ui-monospace,monospace;fill:#3B4147;text-anchor:middle;letter-spacing:.02em;opacity:0;transition:opacity .3s ease}
  .sw-halt.erreicht .sw-hex{fill:#3B4147;stroke:#30363B}
  .sw-halt.erreicht use{stroke:#EEF1F4;--zi-a:#C9CED4}
  .sw-halt.erreicht .sw-name{fill:#26292B}
  .sw-halt.erreicht .sw-tor{opacity:1}
  /* der Schlüssel */
  .sw-schluessel{position:absolute;left:0;top:0;z-index:3;display:flex;align-items:center;gap:10px;padding:8px 16px 8px 8px;border-radius:99px;white-space:nowrap;
    background:linear-gradient(180deg,#FFFFFF,#F1F3F5);box-shadow:0 1px 0 #fff inset,0 0 0 1px rgba(31,35,38,.07),0 18px 30px -14px rgba(20,24,28,.45);
    transform:translate3d(var(--x,0),var(--y,0),0) translate(-50%,calc(-100% - 46px));will-change:transform}
  .sw-z{display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:linear-gradient(160deg,#5A6168,#30363B)}
  .sw-z svg{width:18px;height:18px;fill:none;stroke:#EEF1F4;stroke-width:3;--zi-a:#C9CED4}
  .sw-schluessel small{display:block;font-size:10px;color:var(--t3)}
  .sw-schluessel b{display:block;font-weight:500;font-size:13.5px;color:var(--tinte)}
  /* unten links der Halt, der dran ist */
  html.js:not(.ruhig) .sw-halte{display:grid;gap:0;align-self:start;padding-top:clamp(6px,1.6svh,20px)}
  html.js:not(.ruhig) .sw-halte::before{content:none}
  html.js:not(.ruhig) .sw-p{grid-area:1 / 1;display:block}
  html.js:not(.ruhig) .sw-zi{display:none}
  html.js:not(.ruhig) .sw-text{opacity:0;visibility:hidden;transform:translate3d(0,-10px,0);transition:opacity .18s ease,transform .3s ease,visibility 0s linear .18s}
  html.js:not(.ruhig) .sw-p.jetzt .sw-text{opacity:1;visibility:visible;transform:none;transition:opacity .4s ease .16s,transform .7s var(--s-kurve) .16s,visibility 0s}
  html.js:not(.ruhig) .sw-p.jetzt~.sw-p:not(.jetzt) .sw-text{transform:translate3d(0,16px,0)}
  html.js:not(.ruhig) .sw-text h3{font-size:clamp(30px,2.6vw,42px)}
  html.js:not(.ruhig) .sw-text p{font-size:17px}
  /* unten rechts das Schlüsselbuch, das mitschreibt */
  html.js:not(.ruhig) .sw-buch{align-self:start;margin-top:clamp(6px,1.6svh,20px);padding:18px 22px 14px}
  html.js:not(.ruhig) .sw-eintraege li{padding:8px 0;font-size:13.5px}
  html.js:not(.ruhig) .sw-eintraege li:not(.da){opacity:.16}
  html.js:not(.ruhig) .sw-eintraege li{transition:opacity .45s ease,background-color .45s ease}
  html.js:not(.ruhig) .sw-eintraege li.jetzt{background:linear-gradient(90deg,rgba(142,149,157,.16),rgba(142,149,157,0))}
}
