"""Dialog Studio – schöne Landing-Page (Hero, Preise, Studio)."""

from __future__ import annotations

import html

from jam.dialog_shop import DIALOG_PASSES
from jam.jampulse_brand import PRODUCT_BRAND, PRODUCT_TAGLINE


def _esc(s: str) -> str:
    return html.escape(str(s))


def studio_page_css() -> str:
    return """
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,600;0,9..40,700;0,9..40,800;1,9..40,500&display=swap');

:root {
  --bg: #05040c;
  --bg2: #0c0818;
  --card: rgba(18, 14, 32, 0.82);
  --card-solid: #12101f;
  --border: rgba(168, 85, 247, 0.28);
  --accent: #a855f7;
  --accent2: #ec4899;
  --gold: #ffd54f;
  --mint: #6ee7b7;
  --text: #f8f4ff;
  --muted: #a8a3b8;
  --radius: 18px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 15% -10%, rgba(168, 85, 247, 0.35), transparent 55%),
    radial-gradient(ellipse 60% 45% at 90% 10%, rgba(236, 72, 153, 0.22), transparent 50%),
    radial-gradient(ellipse 50% 40% at 50% 100%, rgba(99, 102, 241, 0.15), transparent 55%),
    var(--bg);
}
.page-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
}

.wrap { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 0 1.25rem 2.5rem; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0 0.5rem;
  flex-wrap: wrap;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text);
}
.logo-mark {
  width: 42px; height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.4);
}
.logo-text strong {
  display: block;
  font-size: 1.05rem;
  background: linear-gradient(90deg, #e9d5ff, #fbcfe8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.logo-text span { font-size: 0.72rem; color: var(--muted); }
.header-nav { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.header-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}
.header-nav a:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.btn-header {
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 8px 28px rgba(168, 85, 247, 0.35);
  transition: transform 0.15s, filter 0.15s;
}
.btn-header:hover { transform: translateY(-1px); filter: brightness(1.06); }

.hero {
  text-align: center;
  padding: 2rem 0 2.5rem;
  animation: fadeUp 0.7s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(255, 213, 79, 0.1);
  border: 1px solid rgba(255, 213, 79, 0.35);
  margin-bottom: 1rem;
}
.gpu-online-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(134, 239, 172, 0.35);
}
.gpu-online-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.8);
  animation: gpu-pulse 2s ease-in-out infinite;
}
@keyframes gpu-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.gpu-queue-hint {
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 5.5vw, 3.15rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, #c084fc, #f472b6, #fcd34d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-lead {
  max-width: 36rem;
  margin: 0 auto 1.35rem;
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.12rem);
  line-height: 1.55;
}
.hero-cta { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1.5rem; }
.btn-hero {
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  font-size: 1rem;
  padding: 0.85rem 1.6rem;
  border-radius: 14px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-hero-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 12px 40px rgba(168, 85, 247, 0.4);
}
.btn-hero-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 48px rgba(236, 72, 153, 0.35); }
.btn-hero-ghost {
  color: var(--text);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
}
.btn-hero-ghost:hover { background: rgba(255,255,255,0.1); }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem 1.25rem;
  margin-top: 0.5rem;
}
.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 5.5rem;
  padding: 0.65rem 1rem;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}
.hero-stat strong { font-size: 1.15rem; color: var(--gold); }
.hero-stat span { font-size: 0.72rem; color: var(--muted); }

.feat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
  margin: 1rem 0 0;
}
.feat-chip {
  font-size: 0.75rem;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #e9d5ff;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 0 0 2rem;
  animation: fadeUp 0.8s ease 0.1s both;
}
@media (max-width: 720px) { .steps { grid-template-columns: 1fr; } }
.step-card {
  position: relative;
  padding: 1.25rem 1.15rem;
  border-radius: var(--radius);
  background: var(--card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  text-align: left;
}
.step-num {
  position: absolute;
  top: 1rem; right: 1rem;
  font-size: 0.7rem;
  font-weight: 800;
  color: rgba(168, 85, 247, 0.5);
}
.step-card h3 { margin: 0 0 0.35rem; font-size: 1rem; }
.step-card p { margin: 0; font-size: 0.85rem; color: var(--muted); line-height: 1.45; }
.step-icon { font-size: 1.5rem; margin-bottom: 0.5rem; }

.section-head {
  text-align: center;
  margin: 0 0 1.25rem;
}
.section-head h2 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 800;
}
.section-head p { margin: 0; color: var(--muted); font-size: 0.92rem; }

.lic {
  font-size: 0.88rem;
  color: var(--muted);
  padding: 0.75rem 1rem;
  background: rgba(12, 10, 22, 0.9);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 1.25rem;
  text-align: center;
}
.lic.ok { color: var(--mint); border-color: rgba(110, 231, 183, 0.35); }

.layout { display: grid; grid-template-columns: 1fr min(300px, 28vw); gap: 1.25rem; align-items: start; }
@media (max-width: 1024px) { .layout { grid-template-columns: 1fr; } }
.sidebar { display: flex; flex-direction: column; gap: 1.25rem; position: sticky; top: 1rem; }
@media (max-width: 1024px) { .sidebar { position: static; } }

.studio-section {
  margin-bottom: 2.5rem;
  padding: 1.5rem;
  border-radius: 22px;
  background: linear-gradient(165deg, rgba(18, 14, 32, 0.95), rgba(8, 6, 16, 0.98));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } }

.card {
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.card label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
textarea {
  width: 100%;
  min-height: 300px;
  background: #0a0814;
  border: 1px solid rgba(168, 85, 247, 0.22);
  border-radius: 14px;
  color: var(--text);
  padding: 1rem;
  font-size: 1rem;
  line-height: 1.55;
  resize: vertical;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}
.row { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.75rem; }
select {
  flex: 1;
  min-width: 180px;
  background: #0a0814;
  border: 1px solid rgba(168, 85, 247, 0.22);
  border-radius: 12px;
  color: var(--text);
  padding: 0.65rem 0.75rem;
  font-size: 0.95rem;
  font-family: inherit;
}

.btn-gen {
  width: 100%;
  margin-top: 1rem;
  padding: 1.05rem 1.5rem;
  font-size: 1.08rem;
  font-weight: 800;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 10px 32px rgba(168, 85, 247, 0.38);
  transition: transform 0.15s, filter 0.15s;
}
.btn-gen:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn-gen:disabled { opacity: 0.55; cursor: not-allowed; transform: none; filter: none; }

.btn-sm {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: inherit;
  font-weight: 600;
  transition: border-color 0.2s, background 0.2s;
}
.btn-sm:hover { border-color: var(--accent); background: rgba(168, 85, 247, 0.1); }
.btn-buy { background: linear-gradient(135deg, rgba(168,85,247,0.25), rgba(236,72,153,0.2)); border-color: rgba(168,85,247,0.5); }

.status {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: #0a0814;
  font-size: 0.9rem;
  color: var(--muted);
  min-height: 2.5rem;
}
.status.ok { color: #86efac; border: 1px solid rgba(134, 239, 172, 0.3); }
.status.err { color: #fca5a5; border: 1px solid rgba(252, 165, 165, 0.3); }
.status.run { color: #c4b5fd; border: 1px solid rgba(196, 181, 253, 0.3); }

.player-box {
  background: #0a0814;
  border-radius: 14px;
  padding: 1rem;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  border: 1px dashed rgba(168, 85, 247, 0.25);
}
video, audio { width: 100%; max-height: 480px; border-radius: 12px; background: #000; }
.placeholder { color: var(--muted); text-align: center; padding: 2rem 1rem; font-size: 0.92rem; }
.dl { display: flex; gap: 0.75rem; flex-wrap: wrap; width: 100%; justify-content: center; }
.dl a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: background 0.2s;
}
.dl a:hover { background: rgba(168, 85, 247, 0.12); }
.hint { font-size: 0.8rem; color: var(--muted); margin-top: 0.5rem; line-height: 1.45; }
.hint code { color: #e9d5ff; background: rgba(168,85,247,0.12); padding: 0.1rem 0.35rem; border-radius: 4px; }

.pricing-section {
  margin-bottom: 2rem;
  padding: 1.75rem 1.25rem 1.5rem;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(26, 16, 48, 0.6), rgba(8, 6, 16, 0.95));
  border: 1px solid rgba(168, 85, 247, 0.35);
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
}
.price-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}
@media (max-width: 960px) { .price-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .price-grid { grid-template-columns: 1fr; } }

.price-card {
  position: relative;
  background: rgba(10, 8, 20, 0.95);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.15rem 1rem 1.1rem;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.price-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(168, 85, 247, 0.18);
  border-color: rgba(168, 85, 247, 0.5);
}
.price-card.best-deal {
  border-color: rgba(255, 213, 79, 0.55);
  background: linear-gradient(165deg, rgba(40, 28, 10, 0.5), rgba(10, 8, 20, 0.98));
  box-shadow: 0 0 32px rgba(255, 213, 79, 0.12);
}
.price-card.popular { border-color: rgba(236, 72, 153, 0.45); }
.price-badge {
  position: absolute;
  top: -0.55rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  white-space: nowrap;
}
.price-badge.gold { background: linear-gradient(135deg, #ffe082, #ffc107); color: #1a0a10; }
.price-badge.pink { background: linear-gradient(135deg, #f472b6, #ec4899); color: #fff; }
.price-period { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.25rem; }
.price-card h3 { margin: 0.35rem 0 0.25rem; font-size: 0.95rem; font-weight: 700; }
.price {
  font-size: 2rem;
  font-weight: 800;
  margin: 0.15rem 0;
  color: var(--gold);
  line-height: 1;
}
.price small { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.price-per { font-size: 0.75rem; color: var(--mint); margin: 0.25rem 0 0.65rem; min-height: 1.1rem; }
.muted { color: var(--muted); font-size: 0.78rem; margin: 0 0 0.85rem; line-height: 1.4; min-height: 2.4rem; }
.price-card .row { justify-content: center; margin-top: 0; }
.price-card .btn-sm { flex: 1; min-width: 0; }

.sidebar-card {
  padding: 1rem;
  background: rgba(18, 14, 32, 0.82);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.sidebar-card > label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.65rem;
}
.feat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.85rem; }
.feat-item { display: flex; gap: 0.65rem; align-items: flex-start; font-size: 0.82rem; line-height: 1.45; }
.feat-icon { font-size: 1.15rem; line-height: 1; flex-shrink: 0; }
.feat-desc { color: var(--muted); font-size: 0.78rem; }
.jami-ad-card .jami-ad-embed { margin-top: 0.25rem; }
.jami-ad-hint { margin-top: 0.65rem; margin-bottom: 0; text-align: center; }

.studio-footer {
  margin-top: 1rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.8;
}
.studio-footer a { color: var(--accent); text-decoration: none; }
.studio-footer a:hover { text-decoration: underline; }

.lan-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.75rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  background: rgba(110, 231, 183, 0.1);
  border: 1px solid rgba(110, 231, 183, 0.3);
  color: var(--mint);
}
.lan-pill a { color: #a7f3d0; word-break: break-all; }
.lan-copy {
  margin-left: 0.35rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(110, 231, 183, 0.35);
  background: rgba(110, 231, 183, 0.12);
  color: var(--mint);
}
.lan-copy:hover { background: rgba(110, 231, 183, 0.22); }
.lic.err { color: #fca5a5; border-color: rgba(252, 165, 165, 0.35); cursor: pointer; }
.lic.err:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
"""


_PASS_UI: dict[str, dict[str, str]] = {
    "dialog_week": {"period": "1 Woche", "badge": "", "badge_class": "", "per": "Perfekt zum Testen"},
    "dialog_month": {"period": "1 Monat", "badge": "Beliebt", "badge_class": "pink", "per": ""},
    "dialog_6months": {"period": "6 Monate", "badge": "Sparpass", "badge_class": "gold", "per": ""},
    "dialog_year": {"period": "1 Jahr", "badge": "Bester Deal", "badge_class": "gold", "per": ""},
}


def _pass_per_line(pid: str, product: dict) -> str:
    ui = _PASS_UI.get(pid, {})
    if ui.get("per"):
        return ui["per"]
    per_day = float(product.get("per_day_eur") or 0)
    if per_day <= 0:
        return ""
    if pid == "dialog_month":
        return f"Nur {per_day:.2f} €/Tag".replace(".", ",")
    if pid in ("dialog_6months", "dialog_year"):
        days = int(product.get("days") or DIALOG_PASSES.get(pid, {}).get("days") or 1)
        per_month = float(product.get("price_eur") or 0) / max(days / 30.44, 1)
        return f"~{per_month:.2f} €/Monat".replace(".", ",")
    return ""


def pricing_cards_html(products: list[dict]) -> str:
    parts: list[str] = []
    for p in products:
        pid = str(p["id"])
        ui = _PASS_UI.get(pid, {"period": "", "badge": "", "badge_class": "", "per": ""})
        badge = ""
        if ui.get("badge"):
            cls = _esc(ui.get("badge_class") or "gold")
            badge = f'<span class="price-badge {cls}">{_esc(ui["badge"])}</span>'
        extra_cls = " best-deal" if pid == "dialog_year" else (" popular" if pid == "dialog_month" else "")
        price = float(p["price_eur"])
        per_line = _pass_per_line(pid, p)
        parts.append(
            f"""<article class="price-card{extra_cls}">
  {badge}
  <p class="price-period">{_esc(ui.get("period", ""))}</p>
  <h3>{_esc(p["name"].split("–")[-1].strip() if "–" in p["name"] else p["name"])}</h3>
  <p class="price">{price:.2f} <small>€</small></p>
  <p class="price-per">{_esc(per_line)}</p>
  <p class="muted">{_esc(p.get("description", ""))}</p>
  <div class="row">
    <button type="button" class="btn-sm btn-buy" data-product="{_esc(pid)}" data-pay="all">Jetzt freischalten</button>
    <button type="button" class="btn-sm btn-pp" data-product="{_esc(pid)}">PayPal</button>
  </div>
</article>"""
        )
    return "".join(parts)


def hero_html(*, lan_url: str, free_note: str = "") -> str:
    week = DIALOG_PASSES["dialog_week"]["price_eur"]
    return f"""
<section class="hero" id="top">
  <span class="hero-badge">✨ {_esc(PRODUCT_BRAND)} · Dialog Studio
    <span class="gpu-online-badge" id="gpuBadge" hidden><span class="dot"></span><span id="gpuBadgeText">GPU online</span></span>
  </span>
  <h1>Dating-Videos, die <em>wirklich lebendig</em> wirken</h1>
  <p class="hero-lead">
    Zwei 3D-Figuren · echte Lippenbewegung · KI-Stimmen · fertig für TikTok &amp; Reels.
    Dein Video wird auf unserem GPU-Server gerendert – einmal gratis testen, danach unbegrenzt ab {week:.2f}&nbsp;€ pro Woche.
  </p>
  <div class="hero-cta">
    <button type="button" class="btn-hero btn-hero-primary" onclick="document.getElementById('studio').scrollIntoView({{behavior:'smooth'}})">Jetzt Video erstellen</button>
    <button type="button" class="btn-hero btn-hero-ghost" onclick="document.getElementById('preise').scrollIntoView({{behavior:'smooth'}})">Preise ansehen</button>
  </div>
  <div class="hero-stats">
    <div class="hero-stat"><strong>2 Min</strong><span>Video-Länge</span></div>
    <div class="hero-stat"><strong>9:16</strong><span>TikTok-Format</span></div>
    <div class="hero-stat"><strong>4K</strong><span>optional</span></div>
    <div class="hero-stat"><strong>{week:.2f} €</strong><span>pro Woche</span></div>
  </div>
  <p class="lan-pill">🏠 Freunde im WLAN: <a href="{_esc(lan_url)}" id="lanLink">{_esc(lan_url)}</a>
    <button type="button" class="lan-copy" id="copyLanBtn" title="Link kopieren">Kopieren</button></p>
  <p class="gpu-queue-hint" id="gpuQueueHint" hidden></p>
</section>"""


def steps_html() -> str:
    return """
<section class="steps" aria-label="So funktioniert es">
  <article class="step-card">
    <span class="step-num">01</span>
    <div class="step-icon">✍️</div>
    <h3>Dialog schreiben</h3>
    <p>Sarah &amp; Laura sprechen deinen Text – oder lade unser Beispiel.</p>
  </article>
  <article class="step-card">
    <span class="step-num">02</span>
    <div class="step-icon">🎬</div>
    <h3>KI rendert 3D</h3>
    <p>Lip-Sync, Mimik &amp; Gesten – auf der Server-GPU (AMD AMF).</p>
  </article>
  <article class="step-card">
    <span class="step-num">03</span>
    <div class="step-icon">📱</div>
    <h3>MP4 herunterladen</h3>
    <p>9:16 für TikTok, Reels &amp; Dating-Werbung – sofort posten.</p>
  </article>
</section>"""


def site_header_html() -> str:
    return f"""
<header class="site-header">
  <a class="logo" href="#top">
    <span class="logo-mark">🎬</span>
    <span class="logo-text"><strong>{_esc(PRODUCT_BRAND)}</strong><span>{_esc(PRODUCT_TAGLINE)}</span></span>
  </a>
  <nav class="header-nav">
    <a href="#studio">Studio</a>
    <a href="#preise">Preise</a>
    <a href="/impressum">Impressum</a>
    <button type="button" class="btn-header" onclick="document.getElementById('studio').scrollIntoView({{behavior:'smooth'}})">Loslegen</button>
  </nav>
</header>"""
