/* ============================================
   Design tokens
   ============================================ */
:root {
  --bg: #F7F8FA;
  --bg-raised: #FFFFFF;
  --ink: #12151A;
  --ink-soft: #4B5563;
  --muted: #8A93A3;
  --border: #E4E7EC;
  --accent: #BC0601;
  --accent-ink: #7A0400;
  --accent-soft: #FBE8E7;
  --flag: #00B37E;
  --flag-soft: #E4F9F1;
  --warn-bg: #FFF7E8;
  --warn-border: #F0DCA6;

  --font-display: "Space Grotesk", "IBM Plex Sans", sans-serif;
  --font-body: "IBM Plex Sans", "Space Grotesk", sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", monospace;

  --maxw: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; color: var(--ink-soft); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.eyebrow::before { content: ">"; color: var(--flag); font-weight: 700; }

/* ============================================
   Header
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 248, 250, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.logo {
  display: flex;
  align-items: center;
}
.logo img {
  height: 38px;
  width: auto;
  display: block;
}

.nav {
  display: flex;
  gap: 32px;
  align-items: center;
}
.nav a {
  text-decoration: none;
  font-size: 15px;
  color: var(--ink-soft);
  transition: color 0.15s ease;
}
.nav a:hover, .nav a.active { color: var(--ink); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 780px) {
  .nav-toggle { display: flex; }

  .header-actions {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 8px 24px 24px;
    box-shadow: 0 12px 24px -12px rgba(0,0,0,0.15);
  }
  .header-actions.open { display: flex; }

  .nav {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }
  .nav a {
    padding: 12px 4px;
    border-bottom: 1px solid var(--border);
    font-size: 16px;
  }

  .header-actions .btn-primary {
    margin-top: 12px;
    justify-content: center;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14.5px;
  padding: 11px 20px;
  border-radius: 8px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #000; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-ink); }

/* KLISYSTEMS wordmark, styled as text (teal S matches their logo) */
.ki-brand {
  font-family: "Baloo 2", var(--font-display), sans-serif;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.ki-brand .ki-s { color: #00BCD4; }

/* ============================================
   Hero
   ============================================ */
.hero {
  padding: 96px 0 72px;
  border-bottom: 1px solid var(--border);
}
.hero h1 {
  font-size: clamp(34px, 5vw, 56px);
  max-width: 16ch;
}
.hero .lede {
  font-size: 19px;
  max-width: 56ch;
  color: var(--ink-soft);
}
.hero-cursor {
  display: inline-block;
  width: 10px;
  height: 1em;
  background: var(--flag);
  margin-left: 4px;
  vertical-align: -0.15em;
  animation: blink 1.1s steps(1) infinite;
}
@media (prefers-reduced-motion: reduce) {
  .hero-cursor { animation: none; }
}
@keyframes blink { 50% { opacity: 0; } }

.hero-actions { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }

.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
}
.hero-text { flex: 1 1 480px; }
.hero-visual { flex: 0 0 340px; max-width: 360px; }
.hero-visual svg { width: 100%; height: auto; }
@media (max-width: 860px) {
  .hero-inner { flex-direction: column; align-items: flex-start; }
  .hero-visual { order: -1; max-width: 260px; align-self: center; }
}

/* ============================================
   Problem grid (solution-first homepage)
   ============================================ */
.problem-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 900px) { .problem-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .problem-grid { grid-template-columns: 1fr; } }

.problem-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s ease, transform .15s ease;
}
.problem-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.problem-card .icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border-radius: 10px;
  color: var(--accent-ink);
}
.problem-card .icon svg { width: 20px; height: 20px; }
.problem-card .label { font-size: 15px; font-weight: 500; }
.problem-card .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ============================================
   Section headers
   ============================================ */
.section { padding: 72px 0; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.section-head h2 { font-size: 30px; margin: 0; }
.section-head .link {
  font-family: var(--font-mono);
  font-size: 14px;
  text-decoration: none;
  color: var(--accent);
  white-space: nowrap;
}
.section-head .link:hover { text-decoration: underline; }

/* ============================================
   Article grid / cards
   ============================================ */
.grid-articles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 900px) { .grid-articles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-articles { grid-template-columns: 1fr; } }

.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s ease, transform .15s ease;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }

.tag {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--flag);
  background: var(--flag-soft);
  border-radius: 6px;
  padding: 4px 9px;
  display: inline-block;
  width: fit-content;
  margin-bottom: 14px;
}
.card h3 { font-size: 19px; margin-bottom: 8px; }
.card p { font-size: 15px; margin-bottom: 16px; flex-grow: 1; }
.card .meta {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.placeholder-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #B7791F;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: 6px;
  padding: 2px 8px;
  margin-left: 8px;
}

/* ============================================
   Tools / affiliate section
   ============================================ */
.section-tools { background: var(--bg-raised); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.disclosure {
  font-size: 13.5px;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 36px;
}
.disclosure strong { color: var(--ink-soft); }

.grid-tools {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
@media (max-width: 900px) { .grid-tools { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-tools { grid-template-columns: 1fr; } }

.tool-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  background: var(--bg);
}
.tool-card .thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 14px;
  background: var(--bg);
}
.tool-card .thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tool-card .thumb-fallback {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-soft), #fff);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-ink);
}
.tools-empty {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--muted);
  grid-column: 1 / -1;
}

/* ============================================
   Filter buttons (Empfehlungen-Seite)
   ============================================ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}
.filter-btn {
  font-family: var(--font-mono);
  font-size: 13.5px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.filter-btn:hover { border-color: var(--accent); color: var(--ink); }
.filter-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* ============================================
   Survey banner
   ============================================ */
.survey-banner {
  background: var(--accent-soft);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
.survey-banner .wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  text-align: center;
}
.survey-banner p {
  margin: 0;
  color: var(--accent-ink);
  font-size: 14.5px;
}
.survey-banner strong { color: var(--ink); }
.survey-banner .btn {
  padding: 8px 18px;
  font-size: 13.5px;
  flex-shrink: 0;
}
.tool-card h4 { font-size: 15.5px; margin: 0 0 6px; text-align: center; }
.tool-card .price { font-family: var(--font-mono); font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.tool-card .btn { width: 100%; justify-content: center; font-size: 13.5px; padding: 9px 14px; }

/* ============================================
   CTA banner -> klisystems.de
   ============================================ */
.cta-banner {
  background: var(--ink);
  color: #fff;
  border-radius: 18px;
  padding: 52px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}
.cta-banner h2 { color: #fff; font-size: 26px; margin-bottom: 8px; }
.cta-banner p { color: #B9BFCC; margin: 0; max-width: 48ch; }
.cta-banner .btn-accent { flex-shrink: 0; }

/* ============================================
   Footer
   ============================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 48px 0;
  margin-top: 24px;
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-links { display: flex; gap: 24px; }
.footer-links a { text-decoration: none; font-size: 14px; color: var(--muted); }
.footer-links a:hover { color: var(--ink); }
.footer-note { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }

/* ============================================
   Allgemeine Mobile-Anpassungen (Handy/kleines Tablet)
   ============================================ */
@media (max-width: 640px) {
  body { font-size: 16px; }

  .wrap { padding: 0 18px; }

  .hero { padding: 56px 0 40px; }
  .section { padding: 48px 0; }

  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { justify-content: center; }

  .section-head { flex-direction: column; align-items: flex-start; gap: 10px; }

  .cta-banner { padding: 32px 24px; flex-direction: column; align-items: stretch; text-align: left; }
  .cta-banner .btn { justify-content: center; }

  .survey-banner .wrap { flex-direction: column; gap: 12px; text-align: left; }
  .survey-banner .btn { width: 100%; justify-content: center; }

  .filter-bar { gap: 8px; }
  .filter-btn { padding: 8px 12px; font-size: 12.5px; }

  .article-hero { padding: 40px 0 28px; }
  .article-meta { flex-wrap: wrap; gap: 10px 18px; }

  .logo img { height: 30px; }
}
.article-hero { padding: 64px 0 40px; border-bottom: 1px solid var(--border); }
.article-hero .tag { margin-bottom: 18px; }
.article-hero h1 { font-size: clamp(30px, 4.5vw, 44px); max-width: 22ch; }
.article-meta {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  display: flex;
  gap: 18px;
  margin-top: 20px;
}
.article-body { max-width: 72ch; padding: 48px 0; }
.article-body h2 { font-size: 24px; margin-top: 1.6em; }
.article-body p, .article-body li { font-size: 17px; color: var(--ink-soft); }
.article-body ul { padding-left: 1.2em; }
.callout {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 18px 22px;
  margin: 28px 0;
  font-size: 15.5px;
  color: var(--accent-ink);
}
.back-link {
  font-family: var(--font-mono);
  font-size: 14px;
  text-decoration: none;
  color: var(--accent);
  display: inline-block;
  margin-bottom: 24px;
}
