/* WerreWerk · Montageplan als Blaupause */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-var.woff2") format("woff2-variations"),
       url("../fonts/archivo-var.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* Farbe: Deep Navy als Grund, zwei Flächenstufen, Eisweiß, eine Signalfarbe */
  --bg: #081b2b;
  --surface: #10283d;
  --surface-2: #133149;
  --side: #0c2234;
  --ink: #eaf1f8;
  --muted: #a9b9c9;
  --line: #8ea6bb;
  --signal: #ffc400;
  --signal-hover: #ffd447;
  --on-signal: #081b2b;

  /* Schrift: fünf Stufen, der Schriftzug füllt seinen Container (WerreWerk ≈ 6,4 em breit) */
  --step-small: 0.875rem;
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.6vw, 1.625rem);
  --step-head: clamp(2.25rem, 1.4rem + 3.6vw, 4.25rem);
  --step-display: calc(100cqi / 6.5);

  /* Raster */
  --margin: clamp(1rem, 3.2vw, 3rem);
  --gap: clamp(1rem, 2vw, 1.5rem);
  --section: clamp(7rem, 12vw, 11rem);
  --max: 90rem;
  --bar-h: 4.5rem;

  /* Bewegung */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--bar-h) + 1rem);
  overflow-x: clip;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Archivo", system-ui, sans-serif;
  font-size: var(--step-body);
  font-stretch: 100%;
  line-height: 1.55;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: clip;
}
body.menu-open { overflow: hidden; }

img, svg { display: block; max-width: 100%; }

h1, h2, h3 {
  margin: 0;
  font-weight: 700;
  font-stretch: 112%;
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }
a { color: inherit; }

::selection { background: var(--signal); color: var(--on-signal); }

:focus-visible { outline: 3px solid var(--signal); outline-offset: 4px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: var(--margin);
  top: -4rem;
  z-index: 20;
  padding: 0.75rem 1rem;
  background: var(--signal);
  color: var(--on-signal);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { top: 1rem; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--margin);
}

/* ---------- Kopfzeile ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
}
.bar::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bg);
  opacity: 0;
  transition: opacity 240ms var(--ease-out);
}
.bar.is-scrolled::before { opacity: 1; }
.bar-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem 2rem;
  min-height: var(--bar-h);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-right: auto;
  text-decoration: none;
  font-weight: 750;
  font-stretch: 118%;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}
.logo svg { width: 2.6rem; height: auto; overflow: visible; }
.logo path { fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linejoin: miter; stroke-linecap: square; }

.nav { display: flex; align-items: center; gap: 1.75rem; }
.nav a {
  position: relative;
  padding-block: 0.4rem;
  text-decoration: none;
  font-size: 1rem;
  color: var(--muted);
  transition: color 180ms ease;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0.1rem;
  height: 2px;
  background: var(--signal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 240ms var(--ease-out);
}
.nav a.is-current { color: var(--ink); }
.nav a.is-current::after { transform: scaleX(1); }
@media (hover: hover) and (pointer: fine) {
  .nav a:hover { color: var(--ink); }
  .nav a:hover::after { transform: scaleX(1); }
}
.nav a:focus-visible::after { transform: scaleX(1); }

.bar-cta { min-height: 2.75rem; padding: 0.55rem 1.1rem; font-size: 1rem; }

.menu-toggle {
  display: none;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  padding: 0.5rem 0.25rem 0.5rem 0.75rem;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}
.menu-icon { position: relative; width: 1.5rem; height: 0.9rem; }
.menu-icon i {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: currentColor;
  transition: transform 260ms var(--ease-out);
}
.menu-icon i:first-child { top: 0; }
.menu-icon i:last-child { bottom: 0; }
.menu-toggle[aria-expanded="true"] .menu-icon i:first-child { transform: translateY(0.4rem) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-icon i:last-child { transform: translateY(-0.4rem) rotate(-45deg); }

.menu {
  position: fixed;
  inset: var(--bar-h) 0 0 0;
  z-index: 9;
  background: var(--bg);
  overflow-y: auto;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 240ms var(--ease-out), transform 320ms var(--ease-out), visibility 0s linear 320ms;
}
.menu.is-open { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
.menu-inner { display: grid; align-content: start; gap: 0.25rem; padding-block: 1.5rem 3rem; }
.menu-inner a:not(.button) {
  justify-self: start;
  padding-block: 0.5rem;
  font-size: clamp(2rem, 9vw, 3rem);
  font-weight: 700;
  font-stretch: 112%;
  letter-spacing: -0.03em;
  text-decoration: none;
}
.menu-inner .button { justify-self: start; margin-top: 1.5rem; }
.menu.is-open .menu-inner > * { animation: rise 420ms var(--ease-out) both; }
.menu.is-open .menu-inner > :nth-child(2) { animation-delay: 40ms; }
.menu.is-open .menu-inner > :nth-child(3) { animation-delay: 80ms; }
.menu.is-open .menu-inner > :nth-child(4) { animation-delay: 120ms; }
.menu.is-open .menu-inner > :nth-child(5) { animation-delay: 160ms; }
.menu.is-open .menu-inner > :nth-child(6) { animation-delay: 200ms; }

/* ---------- Knöpfe und Links ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3rem;
  padding: 0.8rem 1.4rem;
  border: 0;
  background: var(--signal);
  color: var(--on-signal);
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 650;
  font-stretch: 108%;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 180ms ease;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
.button .arrow {
  display: inline-block;
  width: 1.1em;
  height: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: square;
  transition: transform 220ms var(--ease-out);
}
.button:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .button:hover { background: var(--signal-hover); }
  .button:hover .arrow { transform: translateX(4px); }
}
.button:focus-visible .arrow { transform: translateX(4px); }
.button[aria-busy="true"] { pointer-events: none; opacity: 0.75; }

.text-link {
  position: relative;
  display: inline-block;
  padding-block: 0.35rem;
  font-weight: 600;
  text-decoration: none;
}
.text-link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--signal);
  transform-origin: left;
  transition: transform 260ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .text-link:hover::after { transform: scaleX(0.35); }
}
.text-link:active { transform: translateY(1px); }

/* ---------- Startbereich: die Werre bei Nacht, darüber Schrift und Geräte ---------- */

.hero {
  position: relative;
  margin-top: calc(var(--bar-h) * -1);
  padding-top: calc(var(--bar-h) + clamp(3rem, 9vh, 6rem));
  padding-bottom: clamp(3rem, 8vh, 5rem);
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-items: end;
  overflow: clip;
}
.hero-bg { position: absolute; inset: 0; margin: 0; z-index: -1; }
.hero-bg .cyano { position: absolute; inset: -6% 0 0 0; }
.hero-bg .cyano img { position: absolute; inset: 0; object-position: 60% 70%; }
.photo-mask {
  position: absolute;
  inset: 0;
  background: var(--bg);
  transform-origin: right;
  transform: scaleX(0);
  pointer-events: none;
}
.hero > .wrap, .foot > .wrap, .contact > .wrap { container-type: inline-size; }

.hero-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
  align-items: end;
}
.hero-copy { grid-column: 1 / span 7; grid-row: 1; position: relative; z-index: 3; }
.hero-title {
  font-size: clamp(3rem, 1.4rem + 5vw, 6rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.045em;
}
.hero-title .dot, .accent-dot { color: var(--signal); }
.reveal { display: inline-block; overflow: hidden; padding-bottom: 0.1em; margin-bottom: -0.1em; vertical-align: top; }
.reveal > span { display: inline-block; }
.hero-title .reveal { display: block; }
.subline {
  margin-top: clamp(1rem, 2vw, 1.5rem);
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.5rem);
  font-weight: 350;
  font-stretch: 100%;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.subline .reveal { display: block; }
.hero-copy .lead { margin-top: 1.5rem; max-width: 34rem; line-height: 1.55; }
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  margin-top: clamp(1.75rem, 3vw, 2.5rem);
}

/* Geräte: diese Website, im Browser und auf dem Telefon */
.hero-devices {
  grid-column: 8 / span 5;
  grid-row: 1;
  position: relative;
  align-self: center;
  aspect-ratio: 16 / 11;
  perspective: 1400px;
}
.hero-caption {
  grid-column: 8 / span 5;
  grid-row: 2;
  justify-self: end;
  max-width: 22rem;
  margin-top: 1rem;
  padding-left: 0.9rem;
  border-left: 2px solid var(--signal);
  font-size: var(--step-small);
  line-height: 1.45;
  color: var(--ink);
}

.mock { position: absolute; z-index: 2; }
.mock-body { background: var(--surface-2); }
.mock img { width: 100%; height: auto; }
.mock-browser { top: 0; right: 0; width: 86%; }
.mock-browser .mock-body { padding: 0 0.5rem 0.5rem; }
.mock-chrome {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 2rem;
  padding: 0 0.15rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.mock-chrome i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); opacity: 0.6; }
.mock-chrome span { margin-left: 0.6rem; padding: 0 0.6rem; background: var(--bg); line-height: 1.1rem; }
.mock-phone { left: 0; bottom: 0; width: 26%; }
.mock-phone .mock-body { padding: 0.5rem; border-radius: 16px; background: #0d2438; }
.mock-phone img { border-radius: 10px; }

/* Cyanotypie: Fotos der Werre als Blaupause */
.cyano {
  position: relative;
  background: #1c4a78;
  overflow: hidden;
  isolation: isolate;
}
.cyano img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.25) brightness(0.92);
  mix-blend-mode: screen;
  opacity: 0.9;
}
.cyano::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bg);
  mix-blend-mode: multiply;
  opacity: 0.18;
  pointer-events: none;
}
figcaption, .caption {
  margin-top: 0.75rem;
  font-size: var(--step-small);
  line-height: 1.45;
  color: var(--muted);
}

/* ---------- Die Werre ---------- */

.werre {
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}
.werre path {
  fill: none;
  stroke: var(--signal);
  stroke-width: 2;
  stroke-linecap: round;
}
main { position: relative; }
main > section { position: relative; z-index: 1; }

/* ---------- Abschnitte ---------- */

.section { padding-top: var(--section); }

.sec-head h2 { font-size: var(--step-head); }
.sec-head p {
  margin-top: 1.5rem;
  max-width: 36rem;
  font-size: var(--step-lead);
  line-height: 1.4;
}

/* Fläche, die über den dunklen Grund geschoben ist: Tiefe durch Überlagerung und Tonstufe */
.panel {
  background: var(--surface);
  padding: 2.5rem;
  padding: clamp(1.5rem, 4vw, 4rem);
}

/* ---------- Leistungen: drei Karten und die Montage ---------- */

.split-head {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
  align-items: end;
}
.split-head h2 { grid-column: 1 / span 6; }
.split-head p { grid-column: 8 / span 5; margin-top: 0; font-size: var(--step-body); color: var(--muted); line-height: 1.55; }

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  margin-top: clamp(2.5rem, 5vw, 4rem);
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1.75rem 1.75rem 1.5rem;
  background: var(--surface);
  transition: background-color 240ms ease, transform 320ms var(--ease-out);
}
.card::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: var(--signal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 420ms var(--ease-out);
}
.card.is-active { background: var(--surface-2); }
.card.is-active::before { transform: scaleX(1); }
.card-fig { width: 100%; max-width: 15rem; height: 10rem; margin: 0 0 1.75rem; overflow: visible; }
.card h3 { font-size: var(--step-lead); letter-spacing: -0.02em; line-height: 1.15; }
.card-tag { margin-top: 0.4rem; font-weight: 600; }
.card p:not(.card-tag) { margin-top: 0.8rem; color: var(--muted); }
.card .arrow-link { margin-top: auto; padding-top: 1.25rem; }

/* Zeichnungen in den Karten reagieren auf die aktive Leistung */
.card-fig .layer, .card-fig .unit, .card-fig .bubble { transition: transform 520ms var(--ease-out); }
.card.is-active .card-fig .layer { transform: translateY(calc(var(--lift) * -9px)); }
.card.is-active .card-fig .unit { transform: translateX(calc(var(--i) * 5px)); }
.card-fig .packets { opacity: 0; transition: opacity 240ms ease; }
.card-fig .pk { stroke: var(--signal); stroke-width: 3; stroke-linecap: round; }
.card.is-active .card-fig .packets { opacity: 1; }
.card.is-active .card-fig .pk { animation: packet 1.4s linear infinite; }
.card.is-active .card-fig .pk:nth-child(2) { animation-delay: -0.45s; }
.card.is-active .card-fig .pk:nth-child(3) { animation-delay: -0.9s; }
.card.is-active .card-fig .bubble { animation: bob 2.4s var(--ease-out) infinite alternate; }
.card.is-active .card-fig .bubble:nth-of-type(2) { animation-delay: -1.2s; }
.card-fig .ln-sig { stroke: var(--signal); stroke-width: 3; stroke-linecap: round; }
@keyframes packet {
  from { transform: translate(0, 0); opacity: 0; }
  25% { opacity: 1; }
  75% { opacity: 1; }
  to { transform: translate(34px, 20px); opacity: 0; }
}
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(-6px); } }

.arrow-link { display: inline-flex; align-items: center; gap: 0.5rem; }
.arrow-link .arrow { width: 1em; fill: none; stroke: var(--signal); stroke-width: 1.8; transition: transform 220ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .arrow-link:hover .arrow { transform: translateX(4px); }
}

.service-more {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.1rem;
  padding: 0.4rem 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}
.service-more::after {
  content: "";
  width: 0.55rem; height: 0.55rem;
  border-right: 2px solid var(--signal);
  border-bottom: 2px solid var(--signal);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 220ms var(--ease-out);
}
.service-more[aria-expanded="true"]::after { transform: translateY(2px) rotate(-135deg); }
.service-list { margin: 0.5rem 0 0; padding: 0; list-style: none; }
.service-list li {
  position: relative;
  padding: 0.3rem 0 0.3rem 1.4rem;
  line-height: 1.45;
  animation: rise 320ms var(--ease-out) both;
}
.service-list li:nth-child(2) { animation-delay: 30ms; }
.service-list li:nth-child(3) { animation-delay: 60ms; }
.service-list li:nth-child(4) { animation-delay: 90ms; }
.service-list li:nth-child(5) { animation-delay: 120ms; }
.service-list li:nth-child(6) { animation-delay: 150ms; }
.service-list li::before {
  content: "";
  position: absolute; left: 0; top: 0.95em;
  width: 0.7rem; height: 2px;
  background: var(--line);
}

.assembly {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
  align-items: center;
  margin-top: clamp(4rem, 9vw, 7rem);
}
.stage-figure { grid-column: 1 / span 7; margin: 0; }
.assembly-text { grid-column: 9 / span 4; }
.assembly-text h3 { font-size: var(--step-lead); letter-spacing: -0.02em; line-height: 1.15; }
.assembly-text p { margin-top: 0.9rem; color: var(--muted); }

.drawing { width: 100%; height: auto; overflow: visible; }
.drawing .face { stroke: var(--line); stroke-width: 1.4; stroke-linejoin: round; }
.drawing .f-top { fill: var(--surface); }
.drawing .f-left { fill: var(--bg); }
.drawing .f-right { fill: var(--side); }
.drawing .ln { fill: none; stroke: var(--line); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.drawing .ln-bold { stroke: var(--ink); stroke-width: 4.5; stroke-linecap: round; }
.drawing .ln-thin { stroke: var(--line); stroke-width: 1; opacity: 0.7; }
.drawing .fill-ink { fill: var(--line); }
.drawing .dot { fill: var(--line); stroke: none; }
.drawing .guide { stroke: var(--line); stroke-width: 1; stroke-dasharray: 6 6; opacity: 0.8; }
.drawing .leader { fill: none; stroke: var(--ink); stroke-width: 1.2; }
.drawing .tick { fill: var(--ink); }
.drawing .callout { fill: var(--ink); font-size: 26px; font-weight: 650; font-stretch: 110%; letter-spacing: -0.01em; }
.drawing .tool { fill: var(--surface-2); stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; }
.drawing [data-explode] { will-change: transform; }
.drawing .part { transition: opacity 240ms var(--ease-out); }
.drawing.has-focus .part { opacity: 0.3; }
.drawing.has-focus .part.is-active { opacity: 1; }
.drawing .part-motion { transition: transform 420ms var(--ease-out); }
.drawing .packets line { stroke: var(--signal); stroke-width: 2.4; stroke-linecap: round; }
.stage-figure .drawing .packets { opacity: 0; }

.stage-captions { position: relative; height: 1.6em; margin-top: 1.25rem; font-size: var(--step-body); }
.stage-captions p { position: absolute; inset: 0 auto auto 0; margin: 0; color: var(--ink) !important; transition: opacity 260ms var(--ease-out); }
.stage-captions .done { opacity: 0; font-weight: 650; }
.is-assembled .stage-captions .start { opacity: 0; }
.is-assembled .stage-captions .done { opacity: 1; }

/* ---------- Arbeitsprobe: Live-Analyse ---------- */

.sample {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
  align-items: start;
}
.sample .sec-head { grid-column: 1 / span 5; }
.sample .sec-head .sample-note { margin-top: 1.25rem; color: var(--muted); max-width: 32rem; font-size: var(--step-body); }
.lab { grid-column: 7 / span 6; }
.lab-head h3 { font-size: var(--step-lead); letter-spacing: -0.02em; line-height: 1.15; }
.lab-state { margin-top: 0.5rem; color: var(--muted); min-height: 3.1em; }
.lab-progress { height: 3px; margin-top: 0.75rem; background: var(--bg); overflow: hidden; }
.lab-progress span { display: block; height: 100%; background: var(--signal); transform: scaleX(0); transform-origin: left; transition: transform 260ms var(--ease-out); }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; margin: 1.5rem 0 0; }
.tiles div { display: flex; flex-direction: column-reverse; justify-content: flex-end; padding: 1rem 1rem 1.1rem; background: var(--bg); }
.tiles dt { margin-top: 0.4rem; font-size: var(--step-small); color: var(--muted); line-height: 1.3; }
.tiles dd { margin: 0; font-size: var(--step-lead); font-weight: 750; font-stretch: 110%; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tiles dd.na { font-size: 1rem; font-weight: 500; color: var(--muted); white-space: normal; }
.tiles dd.is-new { animation: rise 420ms var(--ease-out) both; }

.groups { margin-top: 1.25rem; }
.group + .group { margin-top: 2px; }
.group-toggle {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  min-height: 3.25rem;
  padding: 0.75rem 1rem;
  border: 0;
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background-color 200ms ease;
  touch-action: manipulation;
}
.group-toggle > span:first-child { flex: 1; }
.group-toggle::after {
  content: "";
  width: 0.8rem; height: 0.8rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M6 0v12M0 6h12' stroke='%23ffc400' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 260ms var(--ease-out);
}
.group-toggle[aria-expanded="true"]::after { transform: rotate(45deg); }
.group-toggle:disabled { cursor: default; color: var(--muted); }
.group-toggle:disabled::after { opacity: 0.4; }
.group-sum { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 500; }
@media (hover: hover) and (pointer: fine) {
  .group-toggle:not(:disabled):hover { background: #173a56; }
}
.group-files { margin: 0; padding: 0.4rem 1rem 0.9rem; list-style: none; background: var(--bg); }
.group-files li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
  animation: rise 320ms var(--ease-out) both;
}
.group-files li + li { border-top: 1px solid var(--surface); }
.group-files .f-name { word-break: break-all; }
.group-files .f-meta { color: var(--muted); white-space: nowrap; text-align: right; }
.lab-when { margin-top: 1.25rem; font-size: var(--step-small); color: var(--muted); }

/* ---------- Projekte (vorbereitet, verborgen bis es echte Projekte gibt) ---------- */

.projects[hidden] { display: none; }
.project-list { display: grid; gap: clamp(4rem, 10vw, 8rem); margin-top: clamp(2.5rem, 5vw, 4rem); }
.project { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: end; }
.project-media { grid-column: 1 / span 8; position: relative; margin: 0; }
.project-info { grid-column: 10 / span 3; }
.project-facts { margin: 1rem 0 0; }
.project-facts div { display: flex; gap: 0.75rem; }
.project-facts dt { color: var(--muted); }
.project-facts dd { margin: 0; }

/* ---------- Über mich ---------- */

.about {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
  align-items: center;
}
.about-text { grid-column: 1 / span 6; }
.about-text h2 { font-size: var(--step-head); }
.about-text h3 { margin-top: clamp(2rem, 4vw, 3rem); font-size: var(--step-lead); letter-spacing: -0.02em; line-height: 1.2; }
.about-text p { margin-top: 1.1rem; max-width: 36rem; }
.about-text .about-lead { margin-top: 1.75rem; font-size: var(--step-lead); line-height: 1.4; }
.about-figure { grid-column: 8 / span 5; margin: 0; }
.about-figure .cyano { aspect-ratio: 4 / 5; }

.region {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
  align-items: center;
  margin-top: clamp(3rem, 7vw, 5rem);
}
.region-text { grid-column: 1 / span 5; }
.region-text h3 { font-size: var(--step-head); }
.region-text p { margin-top: 1.25rem; color: var(--muted); max-width: 30rem; }
.region-map { grid-column: 7 / span 6; width: 100%; max-width: 30rem; height: auto; justify-self: center; overflow: visible; }
.region-map .map-river { fill: none; stroke: var(--signal); stroke-width: 3; stroke-linecap: round; }
.region-map .map-else { fill: none; stroke: var(--line); stroke-width: 2; stroke-linecap: round; }
.region-map .map-town circle { fill: var(--line); }
.region-map text { fill: var(--muted); font-size: 17px; font-weight: 500; }
.region-map .map-home circle { fill: var(--signal); }
.region-map .map-home text { fill: var(--ink); font-size: 22px; font-weight: 700; }
.region-map .map-pulse { fill: none !important; stroke: var(--signal); stroke-width: 2; transform-box: fill-box; transform-origin: center; opacity: 0; }
.region-map .map-label { fill: var(--line); font-size: 14px; font-style: italic; }
.region.is-in .map-pulse { animation: pulse 2.8s var(--ease-out) 600ms infinite; }
@keyframes pulse { from { transform: scale(0.4); opacity: 0.9; } to { transform: scale(1.8); opacity: 0; } }

/* ---------- Ablauf: vier Stationen an einer Linie ---------- */

.process { position: relative; margin-top: clamp(2.5rem, 5vw, 4rem); }
.process-wave {
  position: absolute;
  left: 0; right: 0;
  top: 0;
  width: 100%;
  height: 5rem;
  overflow: visible;
}
.process-wave path { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
.process-wave .wave-base { stroke: var(--surface-2); }
.process-wave .wave-fill { stroke: var(--signal); stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.stations {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(2rem, 3vw, 3rem) var(--gap);
  margin: 0;
  padding: 0;
  list-style: none;
}
.station { text-align: center; }
.station p { margin-inline: auto; }
.station-ring {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 4.5rem; height: 4.5rem;
  margin-left: calc(50% - 2.25rem);
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--surface-2);
  transition: border-color 320ms ease, transform 420ms var(--ease-out);
}
.station-icon { width: 2rem; height: 2rem; fill: none; stroke: var(--line); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: stroke 320ms ease; }
.station-num { display: block; margin-top: 1.25rem; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; transition: color 320ms ease; }
.station h3 { margin-top: 0.35rem; font-size: var(--step-lead); letter-spacing: -0.02em; line-height: 1.15; }
.station p { margin-top: 0.75rem; max-width: 22rem; color: var(--muted); }
.station.is-on .station-ring { border-color: var(--signal); transform: scale(1.04); }
.station.is-on .station-icon { stroke: var(--ink); }
.station.is-on .station-num { color: var(--signal); }

/* ---------- Kontakt ---------- */

.contact .sec-head p { max-width: 40rem; }
.big-mail {
  display: inline-block;
  position: relative;
  margin-top: clamp(2rem, 4vw, 3rem);
  font-size: calc(100cqi / 10.6);
  font-weight: 750;
  font-stretch: 112%;
  letter-spacing: -0.045em;
  line-height: 1;
  text-decoration: none;
  transition: color 220ms ease;
}
.big-mail .at { display: inline-block; color: var(--signal); transition: transform 420ms var(--ease-out); }
.big-mail .mail-a, .big-mail .mail-b { white-space: nowrap; }
.big-mail::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -0.12em;
  height: 0.05em;
  background: var(--signal);
  transform: scaleX(0.08);
  transform-origin: left;
  transition: transform 520ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .big-mail:hover::after { transform: scaleX(1); }
  .big-mail:hover .at { transform: rotate(-18deg) scale(1.06); }
}
.big-mail:focus-visible::after { transform: scaleX(1); }
.big-mail:active { transform: scale(0.99); }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
  margin-top: clamp(3rem, 6vw, 5rem);
}
.contact-note { grid-column: 1 / span 4; }
.contact-note h3 { font-size: var(--step-lead); letter-spacing: -0.02em; line-height: 1.2; }
.contact-note p { margin-top: 1rem; color: var(--muted); }
.mailform { grid-column: 6 / span 7; display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem var(--gap); }
.field { display: grid; gap: 0.45rem; align-content: start; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: 1rem; font-weight: 600; }
.field .hint { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 3.1rem;
  padding: 0.75rem 0.9rem;
  border: 2px solid var(--surface-2);
  border-radius: 0;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 1.0625rem;
  transition: border-color 160ms ease;
}
.field textarea { min-height: 9rem; resize: vertical; line-height: 1.5; }
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23eaf1f8' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.75rem;
}
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: none; border-color: var(--signal); }
.field [aria-invalid="true"] { border-color: var(--signal); }
.field-error { font-size: 0.9375rem; color: var(--signal); }
.field ::placeholder { color: var(--muted); opacity: 1; }
.form-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.form-foot p { font-size: var(--step-small); color: var(--muted); max-width: 26rem; }

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

.foot { margin-top: var(--section); padding-bottom: 2rem; overflow-x: clip; }
.foot-claim { font-size: var(--step-lead); font-weight: 650; font-stretch: 108%; letter-spacing: -0.015em; margin-bottom: 1.5rem; }
.foot-mark {
  font-size: var(--step-display);
  font-weight: 800;
  font-stretch: 125%;
  letter-spacing: -0.045em;
  line-height: 0.82;
  white-space: nowrap;
  margin-left: -0.04em;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--line);
  -webkit-user-select: none;
  user-select: none;
}
.foot-line-draw {
  display: block;
  height: 2px;
  margin-top: 1.25rem;
  background: var(--signal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1400ms var(--ease-out);
}
.foot.is-in .foot-line-draw { transform: scaleX(1); }
.foot-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem var(--gap);
  margin-top: 2.5rem;
}
.foot-col p { color: var(--muted); margin-top: 0.75rem; }
.foot-mail { font-size: var(--step-lead); font-weight: 650; text-decoration-color: var(--signal); text-decoration-thickness: 2px; text-underline-offset: 0.25em; }
.foot-nav { display: grid; align-content: start; gap: 0.35rem; }
.foot-nav a { justify-self: start; padding-block: 0.15rem; text-decoration-color: transparent; text-underline-offset: 0.25em; text-decoration-thickness: 2px; transition: text-decoration-color 200ms ease; }
.foot-nav a:hover, .foot-nav a[aria-current="page"] { text-decoration-color: var(--signal); }
.foot-nav .foot-copy { margin-top: 1rem; font-size: var(--step-small); }
.credits { margin-top: 2.5rem; font-size: var(--step-small); color: var(--muted); max-width: 70rem; }
.credits a { color: var(--muted); }

/* ---------- Unterseiten ---------- */

.doc { padding-top: clamp(3rem, 7vw, 6rem); }
.doc-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }
.doc h1 { grid-column: 1 / span 8; font-size: var(--step-head); }
.doc-body { grid-column: 1 / span 7; margin-top: clamp(2rem, 4vw, 3rem); }
.doc-aside { grid-column: 9 / span 4; margin-top: clamp(2rem, 4vw, 3rem); align-self: start; position: sticky; top: calc(var(--bar-h) + 2rem); }
.doc-aside p { color: var(--muted); }
.doc-aside .button { margin-top: 1.25rem; }
.doc-body h2 { margin-top: 2.75rem; font-size: var(--step-lead); letter-spacing: -0.02em; line-height: 1.2; }
.doc-body h2:first-child { margin-top: 0; }
.doc-body p, .doc-body ul { margin-top: 0.9rem; max-width: 40rem; }
.doc-body ul { padding-left: 1.25rem; }
.doc-body li + li { margin-top: 0.35rem; }
.doc-body a { text-decoration-color: var(--signal); text-underline-offset: 0.2em; }
.placeholder {
  display: block;
  margin-top: 0.9rem;
  padding: 1rem 1.25rem;
  background: var(--signal);
  color: var(--on-signal);
  font-weight: 650;
  max-width: 40rem;
}
.placeholder small { display: block; margin-top: 0.25rem; font-weight: 500; font-size: 0.9375rem; }

/* ---------- Bewegung ---------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
@keyframes line-up { from { transform: translateY(105%); } to { transform: none; } }
@keyframes mask-off { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes mock-in {
  from { opacity: 0; transform: translate3d(48px, 24px, 0) rotateY(-16deg) rotateX(6deg); }
  to { opacity: 1; transform: none; }
}
@keyframes phone-in {
  from { opacity: 0; transform: translate3d(-24px, 48px, 0) rotateY(14deg); }
  to { opacity: 1; transform: none; }
}
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

/* Erster Eindruck: Bild, Text-Reveal, Text, Geräte, Linie. Alles bleibt sofort bedienbar. */
.photo-mask { animation: mask-off 1100ms var(--ease-out) 80ms both; }
.hero-title .reveal > span { animation: line-up 820ms var(--ease-out) 200ms both; }
.hero-title .reveal + .reveal > span { animation-delay: 280ms; }
.subline .reveal > span { animation: line-up 720ms var(--ease-out) 380ms both; }
.subline .reveal + .reveal > span { animation-delay: 440ms; }
.hero-copy .lead { animation: rise 700ms var(--ease-out) 520ms both; }
.hero-copy .actions { animation: rise 700ms var(--ease-out) 580ms both; }
.hero-caption { animation: rise 600ms var(--ease-out) 900ms both; }
.mock-browser .mock-body { animation: mock-in 1100ms var(--ease-out) 620ms both; }
.mock-phone .mock-body { animation: phone-in 1100ms var(--ease-out) 760ms both; }
.hero-line path { stroke-dasharray: 1 1; animation: draw 1600ms var(--ease-out) 1100ms both; }

/* Abschnitte bauen sich gestaffelt auf (nur mit JS) */
.js [data-reveal]:not(.card) > *,
.js .card[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 640ms var(--ease-out), transform 640ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 80ms);
}
.js .card[data-reveal] { transition: opacity 640ms var(--ease-out), transform 640ms var(--ease-out), background-color 240ms ease; }
.js .card[data-reveal]:nth-child(2) { transition-delay: 90ms; }
.js .card[data-reveal]:nth-child(3) { transition-delay: 180ms; }
.js [data-reveal].is-in:not(.card) > *,
.js .card[data-reveal].is-in { opacity: 1; transform: none; }
@media (hover: hover) and (pointer: fine) {
  .js .card[data-reveal].is-in:hover { transform: translateY(-6px); transition-delay: 0s; }
}

/* Weiche Übergänge zwischen den Seiten */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 200ms var(--ease-out) both vt-out; }
::view-transition-new(root) { animation: 360ms var(--ease-out) 60ms both vt-in; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-12px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(16px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
  .js [data-reveal]:not(.card) > *, .js .card[data-reveal] { opacity: 1; transform: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ---------- Tablet ---------- */

@media (max-width: 1100px) {
  .nav { display: none; }
  .menu-toggle { display: inline-flex; }
  .hero { align-items: start; }
  .hero-copy { grid-column: 1 / span 9; }
  .hero-devices { grid-column: 3 / span 10; grid-row: 2; margin-top: 3rem; }
  .hero-caption { grid-column: 1 / span 12; grid-row: 3; }
  .split-head h2, .split-head p { grid-column: 1 / span 12; }
  .split-head p { margin-top: 1.25rem; max-width: 40rem; }
  .cards { grid-template-columns: 1fr; max-width: 44rem; }
  .card { display: grid; grid-template-columns: 11rem 1fr; column-gap: 1.5rem; align-items: start; }
  .card-fig { grid-row: 1 / span 6; width: 11rem; height: 8rem; margin: 0; }
  .card > :not(.card-fig) { grid-column: 2; justify-self: start; }
  .card .arrow-link { margin-top: 0.5rem; }
  .stage-figure { grid-column: 1 / span 12; }
  .assembly-text { grid-column: 1 / span 12; }
  .sample .sec-head, .lab { grid-column: 1 / span 12; }
  .lab { margin-top: 2rem; }
  .about-text { grid-column: 1 / span 7; }
  .about-figure { grid-column: 8 / span 5; }
  .region-text, .region-map { grid-column: 1 / span 12; }
  .region-map { margin-top: 1rem; }
  .stations { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .process-wave { display: none; }
  .contact-note { grid-column: 1 / span 12; }
  .mailform { grid-column: 1 / span 12; margin-top: 1rem; }
  .doc h1, .doc-body { grid-column: 1 / span 12; }
  .doc-aside { grid-column: 1 / span 12; position: static; }
}

/* ---------- Telefon ---------- */

@media (max-width: 720px) {
  :root { --margin: 1.5rem; --bar-h: 4rem; }
  .bar-cta { display: none; }
  .hero { padding-top: calc(var(--bar-h) + 2.5rem); }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy, .hero-devices, .hero-caption { grid-column: 1; }
  .hero-devices { margin-top: 2.5rem; }
  .hero-title { font-size: clamp(2.75rem, 13vw, 3.5rem); }
  .subline { font-size: 1.5rem; }
  .mock-browser { width: 90%; }
  .mock-phone { width: 30%; }
  h1, h2 { font-stretch: 100%; }
  .sec-head h2, .doc h1, .about-text h2, .region-text h3 { font-size: 2rem; }
  .card { grid-template-columns: 1fr; }
  .card-fig { grid-row: auto; width: 100%; max-width: 13rem; height: 9rem; margin-bottom: 1.25rem; }
  .card > :not(.card-fig) { grid-column: 1; }
  .panel { margin-inline: calc(var(--margin) * -0.25); padding: 1.5rem calc(var(--margin) * 0.25 + 0.75rem); }
  .tiles { grid-template-columns: 1fr 1fr; }
  .about-text, .about-figure { grid-column: 1 / span 12; }
  .about-figure { margin-top: 2.5rem; }
  .stations { grid-template-columns: 1fr; gap: 0; }
  .station { display: grid; grid-template-columns: 4.5rem 1fr; column-gap: 1.25rem; text-align: left; padding-bottom: 2rem; }
  .station::before { content: ""; position: absolute; left: 2.25rem; top: 4.5rem; bottom: 0; width: 2px; background: var(--surface-2); }
  .station:last-child::before { display: none; }
  .station { position: relative; }
  .station-ring { grid-row: 1 / span 3; margin: 0; }
  .station-num { margin-top: 0.4rem; }
  .station p { margin-inline: 0; }
  .mailform { grid-template-columns: 1fr; }
  .big-mail { font-size: calc(100cqi / 7.15); line-height: 1.02; }
  .big-mail .mail-b { display: block; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-grid .foot-col:first-child { grid-column: 1 / -1; }
}

/* Nachtstimmung: dunklere Cyanotypie für Hero und Über mich */
.cyano.night { background: #0f3355; }
.cyano.night img { filter: grayscale(1) contrast(1.3) brightness(0.78); opacity: 0.82; }
.cyano.night::after { opacity: 0.42; }
.hero-bg .cyano.night img { opacity: 0.6; filter: grayscale(1) contrast(1.35) brightness(0.62); }
.hero-bg .cyano.night::after { opacity: 0.62; }

/* Die Werre im Hero: läuft unten durchs Bild und zeichnet sich nach dem Laden */
.hero-line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.hero-line path { fill: none; stroke: var(--signal); stroke-width: 2; stroke-linecap: round; vector-effect: non-scaling-stroke; }

/* Schriftzug im Fuß reagiert auf das Scrollen */
.foot-mark .half { display: inline-block; will-change: transform; }
