/* ── FUNKTIONSWEISE ───────────────────────────────────── */
#funktionsweise {
  background: linear-gradient(135deg, #bfdbfe 0%, #bae6fd 42%, #99f6e4 100%);
  min-height: 100vh;
  padding-top: 90px;
  padding-bottom: 100px;
  position: relative;
}
.fw-scroll-hint {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: #1e40af;
  letter-spacing: .04em; text-transform: uppercase; cursor: pointer;
  text-decoration: none; opacity: 0.75; transition: opacity .2s;
}
.fw-scroll-hint:hover { opacity: 1; }
.fw-scroll-arrow {
  color: #1e40af;
  animation: fw-bounce 2s ease-in-out infinite;
}
@keyframes fw-bounce {
  0%, 40%, 100% { transform: translateY(0); }
  70%            { transform: translateY(7px); }
}
.fw-header {
  display: grid; grid-template-columns: 1.1fr 0.9fr;
  gap: 60px; align-items: start;
}
.fw-label {
  font-size: 13px; font-weight: 700; letter-spacing: .1em;
  color: #2563eb; text-transform: uppercase; margin-bottom: 20px;
}
.fw-title {
  font-size: clamp(32px, 4.5vw, 52px); font-weight: 800;
  line-height: 1.1; color: #0f172a; margin: 0;
}
.fw-title-accent { color: #2563eb; }
.fw-desc {
  font-size: 15px; color: #475569; line-height: 1.7;
  padding-top: 20px;
}
.fw-divider {
  height: 1px; background: rgba(37,99,235,0.2);
  margin: 24px 0 20px;
}
.steps {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 20px; margin-top: 0;
}
.step-card {
  border-radius: 20px; padding: 22px 22px;
  transition: transform .2s;
}
.step-card:hover { transform: translateY(-4px); }
.step-card-dark { background: #1a2f7a; }
.step-card-light {
  background: white; border: 1px solid #e2e8f0;
  box-shadow: 0 2px 16px rgba(0,0,0,0.05);
}
.step-top {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 14px;
}
.step-icon-box {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.step-card-dark .step-icon-box { background: rgba(255,255,255,0.12); }
.step-card-light .step-icon-box { background: #f1f5f9; }
.step-num {
  font-size: 15px; font-weight: 700; letter-spacing: .05em;
}
.step-card-dark .step-num { color: rgba(255,255,255,0.4); }
.step-card-light .step-num { color: #94a3b8; }
.step-title { font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.step-card-dark .step-title { color: white; }
.step-card-light .step-title { color: #0f172a; }
.step-desc { font-size: 14px; line-height: 1.65; }
.step-card-dark .step-desc { color: rgba(255,255,255,0.68); }
.step-card-light .step-desc { color: #64748b; }

/* ── ANLEITUNG ────────────────────────────────────────── */
#anleitung { background: white; }
.guide-steps { display: flex; flex-direction: column; gap: 80px; margin-top: 60px; }
.guide-step-layout { display: flex; gap: 60px; align-items: flex-start; }
.guide-step-content { flex: 1 1 0; }
.guide-step-visual  { flex: 1 1 0; }
.guide-step--reverse .guide-step-content { order: 2; }
.guide-step--reverse .guide-step-visual  { order: 1; }
.guide-step-meta { display: flex; gap: 20px; align-items: flex-start; }
.guide-num {
  width: 44px; height: 44px; flex-shrink: 0;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: white;
}
.guide-step--final .guide-num { background: linear-gradient(135deg, #059669, #0ea5e9); }
.guide-info h3 { font-size: 20px; font-weight: 700; color: #0f172a; margin-bottom: 8px; }
.guide-info p  { font-size: 15px; color: #64748b; line-height: 1.65; }
.guide-img {
  width: 100%; display: block; border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.10), 0 4px 16px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.06);
}
.guide-substeps { display: flex; flex-direction: column; gap: 14px; }
.guide-substep-label { font-size: 12px; color: #64748b; margin-top: 6px; font-weight: 500; }

/* ── CLI MOCKUP ───────────────────────────────────────── */
.cli-mockup {
  background: #0c0c0c; border-radius: 10px; overflow: hidden;
  box-shadow: 0 16px 48px rgba(0,0,0,0.4), 0 4px 16px rgba(0,0,0,0.2);
  font-family: 'DM Mono', monospace;
}
.cli-titlebar {
  background: #1c1c1c; padding: 10px 14px;
  display: flex; align-items: center; gap: 7px;
  border-bottom: 1px solid #2a2a2a;
}
.cli-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.cli-dot-red    { background: #ff5f57; }
.cli-dot-yellow { background: #febc2e; }
.cli-dot-green  { background: #28c840; }
.cli-titlebar-name {
  margin-left: 8px; font-size: 12px; color: #6b7280;
}
.cli-body { padding: 24px 22px; display: flex; flex-direction: column; gap: 10px; }
.cli-line { font-size: 13px; line-height: 1.6; color: #e5e7eb; margin: 0; }
.cli-line.cli-muted { color: #6b7280; font-size: 12px; }
.cli-prompt { color: #22c55e; }
.cli-progress-row {
  display: flex; align-items: center; gap: 2px;
  font-size: 13px; margin-top: 6px;
}
.cli-bracket { color: #9ca3af; }
.cli-bar-wrap { position: relative; display: inline-block; }
.cli-bar-bg   { color: #374151; display: block; }
.cli-bar-fg {
  position: absolute; inset: 0;
  color: #22c55e;
  clip-path: inset(0 100% 0 0);
  animation: cli-fill 10s ease-in-out infinite;
  white-space: nowrap; overflow: hidden;
}
@keyframes cli-fill {
  0%   { clip-path: inset(0 100% 0 0); }
  6%   { clip-path: inset(0 82%  0 0); }
  45%  { clip-path: inset(0 8%   0 0); }
  50%  { clip-path: inset(0 0%   0 0); }
  95%  { clip-path: inset(0 0%   0 0); }
  100% { clip-path: inset(0 100% 0 0); }
}
.cli-msg-complete {
  color: #22c55e; opacity: 0;
  animation: cli-msg-in 10s ease-in-out infinite;
}
.cli-msg-countdown {
  opacity: 0;
  animation: cli-msg-sub 10s ease-in-out infinite;
}
@keyframes cli-msg-in {
  0%, 53%  { opacity: 0; transform: translateY(4px); }
  59%      { opacity: 1; transform: translateY(0); }
  95%      { opacity: 1; }
  100%     { opacity: 0; transform: translateY(4px); }
}
@keyframes cli-msg-sub {
  0%, 58%  { opacity: 0; }
  62%      { opacity: 1; }
  95%      { opacity: 1; }
  100%     { opacity: 0; }
}
.cli-count { display: inline-grid; width: 1ch; vertical-align: baseline; }
.cli-n     { grid-area: 1 / 1; opacity: 0; }
.cli-n.n5  { animation: cli-n5 10s linear infinite; }
.cli-n.n4  { animation: cli-n4 10s linear infinite; }
.cli-n.n3  { animation: cli-n3 10s linear infinite; }
.cli-n.n2  { animation: cli-n2 10s linear infinite; }
.cli-n.n1  { animation: cli-n1 10s linear infinite; }
@keyframes cli-n5 { 0%,59.9% { opacity:0; } 60%,66%  { opacity:1; } 66.1%,100% { opacity:0; } }
@keyframes cli-n4 { 0%,66.9% { opacity:0; } 67%,73%  { opacity:1; } 73.1%,100% { opacity:0; } }
@keyframes cli-n3 { 0%,73.9% { opacity:0; } 74%,80%  { opacity:1; } 80.1%,100% { opacity:0; } }
@keyframes cli-n2 { 0%,80.9% { opacity:0; } 81%,87%  { opacity:1; } 87.1%,100% { opacity:0; } }
@keyframes cli-n1 { 0%,87.9% { opacity:0; } 88%,94%  { opacity:1; } 94.1%,100% { opacity:0; } }
.cli-cursor {
  display: inline-block; width: 8px; height: 15px;
  background: #d1d5db; vertical-align: text-bottom; margin-top: 4px;
  animation: cli-blink 1s step-end infinite;
}
@keyframes cli-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── EXPORT CONSOLE ───────────────────────────────────── */
.cli-export { margin-top: 38px; }
.cli-export .cli-body { padding: 16px 16px; gap: 6px; }
.cli-export .cli-line { font-size: 11px; }
.cli-export .cli-export-done { font-size: 11px; }
.cli-export .cli-progress-row { font-size: 11px; }

/*
  12s Zyklus:
  Zeile 1 → 0.5s  (4%)
  Zeile 2 → 2.0s  (17%)
  Zeile 3 → 3.5s  (29%)
  Zeile 4 → 5.0s  (42%)
  Zeile 5 → 6.5s  (54%)
  Bar voll → 7.5s (63%)
  Halten  → 10s   (83%)
  Reset   → 12s   (100%)
*/
.cli-el1 { opacity: 0; animation: cli-export-l1 12s ease-in-out infinite; }
.cli-el2 { opacity: 0; animation: cli-export-l2 12s ease-in-out infinite; }
.cli-el3 { opacity: 0; animation: cli-export-l3 12s ease-in-out infinite; }
.cli-el4 { opacity: 0; animation: cli-export-l4 12s ease-in-out infinite; }
.cli-el5 { opacity: 0; animation: cli-export-l5 12s ease-in-out infinite; }
.cli-success-line { color: #22c55e; }

@keyframes cli-export-l1 { 0%,3%{opacity:0;} 6%,82%{opacity:1;} 88%,100%{opacity:0;} }
@keyframes cli-export-l2 { 0%,15%{opacity:0;} 19%,82%{opacity:1;} 88%,100%{opacity:0;} }
@keyframes cli-export-l3 { 0%,27%{opacity:0;} 31%,82%{opacity:1;} 88%,100%{opacity:0;} }
@keyframes cli-export-l4 { 0%,40%{opacity:0;} 44%,82%{opacity:1;} 88%,100%{opacity:0;} }
@keyframes cli-export-l5 { 0%,52%{opacity:0;} 56%,82%{opacity:1;} 88%,100%{opacity:0;} }

.cli-export-progress { margin-top: 12px; }

.cli-export-bar {
  position: absolute; inset: 0;
  color: #22c55e;
  clip-path: inset(0 100% 0 0);
  animation: cli-export-fill 12s ease-in-out infinite;
  white-space: nowrap; overflow: hidden;
}
@keyframes cli-export-fill {
  0%,3%    { clip-path: inset(0 100% 0 0); }
  6%       { clip-path: inset(0 97% 0 0); }
  56%      { clip-path: inset(0 0% 0 0); }
  82%      { clip-path: inset(0 0% 0 0); }
  88%,100% { clip-path: inset(0 100% 0 0); }
}

.cli-export-done {
  color: #22c55e; margin-left: 10px; font-size: 13px;
  opacity: 0; animation: cli-export-done-in 12s ease-in-out infinite;
}
@keyframes cli-export-done-in {
  0%,54%  { opacity: 0; }
  58%     { opacity: 1; }
  82%     { opacity: 1; }
  88%,100%{ opacity: 0; }
}

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 820px) {
  #funktionsweise { padding-top: 80px; padding-bottom: 40px; }
  .fw-header { grid-template-columns: 1fr; gap: 20px; }
  .fw-desc { padding-top: 0; }
  .steps { grid-template-columns: 1fr; gap: 16px; }
  .fw-scroll-hint { display: none; }

  .guide-steps { gap: 56px; margin-top: 40px; }
  .guide-step-layout { flex-direction: column; gap: 28px; }
  .guide-step--reverse .guide-step-content,
  .guide-step--reverse .guide-step-visual { order: unset; }
}
@media (max-width: 480px) {
  .step-card { padding: 26px 22px; }
  .cli-body { font-size: 11px; padding: 16px 14px; }
  .guide-info h3 { font-size: 18px; }
}
