/* Schriften aus design/fonts/ (DESIGN.md, Typography) */
@font-face { font-family: "Bitter"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/bitter-700.woff2") format("woff2"); }
@font-face { font-family: "Bitter"; font-weight: 800; font-style: normal; font-display: swap; src: url("fonts/bitter-800.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/roboto-400.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/roboto-500.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/roboto-700.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/jetbrains-mono-400.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/jetbrains-mono-700.woff2") format("woff2"); }

/* kaminrun.de - Umsetzung von DESIGN.md (Richtung 2a "Papier").
   Werte nur ueber die Tokens unten aendern; Quelle ist DESIGN.md.
   Die Schrift-Einbindung setzt scripts/build.py davor, sobald design/fonts/ gefuellt ist. */

:root {
  /* 30 - Farbe */
  --papier: #F4F1E9;
  --tinte: #1A1714;
  --satz: #4A463F;
  --grau: #6E6A66;
  --stein: #8A857D;
  --sand: #B4AD9E;
  --linie-hell: #D8D2C6;
  --glut: #FF6900;
  --glut-text: #B24900;
  /* 40 - Typografie */
  --font-display: "Bitter", "Rockwell", "Roboto Slab", Georgia, serif;
  --font-text: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --h1-gross: clamp(36px, 6vw, 56px);
  /* 70 - Raster */
  --breite: 1040px;
  --rand: 56px;
  --rand-zahl: 150px;
  --spalt: 40px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--papier);
  color: var(--satz);
  font: 400 17px/1.65 var(--font-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--glut); color: var(--tinte); }

/* ---------- Links und Fokus (60) */
a {
  color: var(--glut-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 150ms, text-decoration-color 150ms;
}
a:hover { text-decoration-color: var(--glut); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--tinte); outline-offset: 3px; }

/* ---------- Rahmen: Kopf, Inhalt, Fuss */
/* Breite ohne seitliches Padding: Haarlinien in Kopf und Fuss enden buendig
   mit dem Inhalt, wie in Variante 2a. */
.kopf, main, .fuss {
  width: min(var(--breite), calc(100% - 2 * var(--rand)));
  margin: 0 auto;
}

.kopf {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px 32px;
  padding-top: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--tinte);
}
.marke { display: inline-block; line-height: 0; text-decoration: none; }
.logo { width: 210px; height: auto; }
.marke-text { font: 800 22px/1 var(--font-display); color: var(--tinte); }

.menue, .rechtliches { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.menue { gap: 8px 26px; font: 400 13px/1.4 var(--font-mono); }
.menue a { color: var(--tinte); text-decoration: none; }
.menue a:hover { color: var(--glut-text); }
.menue a[aria-current] { color: var(--glut-text); }
.nr { color: var(--sand); }
.menue a[aria-current] .nr { color: inherit; }

/* Unternavigation: Unterseiten des Abschnitts, ueber dem Abschnittskopf */
.unternav { margin: -24px 0 32px calc(var(--rand-zahl) + var(--spalt)); }
.unternav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 8px 22px;
  font: 400 13px/1.4 var(--font-mono);
}
.unternav a { color: var(--grau); text-decoration: none; }
.unternav a:hover, .unternav a[aria-current="page"] { color: var(--glut-text); }

main { padding-top: 64px; padding-bottom: 96px; }

/* ---------- Typografie (40) */
h1, h2, h3, h4 { color: var(--tinte); font-family: var(--font-display); margin: 0; }
h1 { font-weight: 800; font-size: var(--h1-gross); line-height: 1; letter-spacing: -0.02em; }
h2 { font-weight: 700; font-size: clamp(28px, 4vw, 38px); line-height: 1; margin: 48px 0 16px; }
h3 { font-weight: 700; font-size: 24px; line-height: 1.2; margin: 32px 0 12px; }
p, ul, ol { margin: 0 0 16px; }
strong { color: var(--tinte); font-weight: 700; }
code { font: 0.9em var(--font-mono); }

.label {
  font: 400 12px/1.4 var(--font-mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--grau);
}

blockquote {
  margin: 32px 0;
  padding-left: 24px;
  border-left: 3px solid var(--glut);
}
blockquote p { font: 700 24px/1.3 var(--font-display); color: var(--tinte); }

img { max-width: 100%; height: auto; }

/* ---------- Hero (Startseite) */
.hero { padding-bottom: 56px; }
.leitsatz {
  margin-top: 18px;
  font-weight: 800;
  font-size: clamp(44px, 8vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.025em;
}
.punkt { color: var(--glut); }
/* Startbild (Feld bild der Startseite): Nanes LinkedIn-Cover, auf Papier umgefaerbt.
   Der Bildgrund ist exakt --papier, das Band geht nahtlos in die Seite ueber.
   Unten eine Haarlinie mit Glut-Kante wie beim Seitenbild. */
.hero-bild {
  position: relative;
  margin: 40px 0 0;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--tinte);
}
.hero-bild img { display: block; width: 100%; aspect-ratio: 1426 / 490; object-fit: cover; }
.hero-bild::after {
  content: "";
  position: absolute; left: 0; bottom: -2px;
  width: 64px; height: 3px;
  background: var(--glut);
}

/* ---------- Abschnittskopf, editorial (50) */
.abschnittskopf {
  display: grid;
  grid-template-columns: var(--rand-zahl) 1fr;
  gap: var(--spalt);
  align-items: start;
  padding: 34px 0 26px;
  border-top: 1px solid var(--tinte);
  margin-bottom: 40px;
}
/* Die Zahl reicht von der Versalhoehe des Labels bis zur Grundlinie der
   ersten h1-Zeile (Vorschlag Simon, 2026-10-06). Gerechnet aus den Metriken:
   Bitter: Oberlaenge 0.935, Unterlaenge 0.265, Ziffernhoehe 0.735 (em)
   -> bei line-height 1 liegt die Grundlinie 0.835 em unter der Zeilenoberkante,
      die Ziffernoberkante 0.1 em darunter.
   Label (JetBrains Mono 12px/1.4): Versalien beginnen 3.9px unter der Oberkante.
   --oben:  Abstand Oberkante kopf-titel -> Oberkante h1 (Label 16.8px + 6px)
   --anker: wo die Ziffern oben enden sollen */
.abschnittskopf { --oben: 22.8px; --anker: 3.9px; }
/* Ohne Label: Ziffern schliessen mit der Versalhoehe der h1 ab (h1 hat 6px Abstand nach oben) */
.abschnittskopf:not(:has(.label)) { --oben: 6px; --anker: calc(6px + 0.116 * var(--h1-gross)); }
.nr-gross {
  --nr: calc((var(--oben) + 0.835 * var(--h1-gross) - var(--anker)) / 0.735);
  font: 800 var(--nr)/1 var(--font-display);
  margin-top: calc(var(--anker) - 0.1 * var(--nr));
  letter-spacing: -0.03em;
  color: var(--tinte);
  text-align: right;
}
.kopf-titel { padding-bottom: 8px; }
.kopf-titel h1 { margin-top: 6px; }
/* Unterzeile: Bildwort gross, Erklaerung darunter klein (Feld unterzeile) */
.unterzeile {
  display: block;
  margin-top: 12px;
  font: 700 clamp(18px, 2.4vw, 24px)/1.25 var(--font-display);
  letter-spacing: 0;
  color: var(--grau);
}
.trenner {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Inhalt beginnt unter dem Titel, nicht unter der Zahl */
.seite, .karten, .personen, .aktionen {
  margin-left: calc(var(--rand-zahl) + var(--spalt));
  max-width: 68ch;
}
.hero + .seite, .hero ~ .aktionen { margin-left: 0; }
.seite > h2:first-child { margin-top: 0; }
/* Zwischentitel im Fliesstext kleiner als Abschnittstitel (DESIGN.md, Typography) */
.seite h2 { font-size: clamp(24px, 3vw, 28px); line-height: 1.15; margin: 40px 0 12px; }

/* ---------- Buttons (60) */
.aktionen { margin-top: 48px; display: flex; flex-wrap: wrap; gap: 14px; }
.button {
  display: inline-block;
  font: 700 14px/1.2 var(--font-text);
  text-decoration: none;
  padding: 11px 22px;
  background: var(--tinte);
  color: var(--papier);
  transition: background-color 150ms;
}
.button:hover { background: var(--glut-text); color: var(--papier); }
.button-sekundaer { background: transparent; color: var(--tinte); border: 1px solid var(--tinte); padding: 10px 21px; }
.button-sekundaer:hover { background: var(--tinte); color: var(--papier); }

/* ---------- Karten: Werkstuecke, Funken (60) */
.karten { list-style: none; padding: 0; margin-top: 48px; display: grid; gap: 0; }
.karte {
  display: block;
  padding: 24px 0 28px;
  border-top: 1px solid var(--tinte);
  color: inherit;
  text-decoration: none;
}
.karten li:last-child .karte { border-bottom: 1px solid var(--tinte); }
.karte h2 { font-size: 24px; line-height: 1.2; margin: 0 0 8px; transition: color 150ms; }
.karte p { margin: 0; font-size: 15px; color: var(--grau); }
.karte:hover h2 { color: var(--glut-text); }

/* ---------- Blog: Datum und Autor, Rueckweg */
.beitrag-meta { margin: 0 0 8px; }
.beitrag > .beitrag-meta { margin-bottom: 24px; }
.datum-fehlt { color: var(--glut-text); }
.zurueck { margin-top: 48px; font: 400 13px/1.4 var(--font-mono); }
.zurueck a { color: var(--grau); text-decoration: none; }
.zurueck a:hover { color: var(--glut-text); }

/* ---------- Team (60) */
.personen { margin-top: 48px; display: grid; gap: 40px; }
.person { display: grid; grid-template-columns: 140px 1fr; gap: 24px; align-items: start; }
.person h2 { font-size: 24px; margin: 0 0 8px; }
.foto { width: 140px; height: 140px; object-fit: cover; filter: grayscale(1); }
.person.ohne-foto { grid-template-columns: 1fr; }

/* ---------- Fuss (60) */
.fuss {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding-top: 32px;
  padding-bottom: 48px;
  border-top: 1px solid var(--tinte);
}
.logo-fuss { width: 240px; height: auto; }
.fuss-text { font-size: 13px; line-height: 1.7; color: var(--grau); text-align: right; }
.fuss-text p { margin: 0; }
.fuss-text nav { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; font-family: var(--font-mono); }
.rechtliches { gap: 16px; }
.rechtliches a { color: var(--grau); }
.rechtliches a:hover { color: var(--glut-text); }

/* ---------- Einwilligung (scripts/consent.js, nur mit JavaScript) */
.consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  background: var(--papier);
  border-top: 1px solid var(--tinte);
  padding: 20px max(var(--rand), calc((100% - var(--breite)) / 2)) 24px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 32px;
  align-items: end;
}
.consent h2 { grid-column: 1 / -1; margin: 0; color: var(--tinte); }
.consent p { margin: 0; font-size: 15px; max-width: 64ch; }
.consent-knoepfe { display: flex; flex-wrap: wrap; gap: 14px; }
.consent .button { border: 0; cursor: pointer; }

/* ---------- Vorschau (nur --vorschau) */
.vorschau-banner {
  background: var(--tinte);
  color: var(--papier);
  text-align: center;
  font: 400 12px/1.4 var(--font-mono);
  letter-spacing: 0.1em;
  padding: 6px 16px;
}
/* Offene Fragen: nur in der Vorschau, der Live-Bau bricht ab (inhalt/README.md) */
.offene-frage {
  margin: 20px 0;
  padding: 10px 16px;
  border-left: 3px solid var(--glut);
  background: #FBF3E8;
  color: var(--satz);
  font-size: 15px;
  line-height: 1.5;
  max-width: 68ch;
}
.offene-frage .label { display: block; color: var(--glut-text); margin-bottom: 2px; }
.frage-marke {
  display: inline-block;
  margin-left: 4px;
  padding: 0 5px;
  border: 1.5px solid var(--glut);
  background: #FFF7EE;
  color: var(--glut-text);
  font: 700 11px/1.4 var(--font-mono);
  vertical-align: 2px;
  white-space: nowrap;
}
.platzhalter {
  border: 1px dashed var(--stein);
  color: var(--grau);
  font: 400 13px/1.5 var(--font-mono);
  padding: 10px 14px;
}

/* ---------- Seitenbild (Feld bild): Kopf + Einleitung links, Bild rechts */
.seitenhero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 380px);
  grid-template-rows: auto 1fr;
  column-gap: var(--spalt);
  padding-bottom: 56px;
  border-bottom: 1px solid var(--tinte);
}
.seitenhero > .abschnittskopf { grid-column: 1; grid-row: 1; }
.seitenhero > .seite { grid-column: 1; grid-row: 2; align-self: end; margin-bottom: 0; }
.seitenhero > .seite p:last-child { margin-bottom: 0; }
.seitenhero > .seite p:first-child {
  font: 700 clamp(22px, 2.6vw, 28px)/1.25 var(--font-display);
  color: var(--tinte);
}
.seitenbild { grid-column: 2; grid-row: 1 / span 2; margin: 0; position: relative; }
.seitenbild img { display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
/* Glut-Kante: ein Strich in Signalorange unter dem Bild, wie ein Funke */
.seitenbild::after {
  content: "";
  position: absolute; left: 0; bottom: -8px;
  width: 64px; height: 3px;
  background: var(--glut);
}

/* ---------- Mobil (70) */
@media (max-width: 900px) {
  .seite, .karten, .personen, .aktionen, .unternav { margin-left: 0; }
  .seitenhero { grid-template-columns: 1fr; grid-template-rows: auto; row-gap: 24px; }
  .seitenhero > .abschnittskopf { margin-bottom: 0; }
  .seitenhero > .abschnittskopf, .seitenhero > .seite, .seitenbild { grid-column: 1; grid-row: auto; }
  .seitenbild { order: 2; }
  .seitenhero > .seite { order: 3; }
  .seitenbild img { aspect-ratio: 4 / 3; object-position: 50% 30%; }
}
@media (max-width: 640px) {
  :root { --rand: 20px; }
  .logo { width: 160px; }
  main { padding-top: 40px; }
  .unternav { margin-top: -16px; }
  .abschnittskopf { grid-template-columns: 1fr; gap: 12px; }
  .nr-gross { text-align: left; margin-top: 0; line-height: 0.8; }
  .person { grid-template-columns: 1fr; }
  /* Schmal: ganzes Band (Shop -> Agenten -> Daten -> Analyse), randlos bis an den Bildschirmrand */
  .hero-bild { margin-top: 16px; padding-bottom: 16px; }
  .hero-bild img { width: calc(100% + 2 * var(--rand)); max-width: none; margin: 0 calc(-1 * var(--rand)); }
  .fuss-text, .fuss-text nav { text-align: left; justify-content: flex-start; }
  .consent { grid-template-columns: 1fr; gap: 12px; }
}

/* ---------- Bewegung (80) */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
