/* FinanzGecko docs — teilt die Farbtokens der App (siehe lib/ui/theme.dart).
   Dunkel ist der Standard: die Tokens in :root sind die dunkle Palette, die helle
   Variante überschreibt sie weiter unten per prefers-color-scheme. Browser ohne
   Media-Query-Support bleiben damit auf Dunkel — genau wie die <img>-Fallbacks
   der Screenshots in index.html/documentation.html. */

:root {
  --bg: #0a0f0c;
  --surface: #101713;
  --border: #1c2721;
  --muted: #7c8a83;
  --primary: #00c878;
  --primary-ink: #04140d;
  --danger: #ff6b6b;
  --text: #f2f5f3;
  /* kPrimary als *Glyphenfarbe* statt als Fläche — auf dem hellen Hintergrund
     verfehlt #00c878 die WCAG-AA-Grenze von 4,5:1, deshalb dort abgedunkelt.
     Entspricht kPrimaryText in lib/ui/theme.dart. */
  --primary-text: #00c878;
  /* Dasselbe Spiel für kDanger: als Randindikator auf hellem Hintergrund kommt
     #ff6b6b nur auf 2,6:1 und verschwindet praktisch. Entspricht kDangerText in
     lib/ui/theme.dart — im Dunkelmodus identisch mit --danger. */
  --danger-text: #ff6b6b;
  --prose: #cfd8d2;
  --lead: #c3ccc7;
  --shot-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

/* Helle Palette — 1:1 die Light-Tokens aus lib/ui/theme.dart, damit Website und
   App im selben Systemtheme gleich aussehen. Die Markenfarben (--primary,
   --danger) bleiben in beiden Themes identisch, siehe dev/ai/design-tokens.md. */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f7f5;
    --surface: #ffffff;
    --border: #dce3de;
    --muted: #5b6b62;
    --text: #10160f;
    --primary-text: #00814d;
    --danger-text: #ba4e4e;
    --prose: #3c4842;
    --lead: #44514a;
    --shot-shadow: 0 18px 40px rgba(16, 22, 15, 0.12);
  }
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
  /* Browser drucken/exportieren standardmäßig ohne Hintergrundfarben (Tinte sparen) — der für den
     dunklen Hintergrund gewählte helle Text wäre dann auf weißem Papier fast unlesbar. */
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary-text);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
.hint:focus-visible {
  outline: 2px solid var(--primary-text);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  background: var(--surface);
  color: var(--primary-text);
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  left: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
}

header.site {
  border-bottom: 1px solid var(--border);
}

header.site .wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 20px;
  padding-bottom: 20px;
}

header.site img.logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

header.site .brand {
  font-weight: 600;
  font-size: 17px;
  color: var(--text);
  text-decoration: none;
}

header.site nav {
  margin-left: auto;
  display: flex;
  gap: 20px;
}

header.site nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

header.site nav a:hover {
  color: var(--text);
}

/* Landing page */

.hero {
  padding: 96px 0 72px;
  text-align: center;
}

.hero img.logo {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  margin-bottom: 28px;
}

.hero h1 {
  font-size: 34px;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}

.hero p.pitch {
  color: var(--muted);
  font-size: 17px;
  max-width: 520px;
  margin: 0 auto 36px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  padding: 13px 24px;
  border-radius: 8px;
}

.btn:hover {
  filter: brightness(1.08);
}

.cta-group {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface);
  filter: none;
}

.micro-trust {
  color: var(--muted);
  font-size: 13px;
  margin: 16px 0 0;
}

.tags {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 32px;
}

.tag-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.tag-divider {
  width: 1px;
  align-self: stretch;
  min-height: 20px;
  background: var(--border);
}

.tag {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 5px 11px;
  border-radius: 999px;
}

.tag-feature {
  color: var(--primary-text);
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
}

.hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  margin-left: 3px;
  font-size: 11px;
  font-style: normal;
  line-height: 1;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: help;
}

/* Screenshots, features, trust strip */

.screenshots,
.features {
  padding: 64px 0;
  border-top: 1px solid var(--border);
}

.screenshots h2,
.features h2 {
  font-size: 26px;
  text-align: center;
  margin: 0 0 10px;
}

.section-lead {
  color: var(--muted);
  text-align: center;
  font-size: 15px;
  max-width: 480px;
  margin: 0 auto 40px;
}

.shot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.shot-placeholder {
  margin: 0;
}

.shot-box {
  aspect-ratio: 16 / 10;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
}

.shot-placeholder figcaption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* Hero product shot */
.hero-shot {
  margin: 40px auto 0;
  max-width: 720px;
}

.hero-shot img,
.shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shot-shadow);
}

.hero-shot figcaption,
.shot figcaption {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* Screenshot story */
.story {
  display: grid;
  gap: 60px;
  margin-top: 8px;
}

.shot-story {
  display: grid;
  gap: 16px;
}

.shot-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-text);
}

.shot-story h3 {
  font-size: 22px;
  line-height: 1.25;
  margin: 2px 0 0;
}

.shot-story p.shot-lead {
  margin: 0;
  font-size: 15.5px;
  color: var(--lead);
  max-width: 60ch;
}

.shot {
  margin: 8px 0 0;
}

.doc-shot {
  margin: 18px 0 24px;
}

.doc-shot figcaption {
  text-align: left;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.feature-card h3 {
  font-size: 16px;
  margin: 0 0 8px;
}

.feature-card p {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

.testimonials {
  padding: 44px 0 56px;
  border-top: 1px solid var(--border);
}

.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  max-width: 980px;
  margin: 0 auto;
}

.testimonial-card {
  margin: 0;
  padding: 30px 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
}

.testimonial-card blockquote {
  margin: 0;
  position: relative;
}

.testimonial-card blockquote p {
  margin: 0;
  font-size: 18px;
  line-height: 1.5;
  color: var(--text);
}

.testimonial-card blockquote p::before {
  content: "”";
  display: block;
  font-size: 40px;
  line-height: 1;
  color: var(--primary-text);
  margin-bottom: 6px;
}

.testimonial-card figcaption {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.github-stat {
  margin: 16px 0 0;
  text-align: center;
  font-size: 13px;
}

.github-stat a {
  color: var(--muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.github-stat a:hover {
  color: var(--text);
}

.github-stat a span[aria-hidden] {
  color: var(--primary-text);
}

.get {
  padding: 64px 0;
  border-top: 1px solid var(--border);
}

.get-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.get-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
}

/* --primary-text, nicht --primary: als Rahmenindikator gilt die dev/ai/design-tokens.md-Regel
   (Markenfarbe, die einen Rahmen/Fokus färbt → *Text-Variante). #00c878 erreicht
   auf dem hellen Theme nur 2,2:1 gegen --surface und wäre als 1px-Rahmen praktisch
   unsichtbar; #00814d liegt bei 4,9:1. Im Dark Theme sind beide Tokens identisch. */
.get-card-primary {
  border-color: var(--primary-text);
}

.get-card h3 {
  font-size: 18px;
  margin: 0 0 8px;
}

.get-card p {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 20px;
}

.store-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.trust {
  padding: 40px 0;
  border-top: 1px solid var(--border);
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  text-align: center;
}

.trust-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.trust-item strong {
  font-size: 15px;
}

.trust-item span {
  color: var(--muted);
  font-size: 13px;
}

.faq {
  padding: 64px 0;
  border-top: 1px solid var(--border);
}

.faq-list {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-list details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
}

.faq-list summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  list-style: none;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "+";
  float: right;
  color: var(--primary-text);
}

.faq-list details[open] summary::after {
  content: "–";
}

.faq-list p {
  color: var(--muted);
  font-size: 14px;
  margin: 12px 0 0;
}

footer.site {
  border-top: 1px solid var(--border);
  margin-top: 48px;
}

footer.site .wrap {
  padding: 24px;
  color: var(--muted);
  font-size: 13px;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.footer-nav {
  display: flex;
  gap: 18px;
}

.footer-nav a {
  color: var(--muted);
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--text);
}

/* Download page */

.download-hero {
  padding: 72px 0 16px;
  text-align: center;
}

.download-hero h1 {
  font-size: 30px;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}

.download-hero p {
  color: var(--muted);
  font-size: 16px;
  max-width: 520px;
  margin: 0 auto;
}

/* Der vertikale Abstand sitzt auf der Sektion, nicht auf dem Raster — sonst
   überschreibt die `padding`-Kurzschreibweise die seitlichen 24px des .wrap,
   sobald beide Klassen auf demselben Element landen (siehe Kommentar in
   download.html). */
.download-grid-section {
  padding: 40px 0 64px;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.download-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.download-card h2 {
  font-size: 18px;
  margin: 0 0 6px;
}

.download-card .download-req {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 20px;
}

.download-card .btn {
  width: 100%;
  justify-content: center;
}

.download-card .install-hint {
  color: var(--muted);
  font-size: 13px;
  margin: 14px 0 0;
}

/* Vom Skript in download.html gesetzt, sobald das Betriebssystem erkannt wurde:
   die passende Karte rückt an die erste Position und wird hervorgehoben. Die
   beiden anderen bleiben bewusst gleich groß und sichtbar — eine Fehlerkennung
   soll niemanden vom richtigen Download abschneiden. */
.download-card-primary {
  /* Siehe .get-card-primary: --primary-text, sonst ist der Rahmen auf dem hellen
     Theme (2,2:1) nicht wahrnehmbar — das Badge darüber nutzt bereits denselben
     Token und war deshalb sichtbar, während die Umrandung zu fehlen schien. */
  border-color: var(--primary-text);
}

.download-badge {
  align-self: center;
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--primary-text);
}

/* Version und Dateigröße des konkreten Assets — erst sichtbar, wenn die
   GitHub-API geantwortet hat (sonst bleibt das <p> hidden). */
.download-meta {
  color: var(--muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  margin: 10px 0 0;
}

/* Hinweis-Box (Backup-Empfehlung) auf download.html. Bewusst in
   --surface/--border statt in --danger: es ist eine Vorsichtsmaßnahme, keine
   Fehlermeldung — ein roter Kasten direkt unter den Download-Buttons würde
   suggerieren, mit der App stimme etwas nicht. Der schmale linke Akzent hebt
   sie trotzdem aus dem Fließtext heraus.
   Akzent wie bei .card.note: Rahmenindikator, also --primary-text statt
   --primary (das käme hell nur auf 2,2:1). Siehe dev/ai/design-tokens.md. */
.download-note {
  padding: 0 0 24px;
}

.download-note .note {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary-text);
  border-radius: 10px;
  padding: 18px 20px;
  margin: 0;
  color: var(--prose);
  font-size: 14px;
  line-height: 1.65;
}

.download-note .note strong {
  color: var(--text);
}

.download-info {
  padding: 8px 0 56px;
}

.download-info h2 {
  font-size: 20px;
  margin: 32px 0 10px;
}

.download-info h2:first-child {
  margin-top: 0;
}

.download-info p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
  margin: 0;
}

.download-all {
  text-align: center;
  padding-bottom: 64px;
}

.download-all p {
  color: var(--muted);
  font-size: 14px;
}

/* Documentation page */

.doc-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
  align-items: start;
  padding: 48px 0 80px;
}

.doc-nav {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.doc-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 6px;
}

.doc-nav a:hover {
  color: var(--text);
  background: var(--surface);
}

.doc-content h1 {
  font-size: 28px;
  margin: 0 0 8px;
}

.doc-content > .lead {
  color: var(--muted);
  font-size: 16px;
  margin-bottom: 40px;
}

.doc-content section {
  padding-top: 40px;
  margin-top: 40px;
  border-top: 1px solid var(--border);
  scroll-margin-top: 24px;
}

.doc-content section:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.doc-content h2 {
  font-size: 20px;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.doc-content h2 .step {
  color: var(--primary-text);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}

.doc-content h3 {
  font-size: 15px;
  margin: 24px 0 8px;
  color: var(--text);
}

.doc-content p {
  color: var(--prose);
  margin: 0 0 12px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 16px 0;
}

.card p:last-child {
  margin-bottom: 0;
}

.card.note {
  /* Siehe .get-card-primary — Rahmenindikator, also --primary-text. */
  border-left: 3px solid var(--primary-text);
}

.card.warn {
  /* Siehe .card.note — Rahmenindikator, also --danger-text statt --danger. */
  border-left: 3px solid var(--danger-text);
}

ul.feature-list {
  margin: 0 0 12px;
  padding-left: 20px;
  color: var(--prose);
}

ul.feature-list li {
  margin-bottom: 6px;
}

.kbd {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 2px 6px;
  color: var(--text);
}

.flow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 20px 0 8px;
}

.flow .flow-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  color: var(--text);
}

.flow .flow-arrow {
  color: var(--muted);
}

/* Der einzige Breakpoint der Site. Alles Mobile-Spezifische gehört hierher —
   verteilte Einzel-Media-Queries neben den jeweiligen Regeln waren genau der
   Grund, warum bisher nur `.hero` einen verkleinerten Abstand bekam und jede
   andere Sektion ihren Desktop-Rhythmus behielt.

   Die Raster selbst brauchen hier fast nichts: `.shot-grid`, `.feature-grid`,
   `.get-grid`, `.trust-grid` und `.download-grid` nutzen `auto-fit`+`minmax()`
   und fallen von allein um. Nur die beiden mit fester Spaltenzahl müssen
   ausdrücklich zurückgesetzt werden. */
@media (max-width: 700px) {
  /* --- Raster mit fester Spaltenzahl auf eine Spalte --- */

  .doc-layout {
    grid-template-columns: 1fr;
    /* Aus dem Spaltenabstand wird beim Umbruch ein Zeilenabstand: 48px zwischen
       Seitennavigation und Inhalt wären untereinander deutlich zu viel. */
    gap: 24px;
    padding: 32px 0 56px;
  }

  .testimonial-grid {
    grid-template-columns: 1fr;
  }

  .doc-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
  }

  header.site nav {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px 16px;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  /* --- Vertikaler Rhythmus: jede Sektion rund ein Drittel flacher ---
     Die Desktop-Werte sind bewusst unterschiedlich (Hero atmet mehr als der
     Trust-Streifen); diese Staffelung bleibt erhalten, sie wird nur gestaucht.
     Deshalb hier explizite Werte statt eines gemeinsamen Tokens, das die
     Abstufung einebnen würde. `.download-hero` ist das Hero-Gegenstück auf
     download.html, 404.html und danke.html — es fehlte bisher komplett. */

  .hero {
    padding: 64px 0 48px;
  }

  .download-hero {
    padding: 48px 0 12px;
  }

  .screenshots,
  .features,
  .get,
  .faq {
    padding: 44px 0;
  }

  .testimonials {
    padding: 32px 0 40px;
  }

  .trust {
    padding: 32px 0;
  }

  .download-grid-section {
    padding: 28px 0 44px;
  }

  .download-note {
    padding: 0 0 16px;
  }

  .download-note .note {
    padding: 16px 16px;
    font-size: 13.5px;
  }

  .download-info {
    padding: 4px 0 40px;
  }

  .download-info h2 {
    font-size: 18px;
    margin-top: 26px;
  }

  .download-all {
    padding-bottom: 44px;
  }

  /* --- Abstände innerhalb der Sektionen --- */

  .story {
    gap: 40px;
  }

  .hero-shot {
    margin: 28px auto 0;
  }

  .section-lead {
    margin: 0 auto 28px;
  }

  .tags {
    margin-top: 24px;
  }

  /* Seitliches Innenmaß der Karten: 36px bzw. 28px lassen auf einem 360px
     breiten Gerät (abzüglich der 24px von .wrap) zu wenig für den Text übrig. */
  .testimonial-card {
    padding: 24px 22px;
  }

  .get-card,
  .download-card {
    padding: 22px;
  }

  /* --- Überschriften --- */

  .hero h1 {
    font-size: 28px;
  }

  .download-hero h1 {
    font-size: 26px;
  }

  .doc-content h1 {
    font-size: 24px;
  }
}
