/* ============================================
   AUSZEICHNUNGSSCHRIFT
   Inter, auf den Zeichenvorrat der Hauptseiten zugeschnitten.
   Nur für Überschriften, Knöpfe, Kachelbeschriftungen und Navigation —
   Fließtext bleibt in der Systemschrift.
   ============================================ */
/* Das hidden-Attribut muss jede display-Regel schlagen — sonst bleiben
   Elemente sichtbar, die per JavaScript versteckt werden. */
[hidden] { display: none !important; }

@font-face {
  font-family: "Inter";
  src: url("fonts/inter-teilmenge.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ============================================
   DESIGN TOKENS
   ============================================ */
:root {
  /* Farben */
  --bg-body: #fbfcfd;
  --surface: #ffffff;
  --surface-alt: #f7f9fc;
  --border: #dde3ec;
  --border-strong: #c8d1e0;

  --text-headline: #0f2a4d;
  --text-body: #1a1f2e;
  --text-muted: #5a6478;

  --accent: #1d4f8b;
  --accent-hover: #2d6dba;
  --accent-soft: #e8eef7;

  /* Logo-Rot (sparsam als Zweitfarbe) */
  --logo-red: #ff2d2d;
  --logo-red-soft: #ffe8e8;

  /* Schatten */
  --shadow-card: 0 1px 3px rgba(15, 42, 77, 0.06), 0 4px 12px rgba(15, 42, 77, 0.04);
  --shadow-card-hover: 0 4px 12px rgba(15, 42, 77, 0.1), 0 12px 32px rgba(15, 42, 77, 0.08);
  --shadow-soft: 0 1px 2px rgba(15, 42, 77, 0.04);

  /* Geometrie */
  --radius: 12px;
  --radius-sm: 8px;

  /* Schriftgrößen — eine Skala, acht Stufen. Keine Zwischenwerte mehr. */
  --fs-xxs:  11px;   /* Abzeichen, Kachel-Etiketten */
  --fs-xs:   13px;   /* Fußzeile, Bildunterschriften */
  --fs-sm:   15px;   /* Kacheltitel, Navigation */
  --fs-base: 16px;   /* Fließtext */
  --fs-md:   19px;   /* Zwischenüberschriften */
  --fs-lg:   22px;   /* Kartentitel */
  --fs-xl:   28px;   /* Abschnittsüberschriften */
  --fs-2xl:  36px;   /* Seitentitel */
  --fs-3xl:  44px;   /* Hero */

  /* Typo */
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Maße */
  --container: 1200px;
  --topbar-height: 64px;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--text-body);
  background: var(--bg-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

img, svg {
  display: block;
  max-width: 100%;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ============================================
   LAYOUT — CONTAINER
   ============================================ */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================
   TOPBAR
   ============================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.topbar-inner {
  max-width: 1800px;
  margin: 0 auto;
  padding: 0 32px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--text-headline);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.logo-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.logo-dot {
  color: var(--accent);
}

.logo:hover {
  color: var(--text-headline);
}

.nav {
  display: flex;
  gap: 8px;
}

.nav a {
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-weight: 600;
  font-size: var(--fs-sm);
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.nav a:hover {
  background: transparent;
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 5px;
}

/* Mobile-Toggle erstmal versteckt (nur visueller Hint, Funktion kommt später) */
.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  color: var(--text-headline);
}

/* ============================================
   SECTION BASIS
   ============================================ */
section {
  padding: 64px 0;
}

.section-header {
  margin-bottom: 40px;
}

.section-header h2 {
  font-size: var(--fs-xl);
  font-weight: 600;
  color: var(--text-headline);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.section-header p {
  color: var(--text-muted);
  font-size: var(--fs-base);
  max-width: 640px;
}

/* ============================================
   KATEGORIE-KACHELN (4 oben)
   ============================================ */
.categories {
  padding-top: 32px;
  padding-bottom: 32px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.category-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.category-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-strong);
  color: inherit;
}

.category-video {
  position: relative;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  aspect-ratio: 16 / 9;
  margin-bottom: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-video::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, var(--border) 1px, transparent 0);
  background-size: 16px 16px;
  opacity: 0.5;
  pointer-events: none;
}

.video-placeholder-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-soft);
}

.video-placeholder-icon svg {
  width: 16px;
  height: 16px;
  fill: var(--accent);
  margin-left: 2px;
}

.video-placeholder-label {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-size: var(--fs-xxs);
  color: var(--text-muted);
  background: var(--surface);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  z-index: 1;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.category-icon {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.category-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

.category-tile h3 {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text-headline);
  letter-spacing: -0.01em;
}

.category-tile p {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  line-height: 1.45;
}

/* ============================================
   HERO
   ============================================ */
.hero {
  padding: 62px 0 40px;
  position: relative;
  overflow: hidden;
  background: var(--bg-body);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, var(--border-strong) 1px, transparent 0);
  background-size: 32px 32px;
  opacity: 0.4;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.1fr;   /* Text links, Vorschauen rechts als 2x2 */
  gap: 44px;
  align-items: center;
}

.hero-text {
  text-align: left;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
  padding: 6px 14px;
  background: var(--accent-soft);
  border-radius: 20px;
}

/* Roter Punkt als dezenter Logo-Akzent */
.hero-eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--logo-red, #ff2d2d);
  flex-shrink: 0;
}

.hero h1 {
  font-size: var(--fs-2xl);
  font-weight: 400;
  color: var(--text-headline);
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin-bottom: 20px;
}

.hero-subline {
  font-size: var(--fs-md);
  color: var(--text-body);
  line-height: 1.55;
  margin-bottom: 10px;
  max-width: 520px;
}
.hero-subline-extra {
  font-size: var(--fs-base);
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 28px;
  max-width: 520px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--accent);
  color: white;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--fs-base);
  transition: background-color 0.15s, transform 0.15s;
  box-shadow: var(--shadow-soft);
}

.hero-cta:hover {
  background: var(--accent-hover);
  color: white;
  transform: translateY(-1px);
}

.hero-cta svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* ============================================
   HERO-TILES (Mini-Kategorie-Kacheln rechts im Hero)
   ============================================ */
/* ============================================
   MOTIVKACHELN im Hero — dekorativ, ohne Verweis
   ============================================ */
.hero-motive {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 484px;      /* Kachel 153 px, rund 40 Prozent groesser als zuvor */
  justify-self: start;   /* linksbuendig in der rechten Spalte — naeher am Hero-Text */
}

.motiv-kachel {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--stage-bg);
  border: 1px solid var(--border);
}

.motiv-clip {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 1023px) {
  /* Hero einspaltig: die sechs Motive stehen in einer Reihe unter dem Text. */
  .hero-motive {
    max-width: none;
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .hero-motive {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
}

.hero-tiles {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;

  width: 100%;
  max-width: 474px;   /* 30 % schmaler als zuvor (677 px bei 1440 px Fensterbreite) */
  justify-self: end;
}

.hero-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.hero-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-strong);
  color: inherit;
}

.hero-tile-video {
  position: relative;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  aspect-ratio: 8 / 3;
  margin-bottom: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Punkt-Muster nur wenn KEIN Video drin (Platzhalter-Modus) */
.hero-tile-video:not(:has(.hero-tile-clip))::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, var(--border) 1px, transparent 0);
  background-size: 12px 12px;
  opacity: 0.5;
  pointer-events: none;
}

/* Das Video füllt die Kachel komplett, beschneidet bei Bedarf */
.hero-tile-clip {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-tile-play {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  box-shadow: var(--shadow-card);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* Play-Button nur zeigen, wenn Autoplay blockiert ist (Klasse via JS) */
.hero-tile-video.needs-play .hero-tile-play {
  opacity: 1;
  pointer-events: auto;
}

.hero-tile-play svg {
  width: 16px;
  height: 16px;
  fill: var(--accent);
  margin-left: 2px;
}

.hero-tile-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 2px 2px;
}

.hero-tile-icon {
  width: 18px;
  height: 18px;
  color: var(--accent);
  flex-shrink: 0;
}

.hero-tile-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
}

.hero-tile-title {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-headline);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

/* ============================================
   KATEGORIE-ERKLÄR-LEISTE (über den Demos)
   ============================================ */
.category-explainer {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.cat-col {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid rgba(29, 79, 139, 0.35);
  transition: background-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.cat-col:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.cat-col:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.cat-col:hover {
  background: var(--accent-soft);
  color: inherit;
}

.cat-col h3 {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.01em;
  transition: color 0.15s;
}

.cat-col:hover h3 {
  color: var(--accent);
}

.cat-col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.cat-col-arrow {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.5;
  transition: transform 0.15s, opacity 0.15s;
}

.cat-col:hover .cat-col-arrow {
  transform: translateX(3px);
  opacity: 1;
}

.cat-col-icon {
  width: 24px;
  height: 24px;
  color: var(--accent);
  flex-shrink: 0;
}

.cat-col-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

.cat-col p {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============================================
   DEMO-KACHELN (8 in 2 Reihen)
   ============================================ */
.demos {
  padding-top: 48px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.demo-grid {
  display: grid;
  /* Vier Spalten, vier Zeilen, spaltenweise gefuellt:
     jede Spalte enthaelt eine Kategorie. */
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, auto);
  grid-auto-flow: column;
  gap: 20px;
}

/* Gruppenüberschriften nur am Handy sichtbar */
.demo-group-head {
  display: none;
}

/* Blaue Umrandung für die Demo-Kacheln auf der Startseite (wie Kategorie-Seiten) */
.demo-grid .demo-tile {
  border: 1px solid var(--accent);
}

.demo-grid .demo-tile:hover {
  border-color: var(--accent-hover);
}

.demo-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.demo-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-strong);
  color: inherit;
}

.demo-screenshot {
  background: var(--surface-alt);
  aspect-ratio: 2 / 1;
  position: relative;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Karo-Muster nur bei Platzhaltern (ohne Bild) */
.demo-screenshot:not(:has(img))::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.35;
  pointer-events: none;
}

/* Echter Screenshot füllt die Kachel-Vorschau */
.demo-screenshot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Kachel-Feintuning: Metallgitter größer und zentral (UI-Ballast oben/unten ausblenden) */
.demo-screenshot img.tile-fit-metallgitter {
  object-position: center 34%;
  transform: scale(1.85);
}

.demo-screenshot-icon {
  width: 38px;
  height: 38px;
  color: var(--border-strong);
  position: relative;
  z-index: 1;
}

.demo-screenshot-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

.demo-screenshot-label {
  position: absolute;
  bottom: 6px;
  right: 6px;
  font-size: var(--fs-xxs);
  color: var(--text-muted);
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  z-index: 2;
}

.demo-body {
  padding: 10px 14px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.demo-tag {
  font-size: var(--fs-xxs);
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.demo-tile h4 {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-headline);
  line-height: 1.3;
  letter-spacing: -0.01em;
  /* Lange zusammengesetzte Woerter (z. B. "Elektronendichteoberflaeche") passen
     auf schmalen Bildschirmen nicht in eine Zeile. Der Browser darf sie deshalb
     trennen: bevorzugt nach den Silbenregeln (lang="de" ist gesetzt), notfalls
     innerhalb des Wortes. */
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: break-word;
  word-break: normal;
}

/* Formel-Untertitel unter dem Kachel-Titel (z.B. Rechen-Sims) */
.demo-formel {
  display: block;
  margin-top: 3px;
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.3;
  letter-spacing: 0;
}

/* ============================================
   ADRESSATEN-BLOCK (Lehrkräfte / Eltern & Schüler)
   ============================================ */
.audiences {
  padding: 80px 0;
}

.audiences-header {
  margin-bottom: 48px;
}

.audiences-header h2 {
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--text-headline);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.audiences-header p {
  font-size: var(--fs-base);
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
}

.audience-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

.audience-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-card);
}

.audience-icon {
  width: 40px;
  height: 40px;
  color: var(--accent);
  margin-bottom: 16px;
}

.audience-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

.audience-card h3 {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text-headline);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.audience-lead {
  font-size: var(--fs-sm);
  color: var(--text-body);
  margin-bottom: 20px;
  font-weight: 500;
}

.audience-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.audience-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: var(--fs-sm);
  color: var(--text-body);
  line-height: 1.5;
}

.audience-list li svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 3px;
  color: var(--accent);
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
}

.audiences-cta-wrap {
  text-align: center;
}

.audiences-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--fs-sm);
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s;
}

.audiences-cta:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.audiences-cta svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.audiences-cta-note {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-top: 12px;
}

/* ============================================
   FOOTER
   ============================================ */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 40px 0 32px;
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--text-headline);
  letter-spacing: -0.02em;
}

.footer-brand-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.footer-brand-dot {
  color: var(--accent);
}

.footer-tagline {
  margin-top: 4px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-bottom {
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* ============================================
   RESPONSIVE — Tablet
   ============================================ */
@media (max-width: 1023px) {
  .demo-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: none;
    grid-auto-flow: row;
    gap: 16px;
  }
  /* Gruppenüberschriften als dezente klickbare Links (Icon + Text + Pfeil) */
  .demo-group-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    grid-column: 1 / -1;
    margin: 20px 0 4px;
    text-decoration: none;
    color: inherit;
  }
  .demo-group-head:first-child {
    margin-top: 0;
  }
  .demo-group-icon {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    margin-top: 2px;
    color: var(--accent);
  }
  .demo-group-icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    pointer-events: none;
  }
  .demo-group-title {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: var(--fs-md);
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
  }
  .demo-group-arrow {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.55;
    transition: transform 0.15s, opacity 0.15s;
  }
  .demo-group-desc {
    display: block;
    font-size: var(--fs-sm);
    color: var(--text-muted, #555);
    margin-top: 2px;
    line-height: 1.4;
  }
  .demo-group-head:hover .demo-group-title {
    text-decoration: underline;
  }
  .demo-group-head:hover .demo-group-arrow {
    transform: translateX(3px);
    opacity: 1;
  }
  /* Alte Erklär-Leiste ausblenden — Texte stehen jetzt bei den Gruppen */
  .category-explainer {
    display: none;
  }
  .audience-grid {
    grid-template-columns: 1fr;
  }
  .hero h1 {
    font-size: var(--fs-2xl);
  }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  /* Der Hero ist jetzt einspaltig — die frueher noetige Deckelung auf 520px
     wuerde die vier Vorschauen unnoetig schmal machen. */
  .hero-tiles {
    max-width: none;
    margin: 0;
  }
}

/* ============================================
   RESPONSIVE — Mobile
   ============================================ */
@media (max-width: 640px) {
  /* Topbar darf am Handy zweizeilig werden: feste Höhe aufheben */
  .topbar {
    height: auto;
  }
  /* Vier Nav-Buttons direkt zeigen, kompakt in einer Reihe (Hamburger entfällt) */
  .topbar-inner {
    flex-wrap: wrap;
    padding: 10px 16px;
    gap: 10px 0;
  }
  .logo {
    font-size: var(--fs-lg);
  }
  .nav {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    gap: 5px;
  }
  .nav a {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    padding: 8px 4px;
    font-size: var(--fs-xs);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .menu-toggle {
    display: none;
  }
  .demo-grid {
    gap: 14px;
  }
  .hero {
    padding: 32px 0 48px;
  }
  .hero h1 {
    font-size: var(--fs-xl);
  }
  .hero-subline {
    font-size: var(--fs-base);
  }
  .hero-subline-extra {
    font-size: var(--fs-sm);
  }
  .hero-tiles {
    gap: 12px;
    max-width: none;
  }
  .hero-tile {
    padding: 12px;
  }
  .hero-tile-title {
    font-size: var(--fs-base);
  }
  section {
    padding: 48px 0;
  }
  .section-header h2 {
    font-size: var(--fs-xl);
  }
  .audiences {
    padding: 56px 0;
  }
  .audiences-header h2 {
    font-size: var(--fs-xl);
  }
  .audience-card {
    padding: 24px;
  }
  .audience-card h3 {
    font-size: var(--fs-lg);
  }
  .footer-top {
    flex-direction: column;
  }
}

/* ============================================
   CATEGORY-PAGE (Übersichtsseiten der vier Kategorien)
   ============================================ */
.category-page {
  max-width: var(--container);
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.category-page-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 28px;
}

/* Thematische Sektion innerhalb einer Kategorie-Seite */
.category-section {
  margin-bottom: 48px;
  padding-left: 40px;
  padding-right: 40px;
}

/* Erste Sektion etwas tiefer für mehr Luft zum Header */
.category-section:first-of-type {
  margin-top: 16px;
}

.category-section:last-of-type {
  margin-bottom: 0;
}

.category-section-title {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.01em;
  margin-bottom: 18px;
  padding-left: 14px;
  border-left: 3px solid var(--accent);
  line-height: 1.2;
}

.category-page-icon {
  width: 44px;
  height: 44px;
  color: var(--accent);
  margin: 0 auto 14px;
}

.category-page-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

.category-page-title {
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--text-headline);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 8px;
}

.category-page-description {
  font-size: var(--fs-base);
  color: var(--text-body);
  line-height: 1.55;
}

.category-page-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

/* Viewer-Seite: 3 Spalten, größere Kacheln */
.viewer-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin: 0 auto;
}

/* Tool-Seite: 3 Spalten, größere Kacheln (wie Viewer) */
.tool-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

/* Dünne dunkelblaue Umrandung für Kontrast (nur Kategorie-Seiten) */
.category-page-grid .demo-tile {
  border: 1px solid var(--accent);
}

.category-page-grid .demo-tile:hover {
  border-color: var(--accent-hover);
}

/* Kompaktere Variante der demo-tile innerhalb von Kategorie-Seiten */
.category-page-grid .demo-body {
  padding: 8px 12px 12px;
  gap: 3px;
}

.category-page-grid .demo-tag {
  font-size: var(--fs-xxs);
}

.category-page-grid .demo-tile h4 {
  font-size: var(--fs-xs);
  line-height: 1.3;
}

.category-page-grid .demo-screenshot-icon {
  width: 32px;
  height: 32px;
}

.category-page-grid .demo-screenshot-label {
  font-size: var(--fs-xxs);
  padding: 2px 5px;
  bottom: 5px;
  right: 5px;
}

/* Status-Hinweis, dass die Inhalte noch in Vorbereitung sind */
.category-page-note {
  max-width: 720px;
  margin: 40px auto 0;
  padding: 16px 20px;
  background: var(--accent-soft);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  color: var(--text-body);
  line-height: 1.6;
  text-align: center;
}

@media (max-width: 1023px) {
  .category-page-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .category-page-title {
    font-size: var(--fs-2xl);
  }
}

@media (max-width: 640px) {
  .category-page {
    padding: 40px 20px 56px;
  }
  .category-section {
    padding-left: 16px;
    padding-right: 16px;
  }
  .category-page-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .category-page-title {
    font-size: var(--fs-xl);
  }
  .category-page-description {
    font-size: var(--fs-sm);
  }
  .category-page-icon {
    width: 44px;
    height: 44px;
  }
  .category-section-title {
    font-size: var(--fs-base);
  }
}

/* ============================================
   LERNEN-ÜBEN-SPEZIFISCHE STYLES
   ============================================ */

/* 5 Spielformat-Erklärungen oben */
.lue-formats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 40px;
}

.lue-format {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 14px;
  text-align: center;
}

.lue-format-icon {
  width: 32px;
  height: 32px;
  color: var(--accent);
  margin: 0 auto 10px;
}

.lue-format-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

.lue-format h3 {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-headline);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.lue-format p {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  line-height: 1.45;
}

/* Matrix-Layout: Themen × Formate */
.lue-matrix {
  display: grid;
  grid-template-columns: 200px repeat(5, 1fr);
  gap: 10px;
  align-items: stretch;
}

/* Erste Zelle oben links — leer */
.matrix-corner {
  /* keine Inhalte, nur Platzhalter im Grid */
}

/* Spaltenüberschriften (SC, MC, …) */
.matrix-header {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--accent);
  text-align: center;
  padding: 8px 4px;
  letter-spacing: -0.01em;
}

/* Themen-Beschriftung links */
.matrix-theme {
  background: var(--accent-soft);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-headline);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* Matrix-Kachel (Zelle) */
.matrix-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  color: var(--text-body);
  font-size: var(--fs-xxs);
  min-height: 64px;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s, color 0.15s;
  cursor: pointer;
}

.matrix-cell:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
  border-color: var(--border-strong);
  color: var(--accent);
}

.matrix-cell-icon {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: color 0.15s;
}

.matrix-cell:hover .matrix-cell-icon {
  color: var(--accent);
}

.matrix-cell-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

/* Premium-Kennzeichnung: dezentes Schloss rechts unten (dunkelblau auf hell).
   Kachel bleibt vorerst klickbar; harte Sperre folgt im Architektur-Durchgang. */
.matrix-cell {
  position: relative;
}
.matrix-cell-lock {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 16px;
  height: 16px;
  color: var(--accent);
  opacity: 0.85;
  pointer-events: none;
}
.matrix-cell-lock svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}
.matrix-cell:hover .matrix-cell-lock {
  opacity: 1;
}

/* Premium-Schloss auf Screenshot-Kacheln (sim/tool/viewer): unten rechts in der
   weißen Body-Leiste, schlicht dunkelblau (analog lue-Matrix-Schloss). */
.demo-tile .demo-body {
  position: relative;
}
.demo-tile-lock {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 16px;
  height: 16px;
  color: var(--accent);
  opacity: 0.85;
  pointer-events: none;
}
.demo-tile-lock svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* Responsive: Matrix wird auf Tablet/Mobile horizontal scrollbar */
@media (max-width: 900px) {
  .lue-formats {
    grid-template-columns: repeat(2, 1fr);
  }
  .lue-matrix-wrapper {
    overflow-x: auto;
    margin: 0 -16px;
    padding: 0 16px;
  }
  .lue-matrix {
    min-width: 720px;
  }
}

@media (max-width: 640px) {
  .lue-formats {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}


/* ============================================
   CONTENT-PAGE (Pflicht-/Info-Seiten)
   ============================================ */
.content-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

.content-header {
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.content-header h1 {
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--text-headline);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  overflow-wrap: break-word;
}

.content-meta {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.content-page section {
  margin-bottom: 32px;
}

.content-page h2 {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--text-headline);
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.content-page h3 {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-headline);
  margin-top: 14px;
  margin-bottom: 6px;
}

.content-page p {
  margin-bottom: 10px;
  line-height: 1.7;
  color: var(--text-body);
}

.content-page p:last-child {
  margin-bottom: 0;
}

.content-page address {
  font-style: normal;
  line-height: 1.7;
  margin-bottom: 10px;
}

.content-page ul {
  margin: 8px 0 12px 24px;
  padding: 0;
}

.content-page ul li {
  line-height: 1.7;
  margin-bottom: 4px;
  color: var(--text-body);
}

.content-page a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

.content-page a:hover {
  color: var(--accent-hover);
}

.content-page small {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* Kontakt-spezifische Komponenten */
.contact-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin: 8px 0 32px;
  box-shadow: var(--shadow-soft);
}

.contact-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.contact-email {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  display: inline-block;
  letter-spacing: -0.01em;
}

.contact-email:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Platzhalter-Markierung — visuell unübersehbar zum Ausfüllen */
.placeholder {
  display: inline-block;
  background: var(--accent-soft);
  border: 1px dashed var(--accent);
  border-radius: 4px;
  padding: 1px 8px;
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--accent);
}

/* Hinweisbox — für Hinweise an dich, kommt später raus */
.editor-note {
  background: #fff8e1;
  border: 1px solid #f0c040;
  border-left: 4px solid #f0a020;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 24px 0 32px;
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: #5a4400;
}

.editor-note strong {
  color: #3d2e00;
}

/* Status-Box für Stub-Seiten (AGB, Widerruf vor Verkaufsstart) */
.status-box {
  background: var(--accent-soft);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin: 8px 0 32px;
}

.status-box-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.status-box h3 {
  margin-top: 0 !important;
}

.status-box p:last-child {
  margin-bottom: 0;
}

/* Platzhalter-Markierung — visuell unübersehbar zum Ausfüllen */
.placeholder {
  display: inline-block;
  background: var(--accent-soft);
  border: 1px dashed var(--accent);
  border-radius: 4px;
  padding: 1px 8px;
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--accent);
}

/* Hinweisbox — für Hinweise an dich, kommt später raus */
.editor-note {
  background: #fff8e1;
  border: 1px solid #f0c040;
  border-left: 4px solid #f0a020;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 24px 0 32px;
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: #5a4400;
}

.editor-note strong {
  color: #3d2e00;
}

/* ============================================
   RESPONSIVE — sehr schmale Geräte (Nav-Buttons noch kompakter)
   ============================================ */
@media (max-width: 380px) {
  .nav a {
    font-size: var(--fs-xxs);
    padding: 7px 2px;
    letter-spacing: -0.01em;
  }
}


/* ============================================
   RESPONSIVE — Handy im Querformat (niedrige Höhe, quer)
   Vier Hero-Kacheln in einer Reihe; Demo-Gruppen bleiben geordnet.
   ============================================ */
@media (orientation: landscape) and (max-height: 600px) {
  .hero-tiles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-width: none;
    gap: 14px;
  }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  /* Kacheln ~50% größer: höheres Vorschauformat + mehr Innenabstand */
  .hero-tile {
    padding: 14px;
  }
  .hero-tile-video {
    aspect-ratio: 4 / 3;
  }
  .hero-tile-title {
    font-size: var(--fs-base);
  }
  .hero-tile-icon {
    width: 30px;
    height: 30px;
  }
}


/* ============================================
   SCHÜLER-SEKTION — Lernen-Üben Beispiele (horizontale Scroller)
   ============================================ */
.lue-showcase {
  padding: 64px 0;
  /* Zart getönter Hintergrund: hebt die Schüler-Sektion zurückhaltend ab.
     Oben heller Blauton, unten ein Hauch Logo-Rot — sehr dezent. */
  background:
    linear-gradient(180deg, var(--accent-soft) 0%, var(--surface-alt) 55%, var(--logo-red-soft) 140%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.lue-showcase-header {
  margin-bottom: 32px;
}

.lue-showcase-header h2 {
  font-size: var(--fs-xl);
  color: var(--text-headline);
  margin: 0 0 12px;
}

.lue-showcase-intro {
  font-size: var(--fs-base);
  color: var(--text-body);
  line-height: 1.6;
  max-width: 680px;
  margin: 0 0 10px;
}

.lue-showcase-note {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  max-width: 680px;
  margin: 0;
}

.lue-showcase-note a {
  color: var(--accent);
  font-weight: 600;
}

.lue-row {
  margin-bottom: 28px;
}

.lue-row-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: var(--fs-md);
  color: var(--accent);
  margin: 0 0 12px;
}

/* Dezenter roter Akzentpunkt (Logo-Rot) vor dem Reihen-Titel */
.lue-row-title::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--logo-red, #ff2d2d);
  flex-shrink: 0;
}

/* Wrapper für Scroller + Pfeil-Buttons */
.lue-scroller-wrap {
  position: relative;
}

/* Der horizontal scrollbare Bereich */
.lue-scroller {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;  /* sanftes Touch-Scrollen iOS */
  scroll-snap-type: x proximity;
  padding: 4px 2px 12px;
  /* Sanftes Ausblenden am rechten Rand als "mehr"-Hinweis */
  -webkit-mask-image: linear-gradient(to right, #000 0, #000 92%, transparent 100%);
  mask-image: linear-gradient(to right, #000 0, #000 92%, transparent 100%);
}

/* Am rechten Ende angekommen: kein Verblassen mehr (letzte Kachel scharf) */
.lue-scroller.at-end {
  -webkit-mask-image: none;
  mask-image: none;
}
/* Ganz am Anfang: optional auch links nichts ausblenden (Standard ohnehin links scharf) */

/* Scrollleiste dezent */
.lue-scroller::-webkit-scrollbar {
  height: 8px;
}
.lue-scroller::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}
.lue-scroller::-webkit-scrollbar-track {
  background: transparent;
}

/* Einzelne Kachel (ohne Bild) */
.lue-card {
  flex: 0 0 auto;
  width: 218px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.lue-card-bild {
  display: block;
  height: 88px;
  border-bottom: 1px solid var(--border);
}

.lue-card-bild svg { width: 100%; height: 100%; display: block; }

.lue-card-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 11px 13px 12px;
  flex: 1;
}

.lue-card-fuss {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.lue-card-los { font-weight: 600; white-space: nowrap; }

.lue-card.f-zu   .lue-card-bild { background: #e8f1fc; } .lue-card.f-zu   .lue-card-los { color: #1565c0; }
.lue-card.f-sc   .lue-card-bild { background: #e2f6f1; } .lue-card.f-sc   .lue-card-los { color: #00796b; }
.lue-card.f-mc   .lue-card-bild { background: #f0eaff; } .lue-card.f-mc   .lue-card-los { color: #6a3fd0; }
.lue-card.f-fill .lue-card-bild { background: #fdf0e2; } .lue-card.f-fill .lue-card-los { color: #b85c00; }
.lue-card.f-bs   .lue-card-bild { background: #fdeaf1; } .lue-card.f-bs   .lue-card-los { color: #c2185b; }

/* Wenn die Kachel später ein Link wird (a.lue-card): klickbar */
a.lue-card {
  cursor: pointer;
}

.lue-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--accent-hover);
  color: inherit;
}

.lue-card-title {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-headline);
  line-height: 1.35;
}

.lue-card-topic {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-top: auto;
}

/* Pfeil-Buttons (nur Desktop sinnvoll) */
.lue-scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.15s, background-color 0.15s;
}

.lue-scroller-wrap:hover .lue-scroll-btn {
  opacity: 1;
}

.lue-scroll-btn:hover {
  background: var(--accent-soft);
}

.lue-scroll-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lue-scroll-prev { left: -8px; }
.lue-scroll-next { right: -8px; }

/* Touch-Geräte: Pfeile ausblenden, nur Wischen */
@media (pointer: coarse) {
  .lue-scroll-btn {
    display: none;
  }
}

/* Handy: kleinere Kacheln, mehr Anschnitt der nächsten */
@media (max-width: 640px) {
  .lue-showcase {
    padding: 48px 0;
  }
  .lue-showcase-header h2 {
    font-size: var(--fs-xl);
  }
  .lue-card {
    width: 186px;
    padding: 0;
  }
  .lue-card-bild { height: 72px; }
  .lue-card-body { padding: 10px 11px 11px; gap: 4px; }
  .lue-card-title { font-size: var(--fs-sm); }
  .lue-card-fuss { font-size: var(--fs-xs); padding-top: 6px; }
  .lue-scroller {
    gap: 12px;
  }
}


/* ============================================
   SUCHE-LUPE in der Top-Navigation
   ============================================ */
.nav a.nav-suche {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  padding: 0 14px;
  height: 38px;
  border-radius: 999px;
  color: var(--accent);
  background: transparent;
  
  font-weight: 600;
  white-space: nowrap;
}
.nav a.nav-suche svg {
  width: 20px;
  height: 20px;
  min-width: 20px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.nav a.nav-suche .nav-suche-label {
  font-size: var(--fs-sm);
  color: #ff2d2d;
}
.nav a.nav-suche:hover {
  color: var(--accent);
  background: rgba(29, 79, 139, 0.18);
  border-color: rgba(29, 79, 139, 0.48);
}
/* Am Handy (hochkant): nur Lupe, Text ausblenden */
@media (max-width: 640px) {
  .nav a.nav-suche {
    flex: 0 0 auto;
    width: 40px;
    padding: 0;
    gap: 0;
  }
  .nav a.nav-suche .nav-suche-label {
    display: none;
  }
}

/* ============================================
   PREMIUM-MODAL — dezenter Hinweis bei Klick auf gesperrte Premium-Kachel.
   Erscheint nur, wenn eine Premium-Kachel keinen echten Link hat (Hoster-Build).
   Text bewusst ohne App-Verweis (Rechtsseiten-Regel) — später per Einzeiländerung.
   ============================================ */
.premium-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 42, 77, 0.32);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.premium-modal-backdrop.open {
  display: flex;
}
.premium-modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card-hover);
  max-width: 320px;
  width: 100%;
  padding: 26px 22px 22px;
  text-align: center;
  position: relative;
  animation: premium-modal-in 0.16s ease both;
}
@keyframes premium-modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.premium-modal-x {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.premium-modal-x:hover {
  background: var(--surface-alt);
  color: var(--text-headline);
}
.premium-modal-x svg {
  width: 16px; height: 16px;
  stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round;
}
.premium-modal-icon {
  width: 32px;
  height: 32px;
  margin: 0 auto 12px;
  color: var(--accent);
}
.premium-modal-icon svg {
  width: 100%; height: 100%;
  stroke: currentColor; fill: none; stroke-width: 2;
}
.premium-modal-text {
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--text-body);
  margin: 0;
}


/* ============================================================
   SCHNELLSUCHE auf der Startseite (Prototyp)
   Suchfeld und Themenknoepfe. Fuehrt auf suche.html, dort werden
   ?q= und ?thema= ausgewertet.
   ============================================================ */
.startsuche {
  background: var(--surface-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 28px 0 30px;
}

.startsuche-titel {
  margin: 0 0 14px;
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--text-headline);
  letter-spacing: -0.01em;
}

/* Beschriftung nur fuer Screenreader */
.startsuche-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.startsuche-feldzeile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 560px;
}

.startsuche-lupe {
  position: absolute;
  left: 12px;
  /* An der Hoehe des Eingabefelds ausrichten, nicht an der ganzen Zeile.
     Sonst rutscht die Lupe nach unten, sobald der Knopf auf schmalen
     Bildschirmen in die zweite Zeile umbricht. */
  top: 21px;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  pointer-events: none;
}

.startsuche-feld {
  flex: 1;
  min-width: 0;
  padding: 11px 14px 11px 40px;
  font-family: var(--font-main);
  font-size: var(--fs-base);          /* 16px verhindert das Hineinzoomen auf iOS */
  color: var(--text-body);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
}

.startsuche-feld::placeholder { color: var(--text-muted); }

.startsuche-feld:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.startsuche-knopf {
  flex: 0 0 auto;
  padding: 11px 20px;
  font-family: var(--font-main);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.startsuche-knopf:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.startsuche-knopf:focus-visible { outline: 2px solid var(--text-headline); outline-offset: 2px; }

.startsuche-oder {
  margin: 18px 0 8px;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.startsuche-themen {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.startsuche-themen a {
  display: inline-block;
  padding: 7px 14px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  transition: background 0.15s, border-color 0.15s;
}

.startsuche-themen a:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.startsuche-themen a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.startsuche-themen .startsuche-alle {
  color: var(--text-muted);
  background: transparent;
  border-style: dashed;
}

/* Zweite Reihe: Darstellungsformen. Etwas zurueckhaltender als die Themen,
   damit die inhaltliche Reihe die erste Aufmerksamkeit behaelt. */
.startsuche-formen a {
  font-size: var(--fs-xs);
  padding: 6px 12px;
  color: var(--text-body);
}

.startsuche-formen a:hover {
  background: var(--surface-alt);
  border-color: var(--text-muted);
}

/* Tablet (quer) und kleine Notebooks behalten die spaltenweise Anordnung:
   eine Kategorie je Spalte. Erst darunter wird auf zwei Spalten umgestellt. */
@media (min-width: 900px) and (max-width: 1023px) {
  .demo-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, auto);
    grid-auto-flow: column;
    gap: 14px;
  }
}

@media (max-width: 560px) {
  .startsuche { padding: 22px 0 24px; }
  .startsuche-titel { font-size: var(--fs-md); }
  .startsuche-feldzeile { flex-wrap: wrap; }
  .startsuche-knopf { width: 100%; }
  .startsuche-themen a { font-size: var(--fs-xs); padding: 6px 12px; }

  /* Auf schmalen Bildschirmen bleiben vier Themen und der Sammel-Link stehen.
     Die Darstellungsformen entfallen ganz: Wer gezielt nach einer Formelart
     filtert, tut das eher am Rechner. Alles bleibt ueber die Suchseite
     erreichbar. */
  .startsuche-themen > li:nth-child(n+6):not(:last-child) { display: none; }
  .startsuche-formen,
  .startsuche-oder-formen { display: none; }
}


/* ============================================================
   BREITER CONTAINER
   Kachelbereiche nutzen dieselbe Innenbreite wie die Kopfleiste.
   Fliesstext bleibt im schmalen .container - sonst werden die
   Zeilen zu lang.
   ============================================================ */
.container-wide {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ============================================================
   FORMAT-KACHELN (fuenf Aufgabenarten)
   ============================================================ */
.format-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 32px;
}

.format-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.format-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-strong);
}

.format-card-bild {
  display: block;
  height: 96px;
  border-bottom: 1px solid var(--border);
}

.format-card-bild svg { width: 100%; height: 100%; display: block; }

.format-card-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px 14px 14px;
}

.format-card-name {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.format-card-desc {
  font-size: var(--fs-sm);
  color: var(--text-body);
  line-height: 1.4;
}

/* Farbe je Format. Bildflaeche hell, Beschriftung dunkler -
   die leuchtenden Toene erreichen als Text keine 4,5:1. */
.f-zu   .format-card-bild { background: #e8f1fc; } .f-zu   .format-card-name { color: #1565c0; }
.f-sc   .format-card-bild { background: #e2f6f1; } .f-sc   .format-card-name { color: #00796b; }
.f-mc   .format-card-bild { background: #f0eaff; } .f-mc   .format-card-name { color: #6a3fd0; }
.f-fill .format-card-bild { background: #fdf0e2; } .f-fill .format-card-name { color: #b85c00; }
.f-bs   .format-card-bild { background: #fdeaf1; } .f-bs   .format-card-name { color: #c2185b; }

/* Formatkennung auf den Karten des Schiebers */
.lue-card-form {
  font-size: var(--fs-xxs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lue-card.f-zu   .lue-card-form { color: #1565c0; }
.lue-card.f-sc   .lue-card-form { color: #00796b; }
.lue-card.f-mc   .lue-card-form { color: #6a3fd0; }
.lue-card.f-fill .lue-card-form { color: #b85c00; }
.lue-card.f-bs   .lue-card-form { color: #c2185b; }

.lue-mix-mehr {
  margin: 16px 0 0;
  font-size: var(--fs-sm);
}

.lue-mix-mehr a { color: var(--accent); font-weight: 600; text-decoration: none; }
.lue-mix-mehr a:hover { text-decoration: underline; }

/* Zielgruppen-Abschnitt: je Spalte ein Weiterfuehrungs-Link */
.audience-cta {
  display: inline-block;
  margin-top: 16px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.audience-cta:hover { text-decoration: underline; }

@media (max-width: 1023px) {
  .container-wide { padding: 0 24px; }
  .format-cards { grid-template-columns: repeat(3, 1fr); }
}

/* Auf dem Handy werden aus den Bildkacheln farbige Knoepfe: fuenf Kacheln
   ergaeben dort ein 2-2-1-Raster mit einer haengenden Kachel und rund 540px
   Hoehe. Die Formatbezeichnung steht ohnehin auch auf jeder Aufgabenkarte. */
@media (max-width: 640px) {
  .format-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
  }
  .format-card {
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    border-radius: 999px;
    border-width: 1px;
  }
  .format-card:hover { transform: none; box-shadow: none; }
  .format-card-bild,
  .format-card-desc { display: none; }
  /* Mindestens 44px hoch: darunter werden Beruehrungsziele unzuverlaessig. */
  .format-card-body { padding: 11px 16px; gap: 0; }
  .format-card-name { font-size: var(--fs-xs); letter-spacing: 0.03em; }

  .format-card.f-zu   { background: #e8f1fc; border-color: #a8c9ec; }
  .format-card.f-sc   { background: #e2f6f1; border-color: #99d6c9; }
  .format-card.f-mc   { background: #f0eaff; border-color: #c3aef2; }
  .format-card.f-fill { background: #fdf0e2; border-color: #efc191; }
  .format-card.f-bs   { background: #fdeaf1; border-color: #f0a8c2; }
}
/* ============================================================
   THEMENUEBERSICHT auf lue.html
   ============================================================ */
.lue-hub-titel {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--text-headline);
  letter-spacing: -0.01em;
  margin: 40px 0 16px;
}

.thema-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}

.thema-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 16px 16px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.thema-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--accent);
}

.thema-card-name {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--accent);
  line-height: 1.3;
}

.thema-card-desc {
  font-size: var(--fs-xs);
  color: var(--text-body);
  line-height: 1.4;
}

.thema-card-zahl {
  margin-top: auto;
  padding-top: 8px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1023px) {
  .thema-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .thema-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .thema-card { padding: 13px 13px 12px; }
  .thema-card-name { font-size: var(--fs-sm); }
  .thema-card-desc { display: none; }
  .lue-hub-titel { font-size: var(--fs-md); margin: 28px 0 12px; }
}

/* Der Zielgruppen-Abschnitt liegt im breiten Container, damit die Ueberschrift
   mit den uebrigen fluchtet. Die beiden Textspalten bleiben aber schmal. */
.audiences .audience-grid { max-width: 1152px; }

/* ============================================================
   THEMENSEITEN (Periodensystem, Formeln, Reaktionsgleichungen)
   ============================================================ */
/* Themenseiten stehen enger als die Kategorieseiten. */
.thema-seite { padding: 28px 24px 40px; }
.thema-seite .category-page-header { margin-bottom: 14px; }

/* Kopfzeile ueber der Ueberschrift einer Themenseite. */
.thema-kicker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: var(--fs-xxs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 16px;
}

/* Feine Striche links und rechts statt einer Pille — damit sich die Zeile
   klar von den Sprungmarken darunter unterscheidet. */
.thema-kicker::before,
.thema-kicker::after {
  content: "";
  width: 34px;
  height: 1px;
  background: var(--border);
}

@media (max-width: 400px) {
  .thema-kicker {
    letter-spacing: 0.08em;
    gap: 9px;
  }
  .thema-kicker::before,
  .thema-kicker::after { width: 18px; }
}

.thema-sprung {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.thema-sprung a {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 7px 15px;
  text-decoration: none;
}

.thema-sprung a:hover { border-color: var(--accent); }

/* Am Handy nimmt die Sprungleiste mehr Platz als sie einbringt. */
@media (max-width: 767px) {
  .thema-sprung { display: none; }
}

/* section erbt sonst 64 px Innenabstand aus der Grundregel. */
.thema-abschnitt { margin-bottom: 24px; padding: 0; scroll-margin-top: 84px; }

/* Formelgrafik steht unmittelbar rechts neben der Überschrift. */
.thema-abschnitt-kopf {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 22px;
  margin-bottom: 4px;
}
.thema-abschnitt-kopf h2 { margin-bottom: 0; }

.thema-abschnitt h2 {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--text-headline);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

/* Fließtext nutzt die volle Seitenbreite. */
.thema-abschnitt-text {
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--text-body);
  margin-bottom: 10px;
}
.thema-abschnitt-text:last-of-type { margin-bottom: 14px; }

.thema-werkzeuge {
  grid-template-columns: repeat(4, 1fr) !important;
  grid-template-rows: none !important;
  grid-auto-flow: row !important;
  margin-bottom: 16px;
  align-items: start;
}

/* Der kurze Text zu den Werkzeugen steht rechts neben den Kacheln und belegt
   dafür die freien Spalten des Vierer-Rasters. Bei vier Kacheln bleibt keine
   Spalte frei — dann steht er wie bisher darunter. */
.thema-werkzeuge-text {
  font-size: var(--fs-base);
  font-weight: 600;
  line-height: 1.55;
  color: var(--text-body);
  margin: 0;
  align-self: center;
  max-width: 62ch;
}
.thema-werkzeuge-text.spalten-1 { grid-column: span 1; }
.thema-werkzeuge-text.spalten-2 { grid-column: span 2; }
.thema-werkzeuge-text.spalten-3 { grid-column: span 3; }

/* Untergliederung der Aufgabenlisten nach Stoffklassen (Themenseiten). */
.thema-ue-gruppe {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-headline);
  margin: 14px 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-subtle);
}
.thema-ue-gruppe:first-of-type { margin-top: 0; }

/* Hervorgehobene Formelzeile im Fließtext der Themenseiten. */
.thema-formel {
  font-weight: 500;
  color: var(--text-headline);
  margin: 4px 0 14px;
  padding-left: 14px;
  border-left: 3px solid var(--accent);
}

/* Formelgrafik rechts neben der Abschnittsüberschrift (Inline-SVG, kein Bild). */
.formel-bild { flex: 0 0 auto; margin: 0; line-height: 0; }
.formel-bild svg { max-width: 100%; height: auto; }

.thema-ue-titelzeile {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.thema-ue-liste {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

/* Auf breiten Fenstern vier Spalten — die Liste nutzt die volle Breite. */
@media (min-width: 1200px) {
  .thema-ue-liste { grid-template-columns: repeat(4, 1fr); }
}

.thema-ue {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 8px 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.thema-ue:hover { border-color: var(--accent); box-shadow: var(--shadow-card); }

.thema-ue-art {
  flex-shrink: 0;
  font-size: var(--fs-xxs);
  font-weight: 700;
  letter-spacing: .02em;
  padding: 3px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

.thema-ue-titel { font-size: var(--fs-sm); line-height: 1.35; color: var(--text-headline); }

.thema-ue.f-zu   .thema-ue-art { color: #1565c0; background: #e8f1fc; }
.thema-ue.f-sc   .thema-ue-art { color: #00796b; background: #e2f6f1; }
.thema-ue.f-mc   .thema-ue-art { color: #6a3fd0; background: #f0eaff; }
.thema-ue.f-fill .thema-ue-art { color: #b85c00; background: #fdf0e2; }
.thema-ue.f-bs   .thema-ue-art { color: #c2185b; background: #fdeaf1; }

@media (max-width: 1023px) {
  .thema-werkzeuge { grid-template-columns: repeat(2, 1fr) !important; }
  .thema-ue-liste { grid-template-columns: repeat(2, 1fr); }
  /* Ab hier ist keine Spalte mehr übrig: Text unter die Kacheln, volle Breite. */
  .thema-werkzeuge-text,
  .thema-werkzeuge-text.spalten-1,
  .thema-werkzeuge-text.spalten-2,
  .thema-werkzeuge-text.spalten-3 { grid-column: 1 / -1; max-width: none; margin-top: 4px; }
}

@media (max-width: 640px) {
  .thema-ue-liste { grid-template-columns: 1fr; }
  .thema-abschnitt h2 { font-size: var(--fs-lg); }
  /* Am Handy steht die Formel unter der Überschrift. */
  .thema-abschnitt-kopf { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* ---------- Auszeichnungen in Inter ---------- */
h1, h2, h3, h4, h5,
button, .hero-cta, .audience-cta, .audiences-cta, .startsuche-knopf,
.logo, .nav a, .nav a.nav-suche .nav-suche-label, .menu-toggle,
.hero-eyebrow, .hero-tile-title, .hero-tile-meta,
.demo-tag, .demo-tile h4, .demo-group-title, .demo-screenshot-label,
.category-page-grid .demo-tag, .category-page-grid .demo-tile h4,
.category-page-grid .demo-screenshot-label,
.category-page-title, .category-section-title, .category-tile h3,
.cat-col h3, .format-card-name, .contact-label, .status-box-label,
.startsuche-titel, .startsuche-label, .startsuche-themen a, .startsuche-formen a,
.thema-card-name, .thema-card-zahl, .thema-ue-art, .thema-ue-titel, .thema-sprung a,
.lue-card-title, .lue-card-topic, .lue-card-form, .lue-card-los, .lue-row-title,
.lue-hub-titel, .lue-scroll-btn, .matrix-theme, .matrix-cell,
.footer-brand, .footer-links a, .video-placeholder-label,
.demo-formel, .audiences-cta-note,
/* Suchseite (eigene Klassen, gleiche Rollen) */
.fl-titel, .fl-zeile label, .fl-name, .fl-anzahl, .filter-knopf, .reset-btn,
.mehr-btn, .chip, .aktiv-chip, .treffer-art, .treffer-badge, .treffer-gruppe-title {
  font-family: var(--font-display);
}

/* Zwischen 641 und 899 px lief die Kopfzeile über: Die Navigation behielt dort
   volle Größe, obwohl der Platz nicht reicht. Abstand und Innenabstand werden
   in diesem Bereich verkleinert — die Schriftgröße bleibt. */
@media (min-width: 641px) and (max-width: 899px) {
  .nav { gap: 4px; }
  .nav a { padding: 9px 12px; }
  .nav a.nav-suche { padding: 0 10px; gap: 6px; }
}

/* Unterhalb von 780 px reicht auch das nicht: dort zusätzlich eine Stufe kleiner. */
@media (min-width: 641px) and (max-width: 779px) {
  .nav { gap: 3px; }
  .nav a { padding: 8px 8px; font-size: var(--fs-xs); }
  .nav a.nav-suche { padding: 0 9px; }
  .nav a.nav-suche .nav-suche-label { font-size: var(--fs-xs); }
}

/* Lange Themennamen dürfen das Raster nicht auseinanderdrücken (Überlauf bei 320 px). */
.thema-card { min-width: 0; }
.thema-card-name { min-width: 0; overflow-wrap: anywhere; }
.thema-ue { min-width: 0; }
.thema-ue-titel { min-width: 0; overflow-wrap: anywhere; }
h1 { overflow-wrap: break-word; }

/* Bei 320 px ist die Navigation auf 55 px je Eintrag gedeckelt. Inter baut etwas
   breiter, dadurch wurde „3D Viewer" abgeschnitten — hier zwei Pixel zurückholen. */
@media (max-width: 380px) {
  .nav a { padding: 7px 1px; letter-spacing: -0.02em; }
}

/* Kacheltexte: überall Platz für zwei Zeilen, damit die Kacheln gleich hoch sind.
   Auf schmalen Kacheln bleibt der Umbruch frei — dort passen viele Titel nicht
   in zwei Zeilen, und Abschneiden wäre schlimmer als eine dritte Zeile. */
.demo-tile h4 { min-height: calc(2 * 1.3em); }

@media (min-width: 1280px) {
  .demo-tile h4 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

/* ---------- Aufklappmenüs in der Kopfzeile ---------- */
.nav-menu { position: relative; display: inline-flex; align-items: center;
            min-width: 0; flex: 0 1 auto; }
.nav-menu > a { min-width: 0; }
.nav-menu > a { padding-right: 2px; }
.nav-menu-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 38px; padding: 0; margin-right: 2px;
  background: none; border: 0; cursor: pointer;
  color: var(--accent); font: inherit;
}
.nav-menu-toggle svg { width: 11px; height: 8px; transition: transform 0.15s; }
.nav-menu.offen .nav-menu-toggle svg { transform: rotate(180deg); }
.nav-menu-panel {
  position: absolute; top: calc(100% + 6px); left: auto; right: 0; z-index: 210;
  min-width: 260px; max-width: 320px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-card-hover);
  display: flex; flex-direction: column;
}
.nav .nav-menu-panel a {
  flex: 0 0 auto;          /* die Handy-Regel .nav a { flex: 1 1 0 } würde die
                              Einträge in der Höhe auf null zusammendrücken */
  text-align: left;
  overflow: visible;
  padding: 8px 12px; border-radius: 6px; border: 0; background: none;
  font-size: var(--fs-sm); font-weight: 500; color: var(--text-body);
  white-space: normal; line-height: 1.3;
}
.nav .nav-menu-panel a:hover { background: var(--surface-alt); color: var(--accent); text-decoration: none; }
.nav .nav-menu-uebersicht { font-weight: 600; color: var(--accent) !important; border-bottom: 1px solid var(--border) !important; border-radius: 6px 6px 0 0 !important; margin-bottom: 2px; }


/* Sprungziele nicht unter die klebende Kopfzeile schieben */
.category-section-title { scroll-margin-top: 84px; }
/* Am Handy bricht die Kopfzeile um; seit dem fünften Eintrag „Formel-Trainer"
   trägt sie dort eine dritte Zeile. Gemessen: 146 px ab 640 px abwärts,
   178 px bei 320 px, wo zusätzlich der Schriftzug umbricht. */
/* Das Training-Menü steht am Rechner links vor den drei Kategoriemenüs und
   ist durch Abstand und eine feine Linie abgesetzt — es führt auf Themenseiten,
   nicht auf Kategorieübersichten. */
.nav { flex: 1 1 auto; justify-content: flex-end; }

/* Das Trainingsmenü führt inzwischen 15 Themenseiten — in einer Spalte würde die
   Klappe 547 px hoch. Deshalb zwei Spalten, sobald Platz ist. */
.nav-menu-panel#menu-training {
  display: grid;
  grid-auto-flow: column;                 /* spaltenweise füllen: links 1-8, rechts 9-15 */
  grid-template-rows: repeat(8, auto);
  column-gap: 4px;
  width: max-content;
  max-width: min(560px, calc(100vw - 32px));
}
@media (max-width: 640px) {
  .nav-menu-panel#menu-training { max-width: none; }
}

.nav .nav-menu[data-menu="training"] {
  order: -1;
  margin-left: 40px;           /* Abstand zum Schriftzug */
  margin-right: auto;          /* schiebt die drei Kategoriemenüs nach rechts */
}

/* Unter 1024 px wird der Abstand knapp — Trennlinie schmaler statt Beschriftung
   abschneiden. */
@media (max-width: 1023px) {
  .nav .nav-menu[data-menu="training"] { margin-left: 20px; }
}

/* Am Handy passen vier Aufklappmenüs plus Suche nicht in eine Zeile — gemessen
   wird ab 640 px abwärts jede Beschriftung abgeschnitten. „Training" bekommt
   dort deshalb eine eigene, vollbreite Zeile; die erste Zeile bleibt genau so,
   wie sie bis v213 war. Die Kopfzeile ist damit 146 px hoch, bei 320 px 178 px. */
@media (max-width: 640px) {
  .nav { flex-wrap: wrap; }
  .nav .nav-menu[data-menu="training"] {
    flex: 1 0 100%;
    order: 9;
    justify-content: center;
    margin-left: 0;
    margin-right: 0;
  }
  .nav .nav-menu[data-menu="training"] .nav-menu-panel { left: 0; right: 0; }

  .category-section-title { scroll-margin-top: 168px; }
  .thema-abschnitt        { scroll-margin-top: 168px; }
}
@media (max-width: 380px) {
  .category-section-title { scroll-margin-top: 200px; }
  .thema-abschnitt        { scroll-margin-top: 200px; }
}

/* Unterhalb von 641 px trägt der Umbruch die Kopfzeile; die Menü-Hüllen dürfen
   dabei genauso schrumpfen wie einfache Verweise. */
@media (max-width: 640px) {
  /* Die Hülle darf NICHT abschneiden — sonst wird das Aufklappmenü beschnitten.
     Gekürzt wird nur die Beschriftung selbst. */
  .nav-menu { flex: 0 1 auto; overflow: visible; }
  .nav-menu > a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* Zwischen 641 und 779 px wird es eng: Pfeile und Innenabstände schmaler. */
@media (min-width: 641px) and (max-width: 779px) {
  .nav-menu-toggle { width: 14px; }
  .nav a { padding: 8px 4px; }
  .nav { gap: 2px; }
}

/* Auf Berührungsgeräten braucht der Pfeil eine größere Trefferfläche. */
@media (hover: none) and (pointer: coarse) and (min-width: 641px) {
  .nav-menu-toggle { width: 40px; }
}

/* Am Handy bleiben die Pfeile sichtbar; der Platz reicht seit dem Wegfall
   des Eintrags „Übungsaufgaben". Trefferfläche wie bei den Verweisen. */
@media (max-width: 640px) {
  .nav-menu-toggle { width: 22px; height: 32px; }
  .nav-menu-panel { min-width: 0; width: min(280px, calc(100vw - 24px)); }
}

/* Am Handy spannt sich das Menü über die Fensterbreite statt am Knopf zu hängen —
   sonst ragt es bei den rechten Einträgen über den Rand. Die Höhe setzt das
   Skript, weil die Kopfzeile dort umbricht. */
@media (max-width: 640px) {
  .nav-menu-panel {
    position: fixed;
    left: 12px; right: 12px; width: auto; min-width: 0; max-width: none;
    max-height: 62vh; overflow-y: auto;
  }
}


/* Unsichtbare Bruecke zwischen Knopf und Menue, damit der Zeiger auf dem Weg
   nach unten nicht ins Leere faehrt und das Menue zuklappt. */
.nav-menu.offen::after {
  content: ""; position: absolute; top: 100%; left: 0; right: 0; height: 10px;
}


/* ============================================================
   SCHLANKE AUSZEICHNUNG
   Die Hero-Zeile der Startseite stand als einzige Auszeichnung auf
   Stärke 400 und liest sich deutlich ruhiger als der Rest. Dieser
   Block zieht die übrigen Auszeichnungen nach:

     grosse Überschriften                  700/600 -> 400
     Zwischenüberschriften, Kacheln, Knöpfe    600 -> 500

   Nicht angefasst: kleine Versalien-Marken (Formatkennung,
   Aufgabenart, Augenbraue über dem Hero) und der Schriftzug — bei
   11 bis 13 px und Grossbuchstaben wird 400 fadenscheinig.
   Inter ist als variable Schrift 100-900 eingebunden; die Änderung
   lädt kein zusätzliches Byte.
   ============================================================ */

.content-header h1,
.category-page-title,
.category-section-title,
.thema-abschnitt h2,
.audiences-header h2,
.section-header h2,
.content-page h2,
.demo-group-title {
  font-weight: 400;
  letter-spacing: -0.015em;
}

.cat-col h3,
.audience-card h3,
.category-tile h3,
.content-page h3,
.lue-format h3,
.demo-tile h4,
.hero-tile-title,
.thema-card-name,
.thema-ue-gruppe,
.lue-card-title,
.lue-hub-titel,
.startsuche-titel,
.format-card-name {
  font-weight: 500;
  letter-spacing: -0.01em;
}

.hero-cta,
.thema-sprung a,
.nav a,
.nav a.nav-suche,
.nav .nav-menu-uebersicht,
.startsuche-knopf,
.audiences-cta,
.audience-cta,
.lue-showcase-note a,
.lue-mix-mehr a,
.lue-card-los,
.contact-email {
  font-weight: 500;
}
