/* ==========================================================================
   1. VARIABLEN (BRANDING & FARBEN)
   ========================================================================== */
:root {
  /* --- LIGHT MODE --- */
  --primary: #6A3B7F;
  --primary-hover: #542f65;
  --primary-dark: #191434;
  --primary-gradient: #8e4fa8;
  --primary-light: #f3ebf5;

  --text-main: #1a1a2e;
  --text-muted: #555555;
  --text-light: #777777;

  --bg-page: #ffffff;
  --bg-section: #fafafa;
  --border-color: #f0f0f0;
  --nav-bg: rgba(255, 255, 255, 0.92);

  --btn-secondary-bg: #f5f5f7;
  --btn-secondary-text: #1a1a2e;
  
  /* Code-Block Farben (Light Mode) */
  --code-bg: #f8f9fa;
  --syntax-text: #1a1a2e;
  --syntax-k: #6A3B7F;
  --syntax-s: #005bb5;
  --syntax-c: #6e7781;
  --syntax-na: #953800;
  --code-header-bg: rgba(0,0,0,0.03);
  --color-success, #22c55e;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* --- DARK MODE --- */
    --primary: #c084fc; 
    --primary-hover: #d8b4fe;
    --primary-dark: #000000;
    --primary-gradient: #a855f7;
    --primary-light: #2d1b36;

    --text-main: #ffffff;
    --text-muted: #bcbcbc;
    --text-light: #888888;

    --bg-page: #0f0f12;          /* <-- Das hat gefehlt! */
    --bg-section: #1a1a1e;
    --border-color: #2a2a30;
    --nav-bg: rgba(15, 15, 18, 0.85);

    --btn-secondary-bg: #2a2a30;
    --btn-secondary-text: #ffffff;

    /* Code-Block Farben (Dark Mode) */
    --code-bg: #1e1e2e;
    --syntax-text: #d1d1e0;
    --syntax-k: #c084fc;
    --syntax-s: #818cf8;
    --syntax-c: #6b7280;
    --syntax-na: #fb7185;
    --code-header-bg: rgba(255,255,255,0.03);
  }

  /* Link-Farben Korrektur für Dark Mode */
  .prose a, footer a { color: #60a5fa; }
  .prose a:hover { color: var(--primary); }
}

/* ==========================================================================
   2. BASIS & TYPOGRAFIE
   ========================================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { background-color: var(--bg-page); }

body { 
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif; 
  background-color: var(--bg-page) !important;
  color: var(--text-main); 
  line-height: 1.5; 
}

h1 { font-size: 3.5rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1.1; margin-bottom: 1.2rem; color: var(--text-main); }
h1 span { color: var(--primary); }

a { text-decoration: none; transition: all 0.2s ease; }

/* Sichtbarer Fokus für Tastatur-Navigation (WCAG Pflicht) */
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ==========================================================================
   3. NAVIGATION
   ========================================================================== */
nav.top-nav { display: flex; justify-content: space-between; align-items: center; padding: 1.2rem 6%; border-bottom: 1px solid var(--border-color); position: sticky; top: 0; background: var(--nav-bg); backdrop-filter: blur(12px); z-index: 100; }
.logo { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; color: var(--text-main); }
.logo-img { width: 28px; height: 28px; border-radius: 7px; object-fit: contain; }

.nav-links { display: flex; gap: 2rem; font-size: 0.9rem; font-weight: 500; align-items: center; }
.nav-links a { color: var(--text-muted); }
.nav-links a:hover { color: var(--primary); }

.lang-switch { display: flex; gap: 0.5rem; background: var(--border-color); padding: 0.2rem 0.5rem; border-radius: 6px; font-size: 0.8rem; }
.lang-switch a { padding: 0.2rem 0.4rem; border-radius: 4px; color: var(--text-light); text-transform: uppercase; font-weight: bold; }
.lang-switch a.active { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

.nav-btn { background: var(--primary); color: white; padding: 0.5rem 1.2rem; border-radius: 8px; font-size: 0.88rem; font-weight: 600; }
.nav-btn:hover { background: var(--primary-hover); }

/* ==========================================================================
   4. HERO SEKTION
   ========================================================================== */
.hero { display: flex; align-items: center; justify-content: space-between; padding: 6rem 6% 5rem; gap: 4rem; max-width: 1200px; margin: 0 auto; flex-wrap: wrap; }
.hero-text { flex: 1; min-width: 320px; }
.hero-badge { display: inline-block; background: var(--primary-light); color: var(--primary); font-size: 0.78rem; font-weight: 700; padding: 0.4rem 1rem; border-radius: 20px; margin-bottom: 1.5rem; letter-spacing: 0.02em; }
.hero-sub { font-size: 1.15rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 2rem; max-width: 500px; }
.hero-meta { font-size: 0.85rem; color: var(--text-light); margin-bottom: 2rem; display: flex; gap: 1.5rem; font-weight: 500; flex-wrap: wrap; }
.hero-meta span { display: flex; align-items: center; gap: 6px; }

.btns { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn-primary { background: var(--primary); color: white; padding: 0.9rem 2rem; border-radius: 10px; font-size: 0.95rem; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-secondary { background: var(--btn-secondary-bg); color: var(--btn-secondary-text); padding: 0.9rem 1.8rem; border-radius: 10px; font-size: 0.95rem; font-weight: 600; }
.btn-secondary:hover { background: #e8e8ed; }
.btn-ghost { background: transparent; color: var(--primary); padding: 0.9rem 1.5rem; border-radius: 10px; font-size: 0.95rem; font-weight: 600; border: 2px solid var(--primary); }
.btn-ghost:hover { background: var(--primary-light); }

/* ==========================================================================
   5. SCREENSHOTS & BILD-WECHSLER
   ========================================================================== */
.hero-visual { flex: 1; display: flex; justify-content: center; min-width: 320px; }
.screenshot-wrap { width: 100%; max-width: 500px; position: relative; }
.image-display { position: relative; line-height: 0; }
.screenshot-img { display: none; width: 100%; } 
.screenshot-img img { width: 100%; height: auto; border-radius: 12px; }
.single-image .screenshot-img { display: block; }
.tab-input { display: none; }

#tab-0:checked ~ .image-display .screenshot-0,
#tab-1:checked ~ .image-display .screenshot-1,
#tab-2:checked ~ .image-display .screenshot-2 { display: block; animation: fadeIn 0.3s ease-in-out; }

.screenshot-tabs { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 1.5rem; }
.tab-label { padding: 0.5rem 1.2rem; background: var(--bg-section); color: var(--text-muted); border-radius: 20px; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: all 0.2s ease; border: 1px solid var(--border-color); user-select: none; }
.tab-label:hover { background: var(--border-color); color: var(--text-main); }

#tab-0:checked ~ .screenshot-tabs label:nth-child(1),
#tab-1:checked ~ .screenshot-tabs label:nth-child(2),
#tab-2:checked ~ .screenshot-tabs label:nth-child(3) {
  background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 4px 12px rgba(106, 59, 127, 0.2);
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* ==========================================================================
   6. SEKTIONEN (STATS, FEATURES, CHANGELOG)
   ========================================================================== */
.stats { display: flex; gap: 4rem; justify-content: center; padding: 3rem 6%; border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); background: var(--bg-section); flex-wrap: wrap; }
.stat { text-align: center; }
.stat-num { font-size: 2rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 0.85rem; color: var(--text-light); margin-top: 0.3rem; font-weight: 500; }

.features { padding: 6rem 6%; max-width: 1200px; margin: 0 auto; }
.section-label { text-align: center; color: var(--primary); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 1rem; }
.section-title { text-align: center; font-size: 2.5rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 1rem; }
.section-sub { text-align: center; color: var(--text-muted); font-size: 1.1rem; margin-bottom: 4rem; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.feature-card { background: var(--bg-section); border: 1px solid var(--border-color); border-radius: 16px; padding: 2rem; transition: transform 0.2s, box-shadow 0.2s; }
.feature-card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0,0,0,0.05); border-color: var(--primary-light); }
.feature-icon { font-size: 2rem; margin-bottom: 1.2rem; }
.feature-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.6rem; color: var(--text-main); }
.feature-desc { font-size: 0.95rem; color: var(--text-muted); line-height: 1.6; }

.changelog { padding: 6rem 6%; max-width: 800px; margin: 0 auto; }
.changelog-item { border-left: 3px solid var(--primary); padding: 0 0 3rem 2rem; position: relative; }
.changelog-item:last-child { padding-bottom: 0; }
.version-badge { background: var(--primary); color: white; font-size: 0.8rem; font-weight: 700; padding: 0.3rem 0.8rem; border-radius: 6px; position: absolute; left: -2.3rem; top: 0; }
.version-date { color: #888; font-size: 0.85rem; display: block; margin-bottom: 0.5rem; font-weight: 500; }
.version-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 1rem; color: var(--text-main); }
ul.version-changes {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

ul.version-changes > li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
    display: block; /* wichtig: kein flex */
}

ul.version-changes > li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    font-weight: 800;
    color: var(--color-success, #22c55e);
}
.version-badge-old { background: #888; left: -2.1rem; }
.changelog-item-old { border-color: #ccc; }

/* ==========================================================================
   7. PROSE & DOKUMENTATION (INKL. CODE DESIGN)
   ========================================================================== */
.docs-wrapper { display: grid; grid-template-columns: 280px 1fr; max-width: 1200px; margin: 0 auto; gap: 3rem; padding: 3rem 6%; }
.docs-sidebar { position: sticky; top: 100px; height: calc(100vh - 120px); }
.docs-nav { display: flex; flex-direction: column; gap: 0.5rem; align-items: stretch; }
.docs-nav a { color: var(--text-muted); padding: 0.6rem 1rem; border-radius: 8px; font-size: 0.95rem; font-weight: 500; text-align: left; display: block; }
.docs-nav a:hover { background: #f5f5f7; color: var(--primary); }
.docs-nav a.active { background: var(--primary-light); color: var(--primary); font-weight: 700; }

.prose { max-width: 800px; }
.prose h1 { font-size: 2.5rem; margin-bottom: 2rem; border-bottom: 1px solid var(--border-color); padding-bottom: 1rem; }
.prose h2 { font-size: 1.8rem; margin: 2.5rem 0 1rem; }
.prose p { line-height: 1.7; color: var(--text-main); margin-bottom: 1.2rem; }
.prose ul, .prose ol { margin-bottom: 1.2rem; padding-left: 1.5rem; line-height: 1.7; color: var(--text-main); }
.prose li { margin-bottom: 0.5rem; }

/* INLINE CODE */
.prose code {
  font-family: "SF Mono", "Monaco", "Inconsolata", monospace;
  font-size: 0.85em; padding: 0.2em 0.5em; border-radius: 6px; white-space: nowrap;
  background-color: var(--primary-light); color: var(--primary); border: 1px solid var(--border-color);
}

/* GROSSE CODE-BLÖCKE */
.prose .highlight { margin: 2.5rem 0; background: var(--code-bg) !important; border-radius: 12px; overflow: hidden; box-shadow: 0 20px 40px rgba(0,0,0,0.2); border: 1px solid var(--border-color); position: relative; }
.prose .highlight::before {
  content: ""; display: block; height: 32px; background: var(--code-header-bg); border-bottom: 1px solid var(--border-color);
  background-image: radial-gradient(circle, #ff5f57 4px, transparent 5px), radial-gradient(circle, #febc2e 4px, transparent 5px), radial-gradient(circle, #28c840 4px, transparent 5px);
  background-size: 16px 16px; background-position: 12px center, 32px center, 52px center; background-repeat: no-repeat;
}
.prose .highlight pre { margin: 0; padding: 1.5rem; background: transparent !important; overflow-x: auto; font-size: 0.9rem; line-height: 1.6; color: var(--syntax-text) !important; }
.chroma { background-color: transparent !important; }

/* SYNTAX COLORS */
.prose .highlight .k, .prose .highlight .nt { color: var(--syntax-k) !important; font-weight: bold; } 
.prose .highlight .s, .prose .highlight .s2 { color: var(--syntax-s) !important; }
.prose .highlight .c, .prose .highlight .c1, .prose .highlight .cm { color: var(--syntax-c) !important; font-style: italic; }
.prose .highlight .na, .prose .highlight .nc { color: var(--syntax-na) !important; }

/* ==========================================================================
   8. FOOTER & CTA
   ========================================================================== */
.cta { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: white; text-align: center; padding: 6rem 6%; }
.cta h2 { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 1.2rem; }
.cta p { font-size: 1.15rem; opacity: 0.9; margin-bottom: 3rem; max-width: 600px; margin-left: auto; margin-right: auto; line-height: 1.6; }
.btn-white { background: white; color: var(--primary); padding: 1rem 2.5rem; border-radius: 10px; font-weight: 700; margin: 0.5rem; display: inline-block; font-size: 1rem; }
.btn-white:hover { background: var(--primary-light); }
.btn-outline-white { border: 2px solid rgba(255,255,255,0.4); color: white; padding: 1rem 2.5rem; border-radius: 10px; font-weight: 600; margin: 0.5rem; display: inline-block; font-size: 1rem; }
.btn-outline-white:hover { border-color: white; }

footer { background: var(--text-main); color: var(--text-light); text-align: center; padding: 3rem 6%; font-size: 0.9rem; }
footer a { color: #0099ff; font-weight: 500; }
.legal-links { margin-top: 1rem; font-size: 0.8em; }
.legal-links a { color: var(--text-light); }
.dot-separator { margin: 0 0.5rem; opacity: 0.5; }

/* ==========================================================================
   9. RESPONSIVE (MOBILE)
   ========================================================================== */
@media (max-width: 900px) {
  .docs-wrapper { grid-template-columns: 1fr; }
  .docs-sidebar { position: static; height: auto; margin-bottom: 2rem; border-bottom: 1px solid var(--border-color); padding-bottom: 1rem; }
}
@media (max-width: 768px) {
  h1 { font-size: 2.5rem; }
  .hero { flex-direction: column; text-align: center; padding-top: 3rem; }
  .hero-meta, .btns { justify-content: center; }
  .nav-links { display: none; }
}
