@font-face {
  font-family: "Hanken Grotesk";
  src: url("../fonts/hanken-grotesk-300.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

:root {
  --canvas: #020202;
  --surface: #1b1919;
  --ink: #ffffff;
  --muted: #9a9a9a;
  --signal: #0038ff;
  --gutter: 60px;
  --col-gap: 30px;
  --row-gap: 60px;
  --s-1: 5px;
  --s-2: 10px;
  --s-3: 20px;
  --s-4: 30px;
  --s-5: 40px;
  --s-6: 60px;
  --s-7: 160px;
  --display: clamp(2.25rem, 1.35rem + 2.9vw, 3.5rem);
  --t-l: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  --t-m: clamp(1.125rem, 1.05rem + 0.3vw, 1.25rem);
  --t-s: 1.0625rem;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

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

html {
  background: var(--canvas);
  scrollbar-color: #4a4747 var(--canvas);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  font-weight: 300;
  font-size: var(--t-s);
  line-height: 1.5;
  letter-spacing: -0.003em;
  caret-color: var(--ink);
  font-variant-numeric: tabular-nums;
}

::selection { background: var(--ink); color: var(--canvas); }

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
h1, h2, h3 { font-weight: 300; text-wrap: balance; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 12px 20px;
  background: var(--ink);
  color: var(--canvas);
  border-radius: 100px;
}
.skip-link:focus { top: 12px; }

main:focus { outline: none; }

/* ---------- Kopf ---------- */
.kopf {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4) var(--gutter) 0;
}
.marke {
  font-size: var(--t-m);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.hauptnav ul { display: flex; gap: var(--s-4); list-style: none; padding: 0; }
.hauptnav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: var(--t-m);
  color: var(--muted);
  transition: color 160ms var(--ease-out);
}
.hauptnav a:hover, .hauptnav a[aria-current="page"] { color: var(--ink); }

/* ---------- Vorstellung ---------- */
.vorstellung, .seitenkopf {
  padding: clamp(60px, 9vh, 120px) var(--gutter) 0;
}
.vorstellung h1, .seitenkopf h1, .fall-kopf h1 {
  font-size: var(--display);
  line-height: 1.12;
  letter-spacing: -0.003em;
  max-width: 760px;
}
.seitenkopf h1, .fall-kopf h1 { max-width: 14ch; }
.unterzeile {
  margin-top: var(--s-4);
  max-width: 34rem;
  font-size: var(--t-m);
  color: var(--muted);
}

.pfeilzeile {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--t-m);
  color: var(--muted);
}
.pfeil { width: 24px; height: 24px; flex: none; }

/* ---------- Gestell (Zweispaltenraster) ---------- */
.gestell { padding: var(--s-5) var(--gutter) 0; }
.gestell .pfeilzeile { margin-bottom: var(--s-4); }

.raster {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--col-gap);
  row-gap: var(--row-gap);
}
ul.raster--ruhig { padding: var(--s-7) var(--gutter) 0; }

.bogen { position: relative; }
.bogen-bild {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  background: var(--surface);
}
.bogen-bild svg { width: 100%; height: 100%; }
.bogen-text { padding-top: var(--s-3); max-width: 42rem; }
.bogen-titel { font-size: var(--t-m); line-height: 1.3; }
.bogen-zeile { margin-top: var(--s-1); color: var(--muted); }
.bogen-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-3);
  margin-top: var(--s-3);
  color: var(--muted);
  font-size: 0.9375rem;
}

/* Ganze Kachel klickbar, wenn es eine Fallstudie gibt; Hover senkt nur die Deckkraft. */
.bogen--link .bogen-titel a::after { content: ""; position: absolute; inset: 0; }
.bogen--link .bogen-bild, .bogen--link .bogen-text { transition: opacity 200ms var(--ease-out); }
.bogen--link:hover .bogen-bild, .bogen--link:hover .bogen-text { opacity: 0.62; }
.bogen--link .bogen-titel a:focus-visible { outline: none; }
.bogen--link:has(a:focus-visible) { outline: 2px solid var(--ink); outline-offset: 8px; }

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 2px 14px;
  border: 1px solid currentColor;
  border-radius: 100px;
  font-size: 0.9375rem;
  line-height: 1.3;
  color: var(--muted);
  white-space: nowrap;
}
.pill--nass { color: var(--ink); }
.pill--signal {
  border-color: var(--signal);
  background: var(--signal);
  color: var(--ink);
}

/* Frischer Bogen: druckt sich beim Laden Sieb für Sieb. */
.frisch { position: relative; overflow: hidden; }
.durchgang {
  position: absolute;
  left: var(--s-3);
  top: var(--s-3);
  padding: 4px 14px;
  border-radius: 100px;
  background: var(--canvas);
  color: var(--ink);
  font-size: 0.9375rem;
  opacity: 0;
  transition: opacity 400ms var(--ease-out);
}
.durchgang.ist-sichtbar { opacity: 1; }

@media (prefers-reduced-motion: no-preference) {
  .frisch.druckt .sieb { animation: rakel 900ms var(--ease-out) both; }
  .frisch.druckt .sieb:nth-child(1) { animation-delay: 250ms; }
  .frisch.druckt .sieb:nth-child(2) { animation-delay: 1350ms; }
  .frisch.druckt .sieb:nth-child(3) { animation-delay: 2450ms; }
  .frisch.druckt .sieb:nth-child(4) { animation-delay: 3550ms; }
  .frisch.druckt .sieb:nth-child(5) { animation-delay: 4650ms; }
}
@keyframes rakel {
  from { clip-path: inset(0 100% 0 0); opacity: 0.4; }
  to { clip-path: inset(0 0 0 0); opacity: 1; }
}

/* Flächen am Ende des Gestells */
.flaeche { background: var(--surface); }
.flaeche a {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--s-4);
  min-height: 100%;
  aspect-ratio: 16 / 11;
  padding: var(--s-5);
  transition: opacity 200ms var(--ease-out);
}
.flaeche a:hover { opacity: 0.7; }
.riesenwort {
  display: block;
  font-size: clamp(4rem, 1.5rem + 9vw, 10rem);
  line-height: 0.9;
  letter-spacing: -0.03em;
  color: #6f6c6c;
}
.flaeche-text { font-size: var(--t-m); max-width: 24rem; }
.flaeche .pill { align-self: flex-start; }

/* ---------- Arbeitsweise ---------- */
.arbeitsweise, .zweispalter {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--col-gap);
  padding: var(--s-7) var(--gutter) 0;
}
.arbeitsweise h2, .zweispalter > h2 { font-size: var(--t-m); color: var(--muted); }
.arbeitsweise-text { display: grid; gap: var(--s-4); }
.arbeitsweise-text p { font-size: var(--t-l); line-height: 1.35; max-width: 30ch; }
.arbeitsweise-text p:last-child { font-size: var(--t-m); }

.textlink {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 44px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  text-decoration-color: var(--muted);
}
.textlink:hover { text-decoration-color: var(--ink); }

/* ---------- Listen (dl / ol) ---------- */
.liste { display: grid; gap: 0; padding: 0; list-style: none; }
.liste > div, .liste > li {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: var(--s-3);
  padding: var(--s-3) 0;
  border-top: 1px solid #2c2a2a;
}
.liste dt, .liste-kopf { font-size: var(--t-m); }
.liste dd, .liste li > span:last-child { color: var(--muted); }
.liste--ablauf { counter-reset: schritt; }
.liste--ablauf .liste-kopf::before {
  counter-increment: schritt;
  content: counter(schritt) " ";
  color: var(--muted);
  margin-right: var(--s-2);
}

/* ---------- Archiv: dreispaltige Mauer ---------- */
.filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-6) var(--gutter) 0;
}
.filter-titel { color: var(--muted); }
.filter-knoepfe { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.filter-stand { color: var(--muted); }

.pill-knopf {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid #5a5757;
  border-radius: 100px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  transition: color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}
.pill-knopf:hover { color: var(--ink); border-color: var(--ink); }
.pill-knopf[aria-pressed="true"] { color: var(--canvas); background: var(--ink); border-color: var(--ink); }

ul.mauer {
  columns: 3;
  column-gap: var(--col-gap);
  padding: var(--s-5) var(--gutter) 0;
}
.mauer-stein { break-inside: avoid; margin-bottom: var(--s-6); position: relative; }
.mauer-stein[hidden] { display: none; }
.mauer-stein img { width: 100%; height: auto; object-fit: cover; background: var(--surface); }
.mauer-stein--hoch img { aspect-ratio: 3 / 4; }
.mauer-stein--quer img { aspect-ratio: 16 / 11; }
.mauer-stein--quadrat img { aspect-ratio: 1; }
.mauer-stein .bogen-titel { margin-top: var(--s-3); }
.mauer-stein .bogen-titel a::after { content: ""; position: absolute; inset: 0; }
.mauer-stein:has(a):hover img { opacity: 0.62; }
.mauer-stein img { transition: opacity 200ms var(--ease-out); }

/* ---------- Fallstudie ---------- */
.fall-kopf { padding: clamp(100px, 14vh, 160px) var(--gutter) 0; }
.fall-bild { margin-top: var(--s-6); }
.fall-svg { aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface); }
.fall-svg svg { width: 100%; height: 100%; }
.fall-svg .sieb { transition: opacity 360ms var(--ease-out); }
.fall-svg .sieb.ist-aus { opacity: 0; }
.fall-steuerung {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-4);
  padding: var(--s-3) var(--gutter) 0;
  color: var(--muted);
}
.fall-steuerung input[type="range"] { width: min(320px, 100%); accent-color: var(--ink); min-height: 44px; }
.fall-steuerung output { color: var(--ink); }

.fall-spalten {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--col-gap);
  padding: var(--s-7) var(--gutter) 0;
}
.fall-daten { display: grid; gap: var(--s-3); align-content: start; }
.fall-daten dt { color: var(--muted); }
.fall-daten dd { font-size: var(--t-m); }
.fall-text { max-width: 36rem; }
.fall-text p { font-size: var(--t-m); line-height: 1.55; }
.fall-text p + p { margin-top: var(--s-3); }
.fall-text h2 { font-size: var(--t-l); margin: var(--s-6) 0 var(--s-3); }
.durchlaeufe { margin-top: var(--s-4); }
.durchlauf {
  display: grid;
  gap: var(--s-1);
  padding: var(--s-3) 0;
  border-top: 1px solid #2c2a2a;
}
.durchlauf-farbe { font-size: var(--t-m); }
.durchlauf-notiz { color: var(--muted); }
.durchlauf .pill-knopf { justify-self: start; margin-top: var(--s-2); }
.durchlauf.ist-aktiv .durchlauf-farbe::after { content: " · liegt gerade"; color: var(--muted); }

.naechster {
  display: grid;
  gap: var(--s-2);
  margin: var(--s-7) var(--gutter) 0;
  padding: var(--s-5);
  background: var(--surface);
  transition: opacity 200ms var(--ease-out);
}
.naechster:hover { opacity: 0.7; }
.naechster-titel { font-size: var(--display); line-height: 1.15; color: #6f6c6c; }

/* ---------- Werkstatt: offen ---------- */
.offen {
  margin: var(--s-7) var(--gutter) 0;
  padding: var(--s-5);
  background: var(--surface);
  display: grid;
  gap: var(--s-4);
}
.offen .riesenwort { font-size: clamp(3rem, 1.5rem + 6vw, 7.5rem); }
.offen .pill { justify-self: start; }
.offen-text { display: grid; gap: var(--s-3); max-width: 40rem; font-size: var(--t-m); }

/* ---------- Rechner ---------- */
.rechner { padding: var(--s-7) var(--gutter) 0; }
.rechner h2 { font-size: var(--t-l); margin-bottom: var(--s-5); }
.rechner-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--s-4) var(--col-gap);
  padding: var(--s-5);
  background: var(--surface);
}
.rechner-feld { grid-column: 1 / -1; border: 0; padding: 0; margin: 0; }
.rechner-feld legend { color: var(--muted); margin-bottom: var(--s-2); padding: 0; }
.wahl { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.wahl-knopf { position: relative; }
.wahl-knopf input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.wahl-knopf span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid #5a5757;
  border-radius: 100px;
  color: var(--muted);
}
.wahl-knopf input:checked + span { background: var(--ink); color: var(--canvas); border-color: var(--ink); }
.wahl-knopf input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 4px; }
.rechner-zeile { display: grid; gap: var(--s-2); align-content: start; }
.rechner-zeile label, .feld label { color: var(--muted); }
.hinweis { color: var(--muted); font-size: 0.9375rem; }

input:not([type="radio"]):not([type="range"]), select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid #5a5757;
  border-radius: 0;
  background: var(--canvas);
  color: var(--ink);
  font: inherit;
  font-size: var(--t-m);
}
input:not([type="radio"]):not([type="range"]):hover, select:hover, textarea:hover { border-color: var(--muted); }
input[aria-invalid="true"] { border-color: var(--ink); }
input::placeholder, textarea::placeholder { color: #8a8787; }

.rechner-ergebnis { grid-column: 1 / -1; padding-top: var(--s-3); border-top: 1px solid #2c2a2a; }
.ergebnis-preis { font-size: var(--t-l); line-height: 1.35; }
.ergebnis-weg { margin-top: var(--s-2); color: var(--muted); }

.preistabelle {
  width: 100%;
  margin-top: var(--s-6);
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.preistabelle caption { text-align: left; color: var(--muted); padding-bottom: var(--s-3); }
.preistabelle th, .preistabelle td { padding: 12px 16px 12px 0; text-align: left; border-top: 1px solid #2c2a2a; font-weight: 300; }
.preistabelle thead th { color: var(--muted); }

/* ---------- Anfrage ---------- */
.anfrage { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4) var(--s-3); }
.feld { grid-column: 1 / -1; display: grid; gap: var(--s-2); }
.feld--halb { grid-column: span 1; }
.demo-hinweis { grid-column: 1 / -1; color: var(--muted); }
.fehler { color: var(--ink); }
.knopf {
  grid-column: 1 / -1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid var(--ink);
  border-radius: 100px;
  background: var(--ink);
  color: var(--canvas);
  font: inherit;
  font-size: var(--t-m);
  cursor: pointer;
  transition: opacity 160ms var(--ease-out);
}
.knopf:hover { opacity: 0.8; }
.status { grid-column: 1 / -1; font-size: var(--t-m); }
.status:empty { display: none; }

/* ---------- Rechtstexte ---------- */
.rechtstext { padding: var(--s-6) var(--gutter) 0; max-width: calc(44rem + 2 * var(--gutter)); }
.rechtstext h2 { font-size: var(--t-m); margin: var(--s-5) 0 var(--s-2); }
.rechtstext p { color: var(--muted); }

/* ---------- Fuß ---------- */
.fuss { padding: var(--s-7) var(--gutter) var(--s-5); }
.fuss-satz { font-size: var(--t-l); line-height: 1.35; max-width: 24ch; }
.fuss-kacheln {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-2);
  margin-top: var(--s-5);
  padding: 0;
  list-style: none;
}
.kachel-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  min-height: 88px;
  padding: var(--s-3);
  background: var(--surface);
  overflow-wrap: anywhere;
  transition: opacity 200ms var(--ease-out);
}
.kachel-link:hover { opacity: 0.7; }
.fuss-zeile {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-2) var(--s-4);
  margin-top: var(--s-6);
  color: var(--muted);
}
.fuss-zeile a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; text-underline-offset: 0.25em; text-decoration-thickness: 1px; }
.fuss-zeile a:hover { color: var(--ink); }
.fuss-herkunft { margin-top: var(--s-3); color: var(--muted); font-size: 0.9375rem; max-width: 60rem; }

/* ---------- Responsiv: Raster stapelt um, die Schrift bleibt ruhig ---------- */
@media (max-width: 1080px) {
  ul.mauer { columns: 2; }
}
@media (max-width: 1000px) {
  :root { --gutter: 40px; }
  .hauptnav ul { gap: var(--s-3); }
}
@media (max-width: 800px) {
  :root { --gutter: 20px; --row-gap: 48px; --s-7: 100px; }
  .kopf { flex-direction: column; align-items: flex-start; gap: 0; padding-top: var(--s-3); }
  .hauptnav ul { flex-wrap: nowrap; gap: 0 16px; }
  .hauptnav a { font-size: var(--t-s); }
  .raster, .arbeitsweise, .zweispalter, .fall-spalten, .rechner-form, .anfrage, .fuss-kacheln { grid-template-columns: minmax(0, 1fr); }
  .feld--halb { grid-column: 1 / -1; }
  ul.mauer { columns: 1; }
  .flaeche a { aspect-ratio: auto; min-height: 260px; padding: var(--s-4) var(--s-3); }
  .rechner-form, .offen, .naechster { padding: var(--s-4) var(--s-3); }
  .liste > div, .liste > li { grid-template-columns: minmax(0, 1fr); gap: var(--s-1); }
  .fall-svg { aspect-ratio: 4 / 3; }
  .preistabelle { display: block; overflow-x: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
}
