/* codemithaltung.de
   Welt: ein Aushang mit Abreißzetteln auf dunkler Wand.
   Farben der Marke: Tinte, Papier, Petrol, Petrol hell. Petrol gehört allein dem Handeln. */

@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/ibm-plex-sans-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --tinte: #14202b;
  --papier: #f4f1ea;
  --petrol: #0e7c7b;
  --petrol-tief: #0a6968;     /* Petrol für kleine Schrift auf Papier, Kontrast 5,8 zu 1 */
  --petrol-hell: #3fc1b8;
  --tinte-leise: #4a5560;     /* Nebentext auf Papier */
  --papier-leise: #bbbcb8;    /* Nebentext auf der Wand */

  --rand: clamp(1rem, 5.5vw, 5rem);
  --breite: 70rem;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --schatten: drop-shadow(0 1px 0 rgb(0 0 0 / 0.28)) drop-shadow(0 1.5rem 1.75rem rgb(0 0 0 / 0.42));

  color-scheme: dark;
  scrollbar-color: rgb(244 241 234 / 0.32) var(--tinte);
}

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

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

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--tinte);
  color: var(--papier);
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-kerning: normal;
  caret-color: var(--petrol-hell);
}

main { flex: 1; }

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

a {
  color: var(--petrol-hell);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: rgb(63 193 184 / 0.5);
  transition: text-decoration-color 150ms ease, color 150ms ease;
}

@media (hover: hover) and (pointer: fine) {
  a:hover { text-decoration-color: currentColor; }
}

:focus-visible {
  outline: 2px solid var(--petrol-hell);
  outline-offset: 3px;
  border-radius: 2px;
}

h1, h2, h3 {
  margin: 0;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }

.nur-vorlesen {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.sprung {
  position: absolute;
  left: var(--rand);
  top: 0.75rem;
  z-index: 10;
  padding: 0.5rem 0.875rem;
  background: var(--papier);
  color: var(--tinte);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}
.sprung:focus-visible { transform: none; outline-color: var(--petrol-tief); }

/* Kopf auf der Wand */

.kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 5.25rem;
  padding: 0 var(--rand);
}

.kopf__marke { display: block; flex: none; line-height: 0; border-radius: 2px; }
.kopf__marke img { display: block; height: 1.875rem; width: auto; }

.kopf__links {
  display: flex;
  gap: clamp(1.25rem, 2.6vw, 2.25rem);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
  font-weight: 500;
}

.kopf__links a {
  color: var(--papier);
  text-decoration-color: transparent;
  text-underline-offset: 0.4em;
  text-decoration-thickness: 2px;
}
.kopf__links a[aria-current="page"] { text-decoration-color: var(--petrol-hell); }

@media (hover: hover) and (pointer: fine) {
  .kopf__links a:hover { text-decoration-color: rgb(63 193 184 / 0.6); }
}

/* Das Blatt */

.blatt {
  container-type: inline-size;
  position: relative;
  width: min(var(--breite), calc(100% - 2 * var(--rand)), calc((100svh - 7rem) * 1.4142));
  min-width: min(40rem, calc(100% - 2 * var(--rand)));
  margin: 0.75rem auto 0;
  aspect-ratio: 1.4142 / 1;
  display: flex;
  flex-direction: column;
  color: var(--tinte);
  filter: var(--schatten);
  transition: opacity 420ms var(--ease-out), transform 420ms var(--ease-out);

  @starting-style {
    opacity: 0;
    transform: translateY(0.75rem);
  }
}

.blatt ::selection { background: var(--tinte); color: var(--papier); }
.blatt :focus-visible { outline-color: var(--petrol-tief); }
.blatt a { color: var(--petrol-tief); text-decoration-color: rgb(10 105 104 / 0.45); }

.blatt__flaeche {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--papier);
  padding: 6.2cqi 6.4cqi 0;
}

.blatt h1 {
  font-size: max(2.25rem, 5.6cqi);
  line-height: 1.04;
  letter-spacing: -0.026em;
  max-width: 16em;
}

.blatt__vorspann {
  margin-top: max(1rem, 2.1cqi);
  max-width: 46em;
  font-size: max(1.0625rem, 1.7cqi);
  line-height: 1.45;
  color: var(--tinte-leise);
}

.angebote {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: max(1.25rem, 4.2cqi);
  margin: max(1.75rem, 3.6cqi) 0 0;
  padding: 0;
  list-style: none;
}

.angebote__titel {
  display: block;
  font-size: max(1.125rem, 1.95cqi);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.angebote p {
  margin-top: 0.35em;
  font-size: max(1rem, 1.5cqi);
  line-height: 1.45;
}

.blatt__antwortet {
  margin-top: auto;
  padding-top: max(1.25rem, 2.6cqi);
  font-size: max(1rem, 1.5cqi);
}
.blatt__antwortet strong { font-weight: 600; }

.blatt__adresse {
  margin-top: max(1.25rem, 2.6cqi);
  font-size: max(1.375rem, 3.5cqi);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.blatt__adresse a { text-decoration-thickness: 2px; text-underline-offset: 0.16em; }

.blatt__hinweis {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  margin: 0 -6.4cqi;
  padding: max(1rem, 2.2cqi) 6.4cqi max(0.75rem, 1.3cqi);
  background: var(--papier);
  border-bottom: 2px dashed rgb(20 32 43 / 0.45);
  font-size: max(0.875rem, 1.3cqi);
  font-weight: 500;
}
.blatt__hinweis time { color: var(--tinte-leise); font-weight: 400; }

/* Die Zettel: die einzige Linie der Seite ist die Perforation darüber. */

.zettel {
  display: flex;
  gap: 3px;
  height: max(9.5rem, 20cqi);
  margin: 0;
  padding: 0;
  list-style: none;
}

.zettel li { flex: 1; display: flex; min-width: 0; }

.zettel a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(0.75rem, 1.4cqi) 0;
  background: var(--papier);
  color: var(--petrol-tief);
  text-decoration: none;
  transform-origin: 50% 0;
  transition: transform 180ms var(--ease-out), opacity 180ms var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}

.zettel span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: max(0.75rem, 1.25cqi);
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.zettel a:focus-visible { outline: 2px solid var(--petrol-tief); outline-offset: -6px; border-radius: 0; }

@media (hover: hover) and (pointer: fine) {
  .zettel a:hover { transform: translateY(0.3rem) rotate(-1.4deg); }
}

.zettel a:active { transform: translateY(0.45rem) rotate(-2deg); }

.zettel a.ist-ab {
  opacity: 0;
  transform: translateY(2.5rem) rotate(7deg);
  pointer-events: none;
  transition: transform 340ms var(--ease-out), opacity 300ms var(--ease-out);
}

.zettel a.ist-neu {
  transition: opacity 420ms var(--ease-out), transform 420ms var(--ease-out);
}

@container (max-width: 50rem) {
  .zettel li:nth-child(n + 10) { display: none; }
}

@container (max-width: 34rem) {
  .zettel li:nth-child(n + 7) { display: none; }
}

/* Lesende Blätter: Impressum, Datenschutz, 404 */

.blatt--lesen {
  width: min(52rem, calc(100% - 2 * var(--rand)));
  min-width: 0;
  aspect-ratio: auto;
}

.blatt--lesen .blatt__flaeche {
  padding: max(2rem, 8cqi) max(1.25rem, 8cqi) max(2.5rem, 8cqi);
}

.blatt--lesen h1 { font-size: max(2.25rem, 6.5cqi); }

.text {
  margin-top: max(1.5rem, 4cqi);
  max-width: 60ch;
  font-size: 1.0625rem;
  line-height: 1.65;
}
.text h2 {
  margin: 2.2em 0 0.5em;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}
.text h3 { margin: 1.6em 0 0.35em; font-size: 1.1875rem; }
.text p + p { margin-top: 0.85em; }
.text ul { margin: 0.6em 0 0; padding-left: 1.2em; }
.text li { text-wrap: pretty; }
.text li + li { margin-top: 0.4em; }
.text li::marker { color: var(--tinte-leise); }
.text strong { font-weight: 600; }
.text > h2:first-child { margin-top: 0; }

.platzhalter { font-style: italic; color: var(--tinte-leise); }

.blatt__stand {
  margin-top: 3rem;
  font-size: 0.9375rem;
  color: var(--tinte-leise);
}

/* Die Wand unter dem Blatt */

.wand {
  width: min(var(--breite), calc(100% - 2 * var(--rand)));
  margin-inline: auto;
  padding-block: clamp(4.5rem, 10vw, 8.5rem) 0;
}

.wand > h2 {
  max-width: 18em;
  font-size: clamp(1.875rem, 3.4vw, 2.75rem);
  letter-spacing: -0.02em;
}

.wand__vorspann {
  margin-top: 1rem;
  max-width: 40em;
  color: var(--papier-leise);
  font-size: 1.125rem;
}

.reihen {
  margin: clamp(2.25rem, 4vw, 3.5rem) 0 0;
  padding: 0;
  list-style: none;
}

.reihen > li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 0.5rem 3rem;
}
.reihen > li + li { margin-top: clamp(2.25rem, 4vw, 3.25rem); }

.reihen h3 { font-size: clamp(1.25rem, 1.8vw, 1.5rem); letter-spacing: -0.01em; }
.reihen p { max-width: 38em; color: var(--papier-leise); }
.reihen p + p { margin-top: 0.75em; }
.reihen strong { color: var(--papier); font-weight: 600; }

.grundsaetze {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2.5rem 2.5rem;
  margin: clamp(2.25rem, 4vw, 3.5rem) 0 0;
  padding: 0;
  list-style: none;
}
.grundsaetze h3 { font-size: 1.25rem; letter-spacing: -0.01em; }
.grundsaetze p { margin-top: 0.4em; color: var(--papier-leise); }

.person {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 0.75rem 3rem;
  align-items: start;
}
.person > h2 { font-size: clamp(1.875rem, 3.4vw, 2.75rem); letter-spacing: -0.02em; }
.person p { color: var(--papier-leise); max-width: 38em; }
.person p + p { margin-top: 0.75em; }
.person strong { color: var(--papier); font-weight: 600; }

.schluss { padding-bottom: clamp(1rem, 3vw, 2rem); }

.schluss__adresse {
  display: inline-block;
  margin-top: 1.25rem;
  font-size: clamp(1.5rem, 4.4vw, 3.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.schluss__hinweis { margin-top: 1.25rem; color: var(--papier-leise); max-width: 40em; }

/* Fuß */

.fuss {
  width: min(var(--breite), calc(100% - 2 * var(--rand)));
  margin: clamp(4.5rem, 9vw, 7rem) auto 0;
  padding: 0 0 2.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2.5rem;
  font-size: 0.9375rem;
  color: var(--papier-leise);
}

.fuss__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.fuss a,
.fuss button {
  color: var(--papier);
  text-decoration-color: rgb(244 241 234 / 0.35);
}

.fuss button {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  cursor: pointer;
  transition: text-decoration-color 150ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .fuss a:hover,
  .fuss button:hover { text-decoration-color: var(--petrol-hell); }
}

/* Einwilligung: ein kleiner Zettel unten, auf breiten Fenstern rechts.
   So bleibt der erste Abreißzettel frei, der als einziger den Fokus bekommt. */

.einwilligung {
  position: fixed;
  left: var(--rand);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 20;
  width: min(25rem, calc(100% - 2 * var(--rand)));
  padding: 1.375rem 1.5rem 1.5rem;
  background: var(--papier);
  color: var(--tinte);
  filter: var(--schatten);
  transition: opacity 260ms var(--ease-out), transform 260ms var(--ease-out);

  @starting-style {
    opacity: 0;
    transform: translateY(0.75rem);
  }
}
.einwilligung[hidden] { display: none; }
.einwilligung ::selection { background: var(--tinte); color: var(--papier); }
.einwilligung :focus-visible { outline-color: var(--petrol-tief); }
.einwilligung a { color: var(--petrol-tief); text-decoration-color: rgb(10 105 104 / 0.45); }

.einwilligung h2 { font-size: 1.1875rem; letter-spacing: -0.01em; }
.einwilligung p { margin-top: 0.6em; font-size: 0.9375rem; line-height: 1.5; }
.einwilligung__klein { color: var(--tinte-leise); }

.einwilligung__knoepfe {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
  margin-top: 1.125rem;
}

.knopf {
  min-height: 2.75rem;
  padding: 0.625rem 1rem;
  border: 0;
  border-radius: 3px;
  background: var(--tinte);
  color: var(--papier);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 150ms ease;
}
.knopf:active { transform: scale(0.97); }

@media (hover: hover) and (pointer: fine) {
  .knopf:hover { background: #22323f; }
}

/* Telefon und schmale Fenster */

@media (max-width: 48rem) {
  .kopf { min-height: 4.25rem; }
  .kopf__marke img { height: 1.5rem; }
  .kopf__links li.weit { display: none; }

  .blatt {
    width: calc(100% - 2 * var(--rand));
    min-width: 0;
    aspect-ratio: 1 / 1.4142;
    margin-top: 0.25rem;
  }

  .blatt__flaeche { padding: 1.75rem 1.375rem 0; }
  .blatt h1 { font-size: clamp(1.875rem, 9vw, 2.5rem); }
  .blatt__vorspann { font-size: 1rem; }

  .angebote {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-top: 1.5rem;
  }
  .angebote__titel { font-size: 1.0625rem; }
  .angebote:not(.angebote--offen) p { display: none; }
  .blatt:has(.angebote--offen) { aspect-ratio: auto; }

  .blatt__antwortet { font-size: 0.9375rem; padding-top: 1.25rem; }
  .blatt__hinweis { margin: 0 -1.375rem; padding: 1rem 1.375rem 0.625rem; font-size: 0.875rem; }
  .blatt__hinweis p + p { white-space: nowrap; }
  .zettel { height: 12rem; }
  .zettel span { font-size: 0.75rem; }

  .blatt--lesen { aspect-ratio: auto; }
  .blatt--lesen .blatt__flaeche { padding: 2rem 1.375rem 2.5rem; }

  .reihen > li,
  .person { grid-template-columns: 1fr; }
  .grundsaetze { grid-template-columns: 1fr 1fr; gap: 2rem 1.5rem; }
}

@media (max-width: 30rem) {
  .grundsaetze { grid-template-columns: 1fr; }
}

@media (min-width: 48.0625rem) {
  .einwilligung { left: auto; right: var(--rand); }
}

@media (min-width: 48.0625rem) and (max-width: 64rem) {
  .grundsaetze { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .blatt,
  .einwilligung { transition: none; }
  .zettel a,
  .zettel a.ist-ab,
  .zettel a.ist-neu { transform: none; transition: opacity 200ms linear; }
  .knopf:active { transform: none; }
}

@media print {
  body { background: #fff; color: #000; }
  .kopf__links, .zettel, .einwilligung, .fuss__links { display: none; }
  .blatt { filter: none; width: 100%; aspect-ratio: auto; }
}
