/* =============================================================================
   georgstach.de — Editorial Dark (mit hellem Theme)
   1. Tokens      2. Reset       3. Basiselemente   4. Layout
   5. Header/Nav  6. Hero        7. Facts           8. Komponenten
   9. Footer     10. Utilities

   Theming: alle farbigen Werte hängen an den Tokens unter 1. Das dunkle Theme
   ist der Standard (:root), das helle überschreibt via [data-theme="light"].
   Umgeschaltet wird per Attribut am <html>-Element — siehe js/app.js.
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  color-scheme: dark;

  /* Flächen */
  --bg:          #080d14;
  --bg-rgb:      8, 13, 20;
  --bg-alt:      #0c131d;
  --surface:     #101a27;
  --surface-2:   #16222f;
  --surface-translucent: rgba(16, 26, 39, .9);
  --line:        rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .16);
  --fill-subtle: rgba(255, 255, 255, .05);

  /* Text */
  --fg:    #eef2f7;
  --fg-2:  #a4b2c4;
  --fg-3:  #7f90a6;   /* hell genug für AA auf --surface und den Tag-Pillen */

  /* Akzente */
  --accent:      #f0a648;
  --accent-rgb:  240, 166, 72;
  --accent-soft: #ffc87d;
  --accent-dim:  rgba(var(--accent-rgb), .14);
  --on-accent:   #08101a;   /* Text auf Akzentflächen */

  /* Themenabhängige Effekte */
  --header-bg:   rgba(var(--bg-rgb), .82);
  --nav-overlay: rgba(var(--bg-rgb), .97);
  --watermark-opacity: .1;

  --hero-scrim:
    linear-gradient(to bottom,
      rgba(var(--bg-rgb), .78) 0%,
      rgba(var(--bg-rgb), .40) 26%,
      rgba(var(--bg-rgb), .58) 62%,
      rgba(var(--bg-rgb), .94) 88%,
      var(--bg) 100%),
    linear-gradient(105deg, rgba(var(--bg-rgb), .72) 0%, rgba(var(--bg-rgb), 0) 62%);

  --lab-shadow:
    0 1px 0 rgba(255, 255, 255, .12) inset,
    0 -1px 0 rgba(0, 0, 0, .35) inset,
    0 6px 16px rgba(0, 0, 0, .25);

  /* Typografie */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;

  /* Raster */
  --container: 1180px;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --radius: 14px;
  --radius-sm: 8px;

  /* Bewegung */
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* Helles Theme — nur aktiv, wenn der Besucher es ausdrücklich wählt.
   Der Akzent wird abgedunkelt, sonst reicht der Kontrast auf Weiß nicht. */
:root[data-theme="light"] {
  color-scheme: light;

  --bg:          #f7f9fc;
  --bg-rgb:      247, 249, 252;
  --bg-alt:      #eceff5;
  --surface:     #ffffff;
  --surface-2:   #f3f6fa;
  --surface-translucent: rgba(255, 255, 255, .9);
  --line:        rgba(13, 26, 44, .13);
  --line-strong: rgba(13, 26, 44, .24);
  --fill-subtle: rgba(13, 26, 44, .05);

  --fg:    #0f1720;
  --fg-2:  #45535f;
  --fg-3:  #5c6976;

  --accent:      #9e5a09;
  --accent-rgb:  158, 90, 9;
  --accent-soft: #7d4506;
  --on-accent:   #ffffff;

  --watermark-opacity: .06;

  /* Kräftigerer Schleier: das Hero-Foto ist unten dunkel, die Schrift hell-dunkel */
  --hero-scrim:
    linear-gradient(to bottom,
      rgba(var(--bg-rgb), .72) 0%,
      rgba(var(--bg-rgb), .40) 24%,
      rgba(var(--bg-rgb), .72) 60%,
      rgba(var(--bg-rgb), .97) 88%,
      var(--bg) 100%),
    linear-gradient(105deg, rgba(var(--bg-rgb), .88) 0%, rgba(var(--bg-rgb), .18) 65%);

  --lab-shadow:
    0 0 0 1px rgba(13, 26, 44, .08),
    0 6px 16px rgba(13, 26, 44, .12);
}

/* 2. Reset ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: clamp(1rem, .96rem + .2vw, 1.0625rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

ul, ol { list-style: none; padding: 0; }

a { color: inherit; }

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

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

/* 3. Basiselemente --------------------------------------------------------- */
.h2 {
  font-size: clamp(1.75rem, 1.15rem + 2.6vw, 3rem);
  line-height: 1.12;
  letter-spacing: -.025em;
  font-weight: 650;
  text-wrap: balance;
}

.h2--xl { font-size: clamp(2rem, 1.2rem + 3.6vw, 3.75rem); }

.lead {
  font-size: clamp(1.0625rem, 1rem + .4vw, 1.25rem);
  color: var(--fg-2);
  line-height: 1.6;
}

p { color: var(--fg-2); }

.eyebrow {
  display: flex;
  align-items: center;
  gap: .7rem;
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.eyebrow span {
  color: var(--accent);
  padding-right: .7rem;
  border-right: 1px solid var(--line-strong);
}

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

.section { padding-block: clamp(4.5rem, 9vw, 8.5rem); }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--line); }

/* Hero-Motiv als dezentes Wasserzeichen in jedem zweiten Abschnitt */
.section--alt,
.section--contact {
  position: relative;
  isolation: isolate;
}
.section--alt::before,
.section--contact::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../img/hero-1600.webp") 50% 42% / cover no-repeat;
  opacity: var(--watermark-opacity);
  z-index: -1;
  pointer-events: none;
}

.split {
  display: grid;
  gap: clamp(1rem, 3vw, 3.5rem);
  align-items: start;
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

@media (min-width: 860px) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
}

.split__body > * + * { margin-top: 1.1em; }

/* 5. Header / Navigation --------------------------------------------------- */
.skip-link {
  position: fixed;
  top: .75rem; left: .75rem;
  z-index: 200;
  padding: .6rem 1rem;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  border-radius: var(--radius-sm);
  transform: translateY(-160%);
  transition: transform .25s var(--ease);
}
.skip-link:focus-visible { transform: none; }

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;              /* erzeugt zugleich den Stacking-Context für ::before */
  border-bottom: 1px solid transparent;
  transition: border-color .35s var(--ease);
}

/* Fläche und Blur liegen bewusst auf einem Pseudo-Element: stünde der
   backdrop-filter am Header selbst, würde dieser zum Containing Block für
   alles Fixierte darin — das Mobil-Overlay schrumpfte dann auf Header-Höhe. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--header-bg);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  opacity: 0;
  transition: opacity .35s var(--ease);
}

.site-header.is-stuck::before { opacity: 1; }
.site-header.is-stuck { border-bottom-color: var(--line); }

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.5rem;
}

.brand {
  position: relative;
  z-index: 2;                /* bleibt über dem offenen Mobil-Overlay */
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -.01em;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 2rem; height: 2rem;
  border-radius: 7px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: -.02em;
}

/* Schiebt Navigation und Bedienelemente gemeinsam nach rechts */
.site-nav { margin-left: auto; }

.site-header__tools {
  position: relative;
  z-index: 2;                /* bleibt über dem offenen Mobil-Overlay */
  display: flex;
  align-items: center;
  gap: .25rem;
}

.site-nav__list {
  display: flex;
  align-items: center;
  gap: clamp(.5rem, 1.6vw, 1.75rem);
}

.site-nav__list a {
  position: relative;
  display: block;
  padding: .5rem .25rem;
  font-size: .9375rem;
  color: var(--fg-2);
  text-decoration: none;
  transition: color .25s var(--ease);
}

.site-nav__list a::after {
  content: "";
  position: absolute;
  left: .25rem; right: .25rem; bottom: .2rem;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease);
}

.site-nav__list a:hover,
.site-nav__list a.is-current { color: var(--fg); }
.site-nav__list a.is-current::after { transform: scaleX(1); }

.site-nav__cta {
  padding: .5rem 1.1rem !important;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--fg) !important;
}
.site-nav__cta::after { display: none; }
.site-nav__cta:hover { border-color: var(--accent); background: var(--accent-dim); }

/* Theme-Schalter */
.theme-toggle[hidden] { display: none; }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 2.5rem; height: 2.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--fg-2);
  transition: color .25s var(--ease), border-color .25s var(--ease),
              background .25s var(--ease);
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* Beide Symbole liegen übereinander und werden gekreuzt eingeblendet. */
.theme-toggle svg {
  grid-area: 1 / 1;
  width: 1.0625rem; height: 1.0625rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity .3s var(--ease), transform .4s var(--ease);
}

/* Gezeigt wird das Ziel des Klicks: im Dunkeln die Sonne, im Hellen der Mond. */
.theme-toggle .icon-moon { opacity: 0; transform: rotate(-70deg) scale(.5); }

:root[data-theme="light"] .theme-toggle .icon-sun  { opacity: 0; transform: rotate(70deg) scale(.5); }
:root[data-theme="light"] .theme-toggle .icon-moon { opacity: 1; transform: none; }

/* Burger */
.nav-toggle {
  display: none;
  position: relative;
  z-index: 2;
  width: 2.75rem; height: 2.75rem;
  margin-right: -.6rem;
  border-radius: var(--radius-sm);
}

.nav-toggle__bar {
  display: block;
  width: 22px; height: 2px;
  margin: 5px auto;
  background: var(--fg);
  border-radius: 2px;
  transition: transform .3s var(--ease);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:last-child  { transform: translateY(-3.5px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: block; }

  .site-nav {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: var(--nav-overlay);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s var(--ease), visibility .3s;
  }

  .site-nav.is-open { opacity: 1; visibility: visible; }

  .site-nav__list { flex-direction: column; gap: .5rem; text-align: center; }
  .site-nav__list a { font-size: 1.5rem; padding: .6rem 1rem; }
  .site-nav__cta { margin-top: .75rem; }
}

body.nav-open { overflow: hidden; }

/* 6. Hero ------------------------------------------------------------------ */
.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 100svh;
  padding-block: 8rem 6rem;
  overflow: hidden;
  isolation: isolate;
}

.hero__media {
  position: absolute;
  inset: -8% 0 0 0;
  z-index: -2;
}

/* Layer-Promotion nur, solange der Hero sichtbar ist (setzt js/app.js). */
.hero__media.is-animating { will-change: transform; }

.hero__media picture,
.hero__media img {
  width: 100%;
  height: 100%;
}

.hero__media img {
  object-fit: cover;
  object-position: 50% 42%;
}

/* Verlauf: oben dicht für die Navigation, unten Übergang in die Seitenfarbe */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--hero-scrim);
}

.hero__inner { position: relative; }

.hero__kicker {
  display: inline-flex;
  align-items: flex-start;   /* Punkt bleibt auch bei Umbruch auf Zeile 1 */
  gap: .65rem;
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--fg-2);
  margin-bottom: 1.25rem;
}

.dot {
  flex: none;
  width: 7px; height: 7px;
  margin-top: .5em;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.8s var(--ease) infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), .55); }
  70%  { box-shadow: 0 0 0 9px rgba(var(--accent-rgb), 0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0); }
}

.hero__title {
  font-size: clamp(2.75rem, 1.4rem + 6.4vw, 6.5rem);
  line-height: .96;
  letter-spacing: -.04em;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.hero__role {
  font-size: clamp(1.125rem, .95rem + 1vw, 1.75rem);
  line-height: 1.35;
  color: var(--fg);
  letter-spacing: -.015em;
  padding-left: 1.1rem;
  border-left: 2px solid var(--accent);
  margin-bottom: 1.5rem;
}

.hero__role em { font-style: normal; color: var(--accent-soft); }

.hero__lead {
  max-width: 46ch;
  color: var(--fg-2);
  margin-bottom: 2.25rem;
}

.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; }

.hero__scroll {
  position: absolute;
  left: 50%; bottom: 1.75rem;
  translate: -50% 0;
  width: 1.5rem; height: 2.5rem;
  display: grid;
  place-items: start center;
  padding-top: .5rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
}

.hero__scroll span {
  width: 3px; height: 7px;
  border-radius: 2px;
  background: var(--accent);
  animation: scrollcue 2s var(--ease) infinite;
}

@keyframes scrollcue {
  0%, 100% { transform: translateY(0);      opacity: 1; }
  60%      { transform: translateY(.85rem); opacity: 0; }
}

@media (max-width: 640px) { .hero__scroll { display: none; } }

/* 7. Facts ----------------------------------------------------------------- */
.facts { background: var(--bg); border-bottom: 1px solid var(--line); }

.facts__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-inline: 1px solid var(--line);
}

@media (min-width: 760px) { .facts__list { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.facts__item {
  background: var(--bg);
  padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1rem, 2vw, 1.75rem);
}

.facts__num {
  display: block;
  font-size: clamp(1.75rem, 1.2rem + 2vw, 2.75rem);
  font-weight: 650;
  letter-spacing: -.03em;
  line-height: 1.1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.facts__label {
  display: block;
  margin-top: .35rem;
  font-size: .875rem;
  color: var(--fg-3);
}

/* 8. Komponenten ----------------------------------------------------------- */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem 1.6rem;
  border-radius: 999px;
  font-size: .9375rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform .2s var(--ease), background .25s var(--ease),
              border-color .25s var(--ease);
}

.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 6px 24px -8px rgba(var(--accent-rgb), .55);
}
.btn--primary:hover { background: var(--accent-soft); transform: translateY(-2px); }

.btn--ghost { border-color: var(--line-strong); color: var(--fg); }
.btn--ghost:hover { border-color: var(--accent); background: var(--accent-dim); transform: translateY(-2px); }

/* Prinzipien */
.principles {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

@media (min-width: 600px) { .principles { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .principles { grid-template-columns: repeat(4, 1fr); } }

.principle {
  background: var(--surface);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  transition: background .3s var(--ease);
}
.principle:hover { background: var(--surface-2); }

.principle__idx {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--accent);
  letter-spacing: .1em;
}

.principle h3 {
  margin: .6rem 0 .5rem;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -.01em;
}

.principle p { font-size: .9375rem; color: var(--fg-3); }

/* Filter-Chips */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }

.chip {
  padding: .45rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: .875rem;
  color: var(--fg-2);
  transition: color .2s var(--ease), border-color .2s var(--ease),
              background .2s var(--ease);
}

.chip:hover { color: var(--fg); border-color: var(--fg-3); }

.chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

/* Tech-Stack */
.stack { display: flex; flex-wrap: wrap; gap: .5rem; }

.stack li {
  padding: .5rem .9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: .8125rem;
  color: var(--fg-2);
  transition: opacity .3s var(--ease), transform .3s var(--ease),
              border-color .3s var(--ease), color .3s var(--ease);
}

.stack li.is-hit { border-color: var(--accent); color: var(--accent-soft); }
.stack li.is-muted { opacity: .22; transform: scale(.97); }

.stack__status {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .08em;
  color: var(--fg-3);
  min-height: 1.2em;
}

/* Projekt-Cases */
.cases {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

@media (min-width: 900px) { .cases { grid-template-columns: repeat(2, 1fr); } }

.case {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  transition: background .3s var(--ease);
}

.case:hover { background: var(--surface-2); }

.case__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .75rem;
  font-family: var(--font-mono);
  font-size: .6875rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.case__period { color: var(--accent); }
.case__sector { color: var(--fg-3); }

.case__title {
  font-size: clamp(1.1875rem, 1.05rem + .7vw, 1.5rem);
  line-height: 1.25;
  letter-spacing: -.02em;
  font-weight: 620;
  text-wrap: balance;
}

.case__role { margin-top: .4rem; font-size: .8125rem; color: var(--fg-3); }
.case__teaser { margin-top: .9rem; font-size: .9375rem; color: var(--fg-2); }

.case__toggle {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  align-self: flex-start;
  margin-top: 1.25rem;
  padding: .35rem 0;
  font-size: .875rem;
  font-weight: 600;
  color: var(--accent);
}

.case__toggle-icon { position: relative; width: 12px; height: 12px; }

.case__toggle-icon::before,
.case__toggle-icon::after {
  content: "";
  position: absolute;
  inset: 50% 0 auto 0;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  transition: transform .3s var(--ease);
}
.case__toggle-icon::after { transform: rotate(90deg); }
.case__toggle[aria-expanded="true"] .case__toggle-icon::after { transform: rotate(0deg); }

.case__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .4s var(--ease);
}

.case__panel.is-open { grid-template-rows: 1fr; }
.case__panel-inner { overflow: hidden; min-height: 0; }

.case__detail {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.case__detail dt {
  font-family: var(--font-mono);
  font-size: .6875rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .35rem;
}

.case__detail dd {
  margin: 0 0 1.1rem;
  font-size: .9375rem;
  color: var(--fg-2);
}

.case__detail dd:last-of-type { margin-bottom: 0; }

.tags { display: flex; flex-wrap: wrap; gap: .375rem; margin-top: 1.25rem; }

.tags li {
  padding: .25rem .6rem;
  border-radius: 999px;
  background: var(--fill-subtle);
  font-family: var(--font-mono);
  font-size: .6875rem;
  color: var(--fg-3);
}

.cases__more {
  margin-top: 2rem;
  font-size: .9375rem;
  color: var(--fg-3);
  max-width: 70ch;
}

.cases__more a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  white-space: nowrap;
  transition: border-color .25s var(--ease);
}
.cases__more a:hover { border-bottom-color: currentColor; }

/* Innovation-Lab */
.labs {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

@media (min-width: 900px) { .labs { grid-template-columns: repeat(3, 1fr); } }

.lab {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  transition: background .3s var(--ease);
}

.lab:hover { background: var(--surface-2); }

.lab__media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-alt);
}

.lab__media img {
  position: absolute;
  inset: 20px;
  width: calc(100% - 40px);
  height: calc(100% - 40px);
  object-fit: cover;
  border-radius: var(--radius-sm);
  box-shadow: var(--lab-shadow);
}

.lab__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: clamp(1.5rem, 3vw, 2.25rem);
}

.lab__title {
  font-size: clamp(1.0625rem, 1rem + .4vw, 1.25rem);
  line-height: 1.25;
  letter-spacing: -.02em;
  font-weight: 620;
  text-wrap: balance;
}

.lab__desc { margin-top: .9rem; font-size: .9375rem; color: var(--fg-2); }

.lab__link,
.lab__note {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  margin-top: auto;
  padding-top: 1.25rem;
  font-size: .875rem;
  font-weight: 600;
}

.lab__link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease);
}
.lab__link:hover { border-bottom-color: currentColor; }

.lab__note { color: var(--fg-3); font-weight: 400; }

/* Referenzen */
/* Spaltenzahlen, die 12 Einträge immer restlos füllen — sonst bleiben
   leere Zellen als Linienfarbe stehen. */
.refs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  margin-top: clamp(2rem, 4vw, 3rem);
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.refs li {
  display: grid;
  place-items: center;
  min-height: 5.5rem;
  padding: 1rem;
  background: var(--bg-alt);
  font-size: clamp(.9375rem, .85rem + .35vw, 1.125rem);
  font-weight: 600;
  letter-spacing: -.015em;
  color: var(--fg-3);
  text-align: center;
  transition: color .3s var(--ease), background .3s var(--ease);
}

@media (min-width: 560px)  { .refs { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 820px)  { .refs { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1080px) { .refs { grid-template-columns: repeat(6, 1fr); } }

.refs li:hover { color: var(--fg); background: var(--surface); }

.refs__note {
  margin-top: 1.25rem;
  font-size: .875rem;
  color: var(--fg-3);
  max-width: 70ch;
}

/* Timeline */
.timeline {
  position: relative;
  margin-top: clamp(2rem, 4vw, 3rem);
  padding-left: 1.5rem;
  border-left: 1px solid var(--line);
}

.tl {
  position: relative;
  display: grid;
  gap: .5rem 2.5rem;
  padding-bottom: clamp(2rem, 4vw, 3rem);
}

.tl::before {
  content: "";
  position: absolute;
  top: .55rem;
  left: -1.5rem;
  width: 9px; height: 9px;
  translate: -50% 0;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}

@media (min-width: 860px) {
  .timeline { padding-left: 0; border-left: 0; }

  .tl {
    grid-template-columns: 12rem minmax(0, 1fr);
    padding-left: 2.5rem;
    border-left: 1px solid var(--line);
  }

  .tl::before { left: 0; }
}

.tl:last-child { padding-bottom: 0; }

.tl__when {
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .08em;
  color: var(--accent);
  padding-top: .3rem;
}

.tl__what h3 {
  font-size: 1.1875rem;
  font-weight: 620;
  letter-spacing: -.015em;
}

.tl__org { margin: .2rem 0 .7rem; font-size: .875rem; color: var(--fg-3); }
.tl__what > p:last-child { font-size: .9375rem; max-width: 68ch; }

/* Kontakt */
.section--contact {
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(var(--accent-rgb), .10) 0%, transparent 60%),
    var(--bg-alt);
  border-top: 1px solid var(--line);
}

.contact__lead { max-width: 52ch; margin-top: 1.25rem; }

.contact { display: grid; gap: 1rem; margin-top: clamp(2.5rem, 5vw, 4rem); }

@media (min-width: 760px) { .contact { grid-template-columns: repeat(3, 1fr); } }

.contact__card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .5rem;
  padding: clamp(1.5rem, 3vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .3s var(--ease), transform .3s var(--ease);
}

.contact__card:hover { border-color: var(--line-strong); transform: translateY(-3px); }

.contact__label {
  font-family: var(--font-mono);
  font-size: .6875rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.contact__value {
  font-size: clamp(1rem, .95rem + .3vw, 1.1875rem);
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--fg);
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color .2s var(--ease);
}

a.contact__value:hover { color: var(--accent); }
.contact__value--static { color: var(--accent); }

.contact__copy {
  margin-top: .35rem;
  font-family: var(--font-mono);
  font-size: .6875rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fg-3);
  border-bottom: 1px solid var(--line-strong);
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.contact__copy:hover { color: var(--accent); border-color: var(--accent); }

.contact__note { font-size: .875rem; color: var(--fg-3); }

/* 9. Footer ---------------------------------------------------------------- */
.site-footer {
  padding-block: clamp(3rem, 6vw, 4.5rem) 2rem;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.site-footer__inner {
  display: grid;
  gap: 2rem;
  font-size: .875rem;
  color: var(--fg-3);
}

@media (min-width: 700px) { .site-footer__inner { grid-template-columns: repeat(3, 1fr); } }

.site-footer p { color: inherit; }

.site-footer__brand {
  font-size: 1.0625rem;
  font-weight: 650;
  letter-spacing: -.02em;
  color: var(--fg) !important;
  margin-bottom: .4rem;
}

.site-footer__head {
  font-family: var(--font-mono);
  font-size: .6875rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-2) !important;
  margin-bottom: .5rem;
}

.site-footer a {
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.site-footer a:hover { color: var(--accent); border-color: var(--accent); }

.site-footer__legal {
  grid-column: 1 / -1;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
  font-size: .8125rem;
}

/* Nach oben */
.to-top {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 90;
  display: grid;
  place-items: center;
  width: 2.75rem; height: 2.75rem;
  border-radius: 50%;
  background: var(--surface-translucent);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(.6rem);
  transition: opacity .3s var(--ease), transform .3s var(--ease),
              visibility .3s, border-color .25s var(--ease);
}

.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { border-color: var(--accent); }

.to-top span {
  width: 9px; height: 9px;
  border-top: 1.5px solid var(--accent);
  border-left: 1.5px solid var(--accent);
  transform: translateY(2px) rotate(45deg);
}

/* 10. Utilities ------------------------------------------------------------ */
/* Ohne JS (keine .js-Klasse) bleibt der Inhalt sichtbar — kein leerer Screen. */
.js .reveal {
  opacity: 0;
  transform: translateY(1.25rem);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}

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

/* gestaffelte Kinder in Rastern */
.facts__item:nth-child(2), .principle:nth-child(2), .tl:nth-child(2) { transition-delay: .08s; }
.facts__item:nth-child(3), .principle:nth-child(3), .tl:nth-child(3) { transition-delay: .16s; }
.facts__item:nth-child(4), .tl:nth-child(4) { transition-delay: .24s; }
.case:nth-child(2n) { transition-delay: .1s; }
.contact__card:nth-child(2) { transition-delay: .1s; }
.contact__card:nth-child(3) { transition-delay: .2s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }

  .js .reveal { opacity: 1; transform: none; }
  .hero__media { transform: none !important; }
}

@media print {
  .site-header, .nav-toggle, .theme-toggle, .to-top, .hero__scroll, .filters, .skip-link { display: none !important; }
  body { background: #fff; color: #000; }
  .hero { min-height: auto; }
  .case__panel { grid-template-rows: 1fr !important; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
}
