/* Startseite: 3D-Geschichte. Die Szene steht fest (sticky), die Texttafeln laufen ruhig darüber. */
.h3d { position: relative; background: var(--bg); }
.h3d-canvas { position: sticky; top: 0; display: block; width: 100%; height: 100vh; height: 100svh; }
.h3d-steps { position: relative; z-index: 1; margin-top: -100vh; margin-top: -100svh; }
.h3d-step { min-height: 135vh; display: flex; align-items: flex-start; padding-inline: clamp(16px, 5vw, 72px); }
.h3d-step.right { justify-content: flex-end; }
.h3d-step:last-child { min-height: 130vh; }
.h3d-panel {
  position: sticky; top: calc(var(--header) + 16vh); margin-top: 34vh; width: min(520px, 100%);
  display: grid; gap: 18px; padding: clamp(24px, 3vw, 36px);
  background: rgba(22, 23, 26, .74); border: 1px solid var(--line); border-radius: 22px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  opacity: 0; transform: translateY(28px);
  transition: opacity 1.1s ease, transform 1.1s cubic-bezier(.2, .7, .2, 1);
}
.h3d-panel.in { opacity: 1; transform: none; }
.h3d-panel h1 { font-size: clamp(38px, 3.9vw, 60px); font-weight: 760; letter-spacing: -.03em; line-height: 1; }
.h3d-panel h2 { font-size: clamp(30px, 3.2vw, 46px); font-weight: 740; letter-spacing: -.025em; line-height: 1.05; }
.h3d-panel p { color: var(--soft); font-size: clamp(17px, 1.3vw, 19px); line-height: 1.6; }
.h3d-panel .step-no { font-family: var(--mono); font-size: 13px; letter-spacing: .14em; color: var(--blue-bright); }
.h3d-panel .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.h3d-panel .hint { font-size: 14px; color: var(--muted); }
.h3d-panel .hint a { color: var(--soft); }
.h3d-panel .tag { justify-self: start; }

/* Beispiel-Anruf mit Ton (Schritt 01) */
.ton-btn { justify-self: start; display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 20px 10px 14px; border-radius: 999px; border: 1px solid rgba(214,217,222,.4); background: rgba(214,217,222,.08); color: #fff; font: 600 16px/1 var(--head, inherit); cursor: pointer; transition: background .3s, border-color .3s, transform .2s; }
.ton-btn[hidden] { display: none; }
.ton-btn:hover { background: rgba(214,217,222,.16); border-color: rgba(214,217,222,.7); }
.ton-btn:active { transform: scale(.97); }
.ton-btn:focus-visible { outline: 2px solid var(--blue-bright, #8ab4ff); outline-offset: 3px; }
.ton-btn svg { width: 26px; height: 26px; fill: currentColor; flex: none; }
.ton-btn[aria-pressed="true"] { background: rgba(46,204,113,.16); border-color: rgba(46,204,113,.7); }
.ton-btn[aria-pressed="true"] .w { animation: ton-welle 1s ease-in-out infinite; }
@keyframes ton-welle { 50% { opacity: .25; } }
.ton-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.ton-btn.lockt { background: rgba(46,204,113,.9); border-color: rgba(46,204,113,1); color: #08130c; animation: ton-puls 1.6s ease-in-out infinite; }
@keyframes ton-puls { 50% { box-shadow: 0 0 0 10px rgba(46,204,113,0); } 0%, 100% { box-shadow: 0 0 0 0 rgba(46,204,113,.45); } }
.ton-skip { min-height: 44px; padding: 8px 4px; background: none; border: 0; color: var(--soft); font: 500 15px/1 inherit; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.ton-skip[hidden] { display: none; }
.ton-skip:hover { color: #fff; }
.ton-skip:focus-visible { outline: 2px solid var(--blue-bright, #8ab4ff); outline-offset: 3px; border-radius: 6px; }
.anruf-toast { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 60; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 10px; max-width: calc(100vw - 28px); min-height: 48px; padding: 10px 18px; border-radius: 999px; border: 1px solid rgba(229,72,77,.55); background: rgba(22,23,26,.94); color: var(--soft); font: 500 15px/1.3 inherit; cursor: pointer; box-shadow: 0 10px 30px rgba(0,0,0,.45); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: toast-rein .45s cubic-bezier(.2,.7,.2,1); }
.anruf-toast[hidden] { display: none; }
.anruf-toast.gruen { border-color: rgba(46,204,113,1); background: rgba(46,204,113,.95); color: #08130c; font-size: 16px; animation: toast-rein .45s cubic-bezier(.2,.7,.2,1), ton-puls 1.6s ease-in-out .5s infinite; }
.anruf-toast.gruen strong { color: #08130c; }
.anruf-toast svg { width: 24px; height: 24px; fill: currentColor; flex: none; }
.anruf-toast strong { color: #fff; }
.anruf-toast .dot { width: 9px; height: 9px; border-radius: 50%; background: #e5484d; flex: none; animation: ton-welle 1s ease-in-out infinite; }
.anruf-toast:focus-visible { outline: 2px solid var(--blue-bright, #8ab4ff); outline-offset: 3px; }
@keyframes toast-rein { from { opacity: 0; transform: translate(-50%, 16px); } }
.anruf-text { min-height: 3.2em; margin: -4px 0 0; padding: 12px 14px; border-radius: 14px; background: rgba(0,0,0,.28); border-left: 3px solid rgba(46,204,113,.8); font-size: 16px !important; line-height: 1.5 !important; color: var(--soft); }
.anruf-text[hidden] { display: none; }
.anruf-text strong { color: #fff; }
@media (prefers-reduced-motion: reduce) { .ton-btn[aria-pressed="true"] .w, .ton-btn.lockt, .anruf-toast, .anruf-toast .dot { animation: none; } }

/* Kapitel-Punkte rechts */
.h3d-dots { position: fixed; right: clamp(12px, 2vw, 28px); top: 50%; transform: translateY(-50%); z-index: 20; display: grid; gap: 12px; opacity: 0; pointer-events: none; transition: opacity .6s ease; }
body.h3d-on .h3d-dots { opacity: 1; pointer-events: auto; }
.h3d-dots a { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--muted); display: block; transition: background .4s, border-color .4s, transform .4s; }
.h3d-dots a.on { background: var(--accent); border-color: var(--accent); transform: scale(1.25); }
.h3d-dots a span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Ohne 3D (kein WebGL): Tafeln untereinander, ruhig */
.h3d.no3d .h3d-canvas { display: none; }
.h3d.no3d .h3d-steps { margin-top: 0; }
.h3d.no3d .h3d-step { min-height: 0; padding-block: 48px; justify-content: center; }
.h3d.no3d .h3d-panel { position: static; margin-top: 0; opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .h3d-panel { transition: none; opacity: 1; transform: none; } }

@media (max-width: 760px) {
  .h3d-step, .h3d-step.right { justify-content: center; padding-inline: 16px; min-height: 135vh; }
  .h3d-panel { top: auto; bottom: 16px; margin-top: 62vh; padding: 22px; gap: 12px; background: rgba(22, 23, 26, .86); }
  .h3d-panel h1 { font-size: clamp(34px, 9.5vw, 44px); }
  .h3d-panel h2 { font-size: clamp(26px, 7.4vw, 34px); }
  .h3d-panel p { font-size: 16px; }
  .h3d-dots { display: none; }
}
