/* Zahlwerk Landingpage – reines CSS, keine Abhängigkeiten */

@font-face { font-family: "Source Sans Pro"; src: url("fonts/SourceSansPro-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Source Sans Pro"; src: url("fonts/SourceSansPro-Semibold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Source Sans Pro"; src: url("fonts/SourceSansPro-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  /* Farbwelt „Petrol & Koralle“ (Palette.swift) */
  --bg: #0B2428;
  --bg-2: #12333A;
  --deep: #1E6F6A;
  --tone-1: #F7C6B4;
  --tone-2: #EF8A6B;
  --tone-3: #3BA99C;
  --tone-4: #1E6F6A;
  --text: #ffffff;
  --muted: #9DB8B5;
  --line: rgba(143, 209, 196, .15);
  --radius: 18px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(1100px 600px at 85% -10%, rgba(239, 138, 107, .16), transparent 60%),
    radial-gradient(800px 500px at -10% 40%, rgba(59, 169, 156, .16), transparent 60%);
  background-repeat: no-repeat;
  color: var(--text);
  font: 400 18px/1.55 "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--tone-2); }
h1, h2, h3 { line-height: 1.1; margin: 0; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: clamp(28px, 4vw, 40px); margin-bottom: 28px; }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }

/* Kopfzeile */
.top { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 21px; }
.top-right { display: flex; align-items: center; gap: 12px; }
.lang {
  display: inline-flex; padding: 3px; border-radius: 999px;
  background: rgba(255,255,255,.06); border: 1px solid var(--line);
}
.lang a {
  color: var(--muted); text-decoration: none; font-weight: 700; font-size: 14px; letter-spacing: .06em;
  padding: 5px 12px; border-radius: 999px; transition: color .2s, background .2s;
}
.lang a:hover { color: #fff; }
.lang a[aria-current] { background: #fff; color: var(--bg); }
.lang a:focus-visible { outline: 3px solid var(--tone-2); outline-offset: 2px; }
.top-dl {
  color: var(--text); text-decoration: none; font-weight: 600; font-size: 16px;
  padding: 7px 16px; border: 1px solid var(--line); border-radius: 999px;
  transition: background .2s, border-color .2s;
}
.top-dl:hover { background: rgba(255,255,255,.06); border-color: rgba(143,209,196,.38); }

/* Hero */
.hero {
  display: grid; grid-template-columns: 1fr 1.05fr; gap: 56px; align-items: center;
  padding: 56px 0 96px;
}
.eyebrow { color: var(--tone-2); font-weight: 600; text-transform: uppercase; letter-spacing: .12em; font-size: 14px; margin: 0 0 18px; }
h1 { font-size: clamp(44px, 6.4vw, 78px); letter-spacing: -.025em; }
.lede { font-size: clamp(19px, 2vw, 22px); color: #D6E4E2; margin: 22px 0 34px; max-width: 30em; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 24px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: #fff; color: var(--bg); text-decoration: none;
  font-weight: 700; font-size: 19px; padding: 15px 26px; border-radius: 14px;
  box-shadow: 0 10px 30px -8px rgba(239, 138, 107, .5), inset 0 -2px 0 rgba(18, 63, 69, .12);
  transition: transform .15s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -8px rgba(239, 138, 107, .65), inset 0 -2px 0 rgba(18, 63, 69, .12); }
.btn:active { transform: translateY(0); }
.btn:focus-visible, .top-dl:focus-visible { outline: 3px solid var(--tone-2); outline-offset: 3px; }
.meta { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.cta .meta { flex-basis: 100%; }

/* Download-Zähler (wird nur angezeigt, wenn count.php antwortet) */
.dl-count {
  margin: 0; display: inline-flex; align-items: baseline; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255,255,255,.05);
  color: var(--muted); font-size: 15px;
}
.dl-count[hidden] { display: none; }
.dl-count b { color: var(--text); font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dl-count.bump b { display: inline-block; animation: bump .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes bump { 0% { transform: translateY(0); } 35% { transform: translateY(-7px) scale(1.15); } 100% { transform: none; } }

/* Demo-Diagramm */
.demo { margin: 0; }
.demo-chart {
  background: #000; border-radius: var(--radius);
  aspect-ratio: 16 / 9;
  display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 6%;
  padding: 6% 7%;
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.8), 0 0 0 1px var(--line);
}
.pie { width: 100%; height: auto; overflow: visible; }
.seg {
  fill: none; stroke-width: 90;
  stroke-dasharray: calc((var(--v) + .3) * 1px) 100px;
  stroke-dashoffset: calc(var(--o) * -1px);
  animation: fill 8s cubic-bezier(.45, 0, .2, 1) infinite;
}
.s1 { stroke: #fff; } .s2 { stroke: var(--tone-2); } .s3 { stroke: var(--tone-3); } .s4 { stroke: var(--deep); }
.gaps line { stroke: #000; stroke-width: 3.5; stroke-linecap: round; }
.gaps circle { fill: #000; }
.gaps { animation: gaps 8s ease infinite; }
/* Der Kreis füllt sich: alle Segmente wachsen gemeinsam im Uhrzeigersinn */
@keyframes fill {
  0%, 4% { stroke-dasharray: 0 100px; stroke-dashoffset: 0; }
  26%, 94% { stroke-dasharray: calc((var(--v) + .3) * 1px) 100px; stroke-dashoffset: calc(var(--o) * -1px); opacity: 1; }
  100% { stroke-dasharray: calc((var(--v) + .3) * 1px) 100px; stroke-dashoffset: calc(var(--o) * -1px); opacity: 0; }
}
@keyframes gaps { 0%, 22% { opacity: 0; } 28%, 94% { opacity: 1; } 100% { opacity: 0; } }

.legend { color: #fff; font-size: clamp(11px, 1.45vw, 18px); }
.legend-title { font-weight: 600; font-size: 1.3em; margin: 0 0 .5em; padding-bottom: .45em; border-bottom: 1px solid rgba(255,255,255,.35); }
.legend ul { list-style: none; margin: 0; padding: 0; }
.legend li {
  display: flex; align-items: center; gap: .55em; margin: .3em 0;
  animation: legend 8s ease infinite; animation-delay: calc(var(--i) * .12s);
}
.legend i { width: .8em; height: .8em; border-radius: 2px; flex: none; }
.legend b { font-weight: 700; min-width: 3.1em; text-align: right; font-variant-numeric: tabular-nums; }
.c1 { background: #fff; } .c2 { background: var(--tone-2); } .c3 { background: var(--tone-3); } .c4 { background: var(--deep); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.legend-src { color: #8b8b8b; font-size: .8em; margin: .9em 0 0; }
@keyframes legend { 0%, 20% { opacity: 0; transform: translateX(-6px); } 30%, 94% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.demo figcaption { color: var(--muted); font-size: 14px; margin-top: 14px; text-align: center; }

/* Diagrammarten */
.types { padding-bottom: 96px; }
.type-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.type-grid li {
  background: linear-gradient(180deg, var(--bg-2), rgba(18,51,58,.4));
  border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 14px 16px; text-align: center;
  transition: transform .2s, border-color .2s;
}
.type-grid li:hover { transform: translateY(-3px); border-color: rgba(143,209,196,.35); }
.type-grid svg { width: 100%; max-width: 110px; height: auto; margin: 0 auto 12px; display: block; }
.type-grid b { display: block; font-size: 18px; }
.type-grid span { display: block; color: var(--muted); font-size: 14px; line-height: 1.35; margin-top: 2px; }

/* Galerie */
.gallery { padding-bottom: 110px; }
.shots {
  display: grid; gap: 14px;
  grid-template-columns: 1fr 1fr 0.633fr;
  grid-template-areas: "a b e" "c d e";
}
.shot { margin: 0; position: relative; border-radius: 12px; overflow: hidden; background: #000; box-shadow: 0 0 0 1px var(--line); }
.shot img { width: 100%; height: 100%; object-fit: cover; }
.a { grid-area: a; } .b { grid-area: b; } .c { grid-area: c; } .d { grid-area: d; } .e { grid-area: e; }
.tall img { object-fit: contain; }
.tag {
  position: absolute; top: 10px; right: 10px; font-size: 13px; font-weight: 700;
  background: rgba(11,36,40,.8); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px;
}

/* Funktionen */
.features { display: grid; grid-template-columns: 1.1fr 1fr; gap: 64px; align-items: center; padding-bottom: 110px; }
.feat-shot img { border-radius: 12px; box-shadow: 0 40px 80px -30px rgba(0,0,0,.9), 0 0 0 1px var(--line); }
.feat-list dl { margin: 0; }
.feat-list dt { font-weight: 700; font-size: 19px; margin-top: 22px; display: flex; align-items: center; gap: 10px; }
.feat-list dt::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--tone-2); flex: none; }
.feat-list dt:first-child { margin-top: 0; }
.feat-list dd { margin: 4px 0 0 20px; color: #C5D6D3; }

/* Installation */
.install { padding-bottom: 110px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.steps li { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 24px; }
.num {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--deep); color: var(--tone-1); font-weight: 700; margin-bottom: 14px;
}
.steps h3 { font-size: 20px; margin-bottom: 8px; }
.steps p { margin: 0; color: #C5D6D3; font-size: 17px; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .85em; background: rgba(255,255,255,.07); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }
kbd {
  font: 600 .85em/1 "Source Sans Pro", sans-serif; display: inline-block; min-width: 1.6em; text-align: center;
  padding: 3px 5px; margin: 0 1px; border-radius: 5px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); border-bottom-width: 2px;
}

/* Abschluss */
.final { text-align: center; padding: 20px 0 100px; display: flex; flex-direction: column; align-items: center; }
.final img { margin-bottom: 8px; filter: drop-shadow(0 18px 30px rgba(239,138,107,.3)); }
.final h2 { margin-bottom: 24px; }
.final .meta { margin-top: 16px; }

.foot { border-top: 1px solid var(--line); padding: 24px 0 36px; display: flex; justify-content: space-between; color: var(--muted); font-size: 14px; }
.foot { align-items: center; gap: 16px; flex-wrap: wrap; }
.foot a { color: var(--muted); }
.ai-note { order: 3; flex-basis: 100%; margin: 4px 0 0; font-size: 13px; color: var(--muted); opacity: .85; }
.kofi img { display: block; transition: transform .15s; }
.kofi:hover img { transform: translateY(-1px); }

/* Neu in dieser Version */
.news { padding-bottom: 110px; }
.news-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.news-grid li { position: relative; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 24px; }
.news-grid h3 { font-size: 20px; margin-bottom: 8px; }
.news-grid p { margin: 0; color: #C5D6D3; font-size: 17px; }
.news-tag {
  display: inline-block; margin-bottom: 14px; padding: 2px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 700; letter-spacing: .04em; color: var(--bg); background: var(--tone-1);
}
.news-grid li:first-child .news-tag { background: var(--tone-2); }

/* Impressum */
.legal { padding: 40px 0 110px; max-width: 720px; }
.legal h1 { font-size: clamp(36px, 5vw, 52px); margin-bottom: 28px; }
.legal h2 { font-size: 22px; margin: 36px 0 10px; }
.legal p { margin: 0 0 12px; color: #D6E4E2; }
.legal address { font-style: normal; color: #D6E4E2; }
.back { display: inline-block; margin-top: 40px; font-weight: 600; }
.legal h3 { font-size: 19px; margin: 24px 0 8px; }
.legal ul { margin: 0 0 12px; padding-left: 1.2em; color: #D6E4E2; }
.legal li { margin-bottom: 4px; }
.legal address { margin-bottom: 12px; }
.legal .stand, .legal .note { color: var(--muted); font-size: 16px; }
.legal a { overflow-wrap: anywhere; }
.foot-links { display: flex; gap: 20px; flex-wrap: wrap; }

/* Tablet */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 44px; padding-top: 28px; }
  .type-grid { grid-template-columns: repeat(3, 1fr); }
  .features { grid-template-columns: 1fr; gap: 40px; }
  .feat-shot { order: 2; }
  .legend { font-size: clamp(11px, 2.4vw, 18px); }
}
/* Handy */
@media (max-width: 640px) {
  .brand span { font-size: 19px; }
  .top-right { gap: 8px; }
  .top-dl { padding: 7px 12px; }
  body { font-size: 17px; }
  .hero { padding-bottom: 72px; }
  .demo-chart { aspect-ratio: auto; grid-template-columns: 1fr; padding: 28px 24px; gap: 22px; }
  .pie { max-width: 220px; margin: 0 auto; }
  .legend { font-size: 16px; }
  .type-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .shots { grid-template-columns: 1fr 1fr; grid-template-areas: "a a" "b c" "e e" "d d"; gap: 10px; }
  .e { aspect-ratio: 4 / 3; }
  .steps, .news-grid { grid-template-columns: 1fr; }
  .types, .gallery, .features, .news, .install { padding-bottom: 76px; }
}

@media (prefers-reduced-motion: reduce) {
  .seg, .gaps, .legend li { animation: none; }
  .btn, .type-grid li { transition: none; }
  html { scroll-behavior: auto; }
}
