/* Wirkarchitektur — ein Stylesheet, keine Framework-Kaskade.
   Systemschriften, weil eine externe Schriftart eine externe Anfrage wäre. */

:root {
  --papier:   #f7f4ef;
  --tinte:    #16181c;
  --gedaempft:#5c6169;
  --linie:    #ddd6cb;
  --akzent:   #9b3418;
  --code-bg:  #efe9e0;
  --mass:     36rem;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Charter, Georgia, serif;
  --mono:  ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --papier:   #14161a;
    --tinte:    #e6e3dd;
    --gedaempft:#9aa1ab;
    --linie:    #2b2f36;
    --akzent:   #e0765a;
    --code-bg:  #1c2026;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--papier);
  color: var(--tinte);
  font-family: var(--serif);
  font-size: clamp(1.02rem, 0.98rem + 0.3vw, 1.18rem);
  line-height: 1.62;
  text-rendering: optimizeLegibility;
}

/* ---------- Kopf ---------- */

.top {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: baseline;
  justify-content: space-between;
  max-width: 54rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 0;
}

.wordmark {
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--tinte);
  border-bottom: 2px solid var(--akzent);
  padding-bottom: 2px;
}
.wordmark span { color: var(--gedaempft); }

.top nav { display: flex; gap: 1.4rem; font-family: var(--mono); font-size: 0.82rem; }
.top nav a { color: var(--gedaempft); text-decoration: none; }
.top nav a:hover { color: var(--akzent); }

/* ---------- Fließtext ---------- */

main { max-width: 54rem; margin: 0 auto; padding: 0 1.5rem; }

/* Der linke Rand traegt die Abschnittsmarke — damit ist die Spaltenbreite
   eine Entscheidung und kein Rest. */
section {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  column-gap: 2.5rem;
  padding: 3.2rem 0;
  border-top: 1px solid var(--linie);
}
section > * { grid-column: 2; }
section:first-of-type { border-top: 0; }

p, ol, ul, figure { max-width: var(--mass); }
table { max-width: 100%; }

h1 {
  font-size: clamp(1.9rem, 1.2rem + 3vw, 3.1rem);
  line-height: 1.14;
  letter-spacing: -0.015em;
  margin: 2.5rem 0 1.2rem;
  max-width: 18ch;
}

h2 {
  grid-column: 1;
  grid-row: 1 / span 99;
  align-self: start;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--akzent);
  line-height: 1.45;
  text-align: right;
  margin: 0.45rem 0 1.2rem;
  hyphens: auto;
}

h3 { font-size: 1.06rem; margin: 0 0 0.5rem; }

.hero { padding-top: 1rem; }
.hero h1, .hero .lead, .hero .meta { grid-column: 1 / -1; }
.hero h1 { max-width: 22ch; }
.lead { font-size: 1.14em; }
.meta { font-family: var(--mono); font-size: 0.8rem; color: var(--gedaempft); }

a { color: var(--akzent); text-underline-offset: 3px; }

strong { font-weight: 600; }
em { font-style: normal; font-family: var(--mono); font-size: 0.9em; }

/* ---------- Tabelle ---------- */

.schichten { border-collapse: collapse; width: 100%; max-width: 100%; margin-top: 1.8rem; font-size: 0.92em; }
.schichten th {
  text-align: left; font-family: var(--mono); font-size: 0.72rem;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--gedaempft);
  font-weight: 500; padding: 0 1rem 0.6rem 0; border-bottom: 1px solid var(--linie);
}
.schichten td { padding: 0.7rem 1rem 0.7rem 0; border-bottom: 1px solid var(--linie); vertical-align: top; }
.schichten tr td:last-child { color: var(--gedaempft); }

/* ---------- Code ---------- */

figure { margin: 1.6rem 0; max-width: 100%; }

pre {
  background: var(--code-bg);
  border-left: 3px solid var(--akzent);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

code { font-family: var(--mono); font-size: 0.82rem; line-height: 1.55; }

figcaption { font-family: var(--mono); font-size: 0.74rem; color: var(--gedaempft); margin-top: 0.6rem; }

.callout {
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.7;
  border: 1px solid var(--linie);
  padding: 1rem 1.1rem;
  max-width: 100%;
}

/* ---------- Leistungen ---------- */

.leistungen { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); max-width: 100%; }
.leistungen p { font-size: 0.95em; color: var(--gedaempft); }
.leistungen h3::before { content: "— "; color: var(--akzent); }

/* ---------- Haltung ---------- */

.haltung { counter-reset: schritt; list-style: none; padding: 0; margin: 0 0 1.6rem; }
.haltung li { counter-increment: schritt; padding-left: 2.6rem; position: relative; margin-bottom: 0.5rem; }
.haltung li::before {
  content: counter(schritt);
  position: absolute; left: 0; top: 0.15em;
  font-family: var(--mono); font-size: 0.78rem;
  color: var(--akzent); border: 1px solid var(--linie);
  width: 1.7rem; height: 1.7rem; display: grid; place-items: center;
}

/* ---------- Fuß ---------- */

footer {
  max-width: 54rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  border-top: 1px solid var(--linie);
  font-size: 0.86rem;
  color: var(--gedaempft);
}
footer p { max-width: 44rem; }
.fusszeile { display: flex; flex-wrap: wrap; gap: 1.4rem; font-family: var(--mono); font-size: 0.78rem; margin: 1.4rem 0; }
.fusszeile a { color: var(--gedaempft); text-decoration: none; }
.fusszeile a:hover { color: var(--akzent); }
.klein { font-family: var(--mono); font-size: 0.72rem; }

.kontaktzeile { font-family: var(--mono); font-size: 1rem; }

@media (max-width: 52rem) {
  section { display: block; }
  h2 { text-align: left; margin: 0 0 1.2rem; }
}

@media (max-width: 34rem) {
  .top { padding-top: 1.4rem; }
  section { padding: 2.4rem 0; }
}

/* ---------- Nachtrag: Werkbank, Träger, Messwerte ---------- */

.traeger {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--gedaempft);
  letter-spacing: 0.02em;
}
.traeger strong { color: var(--tinte); font-weight: 600; }

.werkbank {
  grid-column: 1 / -1;
  border-collapse: collapse;
  width: 100%;
  margin-top: 0.4rem;
}
.werkbank td { padding: 1rem 1.2rem 1rem 0; border-bottom: 1px solid var(--linie); vertical-align: top; font-size: 0.94em; }
.wb-name { font-family: var(--mono); font-size: 0.8rem; white-space: nowrap; width: 1%; padding-left: 0; }
.wb-name a { text-decoration: none; border-bottom: 1px solid var(--linie); }
.wb-was { color: var(--gedaempft); padding-left: 2rem; }
.wb-lic { font-family: var(--mono); font-size: 0.72rem; color: var(--gedaempft); text-align: right; white-space: nowrap; width: 1%; }

p code, td code, li code {
  font-family: var(--mono);
  font-size: 0.84em;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
}

.messwerte { font-family: var(--mono); font-size: 0.8rem; color: var(--gedaempft); }
.messwerte strong { color: var(--akzent); font-weight: 600; }

.rechtstitel { font-size: 1.55rem; margin-top: 0; }

@media (max-width: 46rem) {
  .werkbank, .werkbank tbody, .werkbank tr, .werkbank td { display: block; width: auto; }
  .werkbank tr { border-bottom: 1px solid var(--linie); padding: 1rem 0; }
  .werkbank td { border: 0; padding: 0.15rem 0; white-space: normal; text-align: left; }
  .top { gap: 0.6rem 1.6rem; }
}
