:root {
  --kurve: cubic-bezier(0.22, 1, 0.36, 1);
  --kurve-weich: cubic-bezier(0.65, 0, 0.35, 1);
  --takt: 0.9s;
}

html:has(.vorhang:not([data-fertig])) {
  overflow: hidden;
}

.vorhang {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: #000;
  clip-path: inset(0 0 0 0);
  transition: clip-path 1.1s var(--kurve-weich);
  --fortschritt: 0;
}

.vorhang[data-fertig] {
  clip-path: inset(0 0 100% 0);
  pointer-events: none;
}

.vorhang__inhalt {
  display: grid;
  justify-items: center;
  gap: var(--sp-6);
  text-align: center;
}

.vorhang__kristall {
  width: min(46vmin, 300px);
  aspect-ratio: 1;
  overflow: visible;
  transform: rotate(-18deg);
  filter: drop-shadow(0 0 24px rgba(155, 92, 255, 0.45));
}

.vorhang__gitter > * {
  fill: none;
  stroke: url(#vorhang-spektrum);
  stroke-width: 0.8;
  stroke-dasharray: 100;
  stroke-dashoffset: calc(100 - clamp(0, (var(--fortschritt) - var(--ab)) * 6, 1) * 100);
  transition: stroke-dashoffset 0.25s linear;
}

.vorhang__gitter > :nth-child(1)  { --ab: 0.00; }
.vorhang__gitter > :nth-child(2)  { --ab: 0.06; }
.vorhang__gitter > :nth-child(3)  { --ab: 0.12; }
.vorhang__gitter > :nth-child(4)  { --ab: 0.18; }
.vorhang__gitter > :nth-child(5)  { --ab: 0.24; }
.vorhang__gitter > :nth-child(6)  { --ab: 0.30; }
.vorhang__gitter > :nth-child(7)  { --ab: 0.36; }
.vorhang__gitter > :nth-child(8)  { --ab: 0.42; }
.vorhang__gitter > :nth-child(9)  { --ab: 0.48; }
.vorhang__gitter > :nth-child(10) { --ab: 0.54; }

.vorhang__marke {
  position: relative;
  margin: 0;
  font-size: clamp(2.5rem, 1.5rem + 4vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
}

.vorhang__marke-grund {
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.28);
}

.vorhang__marke-fuellung {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
    90deg,
    #ffffff 0%,
    #ffffff calc(var(--fortschritt) * 100%),
    transparent calc(var(--fortschritt) * 100%)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@supports not (-webkit-text-stroke: 1px currentColor) {
  .vorhang__marke-grund { color: rgba(255, 255, 255, 0.2); }
}

.vorhang__zeile {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--leise);
}

.vorhang__zahl {
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.vorhang[data-fertig] .vorhang__inhalt {
  transform: translateY(-40px) scale(0.96);
  opacity: 0;
  transition: transform 0.8s var(--kurve), opacity 0.5s ease;
}

@media (prefers-reduced-motion: reduce) {
  .vorhang__gitter > * { transition: none; }
}

.zeiger {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 190;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: #fff;
  pointer-events: none;
  mix-blend-mode: difference;
  transform: translate3d(var(--zx, -100px), var(--zy, -100px), 0) scale(var(--zs, 1));
  transition: scale 0.3s var(--kurve);
  will-change: transform;
}

.zeiger__ring {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 189;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  pointer-events: none;
  backdrop-filter: blur(2px);
  transform: translate3d(var(--rx, -100px), var(--ry, -100px), 0) scale(var(--rs, 1));
  will-change: transform;
}

@media (hover: none), (pointer: coarse) {
  .zeiger,
  .zeiger__ring {
    display: none;
  }
}

.flor {
  position: fixed;
  inset: 0;
  z-index: 180;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 40%, transparent 70%, rgba(0, 0, 0, 0.25) 100%);
}

.hero {
  min-height: calc(100svh - 56px);
}

.hero h1 {
  background: none;
  color: var(--text);
}

.hero h1 .zeile {
  display: block;
  overflow: hidden;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
}

.hero h1 .zeile__inner {
  display: block;
  background: var(--titel-verlauf);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transform: translateY(105%);
  transition: transform 1.1s var(--kurve);
}

.hero h1 .zeile:last-child .zeile__inner {
  background: var(--spektrum);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero h1 .zeile__inner.ist-aufgedeckt {
  transform: translateY(0);
}

html:not(.js-bewegung) .hero h1 .zeile__inner {
  transform: none;
}

.hero__fuss {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-6);
  margin-top: var(--sp-8);
}

.hero__kennzahlen {
  display: flex;
  gap: var(--sp-7);
  margin: 0;
}

.hero__kennzahl {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.hero__kennzahl dt {
  font-size: var(--fs-meta);
  color: var(--leise);
}

.hero__kennzahl dd {
  margin: 0;
  font-size: var(--fs-h3);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.kopf-nummer {
  display: flex;
  align-items: baseline;
  gap: var(--sp-4);
  font-size: var(--fs-meta);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 var(--sp-5);
}

.kopf-nummer::before {
  content: attr(data-nummer);
  font-variant-numeric: tabular-nums;
  background: var(--spektrum);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

html.js-bewegung .projekt-karte .projekt-karte__medien {
  clip-path: inset(0 0 100% 0 round var(--radius));
  transition: clip-path 1.1s var(--kurve);
}

html.js-bewegung .projekt-karte.ist-sichtbar .projekt-karte__medien {
  clip-path: inset(0 0 0 0 round var(--radius));
}

.platte {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background:
    radial-gradient(90% 80% at 80% 10%, rgba(155, 92, 255, 0.35), transparent 60%),
    radial-gradient(80% 70% at 10% 95%, rgba(255, 61, 127, 0.25), transparent 60%),
    linear-gradient(160deg, #18181d 0%, #0c0c10 60%, #060608 100%);
}

.platte[data-typ="website"] {
  background:
    radial-gradient(90% 80% at 80% 15%, rgba(56, 182, 255, 0.3), transparent 60%),
    linear-gradient(160deg, #15161b, #08080a);
}

.platte[data-typ="software"] {
  background:
    radial-gradient(90% 80% at 15% 85%, rgba(56, 220, 180, 0.22), transparent 60%),
    radial-gradient(70% 60% at 85% 10%, rgba(155, 92, 255, 0.22), transparent 60%),
    linear-gradient(160deg, #141418, #070709);
}

.platte__gitter {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask: radial-gradient(ellipse at 50% 50%, #000 30%, transparent 80%);
  mask: radial-gradient(ellipse at 50% 50%, #000 30%, transparent 80%);
}

.platte__kuerzel {
  position: absolute;
  left: var(--sp-6);
  bottom: var(--sp-5);
  font-size: clamp(3rem, 2rem + 5vw, 6.5rem);
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 0.85;
  background: var(--titel-verlauf);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.platte__marke {
  position: absolute;
  right: var(--sp-5);
  top: var(--sp-4);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: uebergang-raus 0.35s var(--kurve-weich) both;
}

::view-transition-new(root) {
  animation: uebergang-rein 0.5s var(--kurve) both;
}

@keyframes uebergang-raus {
  to { opacity: 0; transform: scale(0.985); }
}

@keyframes uebergang-rein {
  from { opacity: 0; transform: translateY(16px); }
}

@media (prefers-reduced-motion: reduce) {
  .vorhang { display: none; }
  .zeiger,
  .zeiger__ring { display: none; }

  .hero h1 .zeile__inner { transform: none; transition: none; }

  .projekt-karte .projekt-karte__medien {
    clip-path: none !important;
    transition: none !important;
  }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}

.hero__canvas {
  transition: none !important;
  opacity: 0;
}

.hero__canvas.ist-bereit {
  opacity: calc((1 - var(--scroll, 0) * 0.6) * (1 - var(--dimm, 0) * 0.62));
}

.filter-zahl {
  margin-left: 0.45em;
  font-size: 0.8em;
  font-variant-numeric: tabular-nums;
  opacity: 0.5;
}

html.js-bewegung .hero__buehne span:nth-child(1) {
  animation: treiben-a 19s ease-in-out infinite alternate;
}

html.js-bewegung .hero__buehne span:nth-child(2) {
  animation: treiben-b 23s ease-in-out infinite alternate;
}

@keyframes treiben-a {
  from { transform: translate(-50%, -50%) scale(1); opacity: 0.14; }
  to   { transform: translate(-58%, -44%) scale(1.2); opacity: 0.2; }
}

@keyframes treiben-b {
  from { transform: translate(-50%, -50%) scale(1); opacity: 0.1; }
  to   { transform: translate(-40%, -58%) scale(1.15); opacity: 0.15; }
}

@media (prefers-reduced-motion: reduce) {
  html.js-bewegung .hero__buehne span:nth-child(1),
  html.js-bewegung .hero__buehne span:nth-child(2) {
    animation: none;
  }
}

.hauptnav a {
  position: relative;
}

.hauptnav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 1px;
  background: var(--spektrum);
  transform: scaleX(0);
  transform-origin: 100% 50%;
  transition: transform 0.4s var(--kurve);
}

.hauptnav a:hover::after,
.hauptnav a:focus-visible::after,
.hauptnav a[aria-current="page"]::after {
  transform: scaleX(1);
  transform-origin: 0 50%;
}

.projekt-karte {
  transform-style: preserve-3d;
}

.projekt-karte__medien {
  will-change: transform;
}

html.js-bewegung .hero__scroll-linie {
  animation: scroll-hinweis 2.4s ease-in-out infinite;
  transform-origin: 50% 0;
}

@keyframes scroll-hinweis {
  0%, 100% { transform: scaleY(0.35); opacity: 0.4; }
  50%      { transform: scaleY(1);    opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .hauptnav a::after { transition: none; }
  .projekt-karte { transform-style: flat; }
  html.js-bewegung .hero__scroll-linie { animation: none; }
}

.klang-schalter {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-left: var(--sp-5);
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  transition: color 0.3s var(--kurve), border-color 0.3s var(--kurve);
}

.klang-schalter:hover,
.klang-schalter:focus-visible {
  color: var(--text);
  border-color: var(--border-hell);
}

.klang-schalter.ist-an {
  color: var(--text);
  border-color: rgba(155, 92, 255, 0.6);
}

.klang-schalter__balken {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.klang-schalter__balken i {
  width: 2px;
  height: 3px;
  background: currentColor;
  border-radius: 1px;
}

.klang-schalter.ist-an .klang-schalter__balken i {
  animation: pegel 0.9s ease-in-out infinite alternate;
}

.klang-schalter.ist-an .klang-schalter__balken i:nth-child(2) { animation-delay: 0.15s; }
.klang-schalter.ist-an .klang-schalter__balken i:nth-child(3) { animation-delay: 0.3s; }
.klang-schalter.ist-an .klang-schalter__balken i:nth-child(4) { animation-delay: 0.45s; }

@keyframes pegel {
  from { height: 3px; }
  to   { height: 12px; }
}

@media (max-width: 640px) {
  .klang-schalter__text { display: none; }
  .klang-schalter { margin-left: var(--sp-3); padding: 6px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .klang-schalter { display: none; }
}

.zeile__inner.ist-fertig,
.einblenden.ist-fertig,
.projekt-karte.ist-fertig {
  transition: none !important;
}

.hero h1 .zeile__inner.ist-fertig {
  transform: none !important;
}

.einblenden.ist-fertig {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}

html.js-bewegung .projekt-karte.ist-fertig .projekt-karte__medien {
  clip-path: inset(0 0 0 0 round var(--radius)) !important;
  transition: none !important;
}

.laufbaender {
  position: relative;
  padding-block: var(--sp-8) var(--sp-6);
  overflow: hidden;
  -webkit-mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.laufband {
  overflow: hidden;
  white-space: nowrap;
  font-size: clamp(2.5rem, 1.2rem + 6vw, 7rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.laufband__spur {
  display: inline-flex;
  will-change: transform;
}

.laufband__spur span {
  flex: none;
  padding-right: 0.3em;
  background: var(--titel-verlauf);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.laufband i {
  font-style: normal;
  font-size: 0.42em;
  vertical-align: 0.6em;
  margin: 0 0.25em;
  background: var(--spektrum);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.laufband--kontur .laufband__spur span {
  background: none;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.28);
}

@supports not (-webkit-text-stroke: 1px currentColor) {
  .laufband--kontur .laufband__spur span { color: rgba(255, 255, 255, 0.18); }
}

@media (prefers-reduced-motion: no-preference) {
  #work-grid .projekt-karte__bild-wrap img {
    transform: scale(calc(1.04 + var(--schub-abs, 0) * 0.04)) translate3d(0, calc(var(--schub, 0) * -10px), 0);
  }
}

.zeiger__ring::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #000;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.zeiger__ring.ist-projekt {
  background: rgba(255, 255, 255, 0.92);
  border-color: transparent;
  backdrop-filter: none;
}

.zeiger__ring.ist-projekt::after {
  opacity: 1;
}

.zeiger__ring {
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-stopped {
  overflow: clip;
}

@media (prefers-reduced-motion: no-preference) {
  #work-grid .projekt-karte:hover .projekt-karte__bild-wrap img,
  #work-grid .projekt-karte:focus-visible .projekt-karte__bild-wrap img {
    transform: scale(calc(1.08 + var(--schub-abs, 0) * 0.04)) translate3d(0, calc(var(--schub, 0) * -10px), 0);
  }
}
