/* Viberight: Tokens und Bausteine. Einzige Quelle für Werte ist :root (DESIGN.md beschreibt sie).
   Radius 0 überall, flach, deckend, Unbounded (Überschriften, höchstens 600) und Sora, selbst gehostet. */
@font-face { font-family: "Sora"; font-style: normal; font-weight: 100 800; font-display: swap; src: url("/assets/fonts/sora-latin.woff2") format("woff2"); }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 200 900; font-display: swap; src: url("/assets/fonts/unbounded-latin.woff2") format("woff2"); }

:root {
  --papier: #e8e8e3;
  --flaeche: #dcdcd6;
  --flaeche-2: #d0d0c9;
  --tinte: #181715;
  --leise: #55544e;
  --messing: #bfb21a;
  --messing-druck: #a69a12;
  --messing-tinte: #181715;
  --feld: #181715;
  --feld-2: #26251f;
  --feld-tinte: #e8e8e3;
  --feld-leise: #b4b3aa;
  --rot: #a3201a;
  --gruen: #2f6b2a;

  --schrift-kopf: "Unbounded", "Sora", ui-sans-serif, system-ui, sans-serif;
  --schrift-text: "Sora", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  /* fünf Größen je Seite, drei je Bereich */
  /* in rem, damit die Schriftgröße des Browsers wirkt (16 px Basis: 30/26 bis 80/44, 21, 17, 16 px) */
  --g-display: clamp(1.875rem, 5.4vw, 5rem);
  --g-h2: clamp(1.625rem, 3.2vw, 2.75rem);
  --g-h3: 1.3125rem;
  --g-text: 1.0625rem;
  --g-klein: 1rem;

  --a-1: 4px; --a-2: 8px; --a-3: 16px; --a-4: 24px; --a-5: 32px; --a-6: 48px; --a-7: 64px; --a-8: 96px; --a-9: 128px;
  --rand: 16px;
  --breite: 1240px;
  --kopf-hoehe: 64px;
  --radius: 0;
  --dauer: 240ms;
  --kurve: cubic-bezier(0.2, 0.7, 0.2, 1);
}
@media (min-width: 640px) { :root { --rand: 32px; } }
@media (min-width: 1024px) { :root { --rand: 48px; } }

*, *::before, *::after { box-sizing: border-box; border-radius: var(--radius); }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: var(--a-6); }
body {
  margin: 0; background: var(--papier); color: var(--tinte);
  font: 400 var(--g-text)/1.55 var(--schrift-text);
  font-variant-numeric: tabular-nums; overflow-wrap: break-word; hyphens: auto;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--schrift-kopf); font-weight: 600; margin: 0; text-wrap: balance; hyphens: manual; overflow-wrap: anywhere; }
h1 { font-size: var(--g-display); line-height: 1.04; letter-spacing: -0.025em; }
h2 { font-size: var(--g-h2); line-height: 1.12; letter-spacing: -0.015em; }
h3 { font-family: var(--schrift-text); font-size: var(--g-h3); line-height: 1.3; font-weight: 600; }
p { margin: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
@media (hover: hover) { a:hover { text-decoration-thickness: 2px; } }
:focus-visible { outline: 3px solid var(--tinte); outline-offset: 3px; }
.dunkel :focus-visible { outline-color: var(--feld-tinte); }
.klein { font-size: var(--g-klein); }
.leise { color: var(--leise); }
.dunkel .leise { color: var(--feld-leise); }
.nur-leser { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sprung { position: absolute; left: var(--rand); top: -100px; background: var(--tinte); color: var(--papier); padding: 0 var(--a-3); min-height: 48px; display: inline-flex; align-items: center; z-index: 10; }
.sprung:focus { top: var(--a-2); }

.rahmen { width: min(var(--breite), 100% - 2 * var(--rand)); margin-inline: auto; }
.raster { display: grid; gap: var(--a-5) var(--a-6); }
@media (min-width: 1024px) { .raster { grid-template-columns: repeat(12, minmax(0, 1fr)); } }

/* Kopf: Logo links, am Handy nur eine Aktion */
.kopf { min-height: var(--kopf-hoehe); display: flex; align-items: center; hyphens: manual; padding-block: var(--a-2); }
.wortmarke, .knopf { hyphens: manual; }
.wortmarke { white-space: nowrap; }
.kopf .rahmen { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--a-2) var(--a-4); }
.wortmarke { font-family: var(--schrift-kopf); font-weight: 700; font-size: var(--g-h3); letter-spacing: -0.02em; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.kopf nav { display: flex; align-items: center; gap: var(--a-4); }
.kopf nav a.link { text-decoration: none; font-size: var(--g-klein); min-height: 44px; min-width: 44px; justify-content: center; display: inline-flex; align-items: center; }
.kopf nav a.link[aria-current="page"] { text-decoration: underline; }
@media (hover: hover) { .kopf nav a.link:hover { text-decoration: underline; } }
@media (max-width: 767px) { .kopf nav a.link { display: none; } }

/* Knöpfe: voll deckend, eine gefüllte Hauptaktion je Bildschirm */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--a-2);
  min-height: 48px; padding: 0 var(--a-4); border: 0; cursor: pointer;
  font: 600 var(--g-text)/1.2 var(--schrift-text); text-decoration: none; text-align: center;
  background: var(--messing); color: var(--messing-tinte);
  transition: background-color var(--dauer) var(--kurve), transform 120ms var(--kurve);
}
/* Knöpfe behalten ihre Schriftfarbe auch in dunklen Abschnitten (dort gilt sonst .dunkel a) */
a.knopf, .dunkel a.knopf { color: var(--messing-tinte); }
a.knopf.zweit, .dunkel a.knopf.zweit { color: var(--tinte); }
.knopf:active { background: var(--messing-druck); }
@media (hover: hover) { .knopf:hover { background: var(--messing-druck); text-decoration: none; } }
.knopf:active { transform: translateY(1px); }
.knopf.zweit { background: var(--flaeche); color: var(--tinte); }
.knopf.zweit:active { background: var(--flaeche-2); }
@media (hover: hover) { .knopf.zweit:hover { background: var(--flaeche-2); } }
.kopf .knopf { min-height: 44px; font-size: var(--g-klein); padding: 0 var(--a-3); }
.knopf[disabled] { background: var(--flaeche-2); color: var(--leise); cursor: default; }
.aktionen { display: flex; flex-wrap: wrap; align-items: center; gap: var(--a-3) var(--a-4); }
.aktionen a.textlink { min-height: 44px; display: inline-flex; align-items: center; }

/* Abschnitte: jeder mit eigenem Hintergrund */
.abschnitt { padding-block: var(--a-7); }
@media (min-width: 1024px) { .abschnitt { padding-block: var(--a-8); } }
.flaeche { background: var(--flaeche); }
.dunkel { background: var(--feld); color: var(--feld-tinte); }
.dunkel a { color: var(--feld-tinte); }
.kopfzeile { display: grid; gap: var(--a-3); max-width: 40rem; margin-bottom: var(--a-6); }
.fall .text p, .schritt .text p, .problem .text p, .form-teil > p { max-width: 40rem; }

/* Hero */
.hero { padding-top: var(--a-7); padding-bottom: var(--a-8); }
.hero h1 { margin-bottom: var(--a-6); }
.hero h1 span { display: block; }
.hero .satz { font-size: var(--g-h3); line-height: 1.45; max-width: 34rem; margin-bottom: var(--a-5); }
@media (min-width: 1024px) {
  .hero .links { grid-column: 1 / span 5; }
  .hero .rechts { grid-column: 6 / span 7; }
}

/* Echte Bruchstücke des Produkts: Code und Befunde in der Textschrift, umbrechend, nie seitlich scrollend */
.buehne { background: var(--feld); color: var(--feld-tinte); padding: var(--a-4); }
.buehne.hell { background: var(--flaeche); color: var(--tinte); }
.buehne .titel { display: flex; justify-content: space-between; align-items: center; gap: var(--a-3); flex-wrap: wrap; margin-bottom: var(--a-3); }
.buehne pre, pre.code {
  margin: 0; font: 400 var(--g-klein)/1.6 var(--schrift-text); font-variant-numeric: tabular-nums;
  white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal; hyphens: none; tab-size: 2;
}
.buehne .s { color: var(--feld-tinte); }
.buehne .k { color: var(--feld-leise); }
.buehne.hell .k { color: var(--leise); }
.buehne.hell .s { color: var(--tinte); }
.buehne .notiz { margin-top: var(--a-3); }
.buehne .leise { color: var(--feld-leise); }
.buehne.hell .leise { color: var(--leise); }
.kopieren { min-height: 44px; min-width: 44px; padding: 0 var(--a-2); background: transparent; color: var(--feld-tinte); border: 0; font: 600 var(--g-klein)/1 var(--schrift-text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.buehne.hell .kopieren { color: var(--tinte); }
.kopieren:active { transform: translateY(1px); }

/* Problem */
@media (min-width: 1024px) {
  .problem .text { grid-column: 1 / span 6; }
  .problem .liste { grid-column: 8 / span 5; }
}
.problem .text p + p { margin-top: var(--a-3); }
.problem .text h2 { margin-bottom: var(--a-5); }
.fundliste { list-style: none; margin: var(--a-4) 0 0; padding: 0; display: grid; gap: var(--a-4); }
.fundliste li { display: grid; gap: var(--a-1); }
.fundliste .id { font-size: var(--g-klein); color: var(--leise); }
.fundliste .was { font-weight: 600; }

/* Beweis */
.fall { display: grid; gap: var(--a-5); padding-top: var(--a-6); }
.fall + .fall { margin-top: var(--a-6); }
@media (min-width: 1024px) {
  .fall { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--a-6); }
  .fall .text { grid-column: 1 / span 4; }
  .fall .bilder { grid-column: 5 / span 8; }
}
.fall .text { display: grid; gap: var(--a-3); align-content: start; }
.bilder { display: grid; gap: var(--a-4); grid-template-columns: 1fr; }
.bilder > p { grid-column: 1 / -1; }
@media (min-width: 640px) { .bilder { grid-template-columns: 1fr 1fr; } }
.bilder figure { margin: 0; display: grid; gap: var(--a-2); align-content: start; }
.bilder figcaption { font-size: var(--g-klein); font-weight: 600; }
.bilder img { width: 100%; background: var(--feld-2); }
.bilder.schmal-bilder { max-width: 640px; grid-template-columns: 1fr 1fr; gap: var(--a-3); }
.bilder.schmal-bilder > p { grid-column: 1 / -1; }
.messung { width: 100%; border-collapse: collapse; font-size: var(--g-klein); }
.messung th, .messung td { text-align: left; padding: var(--a-2) var(--a-3) var(--a-2) 0; font-weight: 400; }
.messung thead th { color: var(--feld-leise); }
.messung tbody td:last-child { font-weight: 600; }
.selbst { margin-top: var(--a-7); max-width: 46rem; }
.dunkel .knopf { margin-top: var(--a-5); }

/* Schritte */
.schritt { display: grid; gap: var(--a-4); }
.schritt + .schritt { margin-top: var(--a-7); }
@media (min-width: 1024px) {
  .schritt { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--a-6); }
  .schritt .text { grid-column: 1 / span 5; }
  .schritt .stueck { grid-column: 6 / span 7; }
}
.schritt .text { display: grid; gap: var(--a-3); align-content: start; }
.schritt .text a { justify-self: start; min-height: 44px; display: inline-flex; align-items: center; }

/* Zugang und Fragen */
@media (min-width: 1024px) {
  .ende .form-teil { grid-column: 1 / span 5; }
  .ende .fragen { grid-column: 7 / span 6; }
}
.form-teil h2 { margin-bottom: var(--a-3); }
.form-teil > p { margin-bottom: var(--a-5); }
.formular { display: grid; gap: var(--a-4); }
.feld { display: grid; gap: var(--a-2); }
.feld label { font-weight: 600; }
.feld .stern { color: var(--rot); }
.feld input {
  width: 100%; min-height: 52px; padding: 0 var(--a-3); font: 400 var(--g-text)/1.4 var(--schrift-text);
  color: var(--tinte); background: var(--papier); border: 1px solid var(--leise);
}
.feld input:focus-visible { outline: 3px solid var(--tinte); outline-offset: 1px; }
.feld input[aria-invalid="true"] { border: 2px solid var(--rot); }
.feld .fehler, .formfehler { color: var(--rot); font-size: var(--g-klein); font-weight: 600; }
.feld .fehler:empty { display: none; }
.honig { display: none; }
.formular .knopf { justify-self: start; min-width: min(224px, 100%); }
.erfolg { display: grid; gap: var(--a-3); padding: var(--a-5); background: var(--papier); }
.erfolg h3 { font-family: var(--schrift-kopf); }
.erfolg a { justify-self: start; min-height: 44px; display: inline-flex; align-items: center; }
.fragen h2 { font-size: var(--g-h3); font-family: var(--schrift-text); margin-bottom: var(--a-4); }
.fragen dl { margin: 0; display: grid; gap: var(--a-4); }
.fragen dt { font-weight: 600; }
.fragen dd { margin: var(--a-1) 0 0; }

/* Unterseiten */
.seitenkopf { padding-top: var(--a-7); padding-bottom: var(--a-7); background: var(--flaeche); }
.seitenkopf + .unten, .seitenkopf + .inhalt { padding-top: var(--a-7); }
.seitenkopf h1 span { display: block; }
.seitenkopf .satz { font-size: var(--g-h3); line-height: 1.45; max-width: 40rem; margin-top: var(--a-5); }
.inhalt { display: grid; gap: var(--a-7); grid-template-columns: minmax(0, 1fr); }
.block { display: grid; gap: var(--a-4); grid-template-columns: minmax(0, 1fr); }
.raster > *, .block > *, .fall > *, .schritt > * { min-width: 0; }
.recht p, .block p { overflow-wrap: anywhere; }
.block .rechts > p, .block .links > p, .liste-plain { max-width: 40rem; }
@media (min-width: 1024px) {
  .block.zwei { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--a-6); }
  .block.zwei > .links { grid-column: 1 / span 4; }
  .block.zwei > .rechts { grid-column: 5 / span 8; }
}
.block .rechts { display: grid; gap: var(--a-4); align-content: start; min-width: 0; }
.adresse { font-weight: 600; overflow-wrap: anywhere; }
.liste-plain { margin: 0; padding-left: 1.2em; display: grid; gap: var(--a-2); }
.werkzeuge { margin: 0; display: grid; gap: var(--a-4); }
@media (min-width: 640px) { .werkzeuge { grid-template-columns: 1fr 1fr; } }
.werkzeuge div { padding: var(--a-4); background: var(--flaeche); display: grid; gap: var(--a-1); }
.werkzeuge dt { font-weight: 600; overflow-wrap: anywhere; }
.werkzeuge dd { margin: 0; }
.tabelle { width: 100%; border-collapse: collapse; }
.tabelle th, .tabelle td { text-align: left; padding: var(--a-3) var(--a-3) var(--a-3) 0; vertical-align: top; }
.tabelle thead th { font-size: var(--g-klein); color: var(--leise); font-weight: 400; }
.tabelle tbody tr:nth-child(odd) { background: var(--flaeche); }
.tabelle tbody td:first-child { padding-left: var(--a-3); }
.tabelle td.zahl, .tabelle th.zahl { text-align: right; width: 7rem; }
@media (max-width: 639px) {
  .tabelle thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .tabelle tr { display: grid; grid-template-columns: 1fr auto; gap: var(--a-1) var(--a-3); padding: var(--a-3); }
  .tabelle td { padding: 0; }
  .tabelle td.name { grid-column: 1 / -1; font-weight: 600; }
  .tabelle tbody td:first-child { padding-left: 0; }
  .tabelle td.zahl { text-align: left; width: auto; }
  .tabelle td.zahl::before { content: attr(data-label) ": "; color: var(--leise); }
}
.regelliste { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--a-3); }
@media (min-width: 768px) { .regelliste { grid-template-columns: 1fr 1fr; } }
.regelliste li { padding: var(--a-4); background: var(--flaeche); display: grid; gap: var(--a-1); }
.regelliste .meta { font-size: var(--g-klein); color: var(--leise); }
.recht h2 { font-size: var(--g-h3); font-family: var(--schrift-text); margin-top: var(--a-6); margin-bottom: var(--a-3); }
.recht p + p, .recht ul { margin-top: var(--a-3); }
.recht { max-width: 40rem; }
.entwurf { background: var(--flaeche-2); padding: var(--a-4); font-weight: 600; margin-bottom: var(--a-6); max-width: 46rem; }
.schluss { padding-block: var(--a-8); }
.schluss .kopfzeile { margin-bottom: var(--a-5); }

/* Fuß: eine ruhige Zeile */
.fuss { padding-top: var(--a-7); padding-bottom: var(--a-5); font-size: var(--g-klein); }
.fuss .rahmen { display: grid; gap: var(--a-3); }
@media (min-width: 1024px) { .fuss .rahmen { grid-template-columns: 1fr auto 1fr; align-items: center; } }
.fuss nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--a-2) var(--a-4); }
.fuss nav a { min-height: 44px; display: inline-flex; align-items: center; }
.fuss .rechts { color: var(--leise); }
@media (min-width: 1024px) { .fuss .rechts { justify-self: end; } }

/* Bewegung: nur unterhalb des ersten Bildschirms, nur transform und opacity, kurz */
.js-ein [data-ein] { opacity: 0; transform: translateY(16px); transition: opacity var(--dauer) var(--kurve), transform var(--dauer) var(--kurve); transition-delay: calc(var(--i, 0) * 60ms); }
.js-ein [data-ein].da { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js-ein [data-ein] { opacity: 1; transform: none; transition: none; }
  .knopf, .kopieren { transition: none; }
}

/* Hilfsklassen (keine Inline-Styles wegen CSP) */
.v1 { --i: 1; }
.mt-3 { margin-top: var(--a-3); }
.mt-4 { margin-top: var(--a-4); }
.mt-5 { margin-top: var(--a-5); }
.unten { padding-bottom: var(--a-8); }
.h1-klein { font-size: var(--g-h2); }
.schmal { max-width: 40rem; }
.messung caption { text-align: left; caption-side: top; padding-bottom: var(--a-2); }
