:root {
  --bg: #eef1f6;
  --fg: #14171d;
  /* Fließtext. 9,1:1 gegen --bg. --muted ist für kurze Beschriftungen. */
  --text: #3a414c;
  --muted: #5a616c;

  /* Reine Dekorlinien. Bewusst schwach, sie sollen nichts behaupten. */
  --line: rgba(20, 23, 29, 0.09);
  --line-2: rgba(20, 23, 29, 0.16);
  /* Grenzen von Bedienelementen. Mindestens 3:1 gegen --bg (WCAG 1.4.11). */
  --line-strong: #7a7f87;

  --accent: #1a56ff;
  --accent-soft: rgba(26, 86, 255, 0.14);

  --maxw: 1240px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --z-base: 0;
  --z-content: 1;
  --z-header: 10;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--z-base);
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(
    ellipse 120% 80% at 50% 0%,
    #000 30%,
    transparent 80%
  );
  mask-image: radial-gradient(
    ellipse 120% 80% at 50% 0%,
    #000 30%,
    transparent 80%
  );
  opacity: 0.6;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

/* Sprungziele dürfen nicht unter dem fixierten Header landen. */
:target,
section[id] {
  scroll-margin-top: 96px;
}

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 36px;
  position: relative;
  z-index: var(--z-content);
}

.prose {
  max-width: 66ch;
}

.skip-link {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -120%);
  z-index: calc(var(--z-header) + 1);
  background: var(--accent);
  color: var(--bg);
  padding: 14px 22px;
  font-weight: 600;
  transition: transform 0.2s var(--ease);
}

.skip-link:focus-visible {
  transform: translate(-50%, 0);
}

/* ---------- NAV ---------- */

/* Bewusst über die ID, nicht über den Elementnamen: Innerhalb des Inhalts
   gibt es weitere <header>- und <footer>-Elemente (Beitragskopf, Beitragsfuß),
   die nichts von der Seitenkopfzeile erben dürfen. */
#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  transition:
    background 0.4s var(--ease),
    border-color 0.4s;
  border-bottom: 1px solid transparent;
}

#header.scrolled {
  background: rgba(238, 241, 246, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 76px;
}

.brand {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: 10px;
  color: var(--fg);
  flex-shrink: 0;
}

.brand .sq {
  width: 10px;
  height: 10px;
  background: var(--accent);
  display: inline-block;
  box-shadow: 0 0 0 4px var(--accent-soft);
  flex-shrink: 0;
}

.brand .brand-suffix {
  color: var(--muted);
}

.nav-links {
  display: flex;
  gap: 30px;
  align-items: center;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  /* Ein umgebrochener Navigationspunkt sieht aus wie zwei. Lieber sichtbar zu
     eng, dann greift der Menü-Umbruch. */
  white-space: nowrap;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  transition: color 0.25s;
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-cta {
  border: 1px solid var(--line-strong);
  color: var(--fg) !important;
  padding: 0 18px;
  transition:
    border-color 0.25s,
    color 0.25s,
    background 0.25s;
}

.nav-cta:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg) !important;
}

.menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--line-strong);
  color: var(--fg);
  min-height: 44px;
  min-width: 44px;
  padding: 0 16px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition:
    border-color 0.25s,
    color 0.25s;
}

.menu-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- MOBILE NAV ---------- */

.mobile-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  /* Voll deckend, kein Weichzeichner: Bei 0.97 blieb der Inhalt darunter
     lesbar, und die Menüpunkte standen gegen einen wandernden Hintergrund. */
  background: var(--bg);
  border-bottom: 1px solid var(--line-2);
}

.mobile-nav.open {
  display: block;
}

.mobile-nav a {
  display: flex;
  align-items: center;
  min-height: 52px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  transition:
    color 0.2s,
    background 0.2s;
}

.mobile-nav a:last-child {
  border-bottom: none;
}

.mobile-nav a:hover {
  color: var(--accent);
  background: rgba(26, 86, 255, 0.05);
}

.mobile-nav .nav-cta {
  margin: 14px 22px 18px;
  justify-content: center;
  border: 1px solid var(--line-strong);
  color: var(--fg) !important;
}

.mobile-nav .nav-cta:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg) !important;
}

/* ---------- HERO ---------- */

.hero {
  padding: clamp(126px, 18vh, 180px) 0 clamp(56px, 9vh, 104px);
}

h1 {
  font-weight: 700;
  font-size: clamp(2.75rem, 8.5vw, 6rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
}

/* Das tragende Wort ist als Struktur gezeichnet, nicht als Fläche. */
.outline {
  color: transparent;
  -webkit-text-stroke: clamp(1px, 0.014em, 1.5px) var(--accent);
}

@supports not (-webkit-text-stroke: 1px currentColor) {
  .outline {
    color: var(--accent);
  }
}

/* Argument und Handlung stehen untereinander. Nebeneinander reißt auf
   breiten Schirmen eine Lücke auf, die der Blick überspringen muss. */
.hero-bottom {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(28px, 3.5vw, 40px);
  margin-top: clamp(34px, 5vw, 52px);
}

.hero-sub {
  max-width: 54ch;
  color: var(--text);
  font-size: clamp(1.0625rem, 1.4vw, 1.1875rem);
}

.hero-sub b {
  color: var(--fg);
  font-weight: 600;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  font-size: 15px;
  font-weight: 600;
  transition:
    transform 0.3s var(--ease),
    background 0.25s,
    color 0.25s,
    border-color 0.25s,
    box-shadow 0.3s;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(26, 86, 255, 0.28);
}

.btn .arr {
  transition: transform 0.3s var(--ease);
}

.btn-primary:hover .arr {
  transform: translate(3px, -3px);
}

.btn-ghost {
  border: 1px solid var(--line-strong);
  color: var(--fg);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- SEKTIONSKOPF ---------- */

.sec-head {
  margin-bottom: clamp(40px, 5vw, 62px);
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 20px;
}

.sec-head h2 {
  font-weight: 600;
  font-size: clamp(1.75rem, 3.6vw, 2.75rem);
  letter-spacing: -0.025em;
  line-height: 1.05;
}

/* ---------- LEISTUNGEN ---------- */

.services {
  padding: clamp(72px, 10vw, 104px) 0;
}

/*
 * Kein Kartenraster: Architektur führt über die volle Breite, die drei
 * anderen stehen darunter als Liste. Nebeneinander ergaben sie drei
 * Leseanfänge auf gleicher Höhe, und das Auge fand keinen Anfang.
 */
.svc {
  padding: clamp(30px, 3.5vw, 42px) 0;
  border-top: 1px solid var(--line-2);
}

.svc--lead {
  border-top: none;
  padding-top: 0;
}

/* Je Feld eine Zeile: links die Ansage, rechts der Text. Alles hängt an
   derselben linken Kante wie der führende Block darüber. Die Produkte weiter
   unten nutzen dasselbe Layout, deshalb steht es einmal für beide. */
.svc-liste .svc,
.produkt-liste .produkt {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  /* Die zweite Zeile nimmt den Überhang der rechten Spalte auf, sonst rutscht
     die Überschrift von ihrer Ansage weg. */
  grid-template-rows: auto 1fr;
  column-gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

.svc-liste .svc-problem,
.svc-liste .svc h3,
.produkt-liste .produkt-art,
.produkt-liste .produkt h3 {
  grid-column: 1;
}

.svc-liste .svc h3,
.produkt-liste .produkt h3 {
  margin-bottom: 0;
}

.svc-liste .svc > p:not(.svc-problem),
.produkt-liste .produkt > p:not(.produkt-art) {
  grid-column: 2;
  grid-row: 1 / span 2;
  max-width: 56ch;
}

.svc-problem {
  color: var(--accent);
  font-weight: 600;
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  margin-bottom: 14px;
  max-width: 40ch;
}

.svc h3 {
  font-weight: 600;
  font-size: 1.375rem;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin-bottom: 12px;
}

.svc--lead h3 {
  font-size: clamp(1.625rem, 2.6vw, 2.125rem);
  letter-spacing: -0.025em;
}

/* Nicht schlicht ".svc p": Das schlüge über die Spezifität die Farbe der
   Problemzeile, und die trägt eine der drei Bedeutungen des Akzents. */
.svc > p:not(.svc-problem) {
  color: var(--text);
  max-width: 62ch;
}

.svc--lead p + p {
  margin-top: 14px;
}

/* ---------- ÜBER MICH ---------- */

.about {
  padding: clamp(72px, 10vw, 104px) 0;
}

.about-text p {
  color: var(--text);
  font-size: clamp(1.0625rem, 1.35vw, 1.1875rem);
  margin-bottom: 20px;
}

.about-text p:last-child {
  margin-bottom: 0;
}

.about-text b {
  color: var(--fg);
  font-weight: 600;
}

.pull {
  margin: clamp(38px, 5vw, 56px) 0 0;
  padding-left: clamp(20px, 3vw, 34px);
  border-left: 1px solid var(--accent);
  max-width: 46ch;
}

.pull p {
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  font-weight: 500;
  line-height: 1.28;
  letter-spacing: -0.02em;
  color: var(--fg);
}

/* ---------- EIGENE PRODUKTE ---------- */

.produkte {
  padding: clamp(72px, 10vw, 104px) 0;
  border-top: 1px solid var(--line-2);
}

.produkte-intro {
  color: var(--text);
  max-width: 62ch;
  margin-bottom: clamp(20px, 3vw, 30px);
}

.produkt {
  padding: clamp(30px, 3.5vw, 42px) 0;
  border-top: 1px solid var(--line-2);
}

/* Die Gattung, nicht das Problem: Sie ordnet ein und markiert nichts, deshalb
   Beschriftungsgrau und kein Rissblau. */
.produkt-art {
  color: var(--muted);
  margin-bottom: 12px;
  max-width: 40ch;
}

.produkt h3 {
  font-weight: 600;
  font-size: 1.375rem;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.produkt h3 a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: var(--line-strong);
  transition: text-decoration-color 0.25s;
}

.produkt h3 a:hover {
  text-decoration-color: var(--accent);
}

.produkt > p:not(.produkt-art) {
  color: var(--text);
}

/* ---------- KONTAKT ---------- */

.contact {
  padding: clamp(80px, 11vw, 120px) 0 clamp(72px, 9vw, 100px);
}

.contact h2 {
  font-weight: 700;
  font-size: clamp(2rem, 6.5vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  max-width: 18ch;
}

.contact-mail {
  display: inline;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 500;
  /* Untergrenze über dem Fließtext: Der einzige Konversionsweg der Seite darf
     nicht ihr kleinster Text sein. Der Innenabstand bringt die Trefferfläche
     über die 24px aus WCAG 2.5.8. */
  font-size: clamp(1.0625rem, 3.2vw, 1.625rem);
  padding: 5px 0;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 9px;
  text-decoration-color: var(--line-strong);
  overflow-wrap: anywhere;
  transition: text-decoration-color 0.3s;
}

.contact-mail-line {
  margin-top: 34px;
}

.contact-mail:hover {
  text-decoration-color: var(--accent);
}

.contact-mail .arr {
  display: inline-block;
  margin-left: 0.45em;
  transition: transform 0.3s var(--ease);
}

.contact-mail:hover .arr {
  transform: translate(3px, -3px);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: clamp(30px, 4vw, 44px);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.status .blip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  animation: pulse 1.8s infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.contact-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  border-top: 1px solid var(--line-2);
  margin-top: clamp(44px, 6vw, 68px);
}

.meta-item {
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.meta-item + .meta-item {
  padding-left: 0;
}

.meta-item .k {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}

.meta-item .v {
  color: var(--text);
  max-width: 40ch;
}

/* ---------- FEHLERSEITE ---------- */

.fehlerseite {
  padding: clamp(140px, 22vh, 210px) 0 clamp(80px, 12vh, 130px);
}

.fehler-code {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 500;
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 20px;
}

.fehlerseite h1 {
  font-size: clamp(2.25rem, 6vw, 4rem);
  max-width: 16ch;
}

.fehler-text {
  margin-top: clamp(24px, 3vw, 32px);
  max-width: 52ch;
  color: var(--text);
}

.fehlerseite .hero-actions {
  margin-top: clamp(30px, 4vw, 42px);
}

/* ---------- REVEAL ---------- */

/*
 * Der sichtbare Zustand ist der Auslieferungszustand. Die Animation kommt
 * additiv dazu, sobald JavaScript läuft. Ohne JS steht die Seite trotzdem.
 */
.reveal {
  opacity: 1;
  transform: none;
}

html.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.8s var(--ease),
    transform 0.8s var(--ease);
}

html.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- FOOTER ---------- */

body > footer {
  border-top: 1px solid var(--line);
  padding: 22px 0;
}

.foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: 14px;
  color: var(--muted);
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
}

.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  transition: color 0.25s;
}

.foot-links a:hover {
  color: var(--accent);
}

/* ---------- BARRIEREFREIHEIT ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  html.js .reveal,
  html.js .reveal.in {
    opacity: 1;
    transform: none;
  }
}

/* ---------- RESPONSIVE ---------- */

/* Eigener Umbruch für die Navigation, auch wenn er zurzeit auf demselben Wert
   liegt wie der des Inhalts. Er beantwortet eine andere Frage: ab wann der
   CTA-Knopf über den Seitenrand liefe. Zusammengelegt verstellt ein weiterer
   Navigationspunkt sonst das Zeilenlayout der Listen. */
@media (max-width: 900px) {
  .nav-links {
    display: none;
  }
  .menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 900px) {
  /* Zwei Lesespalten nebeneinander tragen hier nicht mehr: Die Ansage rutscht
     über den Text. */
  .svc-liste .svc,
  .produkt-liste .produkt {
    display: block;
  }
  .svc-liste .svc h3,
  .produkt-liste .produkt h3 {
    margin-bottom: 12px;
  }
}

@media (max-width: 480px) {
  .wrap {
    padding: 0 22px;
  }
  body {
    font-size: 16px;
  }
  .hero-actions .btn {
    flex: 1 1 100%;
  }
  /* Die Adresse bricht hier über zwei Zeilen. Mit 9px Abstand stieße die
     Unterstreichung fast in die Folgezeile. */
  .contact-mail {
    text-underline-offset: 5px;
  }
}

/* Auf sehr schmalen Geräten kollidiert die volle Wortmarke mit dem
   Menü-Button. Der Zusatz geht, das Zeichen bleibt. */
@media (max-width: 420px) {
  .brand .brand-suffix {
    display: none;
  }
}
