/* =====================================================================
   MUTATOOL — Components & layout
   Depends on tokens.css
   ===================================================================== */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
::selection { background: var(--primary); color: var(--primary-ink); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 2px; }

/* ---------- Layout primitives ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(18px, 4vw, 40px); }
.section { padding-block: clamp(48px, 7vw, 104px); position: relative; }
.section--tight { padding-block: clamp(32px, 4vw, 56px); }

/* Background atmosphere: dotted pixel grid + soft radial */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 32px 32px, 32px 32px;
  opacity: var(--pixel-grid-opacity);
  mask-image: radial-gradient(120% 90% at 70% 0%, #000 35%, transparent 80%);
}
.bg-glow {
  position: fixed; z-index: 0; pointer-events: none;
  top: -10%; right: -5%; width: 60vw; height: 60vw; max-width: 720px; max-height: 720px;
  background: radial-gradient(circle at 50% 50%, var(--primary-soft), transparent 62%);
  filter: blur(8px);
}
.app { position: relative; z-index: 1; }

/* ---------- Eyebrow / pixel labels ---------- */
.eyebrow {
  font-family: var(--font-pixel);
  font-size: var(--fs-pixel-sm);
  letter-spacing: 0.04em;
  color: var(--primary);
  text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 8px;
}
.eyebrow::before {
  content: ""; width: 8px; height: 8px; background: var(--primary);
  box-shadow: 4px 0 0 var(--primary), 0 4px 0 var(--primary-line);
  display: var(--pixel-deco-display);
}
.mono { font-family: var(--font-mono); }
.pixel { font-family: var(--font-pixel); }

/* ---------- Headings ---------- */
.h-display {
  font-family: var(--font-display);
  font-weight: 800; line-height: var(--lh-tight); letter-spacing: -0.02em;
  font-size: var(--fs-3xl); text-wrap: balance;
}
.h1 { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-2xl); line-height: var(--lh-snug); letter-spacing: -0.02em; text-wrap: balance; }
.h2 { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-xl); line-height: var(--lh-snug); letter-spacing: -0.01em; text-wrap: balance; }
.lead { font-size: var(--fs-md); color: var(--text-dim); line-height: var(--lh-body); text-wrap: pretty; max-width: 52ch; }
.dim { color: var(--text-dim); }
.faint { color: var(--text-faint); }

/* ---------- Buttons ---------- */
.btn {
  --bw: var(--border-w);
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--font-body); font-weight: 600; font-size: var(--fs-sm);
  line-height: 1; letter-spacing: 0.01em;
  padding: 13px 18px; border-radius: var(--r-sm);
  border: var(--bw) solid transparent;
  transition: transform var(--dur) var(--ease), background var(--dur), border-color var(--dur), box-shadow var(--dur), color var(--dur);
  position: relative; white-space: nowrap; user-select: none;
}
.btn svg { width: 16px; height: 16px; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--primary); color: var(--primary-ink);
  box-shadow: var(--shadow-2);
}
.btn-primary:hover { background: var(--primary-hi); box-shadow: var(--glow); }
.btn-secondary {
  background: var(--surface-2); color: var(--text); border-color: var(--border-strong);
}
.btn-secondary:hover { border-color: var(--primary-line); background: var(--surface-3); }
.btn-ghost { background: transparent; color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-lg { padding: 16px 24px; font-size: var(--fs-base); }
.btn-block { width: 100%; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 600;
  padding: 4px 9px; border-radius: var(--r-sm);
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-dim);
  letter-spacing: 0.01em;
}
.badge .dot { width: 7px; height: 7px; border-radius: var(--r-pill); background: currentColor; flex: none; }
.badge.is-active  { color: var(--green);   border-color: color-mix(in oklab, var(--green) 40%, var(--border)); background: var(--green-soft); }
.badge.is-module  { color: var(--yellow);  border-color: color-mix(in oklab, var(--yellow) 40%, var(--border)); background: var(--yellow-soft); }
.badge.is-device  { color: var(--cyan);    border-color: color-mix(in oklab, var(--cyan) 40%, var(--border)); background: var(--cyan-soft); }
.badge.is-error   { color: var(--red);     border-color: color-mix(in oklab, var(--red) 40%, var(--border)); background: var(--red-soft); }
.badge.is-brand   { color: var(--primary); border-color: var(--primary-line); background: var(--primary-soft); }
.badge-version { font-family: var(--font-mono); color: var(--text-dim); }

/* ---------- Card ---------- */
.card {
  background: var(--surface); border: var(--border-w) solid var(--border);
  border-radius: var(--r); padding: var(--sp-5);
  position: relative; transition: border-color var(--dur), transform var(--dur) var(--ease), background var(--dur);
}
.card--hover:hover { border-color: var(--border-strong); transform: translateY(-3px); }

/* pixel corner ticks (decoration) */
.pixticks::before, .pixticks::after {
  content: ""; position: absolute; width: 6px; height: 6px;
  display: var(--pixel-deco-display); pointer-events: none;
  border: 2px solid var(--primary-line);
}
.pixticks::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.pixticks::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

/* ============================ NAV ============================ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.nav__inner { display: flex; align-items: center; gap: var(--sp-5); height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.brand__mark { width: 30px; height: 30px; image-rendering: pixelated; flex: none; }
.brand__word { font-family: var(--font-pixel); font-size: 15px; letter-spacing: 0.02em; color: var(--text); }
.brand__word b { color: var(--primary); font-weight: 400; }
.nav__links { display: flex; align-items: center; gap: 2px; margin-left: var(--sp-4); }
.nav__link {
  font-size: var(--fs-sm); font-weight: 500; color: var(--text-dim);
  padding: 8px 12px; border-radius: var(--r-sm); transition: color var(--dur), background var(--dur);
}
.nav__link:hover { color: var(--text); background: var(--surface-2); }
.nav__link.is-active { color: var(--text); }
.nav__spacer { flex: 1; }
.nav__cta { display: flex; align-items: center; gap: 10px; }
.nav__burger { display: none; width: 40px; height: 40px; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); }
.nav__burger span, .nav__burger span::before, .nav__burger span::after {
  content: ""; display: block; width: 16px; height: 2px; background: var(--text); position: relative; transition: transform var(--dur), opacity var(--dur);
}
.nav__burger span::before { position: absolute; top: -5px; }
.nav__burger span::after { position: absolute; top: 5px; }
.nav.is-open .nav__burger span { background: transparent; }
.nav.is-open .nav__burger span::before { transform: translateY(5px) rotate(45deg); }
.nav.is-open .nav__burger span::after { transform: translateY(-5px) rotate(-45deg); }

.nav__mobile { display: none; }

@media (max-width: 860px) {
  .nav__links, .nav__cta .btn-secondary { display: none; }
  .nav__burger { display: flex; }
  .nav__mobile {
    display: grid; gap: 4px; overflow: hidden;
    max-height: 0; transition: max-height var(--dur-slow) var(--ease-out);
    border-bottom: 1px solid transparent;
  }
  .nav.is-open .nav__mobile { max-height: 420px; border-color: var(--border); padding-block: 12px; }
  .nav__mobile a { padding: 12px 8px; border-radius: var(--r-sm); color: var(--text-dim); font-weight: 500; }
  .nav__mobile a:hover { background: var(--surface-2); color: var(--text); }
  .nav__mobile .btn { margin-top: 8px; }
}

/* ============================ HERO ============================ */
.hero { padding-top: clamp(40px, 6vw, 80px); padding-bottom: clamp(40px, 6vw, 80px); position: relative; }
.hero__grid {
  display: grid; grid-template-columns: 1.02fr 1fr; gap: clamp(28px, 4vw, 64px); align-items: center;
}
.hero__title { margin-top: 18px; }
.hero__title .accent { color: var(--primary); }
.hero__title .pixword { font-family: var(--font-pixel); font-size: 0.62em; letter-spacing: 0; }
.hero__sub { margin-top: 22px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero__trust { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 26px; }
.trust-item { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--text-dim); }
.trust-item svg { width: 15px; height: 15px; color: var(--green); flex: none; }

/* ---- Before/After slider ---- */
.ba {
  --pos: 50%;
  position: relative; aspect-ratio: 4/3; width: 100%;
  border-radius: var(--r-lg); overflow: hidden;
  border: var(--border-w) solid var(--border-strong);
  box-shadow: var(--shadow-3);
  user-select: none; touch-action: none; isolation: isolate;
}
.ba__layer { position: absolute; inset: 0; display: grid; place-items: center; }
.ba__sprite { width: 52%; image-rendering: pixelated; filter: drop-shadow(0 8px 14px rgba(0,0,0,.35)); }
/* photo variant: real before/after artwork fills the frame */
.ba.is-photo { aspect-ratio: 391/460; max-width: 420px; margin-inline: auto; }
.ba.is-photo .ba__media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.ba.is-photo .ba__after { background: none; }
/* BEFORE: greenscreen */
.ba__before { background: var(--chroma-green); }
.ba__before.is-magenta { background: var(--chroma-magenta); }
/* AFTER: transparency checkerboard, clipped to --pos */
.ba__after {
  background-color: var(--checker-b);
  background-image:
    linear-gradient(45deg, var(--checker-a) 25%, transparent 25%),
    linear-gradient(-45deg, var(--checker-a) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--checker-a) 75%),
    linear-gradient(-45deg, transparent 75%, var(--checker-a) 75%);
  background-size: 22px 22px;
  background-position: 0 0, 0 11px, 11px -11px, -11px 0;
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}
.ba__tag {
  position: absolute; top: 12px; font-family: var(--font-pixel); font-size: 10px;
  padding: 5px 9px; border-radius: var(--r-sm); letter-spacing: 0.03em;
  background: rgba(0,0,0,.55); color: #fff; backdrop-filter: blur(2px);
}
.ba__tag--before { right: 12px; }
.ba__tag--after  { left: 12px; color: var(--green); background: rgba(8,18,12,.62); }
.ba__handle {
  position: absolute; top: 0; bottom: 0; left: var(--pos); width: 0;
  display: grid; place-items: center; z-index: 3; transform: translateX(-50%);
}
.ba__line { position: absolute; top: 0; bottom: 0; width: 3px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.ba__knob {
  width: 38px; height: 38px; border-radius: var(--r-sm);
  background: var(--primary); color: var(--primary-ink);
  display: grid; place-items: center; box-shadow: var(--shadow-2);
  border: 2px solid #fff; cursor: ew-resize;
}
.ba__knob svg { width: 18px; height: 18px; }
.ba__hint { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); font-family: var(--font-mono); font-size: 11px; color: rgba(255,255,255,.7); background: rgba(0,0,0,.4); padding: 3px 10px; border-radius: var(--r-pill); pointer-events: none; transition: opacity var(--dur); }
.ba.is-dragging .ba__hint { opacity: 0; }
.scanlines::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 4;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.5) 0 1px, transparent 1px 3px);
  opacity: var(--pixel-scanline-opacity); mix-blend-mode: multiply;
}

/* ============================ TRUST STRIP ============================ */
.trustbar {
  display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; justify-content: center;
  padding: 18px var(--sp-5); border: var(--border-w) solid var(--border); border-radius: var(--r);
  background: var(--surface); 
}
.trustbar .trust-item { font-size: var(--fs-sm); }
.trustbar .sep { width: 5px; height: 5px; background: var(--text-faint); display: var(--pixel-deco-display); }

/* ============================ FEATURES ============================ */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-4); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); }
.feature { display: flex; flex-direction: column; gap: 12px; }
.feature__icon {
  width: 46px; height: 46px; border-radius: var(--r-sm);
  display: grid; place-items: center; flex: none;
  background: var(--primary-soft); color: var(--primary); border: 1px solid var(--primary-line);
}
.feature__icon svg { width: 26px; height: 26px; }
.feature__name { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-lg); display: flex; align-items: center; gap: 10px; }
.feature__name .price { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--primary); font-weight: 600; }
.feature__desc { color: var(--text-dim); font-size: var(--fs-sm); }

/* section header */
.sec-head { display: flex; flex-direction: column; gap: 14px; margin-bottom: var(--sp-6); max-width: 60ch; }
.sec-head.center { align-items: center; text-align: center; margin-inline: auto; }

/* ============================ STEPS ============================ */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); counter-reset: step; }
.step { position: relative; padding: var(--sp-5); border: var(--border-w) solid var(--border); border-radius: var(--r); background: var(--surface); }
.step__n { font-family: var(--font-pixel); font-size: 13px; color: var(--primary); margin-bottom: 12px; }
.step__t { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-md); margin-bottom: 6px; }
.step__d { color: var(--text-dim); font-size: var(--fs-sm); }

/* ============================ PRICING TEASER ============================ */
.price-strip { display: grid; grid-template-columns: 1.3fr 1fr; gap: var(--sp-4); align-items: stretch; }
.price-card { border: var(--border-w) solid var(--border); border-radius: var(--r); background: var(--surface); padding: var(--sp-6); display: flex; flex-direction: column; gap: 16px; }
.price-card.is-best { border-color: var(--primary-line); background: linear-gradient(180deg, var(--primary-soft), transparent 60%), var(--surface); box-shadow: var(--glow); }
.price-card__top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.price-card__name { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-lg); }
.price-card__amt { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-2xl); letter-spacing: -0.02em; }
.price-card__amt small { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--text-dim); font-weight: 500; }
.price-list { display: grid; gap: 9px; }
.price-list li { display: flex; gap: 9px; align-items: flex-start; font-size: var(--fs-sm); color: var(--text-dim); list-style: none; }
.price-list svg { width: 16px; height: 16px; color: var(--green); flex: none; margin-top: 2px; }
.modules-mini { display: flex; flex-wrap: wrap; gap: 8px; }
.module-chip { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-xs); font-family: var(--font-mono); padding: 6px 10px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface-2); color: var(--text-dim); }
.module-chip b { color: var(--primary); font-weight: 600; }

/* ============================ FAQ ============================ */
.faq { display: grid; gap: 0; border: var(--border-w) solid var(--border); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.faq__item { border-bottom: 1px solid var(--border); }
.faq__item:last-child { border-bottom: 0; }
.faq__q { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; text-align: left; padding: 18px var(--sp-5); background: transparent; font-weight: 600; font-size: var(--fs-md); transition: background var(--dur); }
.faq__q:hover { background: var(--surface-2); }
.faq__sign { flex: none; width: 22px; height: 22px; display: grid; place-items: center; color: var(--primary); transition: transform var(--dur); position: relative; }
.faq__sign::before, .faq__sign::after { content: ""; position: absolute; background: currentColor; }
.faq__sign::before { width: 12px; height: 2px; }
.faq__sign::after { width: 2px; height: 12px; transition: transform var(--dur); }
.faq__item.is-open .faq__sign::after { transform: scaleY(0); }
.faq__a { max-height: 0; overflow: hidden; transition: max-height var(--dur-slow) var(--ease-out); }
.faq__a-inner { padding: 0 var(--sp-5) 20px; color: var(--text-dim); font-size: var(--fs-sm); max-width: 64ch; }
.faq__item.is-open .faq__a { max-height: 240px; }

/* ============================ FINAL CTA ============================ */
.cta-band { text-align: center; border: var(--border-w) solid var(--primary-line); border-radius: var(--r-lg); padding: clamp(36px, 5vw, 64px); background: linear-gradient(180deg, var(--primary-soft), transparent), var(--surface); position: relative; overflow: hidden; }
.cta-band__pot { width: 56px; image-rendering: pixelated; margin: 0 auto 18px; }

/* ============================ FOOTER ============================ */
.footer { border-top: 1px solid var(--border); background: var(--bg-2); margin-top: var(--sp-8); position: relative; z-index: 1; }
.footer__grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: var(--sp-6); padding-block: var(--sp-7); }
.footer__brand .lead { font-size: var(--fs-sm); margin-top: 14px; }
.footer__col h4 { font-family: var(--font-pixel); font-size: 11px; color: var(--text-faint); text-transform: uppercase; margin-bottom: 16px; letter-spacing: 0.04em; }
.footer__col a, .footer__col span { display: flex; align-items: center; gap: 8px; color: var(--text-dim); font-size: var(--fs-sm); padding: 6px 0; transition: color var(--dur); }
.footer__col a:hover { color: var(--text); }
.footer__col .soon { font-size: 9px; font-family: var(--font-pixel); color: var(--text-faint); border: 1px solid var(--border); padding: 2px 5px; border-radius: 3px; }
.footer__bar { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); padding-block: var(--sp-4); font-size: var(--fs-xs); color: var(--text-faint); }
.footer__legal { display: flex; flex-wrap: wrap; gap: 16px; }
.footer__legal a:hover { color: var(--text-dim); }

/* ============================ RESPONSIVE ============================ */
@media (max-width: 940px) {
  .hero__grid { grid-template-columns: 1fr; }
  .ba { max-width: 540px; margin-inline: auto; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .price-strip { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; gap: var(--sp-5); }
  .hero__cta .btn { flex: 1; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ---------- entrance (content visible by default; never hidden) ---------- */
/* NOTE: a hidden-then-reveal entrance is intentionally omitted — it would
   strand content if a renderer doesn't advance animation time. The page reads
   as a finished, fully-visible layout. Hover/active micro-interactions remain. */

/* ---------- Pre-Launch: sitewide announcement bar + hero stamp (Config: PRELAUNCH) ---------- */
.prelaunch-bar {
  background: linear-gradient(90deg, var(--primary), var(--primary-hi));
  color: var(--primary-ink);
  text-align: center;
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.45;
  padding: 9px 16px;
}
.prelaunch-bar .pl-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  background: var(--primary-ink);
  color: var(--primary-hi);
  padding: 2px 8px;
  border-radius: var(--r-sm);
  margin-right: 10px;
  vertical-align: middle;
}
.prelaunch-bar b { font-weight: 800; }
.prelaunch-bar a { color: var(--primary-ink); text-decoration: underline; text-underline-offset: 2px; }

.hero-stamp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  margin-bottom: 16px;
  padding: 7px 14px;
  border: 2px solid var(--primary);
  border-radius: var(--r-sm);
  background: var(--primary-soft);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transform: rotate(-2.4deg);
}
.hero-stamp::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--primary);
}

/* hidden-Attribut hart durchsetzen: .alert/.cc-state u. a. setzen display: -> UA-[hidden] wuerde sonst
   ueberschrieben (z. B. leere rote #state-warn-Box im Controlcenter trotz hidden). */
[hidden] { display: none !important; }
