/* ==========================================================================
   Handwerksgeist – Stilsystem
   Durchgehend im Blau des Auftritts: dunkles Markenblau, blau eingefärbte
   Werkstatt-Fotos, weiße Serifen-Überschriften wie im Schriftzug des Logos.
   Die Pixel-Quadrate aus dem Logo sind das einzige Schmuckelement; Messing
   gibt es nur für das Hauptziel der Seite: anrufen.

   Keine externen Ressourcen, keine Cookies, kein Tracking.
   Kein style-Attribut im HTML: Die Content-Security-Policy in der .htaccess
   kommt ohne 'unsafe-inline' aus. Neue Varianten hier als Klasse anlegen.
   ========================================================================== */

/* --- Schriften ---------------------------------------------------------- */
/* Selbst gehostet und auf den deutschen Zeichenvorrat beschnitten.
   Source Serif 4 für Überschriften (nah am Schriftzug im Logo), Figtree für
   Text (nah an der Zeile „Der neue Maßstab des Handwerks“). */
@font-face {
  font-family: 'Source Serif 4';
  src: url('../assets/fonts/sourceserif4-var.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Figtree';
  src: url('../assets/fonts/figtree-var.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* --- Farben und Maße ---------------------------------------------------- */
:root {
  color-scheme: dark;

  --blue-950: #06182B;   /* Fußbereich, Kontakt */
  --blue-900: #0A2037;   /* Grundfläche */
  --blue-850: #0E2A47;   /* Abschnitt eine Stufe heller */
  --blue-800: #133457;
  --blue-700: #1B4470;   /* Flächen, Karten */
  --brand:    #034379;   /* Markenblau, aus dem Logo ausgemessen */
  --brand-lit:#0B5094;   /* Markenblau auf dunklem Grund */
  --pixel:    #5E9AD8;   /* die hellen Quadrate im Logo */
  --pixel-2:  #A9CDF2;
  --white:    #FFFFFF;
  --ink:      #EEF4FB;
  --ink-2:    #B9CCE2;
  --ink-3:    #8FA9C6;
  --paper:    #F4F7FB;   /* Zettel und Notizen */
  --paper-ink:#132A44;
  --brass:    #D89149;   /* Messing – nur für „Anrufen“ */
  --brass-2:  #E8A964;

  --line:      rgba(169, 205, 242, 0.2);
  --line-soft: rgba(169, 205, 242, 0.1);

  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans:  'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;

  --step--1: clamp(0.875rem, 0.84rem + 0.15vw, 0.95rem);
  --step-0:  clamp(1.0rem, 0.96rem + 0.2vw, 1.125rem);
  --step-1:  clamp(1.15rem, 1.07rem + 0.4vw, 1.4rem);
  --step-2:  clamp(1.4rem, 1.22rem + 0.9vw, 2rem);
  --step-3:  clamp(1.75rem, 1.4rem + 1.8vw, 2.8rem);
  --step-4:  clamp(2.2rem, 1.55rem + 3vw, 4.1rem);

  --container: 1240px;
  --gutter:    clamp(1rem, 4.5vw, 3.25rem);
  --section-y: clamp(4.5rem, 11vh, 8.5rem);
  --header-h:  4.25rem;
  --radius:    8px;

  --ease:     cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-back:cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Farben des Logos. Die Symbole im Sprite lesen nur diese Variablen, so
     lässt sich jede Verwendung (<use>) einzeln einfärben. */
  --mark-head: var(--brand-lit);
  --mark-hole: var(--white);
  --mark-px:   var(--pixel);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  background: var(--blue-900);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--blue-900);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.65;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1, h2, h3 {
  margin: 0 0 0.5em;
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.012em;
  color: var(--white);
  text-wrap: balance;
}
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); line-height: 1.15; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--pixel-2); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--white); text-decoration-thickness: 2px; }

img, svg, picture, canvas { display: block; max-width: 100%; }
img { height: auto; }

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

::selection { background: var(--pixel); color: var(--blue-950); }

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

/* Abschnitte: dieselbe Farbfamilie, nur hellere und dunklere Stufen. */
.section {
  position: relative;
  padding-block: var(--section-y);
  background: var(--bg, var(--blue-900));
}
.tone-deep  { --bg: var(--blue-900); }
.tone-mid   { --bg: var(--blue-850); }
.tone-night { --bg: var(--blue-950); }

.lead {
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 46ch;
}
.prose { max-width: 62ch; color: var(--ink-2); }
.prose strong { color: var(--white); font-weight: 650; }

.section-head { max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
@media (min-width: 60rem) {
  .section-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: end;
    max-width: none;
  }
  .section-head h2 { margin-bottom: 0; }
}

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

.skip-link {
  position: absolute;
  left: 50%;
  top: 0;
  translate: -50% -120%;
  z-index: 300;
  padding: 0.85rem 1.4rem;
  background: var(--white);
  color: var(--blue-950);
  font-weight: 700;
  text-decoration: none;
  border-radius: 0 0 var(--radius) var(--radius);
  transition: translate 0.2s var(--ease);
}
.skip-link:focus-visible { translate: -50% 0; color: var(--blue-950); }

/* Unsichtbarer Vorrat an Symbolen und Filtern. Nicht display:none – sonst
   greifen manche Browser nicht mehr auf die Filter darin zu. */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* --- Pixelkanten zwischen den Blaustufen -------------------------------- */
/* Die dunklere Fläche greift mit einer Reihe Logo-Quadrate in die hellere. */
.edge-top::before,
.edge-bottom::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 40px;
  background: var(--bg);
  -webkit-mask: url('../assets/edge-pixels.svg') repeat-x 0 0 / 200px 40px;
          mask: url('../assets/edge-pixels.svg') repeat-x 0 0 / 200px 40px;
  pointer-events: none;
  z-index: 1;
}
.edge-top::before { bottom: calc(100% - 1px); }
.edge-bottom::after { top: calc(100% - 1px); transform: scaleY(-1); }
.edge-shift::before { -webkit-mask-position: 80px 0; mask-position: 80px 0; }

/* --- Knöpfe ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 3.2rem;
  padding: 0.85rem 1.35rem;
  font: inherit;
  font-weight: 650;
  line-height: 1.1;
  text-decoration: none;
  border: 1.5px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease),
              color 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn svg { width: 1.15em; height: 1.15em; flex: none; }
.btn:active { transform: translateY(1px); }

/* Messing nur hier: Anrufen ist das Hauptziel der Seite. */
.btn--call { background: var(--brass); color: var(--blue-950); border-color: var(--brass); }
.btn--call:hover { background: var(--brass-2); border-color: var(--brass-2); color: var(--blue-950); }
.btn--line { border-color: rgba(238, 244, 251, 0.55); color: var(--white); background: rgba(6, 24, 43, 0.25); }
.btn--line:hover { border-color: var(--white); background: rgba(238, 244, 251, 0.1); color: var(--white); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: clamp(1.6rem, 3vw, 2.2rem);
}

/* --- Kopfzeile ---------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: var(--header-h);
  padding-inline: var(--gutter);
  color: var(--ink);
  background: rgba(6, 24, 43, 0.72);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
          backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line-soft);
}

.brand {
  --mark-head: #E7F0FA;
  --mark-hole: var(--blue-900);
  --mark-px: var(--pixel);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--white);
  text-decoration: none;
  flex: none;
}
.brand:hover { color: var(--white); }
.brand-mark { width: auto; height: 34px; }
.brand-name {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.mk-head { fill: var(--mark-head); }
.mk-hole { fill: var(--mark-hole); }
.mk-px   { fill: var(--mark-px); }
.mk-head, .mk-hole, .mk-px { fill-opacity: var(--tto, 1); }

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  padding: 0.5rem 0.8rem;
  font: inherit;
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--ink);
  background: transparent;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.menu-toggle svg { width: 18px; height: 18px; }

.site-nav a {
  display: block;
  color: var(--ink);
  font-weight: 550;
  text-decoration: none;
}
.site-nav a:hover,
.site-nav a[aria-current] { color: var(--white); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 0.4em; }

/* Mobil: Menü als Popover. Ohne Popover-Unterstützung steht die Liste
   schlicht im Fluss – nichts wird verschluckt. */
@supports selector(:popover-open) {
  .site-nav[popover] {
    position: fixed;
    inset: var(--header-h) 0 auto auto;
    width: min(20rem, 100vw);
    margin: 0;
    padding: 0.75rem;
    background: var(--blue-950);
    color: var(--ink);
    border: 0;
    border-left: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.7);
    opacity: 0;
    translate: 0 -0.5rem;
    transition-property: opacity, translate, display, overlay;
    transition-duration: 0.22s;
    transition-timing-function: var(--ease);
    transition-behavior: allow-discrete;
  }
  .site-nav[popover]:popover-open { opacity: 1; translate: 0 0; }
  @starting-style {
    .site-nav[popover]:popover-open { opacity: 0; translate: 0 -0.5rem; }
  }
  .site-nav[popover] a {
    padding: 0.85rem 0.9rem;
    border-bottom: 1px solid var(--line-soft);
  }
  .site-nav[popover] a:last-child { border-bottom: 0; }
}

.call-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.6rem;
  padding: 0.5rem 1rem;
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--blue-950);
  background: var(--brass);
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  flex: none;
  transition: background-color 0.2s var(--ease);
}
.call-btn:hover { background: var(--brass-2); color: var(--blue-950); }
.call-btn svg { width: 16px; height: 16px; flex: none; }
.call-btn .call-num { display: none; }
@media (max-width: 29.99rem) {
  .call-btn { padding-inline: 0.75rem; }
  .call-btn .call-txt { display: none; }
  .site-header { gap: 0.6rem; }
  .brand-name { font-size: 1.2rem; }
}

@media (min-width: 64rem) {
  .menu-toggle { display: none; }
  .site-nav,
  .site-nav[popover] {
    display: flex;
    position: static;
    inset: auto;
    width: auto;
    margin: 0 0 0 auto;
    padding: 0;
    gap: clamp(1rem, 1.8vw, 1.75rem);
    background: transparent;
    color: inherit;
    border: 0;
    box-shadow: none;
    opacity: 1;
    translate: none;
    overflow: visible;
  }
  .site-nav a,
  .site-nav[popover] a { padding: 0.4rem 0; font-size: var(--step--1); border: 0; }
  .call-btn .call-num { display: inline; }
}
@media (min-width: 64rem) and (max-width: 74rem) {
  .call-btn .call-num { display: none; }
}

/* Ein feiner Maßstab als Lesefortschritt unter der Kopfzeile. */
.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 5px;
  overflow: hidden;
  pointer-events: none;
}
.progress-bar {
  display: block;
  height: 100%;
  background:
    repeating-linear-gradient(90deg, rgba(6, 24, 43, 0.9) 0 1px, transparent 1px 10px) 0 0 / 100% 2px no-repeat,
    repeating-linear-gradient(90deg, rgba(6, 24, 43, 0.9) 0 1px, transparent 1px 50px) 0 0 / 100% 4px no-repeat,
    linear-gradient(90deg, var(--pixel), var(--pixel-2));
  transform-origin: 0 50%;
  transform: scaleX(var(--progress, 0));
}
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    @keyframes massstab {
      from { transform: scaleX(0); }
      to   { transform: scaleX(1); }
    }
    .progress-bar {
      animation: massstab auto linear both;
      animation-timeline: scroll(root block);
    }
  }
}

/* --- Hero: Werkstatt mit Taschenlampe ----------------------------------- */
/* Drei Ebenen im selben Ausschnitt: das Foto, darunter die „digitale“
   Fassung (Pixel und Erkennungsrahmen) und ein Lichtkegel. Wo das Licht
   hinfällt, sieht man die KI-Ebene der Werkstatt. main.js setzt --mx/--my. */
.hero {
  --mx: 72%;
  --my: 46%;
  --r: clamp(150px, 19vw, 280px);
  position: relative;
  display: flex;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding-block: calc(var(--header-h) + clamp(2rem, 6vh, 4rem)) clamp(3rem, 8vh, 5rem);
  overflow: hidden;
  isolation: isolate;
  background: var(--blue-900);
}
.hero-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero-layer img,
.hero-layer svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}
.hero-photo { z-index: -4; }
.hero-reveal {
  z-index: -3;
  -webkit-mask: radial-gradient(circle var(--r) at var(--mx) var(--my), #000 0 40%, rgba(0, 0, 0, 0.5) 65%, transparent 100%);
          mask: radial-gradient(circle var(--r) at var(--mx) var(--my), #000 0 40%, rgba(0, 0, 0, 0.5) 65%, transparent 100%);
}
.hero-reveal img { opacity: 0.9; }
.hero-light {
  z-index: -2;
  background: radial-gradient(circle calc(var(--r) * 1.7) at var(--mx) var(--my), rgba(169, 205, 242, 0.24), rgba(169, 205, 242, 0.06) 45%, transparent 70%);
}
/* Abdunkeln links für den Text und unten zum nächsten Abschnitt hin. */
.hero-shade {
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(10, 32, 55, 0) 60%, var(--blue-900) 100%),
    linear-gradient(90deg, rgba(6, 24, 43, 0.72) 0%, rgba(6, 24, 43, 0.38) 48%, rgba(6, 24, 43, 0.05) 75%);
}

/* Hinweis unten rechts – nur, wenn main.js das Licht wirklich bewegt. */
.hero-hint {
  position: absolute;
  right: var(--gutter);
  bottom: clamp(1.25rem, 4vh, 2.25rem);
  z-index: 1;
  display: none;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--ink-2);
  transition: opacity 0.6s var(--ease);
}
.hero-hint::before {
  content: '';
  width: 0.7rem;
  height: 0.7rem;
  background: var(--pixel-2);
  box-shadow: 0 0 0 4px rgba(169, 205, 242, 0.18), 0 0 18px 4px rgba(169, 205, 242, 0.35);
}
.hero.has-light .hero-hint { display: inline-flex; }
.hero.lit .hero-hint { opacity: 0; }
.hint-touch { display: none; }
@media (hover: none), (pointer: coarse) {
  .hint-fine { display: none; }
  .hint-touch { display: inline; }
}
@media (max-width: 59.99rem) {
  .hero-hint { left: var(--gutter); right: auto; }
  .hero-shade {
    background:
      linear-gradient(180deg, rgba(10, 32, 55, 0) 60%, var(--blue-900) 100%),
      rgba(6, 24, 43, 0.58);
  }
}

/* Erkennungsrahmen der KI-Ebene */
.scan-box { fill: rgba(169, 205, 242, 0.06); stroke: var(--pixel-2); stroke-width: 2.5; }
.scan-corner { fill: none; stroke: var(--white); stroke-width: 5; stroke-linecap: square; }
.scan-dim { fill: none; stroke: var(--pixel-2); stroke-width: 2; }
.scan-tag { fill: var(--pixel-2); }
.scan-text {
  font-family: var(--sans);
  font-size: 24px;
  font-weight: 700;
  fill: var(--blue-950);
}
.scan-note {
  font-family: var(--sans);
  font-size: 26px;
  font-weight: 600;
  fill: var(--white);
}
.scan-bit { fill: var(--pixel-2); }
.scan-check { fill: none; stroke: var(--pixel-2); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }

.hero-grid {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  width: 100%;
}
.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1.6rem;
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--ink-2);
}
.hero-status .px { width: 9px; height: 9px; background: var(--pixel); flex: none; }
/* Schriftzug und Zeile darunter wie im Logo: gleich breit. Die Größe richtet
   sich nach der Textspalte (Container-Einheiten), damit der Schriftzug nie
   in den Kopf läuft. */
.hero-copy { container-type: inline-size; min-width: 0; }
.hero-title { margin: 0; }
.wordmark {
  display: block;
  width: fit-content;
  font-family: var(--serif);
  font-size: clamp(2.3rem, 0.5rem + 8.4vw, 5.6rem);
  font-size: min(12.6cqi, 5.6rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.015em;
  color: var(--white);
}
.tagline {
  display: block;
  margin-top: 0.4em;
  font-family: var(--sans);
  font-size: clamp(1.05rem, 0.4rem + 3.6vw, 2.35rem);
  font-size: min(5.95cqi, 2.35rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0;
  color: #E4EDF7;
}
.hero-mark {
  --mark-head: var(--brand);
  --mark-hole: var(--white);
  --mark-px: var(--pixel);
  position: relative;
  z-index: 0;
  width: clamp(110px, 26vw, 360px);
  justify-self: center;
}
/* Lichthof hinter dem Kopf, wie im Motiv des bisherigen Auftritts */
.hero-mark::before {
  content: '';
  position: absolute;
  inset: -45% -50% -45% -40%;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(200, 224, 250, 0.42), rgba(169, 205, 242, 0.14) 50%, transparent 100%);
  pointer-events: none;
}
.hero-mark svg { width: 100%; height: auto; filter: drop-shadow(0 18px 30px rgba(3, 20, 40, 0.35)); }
@media (min-width: 60rem) {
  .hero-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); }
  .hero-mark { grid-column: 2; grid-row: 1; }
}
@media (max-width: 59.99rem) {
  .hero-mark { order: -1; justify-self: start; width: clamp(96px, 30vw, 170px); }
}

/* --- Kernaussage: aus dem Dunkel ins Licht ------------------------------ */
/* Drei Zeilen, groß gesetzt. Mit GSAP erscheinen sie beim Scrollen
   nacheinander und hinter der letzten geht das Licht an (--glow). Ohne
   JavaScript steht alles sofort da. */
.statement {
  --glow: 1;
  overflow: hidden;
  isolation: isolate;
  padding-block: clamp(5rem, 16vh, 10rem);
}
.statement::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -35%;
  z-index: -1;
  width: min(80rem, 150vw);
  height: 90%;
  translate: -50% 0;
  background: radial-gradient(closest-side, rgba(169, 205, 242, 0.2), rgba(94, 154, 216, 0.07) 55%, transparent 100%);
  opacity: var(--glow);
  pointer-events: none;
}
.statement-text {
  margin: 0;
  font-size: clamp(1.95rem, 0.9rem + 4.2vw, 4.6rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.015em;
}
.statement-line { display: block; }
.statement-line + .statement-line { margin-top: 0.4em; }
/* Ab Tablet-Breite steht jeder Satz in einer Zeile: die Größe richtet sich
   nach der Spaltenbreite, der längste Satz ist gut 17,5 Geviert breit. */
@media (min-width: 60rem) {
  .statement .container { container-type: inline-size; }
  .statement-text { font-size: min(5.6cqi, 4rem); }
  .statement-line + .statement-line { margin-top: 0.16em; }
}
.statement-line--dark { color: var(--ink-3); }
.statement-ki {
  position: relative;
  color: var(--pixel-2);
}
/* Zwei Quadrate wie am Logo-Kopf */
.statement-ki::before,
.statement-ki::after {
  content: '';
  position: absolute;
  background: var(--pixel);
}
.statement-ki::before { right: -0.34em; top: 0.4em; width: 0.18em; height: 0.18em; }
.statement-ki::after  { right: -0.56em; top: 0.18em; width: 0.11em; height: 0.11em; opacity: 0.6; }
.statement-year { color: var(--white); text-shadow: 0 0 0.6em rgba(169, 205, 242, 0.45); }
.statement-lead {
  max-width: 46ch;
  margin: clamp(1.8rem, 4vw, 2.6rem) 0 0;
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--ink-2);
}

/* --- Woche: Schreibtisch und Plantafel ---------------------------------- */
.week-switch {
  display: inline-flex;
  flex-wrap: wrap;
  padding: 4px;
  background: rgba(6, 24, 43, 0.86);
  border: 1px solid var(--line);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px -14px rgba(0, 0, 0, 0.7);
}
.week-fieldset {
  position: sticky;
  top: calc(var(--header-h) + 0.75rem);
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.1rem;
  width: fit-content;
  margin: 0 0 1rem;
  padding: 0;
  border: 0;
  min-width: 0;
}
.week-option { position: relative; }
.week-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.week-option span {
  display: block;
  padding: 0.65rem 1.2rem;
  font-weight: 650;
  color: var(--ink-2);
  border-radius: 999px;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}
.week-option input:checked + span { background: var(--white); color: var(--blue-950); }
.week-option input:focus-visible + span { outline: 3px solid var(--pixel-2); outline-offset: 2px; }

/* Mit JavaScript: ein weißer Schieber statt des Hintergrundwechsels – und ein
   Band, das ihn auf „So ist es heute“ festhält, bis man es durchschneidet.
   Schieber, Band, Schere und Hinweis legt main.js an; ohne JavaScript bleibt
   der schlichte Umschalter oben. */
.week-switch { position: relative; }
.week-knob {
  position: absolute;
  left: var(--knob-x, 4px);
  top: var(--knob-y, 4px);
  width: var(--knob-w, 0px);
  height: var(--knob-h, 0px);
  background: var(--white);
  border-radius: 999px;
  box-shadow: 0 3px 10px -2px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.week-switch.knob-ready .week-knob { transition: left 0.45s var(--ease-out), width 0.45s var(--ease-out); }
.week-switch.has-knob .week-option span { position: relative; z-index: 1; transition: color 0.3s var(--ease) 0.12s; }
.week-switch.has-knob .week-option input:checked + span { background: transparent; }
.week-tape,
.week-scissors { position: absolute; z-index: 2; overflow: visible; pointer-events: none; }
.week-scissors { z-index: 3; }
/* Über dem Band wird der Mauszeiger zur Schere; ein Klick schneidet es durch. */
.week-tape {
  pointer-events: auto;
  cursor: url('../assets/cursor-schere.svg') 5 5, url('../assets/cursor-schere.png') 5 5, pointer;
}
.tape-base   { fill: none; stroke: var(--white); stroke-width: 9; }
.tape-stripe { fill: none; stroke: var(--pixel); stroke-width: 9; stroke-dasharray: 6 6; }
.week-scissors path,
.week-hint path { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.week-scissors circle,
.week-hint circle { fill: var(--blue-950); stroke: currentColor; stroke-width: 2.4; }
.week-scissors { color: var(--white); }
.week-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--step--1);
  font-weight: 650;
  color: var(--pixel-2);
}
.week-hint svg { flex: none; }

.week-stage {
  display: grid;
  gap: clamp(1.25rem, 3vw, 2rem);
}
.panel {
  position: relative;
  min-width: 0;
  margin: 0;
  background: var(--blue-900);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.panel-title {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.1rem 1rem;
  margin: 0;
  padding: 0.8rem 1.1rem;
  font-family: var(--sans);
  font-size: var(--step--1);
  font-weight: 650;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line-soft);
}

/* Schreibtisch, gezeichnet wie ein Bauplan. */
.desk { display: block; width: 100%; height: auto; }
.desk-bg { fill: var(--blue-900); }
.desk-grid { stroke: rgba(169, 205, 242, 0.07); stroke-width: 1; }
.desk-line { fill: rgba(169, 205, 242, 0.05); stroke: var(--pixel-2); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.desk-line--soft { stroke: rgba(169, 205, 242, 0.45); }
.desk-fill { fill: var(--blue-800); stroke: var(--pixel-2); stroke-width: 1.6; }
.desk-screen { fill: #0C2743; stroke: var(--pixel-2); stroke-width: 1.6; }
.desk-paper { fill: var(--paper); stroke: #9FB8D3; stroke-width: 1; }
.desk-note { fill: #D9E8F7; stroke: #9FB8D3; stroke-width: 1; }
.desk-note--dark { fill: #BCD6F0; }
.desk-ink { fill: none; stroke: #4A6A8F; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.desk-text {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 700;
  fill: var(--paper-ink);
}
.desk-text--s { font-size: 11px; }
.desk-text--screen { font-size: 12.5px; font-weight: 600; fill: var(--ink); }
.desk-text--dim { fill: var(--ink-3); }
.desk-text--head { font-size: 15px; font-weight: 700; fill: var(--white); }
.desk-text--clock { font-size: 24px; font-weight: 700; letter-spacing: 0.08em; fill: var(--pixel-2); font-variant-numeric: tabular-nums; }
.desk-pin { fill: var(--pixel); }
.desk-tick { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.desk-rule { fill: var(--pixel-2); stroke: var(--paper-ink); stroke-width: 0.8; }
.desk-ok { fill: var(--pixel); }
.desk-check { fill: none; stroke: var(--blue-950); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.desk-bit { fill: var(--pixel); }
.desk-bit--light { fill: var(--pixel-2); }
.desk-alert { fill: #E7F0FA; }
.desk-ring { fill: none; stroke: var(--pixel-2); stroke-width: 1.4; stroke-linecap: round; }
.desk-plant { fill: none; stroke: var(--pixel-2); stroke-width: 1.6; stroke-linecap: round; }
.desk-mark { --mark-head: #E7F0FA; --mark-hole: var(--blue-900); --mark-px: var(--pixel); }

/* Ohne GSAP schaltet CSS die beiden Zustände um (mit GSAP übernimmt main.js). */
.desk .tidy { opacity: 0; transition: opacity 0.5s var(--ease); }
.desk .mess { transition: opacity 0.4s var(--ease); }
html:not(.has-gsap) .week:has(#woche-ziel:checked) .desk .mess { opacity: 0; }
html:not(.has-gsap) .week:has(#woche-ziel:checked) .desk .tidy { opacity: 1; transition-delay: 0.25s; }
html.has-gsap .desk .tidy,
html.has-gsap .desk .mess { transition: none; }
.desk-ki .desk-ring { opacity: 0.5; }

/* Plantafel: Zeilen für Leute, Spalten für Tage. */
.board-scroll { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
.board {
  --gap: 6px;
  position: relative;
  display: grid;
  grid-template-columns: 5.4rem repeat(5, minmax(6.4rem, 1fr));
  gap: var(--gap);
  min-width: 40rem;
  padding: 0.9rem 3.4rem 1rem 0.9rem;
  background:
    linear-gradient(rgba(169, 205, 242, 0.05) 1px, transparent 1px) 0 0 / 100% 24px,
    var(--blue-900);
}
.board-head {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-3);
  text-align: center;
  padding-bottom: 0.2rem;
}
.board-row {
  align-self: stretch;
  display: flex;
  align-items: center;
  padding: 0.4rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-2);
  background: rgba(169, 205, 242, 0.06);
  border-radius: 6px;
}
.board-row--chef { color: var(--white); background: rgba(94, 154, 216, 0.2); }
.cell {
  position: relative;
  display: grid;
  min-height: 4.6rem;
  padding: 4px;
  background: rgba(169, 205, 242, 0.04);
  border: 1px dashed rgba(169, 205, 242, 0.14);
  border-radius: 6px;
}
.cell--span2 { grid-column: span 2; }
.cell--span3 { grid-column: span 3; }
.stack {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-self: start;
}
.card,
.slip {
  position: relative;
  padding: 0.35rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.2;
  border-radius: 4px;
}
.card {
  color: var(--blue-950);
  background: var(--pixel-2);
  box-shadow: inset 3px 0 0 var(--pixel);
}
.card small { display: block; font-weight: 500; color: #28496D; }
.card--wide { background: #C9DFF5; }
.card--school { background: rgba(169, 205, 242, 0.22); color: var(--ink); box-shadow: inset 3px 0 0 var(--ink-3); }
.slip {
  color: var(--paper-ink);
  background: var(--paper);
  border: 1px solid #B6C9DE;
  rotate: -1.2deg;
  transition:
    opacity 0.25s var(--ease) var(--d, 0s),
    translate 0.6s var(--ease) var(--d, 0s),
    scale 0.35s var(--ease) calc(0.45s + var(--d, 0s)),
    rotate 0.35s var(--ease) calc(0.45s + var(--d, 0s)),
    background-color 0.3s var(--ease) calc(0.45s + var(--d, 0s)),
    border-color 0.3s var(--ease) calc(0.45s + var(--d, 0s)),
    color 0.2s var(--ease) calc(0.55s + var(--d, 0s));
}
.slip:nth-child(even) { rotate: 1deg; }
.slip::before {
  content: '';
  position: absolute;
  top: -3px;
  left: 50%;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  border-radius: 50%;
  background: var(--pixel);
}
.card--new,
.slip--new {
  scale: 0.6;
  opacity: 0;
  transition: scale 0.2s var(--ease), opacity 0.2s var(--ease);
}
.slip--new { rotate: 0deg; border: 1.5px dashed var(--pixel); color: var(--brand); }

.board-ki {
  position: absolute;
  right: 0.7rem;
  top: 50%;
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  translate: 0 -50%;
  background: var(--blue-950);
  border: 1px solid var(--line);
  border-radius: 50%;
  opacity: 0.35;
  transition: opacity 0.3s var(--ease), scale 0.4s var(--ease-back);
  --mark-head: #E7F0FA; --mark-hole: var(--blue-950); --mark-px: var(--pixel);
}
.board-ki svg { width: 60%; height: auto; }
.board-hint { display: none; margin: 0.6rem 0 0; font-size: var(--step--1); color: var(--ink-3); }
@media (max-width: 44rem) { .board-hint { display: block; } }

.stack > :nth-child(1) { --d: 0s; }
.stack > :nth-child(2) { --d: 0.06s; }
.stack > :nth-child(3) { --d: 0.12s; }
.stack > :nth-child(4) { --d: 0.18s; }

/* Zustand „Da wollen wir hin“: Bürozettel werden zu Pixeln und wandern zur
   KI am rechten Rand, freie Tage bekommen Handwerk. Reines CSS. */
.week:has(#woche-ziel:checked) .slip:not(.slip--new) {
  scale: 0.2;
  rotate: 0deg;
  background: var(--pixel);
  color: transparent;
  border-color: var(--pixel);
  translate: var(--fly, 20rem) 0;
  opacity: 0;
  transition:
    scale 0.35s var(--ease) var(--d, 0s),
    rotate 0.35s var(--ease) var(--d, 0s),
    background-color 0.3s var(--ease) var(--d, 0s),
    border-color 0.3s var(--ease) var(--d, 0s),
    color 0.15s var(--ease) var(--d, 0s),
    translate 0.7s var(--ease) calc(0.25s + var(--d, 0s)),
    opacity 0.3s var(--ease) calc(0.6s + var(--d, 0s));
}
.week:has(#woche-ziel:checked) .card--new,
.week:has(#woche-ziel:checked) .slip--new {
  scale: 1;
  opacity: 1;
  transition: scale 0.45s var(--ease-back) calc(0.8s + var(--d, 0s)), opacity 0.3s var(--ease) calc(0.8s + var(--d, 0s));
}
.week:has(#woche-ziel:checked) .board-ki { opacity: 1; scale: 1.12; transition-delay: 0.1s; }
.day-2 { --fly: 30rem; }
.day-3 { --fly: 23rem; }
.day-5 { --fly: 9rem; }

.week-caption {
  display: grid;
  margin-top: clamp(1.25rem, 3vw, 2rem);
  max-width: 60ch;
  font-size: var(--step-1);
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
}
.week-caption > * { grid-area: 1 / 1; margin: 0; transition: opacity 0.3s var(--ease); }
.caption-goal { opacity: 0; }
.week:has(#woche-ziel:checked) .caption-now { opacity: 0; }
.week:has(#woche-ziel:checked) .caption-goal { opacity: 1; }
/* Kurze Zustandszeile in den Kopfzeilen der beiden Tafeln */
.state-goal { display: none; }
.week:has(#woche-ziel:checked) .state-now { display: none; }
.week:has(#woche-ziel:checked) .state-goal { display: inline; }

/* --- KI: Kopf frei ------------------------------------------------------ */
.ki {
  background-image: radial-gradient(rgba(94, 154, 216, 0.16) 1px, transparent 1.4px);
  background-size: 24px 24px;
}
.split {
  display: grid;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
@media (min-width: 60rem) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .split--flip > :first-child { order: 2; }
}
.ki-visual {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 34rem;
  width: 100%;
  margin-inline: auto;
}
.voxel-stage { position: absolute; inset: 0; }
.voxel-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s var(--ease);
}
.voxel-stage.is-3d canvas { opacity: 1; }
.voxel-stage.is-3d .ki-head { opacity: 0; }
.ki-head {
  --mark-head: #E7F0FA;
  --mark-hole: var(--blue-900);
  --mark-px: var(--pixel);
  position: absolute;
  inset: 8%;
  width: 84%;
  height: 84%;
  transition: opacity 0.6s var(--ease);
}
.tags { position: absolute; inset: 0; pointer-events: none; }
.tag {
  position: absolute;
  padding: 0.3rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--paper-ink);
  background: var(--paper);
  border-radius: 3px;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}
.tag:nth-child(1) { left: 58%; top: 14%; rotate: -6deg; }
.tag:nth-child(2) { left: 70%; top: 32%; rotate: 5deg; }
.tag:nth-child(3) { left: 4%;  top: 12%; rotate: 4deg; }
.tag:nth-child(4) { left: 64%; top: 60%; rotate: -3deg; }
.tag:nth-child(5) { left: 12%; top: 72%; rotate: 7deg; }

.pixel-list {
  display: grid;
  gap: clamp(1.4rem, 3vw, 2rem);
  margin: clamp(2rem, 4vw, 3rem) 0 0;
  padding: 0;
  list-style: none;
}
.pixel-list li {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  gap: 0 1rem;
}
.pixel-list h3 { grid-column: 2; margin-bottom: 0.25em; font-size: var(--step-1); }
.pixel-list p  { grid-column: 2; margin: 0; color: var(--ink-2); }
.pixel-list .bits { grid-row: 1 / span 2; }
.bits { position: relative; width: 2.2rem; height: 2.2rem; margin-top: 0.1rem; }
.bits i { position: absolute; background: var(--pixel); }
.bits i:nth-child(1) { left: 0; top: 0.55rem; width: 1.1rem; height: 1.1rem; }
.bits i:nth-child(2) { left: 1.35rem; top: 0; width: 0.7rem; height: 0.7rem; opacity: 0.6; }
.bits i:nth-child(3) { left: 1.45rem; top: 1.25rem; width: 0.45rem; height: 0.45rem; opacity: 0.4; }
.bits--2 i:nth-child(1) { top: 0.9rem; left: 0.35rem; }
.bits--2 i:nth-child(2) { left: 0; top: 0.1rem; }
.bits--3 i:nth-child(1) { top: 0.2rem; left: 0.8rem; }
.bits--3 i:nth-child(3) { left: 0.1rem; top: 1.5rem; }

/* --- So arbeiten wir: Werkzeuge als Bauplan ----------------------------- */
.sheet {
  position: relative;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(rgba(169, 205, 242, 0.12) 1px, transparent 1px) -1px -1px / 120px 120px,
    linear-gradient(90deg, rgba(169, 205, 242, 0.12) 1px, transparent 1px) -1px -1px / 120px 120px,
    linear-gradient(rgba(169, 205, 242, 0.05) 1px, transparent 1px) -1px -1px / 24px 24px,
    linear-gradient(90deg, rgba(169, 205, 242, 0.05) 1px, transparent 1px) -1px -1px / 24px 24px,
    var(--brand);
  border: 1px solid rgba(169, 205, 242, 0.35);
  border-radius: 10px;
  box-shadow: inset 0 0 0 10px rgba(6, 24, 43, 0.18), 0 40px 70px -50px rgba(0, 0, 0, 0.8);
  container-type: inline-size;
  overflow: hidden;
}
@media (min-width: 40.01rem) { .sheet { aspect-ratio: 1.9; } }
/* Schriftfeld unten rechts, wie auf jeder technischen Zeichnung. */
.titleblock {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  grid-template-columns: auto auto;
  font-size: clamp(0.55rem, 1.1cqw, 0.72rem);
  color: var(--ink-2);
  border: 1px solid rgba(169, 205, 242, 0.45);
  pointer-events: none;
}
.titleblock span { padding: 0.25rem 0.55rem; border: 1px solid rgba(169, 205, 242, 0.25); }
.titleblock b { font-weight: 700; color: var(--white); }
.tool-slot {
  position: absolute;
  display: grid;
  justify-items: center;
}
.tool-slot--waage     { left: 6%;  top: 10%; width: 50%; }
.tool-slot--zollstock { left: 64%; top: 7%;  width: 28%; }
.tool-slot--bleistift { left: 9%;  top: 55%; width: 22%; }
.tool-slot--handy     { left: 40%; top: 44%; width: 10.5%; }
.tool-slot--ki        { left: 61%; top: 47%; width: 16%; }
.tool-slot--ki { --mark-head: #E7F0FA; --mark-hole: var(--brand); --mark-px: var(--pixel-2); }

.tool-home,
.tool {
  grid-area: 1 / 1;
  width: 100%;
}
/* Wird ein Werkzeug abgenommen, bleibt sein gestrichelter Umriss zurück.
   Die Zeichnung steckt per <use> in einem Schatten-Baum; Selektoren wie
   „.tool-home .t-fill“ kommen dort nicht an, vererbte Eigenschaften und
   Variablen schon. Deshalb: Strichelung erben, Flächen über --tto aus. */
.tool-home {
  --tto: 0;
  opacity: 0;
  color: var(--pixel-2);
  stroke-dasharray: 4 4;
  transition: opacity 0.3s var(--ease);
}
.tool {
  position: relative;
  padding: 0;
  color: var(--white);
  background: none;
  border: 0;
  cursor: pointer;
  transition: translate 0.35s var(--ease-back), rotate 0.35s var(--ease), filter 0.35s var(--ease);
}
.tool svg, .tool-home svg { width: 100%; height: auto; }
.tool:hover { translate: 0 -4px; filter: drop-shadow(0 0 10px rgba(169, 205, 242, 0.55)); }
.tool:focus-visible { outline-offset: 6px; }
.tool.is-lifted {
  translate: 5% -16%;
  rotate: -7deg;
  filter: drop-shadow(0 22px 18px rgba(0, 0, 0, 0.45));
}
.tool-slot:has(.tool.is-lifted) .tool-home { opacity: 0.6; }
.t-line { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.t-line-s { fill: none; stroke: currentColor; stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; }
.t-fill { fill: rgba(238, 244, 251, 0.1); fill-opacity: var(--tto, 1); stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.t-thin { fill: none; stroke: currentColor; stroke-width: 1; opacity: 0.7; }
.t-text { font-family: var(--sans); font-weight: 700; fill: currentColor; fill-opacity: var(--tto, 1); }
.t-dim { fill: none; stroke: var(--pixel-2); stroke-width: 1; }
.t-dimtext { font-family: var(--sans); font-size: 9px; font-weight: 600; fill: var(--pixel-2); fill-opacity: var(--tto, 1); }

.tool-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  font-size: clamp(0.62rem, 1.3cqw, 0.82rem);
  font-weight: 650;
  color: var(--ink);
  white-space: nowrap;
}
.tool-label i {
  display: inline-grid;
  place-items: center;
  width: 1.5em;
  height: 1.5em;
  font-style: normal;
  font-weight: 700;
  color: var(--brand);
  background: var(--white);
  border-radius: 50%;
}

/* Karten zu den Werkzeugen: Popover, in unterstützenden Browsern mit
   Ein- und Ausblenden. Ohne Popover-Unterstützung stehen sie als Liste
   unter dem Blatt – der Inhalt bleibt erreichbar. */
.tool-cards { display: grid; gap: 1rem; margin-top: 2rem; }
.tool-card {
  color: var(--ink);
  background: var(--blue-850);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: clamp(1.4rem, 3vw, 2rem);
}
.tool-card h3 { font-size: var(--step-3); margin-bottom: 0.35em; }
.tool-card p { color: var(--ink-2); }
.tool-card .btn { margin-top: 1.2rem; }
.tool-card-close {
  display: none;
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  padding: 0;
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
}
.tool-card-close svg { width: 16px; height: 16px; }
.tool-card-kicker {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
  font-size: var(--step--1);
  font-weight: 650;
  color: var(--pixel-2);
}

@supports selector(:popover-open) {
  .tool-cards { display: contents; }
  .tool-card[popover] {
    position: fixed;
    inset: 0;
    width: min(30rem, calc(100vw - 2rem));
    height: fit-content;
    max-height: calc(100svh - 2rem);
    margin: auto;
    overflow: auto;
    box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.8);
    opacity: 0;
    translate: 0 1.25rem;
    transition-property: opacity, translate, display, overlay;
    transition-duration: 0.3s;
    transition-timing-function: var(--ease-out);
    transition-behavior: allow-discrete;
  }
  .tool-card[popover]:popover-open { opacity: 1; translate: 0 0; }
  @starting-style {
    .tool-card[popover]:popover-open { opacity: 0; translate: 0 1.25rem; }
  }
  .tool-card[popover]::backdrop {
    background: rgba(3, 12, 24, 0);
    transition: display 0.3s allow-discrete, overlay 0.3s allow-discrete, background-color 0.3s var(--ease);
  }
  .tool-card[popover]:popover-open::backdrop { background: rgba(3, 12, 24, 0.6); }
  @starting-style {
    .tool-card[popover]:popover-open::backdrop { background: rgba(3, 12, 24, 0); }
  }
  .tool-card-close { display: grid; }
}

@media (max-width: 40rem) {
  .sheet { aspect-ratio: 3 / 4; }
  .tool-slot--zollstock { left: 6%;  top: 6%;  width: 44%; }
  .tool-slot--bleistift { left: 58%; top: 5%;  width: 34%; }
  .tool-slot--waage     { left: 6%;  top: 33%; width: 86%; }
  .tool-slot--handy     { left: 14%; top: 55%; width: 24%; }
  .tool-slot--ki        { left: 52%; top: 56%; width: 32%; }
  .titleblock { display: none; }
}

/* --- Mit Handwerkern, für Handwerker ------------------------------------ */
.crew-photo {
  position: relative;
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.crew-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.crew-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 32, 55, 0.05) 45%, rgba(10, 32, 55, 0.6) 100%);
  pointer-events: none;
}
.crew-photo figcaption {
  position: absolute;
  left: 1rem;
  bottom: 0.8rem;
  z-index: 1;
  font-size: var(--step--1);
  color: var(--ink);
}
.crew-names { color: var(--white); font-weight: 650; }
.facts {
  display: grid;
  gap: 0.7rem;
  margin: 1.8rem 0 0;
  padding: 0;
  list-style: none;
}
.facts li {
  display: grid;
  grid-template-columns: 0.6rem minmax(0, 1fr);
  gap: 0.9rem;
  align-items: baseline;
  color: var(--ink-2);
}
.facts li::before { content: ''; width: 0.6rem; height: 0.6rem; background: var(--pixel); translate: 0 0.05rem; }

/* --- Kontakt ------------------------------------------------------------ */
.contact {
  background:
    radial-gradient(60% 80% at 85% 20%, rgba(94, 154, 216, 0.18), transparent 70%),
    var(--bg);
}
.contact-head { display: grid; gap: 1.5rem 4rem; align-items: end; }
@media (min-width: 60rem) { .contact-head { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.contact-head h2 { margin-bottom: 0; }
.contact-call {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
  margin-top: clamp(2rem, 4vw, 3rem);
  padding-top: clamp(1.5rem, 3vw, 2rem);
  border-top: 1px solid var(--line);
}
.phone-big {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 1rem + 5.5vw, 5.4rem);
  font-weight: 500;
  line-height: 1;
  color: var(--white);
  text-decoration: none;
  white-space: nowrap;
  font-variant-numeric: lining-nums;
}
.phone-big:hover { color: var(--pixel-2); }
.contact-mail {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
}
.contact-mail svg { width: 20px; height: 20px; }

/* --- Fußbereich wie im bisherigen Auftritt: ruhig und mittig ----------- */
.site-footer {
  position: relative;
  padding-block: clamp(3rem, 6vw, 4rem) 2rem;
  font-size: var(--step--1);
  text-align: center;
  color: var(--ink-2);
  background: var(--bg, var(--blue-950));
}
.footer-brand {
  --mark-head: #E7F0FA;
  --mark-hole: var(--blue-950);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.4rem;
  color: var(--white);
  text-decoration: none;
}
.footer-brand:hover { color: var(--white); }
.footer-brand svg { height: 44px; width: auto; }
.footer-brand span { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; }
.footer-address { margin: 0 0 1.4rem; font-style: normal; line-height: 1.8; }
.footer-address b { color: var(--white); font-weight: 650; }
.footer-address a { color: var(--ink); text-decoration: none; }
.footer-address a:hover { text-decoration: underline; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.4rem;
  margin: 0 0 1.6rem;
  padding: 0;
  list-style: none;
}
.footer-links a { color: var(--ink-2); }
.footer-note { margin: 0; padding-top: 1.4rem; border-top: 1px solid var(--line-soft); color: var(--ink-3); }

/* --- Unterseiten -------------------------------------------------------- */
.page-head {
  position: relative;
  padding-block: calc(var(--header-h) + clamp(3rem, 8vh, 5rem)) clamp(2rem, 4vw, 3rem);
  background:
    linear-gradient(90deg, rgba(6, 24, 43, 0.85), rgba(6, 24, 43, 0.35)),
    url('../assets/img/werkstatt-blau-960.webp') 70% 60% / cover no-repeat,
    var(--blue-900);
  border-bottom: 1px solid var(--line);
}
.page-head h1 { font-size: var(--step-4); margin-bottom: 0; }
.page-head .lead { margin-top: 1.2rem; }
.back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
}
.back:hover { color: var(--white); text-decoration: underline; }
.back svg { width: 15px; height: 15px; }

.legal { padding-block: clamp(2.5rem, 6vw, 4rem) var(--section-y); }
/* Textspalte bündig mit der Überschrift darüber, aber mit lesbarer Zeilenlänge. */
.legal .container > * { max-width: 48rem; }
.legal h2 {
  margin-top: 2.4em;
  padding-top: 1.4rem;
  font-size: var(--step-2);
  line-height: 1.15;
  border-top: 1px solid var(--line);
}
.legal h2:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.legal h3 { font-size: var(--step-1); margin-top: 2em; }
.legal p, .legal li { color: var(--ink-2); }
.legal strong { color: var(--white); font-weight: 650; }
.legal ul { padding-left: 1.2rem; }
.legal li { margin-bottom: 0.5rem; }
.legal li::marker { color: var(--pixel); }
.legal address {
  font-style: normal;
  padding: 1.1rem 1.3rem;
  background: var(--blue-850);
  border: 1px solid var(--line);
  border-left: 4px solid var(--pixel);
  border-radius: var(--radius);
  color: var(--ink);
}
.legal code { font-size: 0.95em; }
.note {
  margin-top: 2.5rem;
  padding: 1rem 1.2rem;
  font-size: var(--step--1);
  color: var(--ink-2);
  background: var(--blue-850);
  border-left: 4px solid var(--pixel);
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* Karriere */
.jobs { padding-block: 0 var(--section-y); }
.jobs .container > * { max-width: 54rem; }
.jobs-intro { padding-block: clamp(2.5rem, 5vw, 3.5rem) 0; }
.job {
  position: relative;
  margin-top: clamp(1.5rem, 3vw, 2.2rem);
  padding: clamp(1.6rem, 3vw, 2.5rem);
  background: var(--blue-850);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.job h2 { font-size: var(--step-3); }
.job h3 { font-size: var(--step-1); margin: 2em 0 0.9em; }
.job p { color: var(--ink-2); }
.job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.4rem;
  padding: 0;
  list-style: none;
}
.job-meta li {
  padding: 0.25rem 0.75rem;
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--ink);
  background: rgba(169, 205, 242, 0.12);
  border-radius: 999px;
}
.checklist {
  display: grid;
  gap: 0.8rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.checklist li {
  display: grid;
  grid-template-columns: 0.6rem minmax(0, 1fr);
  gap: 0.9rem;
  align-items: baseline;
  color: var(--ink-2);
}
.checklist li::before { content: ''; width: 0.6rem; height: 0.6rem; background: var(--pixel); translate: 0 0.05rem; }

/* 404 */
.error-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--header-h) + 3rem) var(--gutter) 3rem;
  text-align: center;
}
.error-page .lead { margin-inline: auto; }
.error-mark {
  --mark-head: var(--brand-lit);
  --mark-hole: var(--white);
  width: 7rem;
  margin: 0 auto 1.5rem;
}
.error-code { display: block; font-family: var(--serif); font-size: var(--step-3); color: var(--pixel-2); margin-bottom: 0.3rem; }

/* Hilfsklassen statt style-Attributen (CSP ohne 'unsafe-inline'). */
.u-muted  { color: var(--ink-3); }
.u-wide   { max-width: none; }
.u-center { margin-inline: auto; text-align: center; }
.actions--center { justify-content: center; }

/* --- Intro -------------------------------------------------------------- */
/* boot.js setzt 'intro' vor dem ersten Zeichnen: Dann bleiben Schriftzug,
   Kopf und Kopfzeile verborgen, bis main.js sie zusammensetzt. Hängt etwas,
   nimmt boot.js die Klasse nach kurzer Zeit selbst wieder weg. */
html.intro .site-header,
html.intro .hero-status,
html.intro .hero-title,
html.intro .hero .actions,
html.intro .hero-mark { opacity: 0; }
html.intro .hero-photo,
html.intro .hero-reveal,
html.intro .hero-light { opacity: 0; }
html.intro-live body { overflow: hidden; }

.intro-px { position: fixed; left: 0; top: 0; z-index: 150; pointer-events: none; }
.intro-hello {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 150;
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(1.1rem, 0.8rem + 1.2vw, 1.9rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--ink-2);
  pointer-events: none;
}
/* Lichtkante, die den Schriftzug „einscannt“ */
.intro-scan {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 150;
  width: 3px;
  background: var(--pixel-2);
  box-shadow: 0 0 14px 2px rgba(169, 205, 242, 0.7);
  pointer-events: none;
}
.intro-skip {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 160;
  padding: 0.6rem 1rem;
  font: inherit;
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--ink);
  background: rgba(6, 24, 43, 0.6);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.intro-skip:hover { background: var(--white); color: var(--blue-950); }

/* --- Seitenübergänge ---------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .site-header { view-transition-name: kopfzeile; }
  ::view-transition-old(root) { animation: 0.25s var(--ease) both vt-raus; }
  ::view-transition-new(root) { animation: 0.35s var(--ease-out) both vt-rein; }
  @keyframes vt-raus { to { opacity: 0; } }
  @keyframes vt-rein { from { opacity: 0; transform: translateY(12px); } }
}

/* --- Rücksicht auf Systemeinstellungen ---------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  .tool.is-lifted, .tool:hover { translate: none; rotate: none; }
}

@media (prefers-contrast: more) {
  :root { --ink-2: #D6E2EF; --ink-3: #C2D3E6; --line: rgba(200, 224, 250, 0.45); }
}

@media (forced-colors: active) {
  .hero-reveal, .hero-light, .progress, .edge-top::before, .edge-bottom::after { display: none; }
}

/* --- Druck -------------------------------------------------------------- */
@media print {
  .site-header, .hero-layer, .progress, .board-ki, .sheet, .voxel-stage, .tags,
  .skip-link, .edge-top::before, .edge-bottom::after, .desk { display: none !important; }
  html, body, .section, .hero, .site-footer { background: #fff !important; color: #000 !important; }
  h1, h2, h3, .wordmark, .tagline { color: #000 !important; }
  .tool-cards { display: grid !important; }
  .tool-card[popover] { display: block !important; position: static !important; opacity: 1 !important; translate: none !important; }
  a { color: #000; }
}
