:root {
  --bg: #0b0e14;
  --surface: #131823;
  --surface-2: #1a2130;
  --ink: #e9edf5;
  --muted: #8b95a7;
  --line: #232b3a;
  --mathe: #4da3ff;
  --mathe-soft: rgba(77,163,255,.12);
  --religion: #f2b04a;
  --religion-soft: rgba(242,176,74,.12);
  --radius: 16px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--bg); line-height: 1.55; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 48px 48px; mask-image: linear-gradient(to bottom, #000 0, transparent 900px); }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* Topbar */
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(11,14,20,.75); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -.01em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--mathe), var(--religion)); color: #0b0e14; font-weight: 800; font-size: 14px; }
.nav { display: flex; gap: 24px; }
.nav a { text-decoration: none; color: var(--muted); font-size: 15px; transition: color .15s; }
.nav a:hover { color: var(--ink); }

/* Hero */
.hero { position: relative; padding: 96px 0 72px; overflow: hidden; }
.hero::before, .hero::after { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; filter: blur(110px); opacity: .35; z-index: -1; }
.hero::before { background: var(--mathe); top: -260px; left: -140px; }
.hero::after { background: var(--religion); top: -200px; right: -180px; opacity: .22; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 20px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.03);
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #3ddc97; box-shadow: 0 0 10px #3ddc97; }
h1 { margin: 0; font-weight: 800; font-size: clamp(42px, 7vw, 76px); line-height: 1.02; letter-spacing: -.035em; }
h1 .amp { background: linear-gradient(90deg, var(--mathe), var(--religion)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { max-width: 600px; margin: 22px 0 44px; font-size: 19px; color: var(--muted); }

.subjects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; max-width: 780px; }
.subject { position: relative; display: flex; align-items: center; gap: 16px; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  cursor: pointer; text-align: left; transition: transform .2s, border-color .2s, box-shadow .2s; }
.subject:hover { transform: translateY(-3px); }
.subject-mathe:hover { border-color: var(--mathe); box-shadow: 0 10px 40px -10px rgba(77,163,255,.45); }
.subject-religion:hover { border-color: var(--religion); box-shadow: 0 10px 40px -10px rgba(242,176,74,.4); }
.subject-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 14px; flex: none; }
.subject-icon svg { width: 30px; height: 30px; }
.subject-mathe .subject-icon { background: var(--mathe-soft); color: var(--mathe); }
.subject-religion .subject-icon { background: var(--religion-soft); color: var(--religion); }
.subject-text { display: flex; flex-direction: column; flex: 1; }
.subject-text strong { font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.subject-text small { color: var(--muted); font-family: var(--mono); font-size: 13px; }
.arrow { font-size: 20px; color: var(--muted); transition: transform .2s, color .2s; }
.subject:hover .arrow { transform: translateX(4px); color: var(--ink); }

/* Materials */
.materials { padding: 56px 0 88px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
h2 { margin: 0; font-weight: 800; font-size: 34px; letter-spacing: -.03em; }
.result-count { margin: 0; color: var(--muted); font-family: var(--mono); font-size: 13px; }

.filters { display: flex; flex-direction: column; gap: 14px; margin-bottom: 32px; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: rgba(19,24,35,.6); }
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; width: fit-content; }
.tab { border: 0; background: transparent; padding: 8px 18px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--muted); transition: color .15s, background .15s; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px #2e384b; }
.filter-row { display: flex; gap: 12px; flex-wrap: wrap; }
.search { flex: 1 1 280px; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; transition: border-color .15s; }
.search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search input { border: 0; outline: 0; background: transparent; width: 100%; padding: 12px 0; }
.search input::placeholder { color: #5f697b; }
.search:focus-within, select:focus { border-color: var(--mathe); }
select { padding: 12px 38px 12px 14px; border: 1px solid var(--line); border-radius: 12px; outline: 0; cursor: pointer; appearance: none;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238b95a7' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 14px center; }

.group { margin-bottom: 40px; }
.group-title { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; font-family: var(--mono); font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 500; }
.group-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

.card { position: relative; display: flex; flex-direction: column; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color .2s, transform .2s; }
.card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, var(--accent), transparent); }
.card:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); transform: translateY(-2px); }
.card.mathe { --accent: var(--mathe); --soft: var(--mathe-soft); }
.card.religion { --accent: var(--religion); --soft: var(--religion-soft); }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.pill { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--soft); color: var(--accent); }
.pill.plain { background: var(--surface-2); color: var(--muted); font-weight: 500; }
.card h3 { margin: 0 0 6px; font-size: 18px; line-height: 1.3; letter-spacing: -.01em; }
.card .thema { margin: 0 0 10px; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.card .desc { margin: 0 0 20px; font-size: 15px; color: #b6bfcd; }
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.date { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.download { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px; background: var(--accent); color: #0b0e14; text-decoration: none; font-size: 14px; font-weight: 700; transition: box-shadow .2s, filter .2s; }
.download:hover { filter: brightness(1.08); box-shadow: 0 0 24px -4px var(--accent); }
.download svg { width: 16px; height: 16px; }

.empty { padding: 48px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }

/* Contact & footer */
.contact { padding: 0 0 72px; }
.contact-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 40px; border: 1px solid var(--line); border-radius: 24px;
  background: radial-gradient(600px 200px at 0% 0%, var(--mathe-soft), transparent), radial-gradient(600px 200px at 100% 100%, var(--religion-soft), transparent), var(--surface); }
.contact p { margin: 6px 0 0; color: var(--muted); }
.btn { display: inline-block; padding: 12px 20px; border-radius: 12px; background: var(--ink); color: var(--bg); text-decoration: none; font-weight: 700; transition: transform .15s; }
.btn:hover { transform: translateY(-1px); }
.footer { padding: 24px 0 32px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer a:hover { color: var(--ink); }

/* Impressum page */
.page { padding: 64px 24px 80px; max-width: 760px; }
.page h1 { font-size: 44px; margin-bottom: 28px; }
.page h2 { font-size: 22px; margin: 36px 0 8px; letter-spacing: -.01em; }
.page p { color: #b6bfcd; }
.page a { color: var(--mathe); }

@media (max-width: 640px) {
  .nav a[data-goto] { display: none; }
  .subjects { grid-template-columns: 1fr; }
  .hero { padding: 64px 0 48px; }
  .lead { font-size: 17px; }
  select { flex: 1 1 45%; }
  .contact-inner { padding: 28px; }
}
