/* Patefact Website
   Farbpalette aus der App (Design.md). Dunkelmodus ist der Leitmodus. */

:root {
  --bg:            #0A1520;
  --bg-soft:       #0F1F30;
  --border:        #1A3A5C;
  --accent:        rgb(45, 212, 191);
  --accent-dim:    rgba(45, 212, 191, .16);
  --tx:            rgb(59, 130, 246);
  --text:          #E8EEF5;
  --text-dim:      #93A8BE;
  --text-faint:    #5E7590;

  --wrap:          1180px;
  --radius:        14px;
  --serif:         "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans:          -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  position: relative;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

/* ---------- Typografie ---------- */

h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .6em; }
h1 { font-size: clamp(2.3rem, 5.5vw, 4rem); font-weight: 700; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); font-weight: 650; }
h3 { font-size: 1.16rem; font-weight: 640; }

.lead { font-size: clamp(1.05rem, 1.7vw, 1.3rem); color: var(--text-dim); max-width: 62ch; }
.eyebrow {
  font-size: .82rem; font-weight: 600; letter-spacing: .13em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 1rem;
}
.muted { color: var(--text-dim); }
.small { font-size: .92rem; }

section { padding: clamp(4.5rem, 9vw, 8rem) 0; }
.section-head { max-width: 68ch; margin-bottom: 3.2rem; }

/* ---------- Ankündigungsbanner ----------
   ENTFERNEN ZUM LAUNCH: dieses <div class="banner"> im HTML löschen. */

.banner {
  background: var(--accent-dim);
  border-bottom: 1px solid rgba(45, 212, 191, .28);
  color: var(--accent);
  text-align: center;
  font-size: .93rem;
  font-weight: 550;
  padding: .7rem 1.25rem;
}

/* ---------- Kopfzeile ---------- */

.site-head {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(14px);
  background: rgba(10, 21, 32, .78);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease;
}
.site-head.is-stuck { border-bottom-color: var(--border); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 1.5rem; }

.brand { font-family: var(--serif); font-size: 1.42rem; letter-spacing: .01em; color: var(--text); }
.brand:hover { text-decoration: none; }

.nav { display: flex; gap: 1.9rem; font-size: .95rem; }
.nav a { color: var(--text-dim); }
.nav a:hover { color: var(--text); text-decoration: none; }
@media (max-width: 800px) { .nav { display: none; } }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .85rem 1.6rem; border-radius: 10px;
  font-weight: 600; font-size: 1rem; border: 1px solid transparent;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #05141a; }
.btn-primary:hover { background: #5fe6d0; }
.btn-ghost { border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-row { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 2.2rem; }

/* ---------- Organischer Hintergrund ----------
   Mehrere überlappende Radialverläufe in der App-Palette. Liegt fix hinter
   allen Inhalten und driftet sehr langsam, damit die Fläche lebt statt
   einfarbig zu wirken. Bewusst niedrig deckend, damit der Text lesbar bleibt. */

.bg-mesh {
  position: fixed;
  inset: -12%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(42% 34% at 16% 10%, rgba(59, 130, 246, .26), transparent 66%),
    radial-gradient(38% 32% at 84%  6%, rgba(45, 212, 191, .20), transparent 68%),
    radial-gradient(46% 38% at 72% 40%, rgba(76,  86, 210, .22), transparent 70%),
    radial-gradient(40% 34% at 12% 52%, rgba(45, 212, 191, .13), transparent 70%),
    radial-gradient(52% 42% at 56% 86%, rgba(59, 130, 246, .17), transparent 72%),
    radial-gradient(34% 30% at 90% 70%, rgba(45, 212, 191, .11), transparent 70%);
  filter: blur(24px);
  animation: drift 34s ease-in-out infinite;
}

@keyframes drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  33%      { transform: translate3d(-1.6%,  1.2%, 0) scale(1.05); }
  66%      { transform: translate3d( 1.4%, -1.0%, 0) scale(1.03); }
}

/* ---------- Hero ---------- */

.hero { padding-top: clamp(3.5rem, 7vw, 6rem); position: relative; text-align: center; }
.hero .wrap { position: relative; }
.hero-copy { max-width: 46ch; margin-inline: auto; }
.hero .lead { margin-inline: auto; }
.hero .btn-row { justify-content: center; }
.hero h1 .accent { color: var(--accent); }

.hero-shot { margin-top: clamp(3rem, 6vw, 5rem); position: relative; }
.hero-shot img {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .85);
}

/* ---------- Signature: animierte Matrix ---------- */

.matrix-demo {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center;
}
@media (max-width: 900px) { .matrix-demo { grid-template-columns: 1fr; } }

.matrix-stage {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.2rem, 3vw, 2.2rem);
}
.matrix-stage svg { width: 100%; height: auto; display: block; }

.mx-label { fill: var(--text-faint); font-size: 7px; font-family: var(--sans); }
.mx-grid  { stroke: var(--border); stroke-width: .6; }
.mx-tx    { fill: var(--tx); }
.mx-rx    { fill: var(--accent); }

/* Verbindungspunkte rasten nacheinander ein. Ohne JavaScript stehen sie sofort da. */
.mx-link { opacity: 1; transform: none; transform-origin: center; transform-box: fill-box; }
.js .mx-link { opacity: 0; transform: scale(.2); }
.js .is-live .mx-link {
  animation: snap .55s cubic-bezier(.2, 1.5, .4, 1) forwards;
  animation-delay: calc(var(--i) * .11s);
}
@keyframes snap {
  0%   { opacity: 0; transform: scale(.2); }
  70%  { opacity: 1; transform: scale(1.25); }
  100% { opacity: 1; transform: scale(1); }
}
.mx-trace { stroke: var(--accent); stroke-width: 1.1; opacity: .35; stroke-dasharray: 220; stroke-dashoffset: 0; }
.js .mx-trace { stroke-dashoffset: 220; }
.js .is-live .mx-trace { animation: draw 1.5s ease forwards .5s; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- Sticky-Scroll-Sektion ---------- */

.sticky-sec { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
@media (max-width: 900px) { .sticky-sec { grid-template-columns: 1fr; } }

.sticky-media { position: sticky; top: 110px; }
@media (max-width: 900px) { .sticky-media { position: static; } }
.sticky-media img {
  border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .8);
}

.step { padding: clamp(2rem, 5vw, 3.2rem) 0; border-top: 1px solid var(--border); }
.step:first-child { border-top: 0; padding-top: 0; }
.step h3 { color: var(--text); }
.step p { color: var(--text-dim); margin: 0; }

/* ---------- Karten-Raster ---------- */

.grid { display: grid; gap: 1.4rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 880px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.7rem;
  transition: border-color .22s ease, transform .22s ease;
}
.card:hover { border-color: rgba(45, 212, 191, .45); transform: translateY(-3px); }
.card h3 { margin-bottom: .45rem; }
.card p { margin: 0; color: var(--text-dim); font-size: .97rem; }
.card .ico { color: var(--accent); margin-bottom: .9rem; display: block; }

/* ---------- How-To ---------- */

.howto { counter-reset: schritt; }
.howto .card { position: relative; padding-top: 2.6rem; }
.howto .card::before {
  counter-increment: schritt; content: counter(schritt);
  position: absolute; top: 1.4rem; left: 1.7rem;
  font-family: var(--serif); font-size: 1.6rem; color: var(--accent); line-height: 1;
}

/* ---------- Preise ---------- */

.plans { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.4rem; align-items: stretch; }
@media (max-width: 880px) { .plans { grid-template-columns: 1fr; } }

.plan { display: flex; flex-direction: column; }
.plan.is-featured { border-color: rgba(45, 212, 191, .5); background: linear-gradient(180deg, rgba(45, 212, 191, .07), transparent 55%), var(--bg-soft); }
.plan .price { font-family: var(--serif); font-size: 2.4rem; margin: .3rem 0 .2rem; }
.plan ul { list-style: none; padding: 0; margin: 1.4rem 0 0; }
.plan li { padding: .5rem 0 .5rem 1.6rem; position: relative; color: var(--text-dim); font-size: .97rem; }
.plan li::before { content: "→"; position: absolute; left: 0; color: var(--accent); }

/* ---------- FAQ ---------- */

.faq details {
  border-bottom: 1px solid var(--border);
  padding: 1.15rem 0;
}
.faq summary {
  cursor: pointer; font-weight: 600; font-size: 1.04rem;
  list-style: none; display: flex; justify-content: space-between; gap: 1.5rem; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.4rem; line-height: 1; flex: none; transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--text-dim); margin: .8rem 0 0; max-width: 78ch; }

/* ---------- Abschluss-CTA ---------- */

.cta-box {
  background: linear-gradient(160deg, rgba(45, 212, 191, .10), transparent 60%), var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(2.4rem, 6vw, 4.5rem);
  text-align: center;
}
.cta-box h2 { margin-bottom: .5rem; }
.cta-box .lead { margin-inline: auto; }

/* ---------- Fußzeile ---------- */

.site-foot { border-top: 1px solid var(--border); padding: 3rem 0 4rem; color: var(--text-faint); font-size: .92rem; }
.foot-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem; margin-bottom: 2.2rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: 1.6rem; }
.foot-links a { color: var(--text-dim); }
.disclaimer { max-width: 82ch; line-height: 1.6; }

/* ---------- Scroll-Reveal ----------
   WICHTIG: Inhalte sind standardmäßig SICHTBAR. Erst wenn JavaScript läuft,
   setzt die Klasse `js` am <html> den Startzustand für die Animation. Fällt
   das Skript aus (blockiert, Ladefehler, kein IntersectionObserver), bleibt
   die Seite vollständig lesbar statt unsichtbar. */

.reveal { opacity: 1; transform: none; transition: opacity .7s ease, transform .7s ease; }
.js .reveal { opacity: 0; transform: translateY(26px); }
.js .reveal.is-in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .09s; }
.reveal[data-delay="2"] { transition-delay: .18s; }
.reveal[data-delay="3"] { transition-delay: .27s; }

/* ---------- Bewegung reduzieren ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
  .mx-link { opacity: 1; transform: none; }
  .mx-trace { stroke-dashoffset: 0; }
}
