/* ==========================================================================
   hintergrund.net – globales Stylesheet
   Ein File, keine Webfonts, keine externen Requests → PageSpeed 100/100
   ========================================================================== */

:root {
  --bg: #faf9f7;
  --surface: #ffffff;
  --text: #1b1917;
  --muted: #5c5751;
  --accent: #6d28d9;
  --accent-2: #2563eb;
  --accent-soft: #f3eeff;
  --border: #e8e5e0;
  --shadow: 0 1px 2px rgba(20, 16, 12, .05), 0 10px 28px -14px rgba(20, 16, 12, .18);
  --radius: 14px;
  --maxw: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0e0d;
    --surface: #191715;
    --text: #f1efec;
    --muted: #a6a09a;
    --accent: #a78bfa;
    --accent-2: #60a5fa;
    --accent-soft: #241c33;
    --border: #2b2825;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 10px 28px -14px rgba(0, 0, 0, .7);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(1rem, .96rem + .2vw, 1.0625rem);
  line-height: 1.65;
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}

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

a { color: var(--accent-2); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

h1, h2, h3 { line-height: 1.25; letter-spacing: -.015em; }
h1 { font-size: clamp(1.75rem, 1.35rem + 1.8vw, 2.6rem); margin: .2em 0 .45em; }
h2 { font-size: clamp(1.3rem, 1.15rem + .8vw, 1.7rem); margin: 1.8em 0 .5em; }
h3 { font-size: 1.15rem; margin: 1.4em 0 .4em; }

img, svg, video { max-width: 100%; height: auto; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* --------------------------------------------------------------------------
   Header & Navigation
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-row { display: flex; align-items: center; gap: 24px; min-height: 60px; }

.logo {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 1.1rem; letter-spacing: -.02em;
  color: var(--text); text-decoration: none; white-space: nowrap;
}
.logo span { color: var(--accent); }
.logo svg { flex: none; }

.nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: .95rem;
  padding: 8px 12px; border-radius: 8px; white-space: nowrap;
}
.nav a:hover { color: var(--text); background: var(--accent-soft); }

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

.hero { padding: clamp(40px, 8vw, 88px) 0 clamp(28px, 5vw, 56px); }
.hero h1 { margin-top: 0; }
.hero .gradient-text {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead { font-size: clamp(1.05rem, 1rem + .4vw, 1.25rem); color: var(--muted); max-width: 62ch; }

.kicker {
  display: inline-block; font-size: .8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--accent); margin-bottom: 8px;
}

/* --------------------------------------------------------------------------
   Breadcrumb
   -------------------------------------------------------------------------- */

.breadcrumb { padding: 16px 0 0; font-size: .875rem; color: var(--muted); }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.breadcrumb li + li::before { content: "›"; margin-right: 6px; color: var(--muted); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

/* --------------------------------------------------------------------------
   Karten & Grids
   -------------------------------------------------------------------------- */

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin: 24px 0; }
.grid.tight { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }

.card {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; text-decoration: none; color: var(--text);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent); color: var(--text); }
.card h3 { margin: 8px 0 6px; font-size: 1.05rem; }
.card p { margin: 0; font-size: .9rem; color: var(--muted); }
.card .swatch { display: block; height: 56px; border-radius: 9px; border: 1px solid var(--border); }

.linklist { columns: 2; gap: 32px; padding-left: 20px; margin: 16px 0; }
.linklist li { margin: 6px 0; break-inside: avoid; }
@media (max-width: 560px) { .linklist { columns: 1; } }

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

.article { max-width: 76ch; padding-bottom: 40px; }
.article > p, .article li { color: var(--text); }
.article .intro { font-size: 1.1rem; color: var(--muted); }
.article ul, .article ol { padding-left: 24px; }
.article li { margin: 6px 0; }
.article hr { border: 0; border-top: 1px solid var(--border); margin: 40px 0; }

.meta-line { font-size: .875rem; color: var(--muted); margin-bottom: 20px; }

.toc {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 22px; margin: 24px 0; font-size: .95rem;
}
.toc strong { display: block; margin-bottom: 8px; }
.toc ol { margin: 0; padding-left: 20px; }
.toc li { margin: 4px 0; }
.toc a { text-decoration: none; }

/* Tabellen */
.table-scroll { overflow-x: auto; margin: 20px 0; border: 1px solid var(--border); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: .93rem; background: var(--surface); }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--accent-soft); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }

/* Hinweisboxen */
.note, .disclosure {
  border-left: 4px solid var(--accent); background: var(--accent-soft);
  border-radius: 0 10px 10px 0; padding: 14px 18px; margin: 20px 0; font-size: .95rem;
}
.disclosure { border-left-color: var(--accent-2); color: var(--muted); }

/* FAQ */
.faq { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); margin: 10px 0; }
.faq summary {
  cursor: pointer; font-weight: 600; padding: 14px 18px; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.3rem; color: var(--accent); flex: none; }
.faq[open] summary::after { content: "–"; }
.faq .faq-body { padding: 0 18px 14px; color: var(--muted); }

/* Schritt-für-Schritt */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 24px 0; }
.steps > li { counter-increment: step; position: relative; padding: 0 0 22px 52px; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 700;
}
.steps > li:not(:last-child)::after {
  content: ""; position: absolute; left: 16px; top: 40px; bottom: 4px; width: 2px; background: var(--border);
}
.steps h3 { margin: 4px 0 6px; }
.steps p { margin: 0; color: var(--muted); }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
  font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer;
  border: 0; border-radius: 10px; padding: 12px 22px;
  transition: filter .15s ease, transform .1s ease;
}
.btn:hover { filter: brightness(1.1); color: #fff; }
.btn:active { transform: scale(.98); }

.btn-outline {
  background: transparent; color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); filter: none; }

/* --------------------------------------------------------------------------
   Generator (Farb-/Verlaufs-Downloads)
   -------------------------------------------------------------------------- */

.generator {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; margin: 28px 0; box-shadow: var(--shadow);
}
.gen-preview {
  height: 180px; border-radius: 10px; border: 1px solid var(--border); margin-bottom: 18px;
  background:
    linear-gradient(45deg, #00000014 25%, transparent 25%, transparent 75%, #00000014 75%),
    linear-gradient(45deg, #00000014 25%, transparent 25%, transparent 75%, #00000014 75%);
  background-size: 20px 20px; background-position: 0 0, 10px 10px;
  position: relative; overflow: hidden;
}
.gen-preview > div { position: absolute; inset: 0; }
.gen-controls { display: flex; flex-wrap: wrap; gap: 16px; align-items: end; }
.gen-controls label { display: grid; gap: 6px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.gen-controls select, .gen-controls input[type="number"] {
  font: inherit; padding: 9px 12px; border-radius: 9px; border: 1.5px solid var(--border);
  background: var(--bg); color: var(--text); min-width: 110px;
}
.gen-controls input[type="color"] {
  inline-size: 54px; block-size: 42px; padding: 3px; border-radius: 9px;
  border: 1.5px solid var(--border); background: var(--bg); cursor: pointer;
}
.gen-custom[hidden] { display: none; }
.gen-hint { font-size: .85rem; color: var(--muted); margin: 12px 0 0; }

/* --------------------------------------------------------------------------
   Produkt-/Affiliate-Karten
   -------------------------------------------------------------------------- */

.product {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; margin: 20px 0; box-shadow: var(--shadow);
}
.product .badge {
  display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); border: 1px solid var(--border);
  border-radius: 999px; padding: 2px 10px; margin-bottom: 8px;
}
.product h3 { margin: 0 0 8px; }
.product .pro-con { display: grid; gap: 4px 24px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); padding: 0; list-style: none; margin: 12px 0 16px; }
.product .pro-con li { font-size: .92rem; }
.product .pro-con .pro::before { content: "✓ "; color: #16a34a; font-weight: 700; }
.product .pro-con .con::before { content: "✗ "; color: #dc2626; font-weight: 700; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer { border-top: 1px solid var(--border); margin-top: 64px; padding: 40px 0 32px; background: var(--surface); }
.foot-grid { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 24px; }
.site-footer h3 { font-size: .9rem; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 10px; color: var(--muted); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 6px 0; }
.site-footer a { color: var(--text); text-decoration: none; font-size: .95rem; }
.site-footer a:hover { color: var(--accent); }
.site-footer p { color: var(--muted); font-size: .95rem; margin: 6px 0; }
.foot-note { font-size: .82rem !important; }
