:root {
  color-scheme: light;
  --bg: #f7f8fc;
  --surface: #ffffff;
  --surface-soft: #f0f3f9;
  --text: #151927;
  --muted: #667085;
  --border: #e3e7ef;
  --brand: #5b5ce2;
  --brand-strong: #4445c8;
  --brand-soft: #ececff;
  --warning: #fff5df;
  --warning-border: #f3d58e;
  --shadow: 0 18px 50px rgb(26 36 74 / 7%);
  --radius: 20px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #10121b;
  --surface: #191c28;
  --surface-soft: #222637;
  --text: #f0f2fb;
  --muted: #a5abc0;
  --border: #30364a;
  --brand: #a2a3ff;
  --brand-strong: #c1c2ff;
  --brand-soft: #292b4d;
  --warning: #352d1e;
  --warning-border: #695426;
  --shadow: 0 18px 50px rgb(0 0 0 / 20%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  min-width: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.65;
}
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1160px, calc(100% - 48px));
  min-height: 76px;
  margin: 0 auto;
  gap: 28px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, #7677f6, #4748ce);
  box-shadow: 0 8px 18px rgb(83 84 220 / 22%);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
}
.brand-text { display: grid; line-height: 1.2; }
.brand-text strong { font-size: 14px; letter-spacing: -.02em; }
.brand-text small { margin-top: 5px; color: var(--muted); font-size: 12px; }
.main-nav, .header-actions { display: flex; align-items: center; gap: 24px; }
.main-nav a { color: var(--muted); font-size: 14px; font-weight: 550; }
.main-nav a:hover, .main-nav a:focus-visible { color: var(--brand); }
.header-actions { gap: 12px; }
.header-action {
  display: grid;
  min-width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
}
.theme-button { font-size: 20px; }
.header-cta, .button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.header-cta:hover, .button:hover { transform: translateY(-1px); background: var(--brand-strong); box-shadow: 0 7px 18px rgb(79 80 198 / 18%); }
.menu-button { display: none; }

.home-hero {
  position: relative;
  overflow: hidden;
  padding: 82px 24px 76px;
  background:
    radial-gradient(ellipse at 14% 0%, rgb(116 116 255 / 14%), transparent 32%),
    radial-gradient(ellipse at 88% 50%, rgb(64 183 211 / 10%), transparent 28%),
    var(--surface);
}
.hero-inner { width: min(850px, 100%); margin: 0 auto; text-align: center; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.home-hero h1 { max-width: 750px; margin: 15px auto 13px; font-size: clamp(38px, 6vw, 62px); letter-spacing: -.055em; line-height: 1.08; }
.hero-subtitle { max-width: 600px; margin: 0 auto; color: var(--muted); font-size: 18px; }
.search-box {
  display: flex;
  max-width: 690px;
  min-height: 68px;
  align-items: center;
  margin: 34px auto 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: left;
}
.search-box input {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}
.search-box input:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; border-radius: 8px; }
.search-box input::placeholder { color: var(--muted); }
.search-submit { min-height: 48px; padding: 0 22px; border: 0; border-radius: 12px; background: var(--brand); color: white; cursor: pointer; font-weight: 650; }
.search-results { margin-top: 14px; text-align: left; }
.search-result-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.empty-search { padding: 14px 18px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); color: var(--muted); }

.content-section, .popular-section { width: min(1120px, calc(100% - 48px)); margin: 70px auto; }
.section-heading { margin-bottom: 24px; }
.section-heading h2 { margin: 7px 0 0; font-size: clamp(25px, 3vw, 34px); letter-spacing: -.035em; line-height: 1.2; }
.category-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.category-card, .article-card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.category-card { min-height: 210px; padding: 24px; }
.category-card:hover, .article-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--brand) 48%, var(--border)); box-shadow: var(--shadow); }
.category-number { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 750; }
.category-card h3 { margin: 17px 0 5px; font-size: 18px; letter-spacing: -.025em; }
.category-card p { margin: 0; color: var(--muted); font-size: 14px; }
.category-count { margin-top: auto; padding-top: 15px; color: var(--brand); font-size: 12px; font-weight: 650; }
.popular-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.article-card { min-height: 148px; padding: 20px 22px; }
.card-kicker { color: var(--brand); font-size: 11px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.card-title { margin-top: 8px; font-size: 17px; }
.card-description { margin-top: 5px; padding-right: 18px; color: var(--muted); font-size: 13px; }
.card-arrow { position: absolute; top: 20px; right: 22px; color: var(--brand); font-size: 19px; }

.breadcrumbs { display: flex; width: min(1120px, calc(100% - 48px)); flex-wrap: wrap; gap: 10px; margin: 28px auto 20px; color: var(--muted); font-size: 13px; }
.breadcrumbs a:hover { color: var(--brand); }
.current-crumb { color: var(--text); }
.article-layout { display: grid; width: min(1120px, calc(100% - 48px)); grid-template-columns: minmax(0, 760px) 250px; align-items: start; justify-content: space-between; gap: 48px; margin: 0 auto; }
.article-content { min-width: 0; }
.article-header { padding: 22px 0 28px; border-bottom: 1px solid var(--border); }
.article-header h1 { margin: 9px 0 10px; font-size: clamp(34px, 4.4vw, 48px); letter-spacing: -.05em; line-height: 1.12; }
.article-lead { max-width: 700px; margin: 0; color: var(--muted); font-size: 18px; }
.article-section { padding: 25px 0; border-bottom: 1px solid var(--border); scroll-margin-top: 100px; }
.article-section h2 { margin: 0 0 12px; font-size: 22px; letter-spacing: -.03em; line-height: 1.3; }
.article-section p { margin: 9px 0; color: var(--muted); }
.article-section ul { display: grid; gap: 9px; margin: 12px 0 0; padding-left: 22px; color: var(--muted); }
.article-section li::marker { color: var(--brand); }
.section-warning, .section-info { margin-top: 18px; padding: 17px 20px; border: 1px solid var(--warning-border); border-radius: 15px; background: var(--warning); }
.section-warning h2::before { content: "Wichtig · "; color: #a06b00; font-size: 12px; letter-spacing: .07em; text-transform: uppercase; }
.section-info { border-color: var(--border); background: var(--surface-soft); }
.section-info h2::before { content: "Hinweis · "; color: var(--brand); font-size: 12px; letter-spacing: .07em; text-transform: uppercase; }
.article-aside { position: sticky; top: 105px; padding: 20px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.article-aside strong { font-size: 13px; }
.article-aside ul { display: grid; gap: 11px; margin: 14px 0 0; padding: 0; list-style: none; }
.article-aside a { color: var(--muted); font-size: 12px; line-height: 1.45; }
.article-aside a:hover { color: var(--brand); }
.article-pager { display: flex; width: min(1120px, calc(100% - 48px)); justify-content: space-between; gap: 14px; margin: 28px auto; }
.pager-link { max-width: 50%; padding: 13px 16px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); color: var(--brand); font-size: 13px; font-weight: 650; }
.pager-next { margin-left: auto; text-align: right; }
.pager-placeholder { flex: 1; }
.faq-list { display: grid; gap: 10px; margin-top: 14px; }
.faq-item { padding: 15px 17px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); }
.faq-item summary { cursor: pointer; font-weight: 650; }
.faq-item p { margin-bottom: 0; }

.support-banner {
  display: flex;
  width: min(1120px, calc(100% - 48px));
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 54px auto 72px;
  padding: 26px 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(120deg, var(--brand-soft), var(--surface));
}
.support-banner strong { font-size: 17px; }
.support-banner p { margin: 3px 0 0; color: var(--muted); font-size: 14px; }
.button-dark { background: var(--text); color: var(--surface); }
.button-dark:hover { background: var(--brand-strong); color: white; }
.button-light { border-color: var(--border); background: var(--surface); color: var(--text); }
.form-panel { width: min(760px, calc(100% - 48px)); margin: 35px auto 64px; padding: 28px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.form-panel h2 { margin: 0 0 5px; font-size: 24px; letter-spacing: -.035em; }
.form-panel > p { margin: 0 0 23px; color: var(--muted); }
.support-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.form-field { display: grid; gap: 7px; }
.form-field label { font-size: 13px; font-weight: 650; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--bg);
  color: var(--text);
}
.form-field textarea { resize: vertical; }
.field-message, .form-note, .form-status, .support-form button { grid-column: 1 / -1; }
.form-note, .form-status { margin: 0; color: var(--muted); font-size: 13px; }
.form-status { min-height: 1.4em; }
.support-form button { justify-self: start; }
.honeypot-field { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
.submission-success {
  display: grid;
  justify-items: center;
  padding: 28px 12px 34px;
  text-align: center;
  animation: success-appear .42s cubic-bezier(.2,.8,.2,1) both;
}
.success-icon {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border: 1px solid color-mix(in srgb, #22a06b 34%, var(--border));
  border-radius: 50%;
  background: color-mix(in srgb, #22a06b 13%, var(--surface));
  color: #16845a;
  font-size: 39px;
  font-weight: 750;
  line-height: 1;
  animation: success-check .5s .12s cubic-bezier(.16,1.4,.45,1) both;
}
.submission-success h3 { margin: 18px 0 5px; font-size: 25px; letter-spacing: -.04em; }
.submission-success p { max-width: 540px; margin: 5px 0; color: var(--muted); }
.submission-success .success-reference { margin-top: 14px; padding: 7px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); font-size: 13px; font-weight: 650; }
.success-contact { margin-top: 10px; color: var(--brand); font-weight: 650; }
@keyframes success-appear { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes success-check { from { opacity: 0; transform: scale(.45) rotate(-20deg); } to { opacity: 1; transform: scale(1) rotate(0); } }

.not-found { width: min(700px, calc(100% - 48px)); min-height: 60vh; margin: 0 auto; padding: 100px 0; text-align: center; }
.not-found h1 { margin: 12px 0; font-size: clamp(34px, 5vw, 52px); letter-spacing: -.05em; line-height: 1.1; }
.not-found p { color: var(--muted); }
.not-found-actions { display: flex; justify-content: center; gap: 12px; margin-top: 25px; }
.site-footer { display: flex; min-height: 84px; align-items: center; justify-content: space-between; gap: 18px; padding: 18px max(24px, calc((100% - 1120px) / 2)); border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.site-footer a:first-child { color: var(--text); font-weight: 650; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

@media (max-width: 900px) {
  .header-inner { width: min(100% - 36px, 760px); gap: 14px; }
  .main-nav { gap: 15px; }
  .header-actions { gap: 7px; }
  .header-cta { padding: 0 12px; }
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .article-aside { position: static; grid-row: 1; }
  .article-aside ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-content { grid-row: 2; }
}
@media (max-width: 820px) {
  .header-inner { width: calc(100% - 32px); min-height: 66px; }
  .brand-mark { width: 38px; height: 38px; }
  .main-nav { position: absolute; top: calc(100% + 1px); right: 0; left: 0; display: none; flex-direction: column; align-items: stretch; gap: 0; padding: 8px 16px 14px; border-bottom: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); }
  .main-nav.is-open { display: flex; }
  .main-nav a { padding: 12px; }
  .header-actions { margin-left: auto; }
  .header-actions .header-cta { display: none; }
  .header-action { min-width: 38px; height: 38px; }
  .menu-button { display: inline-flex; min-height: 40px; align-items: center; padding: 0 11px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); font-size: 12px; }
  .home-hero { padding: 62px 18px 56px; }
  .hero-subtitle { font-size: 16px; }
  .search-box { min-height: 60px; margin-top: 25px; }
  .search-box input { padding: 0 9px; font-size: 14px; }
  .search-submit { min-height: 44px; padding: 0 14px; font-size: 13px; }
  .content-section, .popular-section { width: calc(100% - 32px); margin: 50px auto; }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .category-card { min-height: 200px; padding: 17px; border-radius: 16px; }
  .category-card h3 { margin-top: 13px; font-size: 16px; }
  .category-card p { font-size: 13px; }
  .popular-grid, .search-result-list { grid-template-columns: minmax(0, 1fr); }
  .breadcrumbs, .article-layout, .article-pager { width: calc(100% - 32px); }
  .breadcrumbs { margin-top: 20px; }
  .article-aside ul { grid-template-columns: minmax(0, 1fr); }
  .article-header { padding-top: 10px; }
  .article-lead { font-size: 16px; }
  .article-section { padding: 21px 0; }
  .article-section h2 { font-size: 20px; }
  .support-banner { width: calc(100% - 32px); align-items: flex-start; flex-direction: column; margin: 40px auto 54px; padding: 22px; }
  .form-panel { width: calc(100% - 32px); padding: 21px; }
  .support-form { grid-template-columns: minmax(0, 1fr); }
  .field-message, .form-note, .form-status, .support-form button { grid-column: 1; }
  .not-found-actions { align-items: center; flex-direction: column; }
  .site-footer { align-items: flex-start; flex-direction: column; padding: 20px 16px; }
}
@media (max-width: 360px) {
  .header-inner { gap: 8px; }
  .brand { gap: 8px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-text strong { font-size: 12px; }
  .brand-text small { font-size: 11px; }
  .header-actions .header-action:first-child { display: none; }
  .menu-button { min-height: 38px; padding: 0 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #10121b;
    --surface: #191c28;
    --surface-soft: #222637;
    --text: #f0f2fb;
    --muted: #a5abc0;
    --border: #30364a;
    --brand: #a2a3ff;
    --brand-strong: #c1c2ff;
    --brand-soft: #292b4d;
    --warning: #352d1e;
    --warning-border: #695426;
    --shadow: 0 18px 50px rgb(0 0 0 / 20%);
  }
}
