/* Schriftkatalog von Starte sichtbar. Der Rahmen der Seite steht in der Systemschrift, damit allein die Proben in den
   Karten die Schriften des Katalogs zeigen. Die Schriften der Karten kommen über --t (Überschrift), --x (Text) und
   --tg (Gewicht der Überschrift) aus dem style-Attribut jeder Karte. */
:root {
  --papier: #f8f5ef;
  --tinte: #1f1c19;
  --leise: #5d5750;
  --linie: #ddd5c8;
  --akzent: #8f4527;
  --akzent-hell: #f3e3d8;
  --karte: #ffffff;
  --probe-grund: #ffffff;
  --probe-tinte: #1f1c19;
  --probe-leise: #5d5750;
  --rand: 32px;
  color-scheme: light;
}
:root[data-grund="creme"] { --probe-grund: #f2e9da; --probe-tinte: #2b2620; --probe-leise: #625849; }
:root[data-grund="dunkel"] { --probe-grund: #17211d; --probe-tinte: #efe8da; --probe-leise: #b9b1a3; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* Abstand für Sprünge zu einer Karte (#nr-3), damit sie nicht unter der Werkzeugleiste liegt. Bewusst nicht als
   scroll-padding am html: Dann schiebt der Browser die Seite beim Tippen ins Namensfeld der Leiste weg */
.karte, .gruppe { scroll-margin-top: 14rem; }
body {
  margin: 0;
  background: var(--papier);
  color: var(--tinte);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
a { color: var(--akzent); text-underline-offset: 0.15em; }
.rahmen { max-width: 76rem; margin: 0 auto; padding-left: var(--rand); padding-right: var(--rand); }
.sprung { position: absolute; left: -9999px; }
.sprung:focus { left: 1rem; top: 1rem; z-index: 20; background: var(--tinte); color: var(--papier); padding: 0.5rem 1rem; }

/* Kopf */
.kopf { padding: 4.5rem 0 2.5rem; }
.marke { margin: 0 0 1rem; font-size: 0.85rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--akzent); font-weight: 600; }
.kopf h1 { margin: 0; font-size: clamp(2.2rem, 5.5vw, 3.6rem); line-height: 1.05; letter-spacing: -0.02em; font-weight: 700; max-width: 18ch; }
.einleitung { max-width: 44rem; font-size: 1.125rem; color: var(--leise); margin: 1.25rem 0 0; }
.schritte { list-style: none; counter-reset: s; padding: 0; margin: 2rem 0 0; display: grid; gap: 0.75rem 2rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); max-width: 60rem; }
.schritte li { counter-increment: s; position: relative; padding-left: 2.4rem; color: var(--leise); }
.schritte li::before { content: counter(s); position: absolute; left: 0; top: -0.1rem; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--tinte); color: var(--papier); font-weight: 600; font-size: 0.9rem; display: grid; place-items: center; }
.schritte strong { color: var(--tinte); }

/* Werkzeugleiste, bleibt beim Scrollen oben. Ohne JavaScript täte sie nichts, dann bleibt sie weg */
.ohne-js .werkzeug { display: none; }
.werkzeug { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--papier) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-top: 1px solid var(--linie); border-bottom: 1px solid var(--linie); }
.werkzeug-innen { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; align-items: end; padding-top: 0.85rem; padding-bottom: 0.5rem; }
.feld { display: flex; flex-direction: column; gap: 0.25rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.feld > span, .feld legend { font-size: 0.8rem; font-weight: 600; color: var(--leise); padding: 0; }
.feld input, .feld select {
  font: inherit; color: var(--tinte); background: #fff; border: 1px solid var(--linie); border-radius: 10px;
  min-height: 44px; padding: 0 0.85rem; width: 15rem; max-width: 100%;
}
.feld input:focus-visible, .feld select:focus-visible, .chip:focus-visible, .knopf:focus-visible, .merken:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; }
.grund { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.grund legend { width: 100%; margin-bottom: 0.25rem; float: left; }
.filter { display: flex; gap: 0.4rem; overflow-x: auto; padding-top: 0.25rem; padding-bottom: 0.75rem; scrollbar-width: none; }
.filter::-webkit-scrollbar { display: none; }
/* Am Rechner alle Wirkungen sichtbar, am Handy wischbar in einer Zeile */
@media (min-width: 640px) { .filter { flex-wrap: wrap; overflow-x: visible; } }
.chip {
  font: inherit; font-size: 0.92rem; min-height: 40px; padding: 0 1rem; border-radius: 999px; cursor: pointer; white-space: nowrap;
  background: transparent; color: var(--tinte); border: 1px solid var(--linie);
}
.chip:hover { border-color: var(--tinte); }
.chip[aria-pressed="true"] { background: var(--tinte); color: var(--papier); border-color: var(--tinte); }

/* Reiter für die drei Ansichten */
.reiter { display: flex; gap: 0.25rem; padding-top: 0.75rem; overflow-x: auto; scrollbar-width: none; }
.reiter::-webkit-scrollbar { display: none; }
.reiter-knopf {
  font: inherit; font-weight: 600; min-height: 44px; padding: 0 1.1rem; border: 0; border-radius: 10px 10px 0 0; cursor: pointer;
  background: transparent; color: var(--leise); white-space: nowrap; border-bottom: 3px solid transparent;
}
.reiter-knopf[aria-selected="true"] { color: var(--tinte); border-bottom-color: var(--akzent); }
.reiter-knopf:focus-visible { outline: 3px solid var(--akzent); outline-offset: -3px; }
.anzahl { font-weight: 400; color: var(--leise); font-variant-numeric: tabular-nums; }
.ohne-js .reiter { display: none; }

/* Mit JavaScript nur die gewählte Ansicht und nur die Bedienelemente, die dort etwas tun. Ohne stehen alle
   Ansichten untereinander, jede mit Überschrift */
:root:not(.ohne-js) .ansicht { display: none; }
:root[data-ansicht="paare"]:not(.ohne-js) [data-bereich="paare"],
:root[data-ansicht="schriften"]:not(.ohne-js) [data-bereich="schriften"] { display: block; }
:root:not([data-ansicht="paare"]) .nur-paare,
:root:not([data-ansicht="schriften"]) .nur-schriften { display: none; }
.ansicht-titel { font-size: 2rem; margin: 3rem 0 0; }
:root:not(.ohne-js) .ansicht-titel { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ansicht-satz { max-width: 44rem; color: var(--leise); margin: 2.5rem 0 0; }
.ansicht-satz p { margin: 0 0 0.75rem; }

/* Gruppen und Karten */
.gruppe { padding: 3rem 0 0.5rem; }
.gruppe[hidden] { display: none; }
.gruppe-kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1.25rem; margin-bottom: 1.25rem; }
.gruppe-kopf h2 { margin: 0; font-size: 1.6rem; letter-spacing: -0.01em; }
.gruppe-kopf p { margin: 0; color: var(--leise); max-width: 40rem; }
.karten { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); }
.karte {
  display: flex; flex-direction: column; background: var(--karte); border: 1px solid var(--linie); border-radius: 18px; overflow: hidden;
  /* Karten außerhalb des Bildschirms zeichnet der Browser nicht, damit lädt er ihre Schriften erst beim Hinscrollen */
  content-visibility: auto; contain-intrinsic-size: auto 34rem;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.karte[hidden] { display: none; }
.karte.gemerkt { border-color: var(--akzent); box-shadow: 0 0 0 2px var(--akzent); }
.karte-kopf { display: flex; align-items: center; gap: 0.6rem; padding: 0.75rem 0.75rem 0.75rem 1.25rem; border-bottom: 1px solid var(--linie); }
.nr { font-weight: 700; font-variant-numeric: tabular-nums; }
.paarname { color: var(--leise); flex: 1; }
.merken {
  display: inline-flex; align-items: center; gap: 0.4rem; font: inherit; font-size: 0.9rem; min-height: 40px; padding: 0 0.85rem;
  border-radius: 999px; border: 1px solid var(--linie); background: transparent; color: var(--tinte); cursor: pointer;
}
.merken svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.merken[aria-pressed="true"] { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.merken[aria-pressed="true"] svg { fill: currentColor; }

.probe { background: var(--probe-grund); color: var(--probe-tinte); padding: 1.75rem 1.5rem 1.6rem; font-family: var(--x), system-ui, sans-serif; transition: background 0.2s, color 0.2s; }
.probe-marke { font-family: var(--t), Georgia, serif; font-weight: 400; font-synthesis-weight: none; font-size: 1.15rem; margin: 0 0 1.4rem; overflow-wrap: anywhere; }
.probe-titel { font-family: var(--t), Georgia, serif; font-weight: var(--tg); font-synthesis-weight: none; font-size: clamp(1.9rem, 3.2vw, 2.35rem); line-height: 1.1; margin: 0 0 0.9rem; letter-spacing: -0.005em; overflow-wrap: break-word; hyphens: auto; }
.probe-klein { font-family: var(--t), Georgia, serif; font-weight: var(--tk); font-synthesis-weight: none; font-size: 1.5rem; line-height: 1.2; margin: 0 0 0.75rem; overflow-wrap: break-word; }
.probe-text { margin: 0 0 1rem; font-size: 1.0625rem; line-height: 1.6; }
.probe-text strong { font-weight: 700; }
.probe-termin { margin: 0; font-size: 0.95rem; color: var(--probe-leise); font-variant-numeric: lining-nums; }

/* Einzelne Schrift: Titel und Text in derselben Schrift */
.probe-einzel .probe-marke { font-size: clamp(1.9rem, 3.2vw, 2.35rem); line-height: 1.1; margin-bottom: 1rem; }
.einzel-satz { font-size: 1.3rem; line-height: 1.4; margin: 0 0 0.75rem; }
.einzel-fett { font-weight: 700; font-size: 1.15rem; margin: 0 0 0.75rem; }
.einzel-abc { font-size: 1rem; line-height: 1.6; margin: 0; color: var(--probe-leise); overflow-wrap: anywhere; }

.karte-fuss { padding: 1.1rem 1.25rem 1.25rem; display: flex; flex-direction: column; gap: 0.6rem; font-size: 0.92rem; flex: 1; }
.karte-fuss p { margin: 0; }
.satz { color: var(--tinte); }
.namen { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0; }
.namen div { display: flex; gap: 0.35rem; }
.namen dt { color: var(--leise); }
.namen dt::after { content: ":"; }
.namen dd { margin: 0; font-weight: 600; }
.branchen, .vorbild { color: var(--leise); }

.leer { padding: 3rem 0; text-align: center; color: var(--leise); }

/* Auswahl unten */
.auswahl { position: sticky; bottom: 0; z-index: 10; background: var(--tinte); color: var(--papier); margin-top: 3rem; }
.auswahl[hidden] { display: none; }
.auswahl-innen { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding-top: 0.75rem; padding-bottom: 0.75rem; }
.auswahl p { margin: 0; }
.auswahl-knoepfe { display: flex; gap: 0.5rem; }
.knopf { font: inherit; font-weight: 600; min-height: 44px; padding: 0 1.1rem; border-radius: 999px; border: 1px solid var(--papier); background: var(--papier); color: var(--tinte); cursor: pointer; }
.knopf.leise { background: transparent; color: var(--papier); }
.auswahl .knopf:focus-visible { outline-color: var(--papier); }

.fuss { padding: 3rem 0 4rem; color: var(--leise); }
.fuss p { margin: 0 0 0.5rem; max-width: 44rem; }
.klein { font-size: 0.85rem; }
.fehlerseite { padding: 6rem var(--rand); }

@media (max-width: 639px) {
  :root { --rand: 20px; }
  .kopf { padding: 2.5rem 0 1.75rem; }
  .einleitung { font-size: 1.05rem; }
  /* Am Handy bliebe mit fester Leiste und Auswahl unten zu wenig Platz für die Karten. Name, Branche und Grund
     stellt man einmal ein, die Leiste scrollt deshalb mit weg */
  .werkzeug { position: static; }
  .karte, .gruppe { scroll-margin-top: 1rem; }
  .werkzeug-innen { gap: 0.6rem; }
  .auswahl-paarname { display: none; }
  /* Die Art steht schon über der Gruppe, im schmalen Kartenkopf bräche sie um */
  .einzel .paarname { visibility: hidden; }
  .auswahl-innen { flex-wrap: nowrap; padding-top: 0.6rem; padding-bottom: 0.6rem; }
  .auswahl p { font-size: 0.95rem; }
  .knopf { padding: 0 0.9rem; }
  .feld:not(.grund) { flex: 1 1 9rem; }
  .feld input, .feld select { width: 100%; }
  .probe { padding: 1.5rem 1.25rem 1.4rem; }
  .gruppe { padding-top: 2.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
