/* ==========================================================================
   AI BRIDGE PARTNERS — layout.css
   Bühne (WebGL), Navigation, Sektionen, Footer.
   ========================================================================== */

/* ---------- Persistente WebGL-Bühne ---------- */
.stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s var(--ease);
}
.stage.is-ready { opacity: 1; }
.stage canvas { width: 100%; height: 100%; }

/* Fallback ohne WebGL: ruhiger Farbverlauf statt Partikel.
   Blendet sich selbst ein — scene.reveal() läuft in diesem Fall nicht. */
.stage.is-fallback {
  opacity: 1;
  background:
    radial-gradient(60% 50% at 70% 30%, rgba(47, 110, 224, 0.20), transparent 70%),
    radial-gradient(45% 45% at 25% 70%, rgba(27, 75, 171, 0.16), transparent 70%);
}

/* Filmkorn — nimmt der Fläche das Digitale */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 6s steps(6) infinite;
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-4%, 3%); }
  40%  { transform: translate(3%, -4%); }
  60%  { transform: translate(-3%, -2%); }
  80%  { transform: translate(4%, 2%); }
  100% { transform: translate(0, 0); }
}

/* Scroll-Fortschritt */
.scroll-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 90;
  pointer-events: none;
}
.scroll-progress span {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--blue-600), var(--blue-300));
}

/* Inhalt liegt grundsätzlich über der Bühne */
main, .nav, .footer { position: relative; z-index: 2; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 80;
  padding: clamp(0.9rem, 1.8vw, 1.6rem) 0;
  transition: transform 0.5s var(--ease), background-color 0.4s linear,
              backdrop-filter 0.4s linear, border-color 0.4s linear;
  border-bottom: 1px solid transparent;
}
.nav.is-stuck {
  background: rgba(5, 7, 14, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--hair);
}
.nav.is-hidden { transform: translateY(-105%); }

.nav__inner {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gut);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  letter-spacing: -0.02em;
}
.brand__mark {
  position: relative;
  align-self: center;
  width: 13px; height: 13px;
  border: 1.5px solid var(--blue-400);
  border-radius: 50%;
  transition: transform 0.6s var(--ease);
}
.brand__mark::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--blue-400);
  transform: scale(0.75);
  transition: transform 0.4s var(--ease);
}
.brand:hover .brand__mark { transform: rotate(180deg) scale(1.1); }
.brand:hover .brand__mark::after { transform: scale(1); }
.brand__word {
  /* Der Name ist mehrteilig — er darf nie umbrechen, sonst kippt die
     Kopfzeile in zwei Zeilen. Die Größe schrumpft stattdessen mit. */
  font-size: clamp(0.82rem, 0.62rem + 0.9vw, 1.02rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.brand__sub {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-mute);
  white-space: nowrap;
}

/* Auf schmalen Geräten trägt der Zusatz nichts bei, was die Seite nicht
   ohnehin sagt — und er wäre die Zeile, die als Erstes bricht. */
@media (max-width: 720px) {
  .brand__sub { display: none; }
}
.brand--lg .brand__word { font-size: clamp(1.4rem, 3vw, 2rem); }
.brand--lg .brand__mark { width: 18px; height: 18px; }

.nav__links {
  display: flex;
  gap: clamp(1.2rem, 2.4vw, 2.4rem);
  font-size: 0.875rem;
  color: var(--fg-dim);
}
.nav__links a { position: relative; padding: 0.3rem 0; }
.nav__links a span { position: relative; display: block; }
.nav__links a span::after {
  content: "";
  position: absolute;
  left: 0; bottom: -3px;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: 100% 50%;
  transition: transform 0.45s var(--ease);
}
.nav__links a:hover { color: var(--fg); }
.nav__links a:hover span::after { transform: scaleX(1); transform-origin: 0 50%; }
.nav__links a.is-active { color: var(--blue-300); }

.nav__end { display: flex; align-items: center; gap: 0.9rem; }

.nav__toggle {
  display: none;
  width: 42px; height: 42px;
  place-items: center;
  border: 1px solid var(--hair-strong);
  border-radius: 50%;
}
.nav__toggle-lines { display: block; width: 16px; }
.nav__toggle-lines i {
  display: block;
  height: 1.5px;
  background: var(--fg);
  transition: transform 0.4s var(--ease), opacity 0.25s linear;
}
.nav__toggle-lines i:first-child { margin-bottom: 4px; }
.nav__toggle[aria-expanded="true"] .nav__toggle-lines i:first-child { transform: translateY(3px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__toggle-lines i:last-child { transform: translateY(-2.5px) rotate(-45deg); }

/* ---------- Mobiles Menü ---------- */
.menu {
  position: fixed;
  inset: 0;
  z-index: 79;
  overscroll-behavior: contain;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3rem;
  padding: 6rem var(--gut) 3rem;
  background: var(--ink-900);
  clip-path: inset(0 0 100% 0);
}
.menu__nav { display: flex; flex-direction: column; gap: 0.4rem; }
.menu__nav a {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  font-size: clamp(2.2rem, 11vw, 3.4rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.1;
  border-bottom: 1px solid var(--hair);
  padding: 0.5rem 0;
}
.menu__nav a i {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-style: normal;
  letter-spacing: 0.1em;
  color: var(--blue-400);
}
.menu__foot {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--fg-dim);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding: clamp(8rem, 18vh, 12rem) 0 clamp(2rem, 5vh, 3.5rem);
}
.hero::after {
  /* Lesbarkeit über der Partikelbühne */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(5, 7, 14, 0.55) 0%, rgba(5, 7, 14, 0.1) 45%, rgba(5, 7, 14, 0.85) 100%);
  pointer-events: none;
}
.hero__inner { width: 100%; }

.hero__title {
  font-size: clamp(3.1rem, 10.2vw, 10.5rem);
  margin: clamp(1.2rem, 3vw, 2rem) 0 clamp(2rem, 5vw, 3.4rem);
  letter-spacing: -0.045em;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(1.8rem, 4vw, 4rem);
  align-items: end;
  padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
  border-bottom: 1px solid var(--hair);
}
.hero__lede {
  max-width: 46ch;
  color: var(--fg-dim);
  font-size: clamp(1rem, 1.15vw, 1.15rem);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.hero__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  padding-top: clamp(1.5rem, 3vw, 2.2rem);
}
.hero__scroll { display: flex; align-items: center; gap: 0.75rem; }
.hero__scroll-rail {
  position: relative;
  display: block;
  width: 52px; height: 1px;
  background: var(--hair-strong);
  overflow: hidden;
}
.hero__scroll-rail i {
  position: absolute;
  inset: 0;
  background: var(--blue-300);
  transform-origin: 0 50%;
  animation: rail 2.6s var(--ease-io) infinite;
}
@keyframes rail {
  0%   { transform: translateX(-100%); }
  55%  { transform: translateX(0); }
  100% { transform: translateX(100%); }
}

.hero__stats {
  display: flex;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  text-align: right;
}
.hero__stats dt { margin-bottom: 0.3rem; }
.hero__stats dd {
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--blue-100);
}

/* ---------- Ticker ---------- */
.ticker {
  position: relative;
  z-index: 2;
  overflow: hidden;
  padding: 1.1rem 0;
  border-block: 1px solid var(--hair);
  background: rgba(8, 12, 22, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.ticker__rail { display: flex; width: max-content; will-change: transform; }
.ticker__group {
  display: flex;
  align-items: center;
  gap: 2.2rem;
  padding-right: 2.2rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-dim);
  white-space: nowrap;
}
.ticker__group i { font-style: normal; color: var(--blue-500); font-size: 0.6rem; }

/* ---------- Manifest ---------- */
.manifest { padding: clamp(7rem, 16vh, 13rem) 0; }
.manifest__text {
  font-size: clamp(1.5rem, 3.4vw, 2.9rem);
  line-height: 1.28;
  letter-spacing: -0.03em;
  max-width: 22ch;
  min-width: 0;
  font-weight: 400;
}
.manifest__text .w { color: var(--fg-mute); transition: color 0.2s linear; }
.manifest__sign { margin-top: clamp(2rem, 4vw, 3rem); }

@media (min-width: 900px) {
  .manifest__text { max-width: 26ch; margin-left: auto; width: min(100%, 62ch); }
  .manifest__sign { text-align: right; }
}

/* ---------- Leistungen ---------- */
.services { padding: var(--sec-y) 0; }
.services__inner {
  display: grid;
  gap: clamp(2.5rem, 5vw, 5rem);
}
.services__aside .h2 { margin-bottom: 1.5rem; }
.services__note {
  color: var(--fg-dim);
  max-width: 36ch;
  font-size: 0.95rem;
}
.services__signature {
  display: none;
  margin-top: clamp(2rem, 5vw, 4rem);
  padding-top: 1.1rem;
  border-top: 1px solid var(--hair);
}
.services__signature strong {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--blue-200);
}

@media (min-width: 1000px) {
  .services__inner { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); align-items: start; }
  .services__aside { position: sticky; top: 22vh; }
  .services__signature { display: block; }
}

/* ---------- Prozess ---------- */
.process {
  position: relative;
  z-index: 2;
  padding: var(--sec-y) 0 0;
  overflow: hidden;
}
.process__head { margin-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.process__head .h2 { margin-bottom: 1.2rem; }
.process__note { color: var(--fg-on-paper-dim); }

/* Im gepinnten Zustand muss die Sektion exakt in den Viewport passen. */
.process.is-pinning {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: clamp(4rem, 9vh, 6.5rem);
}
.process.is-pinning .process__head { margin-bottom: clamp(1.5rem, 3.5vh, 2.75rem); }
.process.is-pinning .process__track { padding-bottom: clamp(1.5rem, 4vh, 3rem); }
.process.is-pinning .step { min-height: clamp(17rem, 34vh, 22rem); }

.process__track { padding-bottom: clamp(4rem, 9vw, 7rem); }
.process__rail {
  display: flex;
  gap: clamp(1rem, 2vw, 1.75rem);
  padding-inline: var(--gut);
  will-change: transform;
}

/* Ohne Pin (Mobile / reduced motion): natives horizontales Scrollen */
.process__track:not(.is-pinned) {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.process__track:not(.is-pinned)::-webkit-scrollbar { display: none; }
.process__track:not(.is-pinned) .step { scroll-snap-align: center; }

.step {
  flex: 0 0 auto;
  width: min(78vw, 25rem);
  min-height: clamp(19rem, 30vw, 24rem);
  display: flex;
  flex-direction: column;
  padding: clamp(1.5rem, 2.6vw, 2.2rem);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--hair-dark);
  border-radius: var(--radius-lg);
  transition: transform 0.5s var(--ease), background-color 0.5s var(--ease);
}
.step:hover { transform: translateY(-6px); background: #fff; }
.step__num {
  color: var(--blue-600);
  letter-spacing: 0.18em;
  margin-bottom: auto;
}
.step h3 {
  font-size: clamp(1.7rem, 2.8vw, 2.4rem);
  margin: 2.5rem 0 0.9rem;
}
.step p { color: var(--fg-on-paper-dim); font-size: 0.95rem; max-width: 34ch; }
.step__meta { margin-top: 1.4rem; color: var(--blue-600); }

.step--end {
  background: var(--fg-on-paper);
  border-color: var(--fg-on-paper);
  color: var(--paper);
}
.step--end .step__num { color: var(--blue-300); }
.step--end p { color: rgba(238, 241, 247, 0.66); }
.step--end .btn { margin-top: 1.6rem; align-self: flex-start; }

/* ---------- Arbeiten ---------- */
.work { padding: var(--sec-y) 0; }
.work__head { margin-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.work__list { display: grid; gap: clamp(1rem, 1.6vw, 1.5rem); }
.work__disclaimer { margin-top: 2rem; }

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

/* ---------- Zahlen ---------- */
.figures { padding: clamp(3rem, 7vw, 5rem) 0 var(--sec-y); }
.figures__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--hair);
  border: 1px solid var(--hair);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.figure {
  background: rgba(8, 12, 22, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: clamp(1.6rem, 3.4vw, 2.8rem);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: background-color 0.5s var(--ease);
}
.figure:hover { background: rgba(16, 26, 48, 0.8); }
.figure strong {
  font-size: clamp(2.4rem, 5.4vw, 4.2rem);
  font-weight: 400;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--blue-100);
  font-variant-numeric: tabular-nums;
}
@media (min-width: 900px) {
  .figures__grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- FAQ ---------- */
.faq { padding: var(--sec-y) 0; }
.faq__inner { display: grid; gap: clamp(2rem, 4vw, 4rem); }
@media (min-width: 1000px) {
  .faq__inner { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); align-items: start; }
  .faq__head { position: sticky; top: 22vh; }
}

/* ---------- Kontakt ---------- */
.contact {
  position: relative;
  padding: var(--sec-y) 0;
}
.contact::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(70% 60% at 50% 100%, rgba(27, 75, 171, 0.28), transparent 70%);
  pointer-events: none;
}
.contact__inner { display: grid; gap: clamp(2.5rem, 5vw, 5rem); }
.contact__intro .h2 { margin-bottom: 1.4rem; }
.contact__lede { color: var(--fg-dim); max-width: 40ch; }
.contact__meta {
  display: grid;
  gap: 0.9rem;
  margin-top: clamp(2rem, 4vw, 3rem);
  padding-top: clamp(1.5rem, 3vw, 2rem);
  border-top: 1px solid var(--hair);
}
.contact__meta li { display: grid; gap: 0.15rem; }
.contact__meta a { transition: color 0.3s var(--ease); }
.contact__meta a:hover { color: var(--blue-300); }

@media (min-width: 1000px) {
  .contact__inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .contact__intro { position: sticky; top: 20vh; }
}

/* ---------- Footer ---------- */
.footer {
  padding: clamp(3rem, 6vw, 5rem) 0 clamp(1.5rem, 3vw, 2.5rem);
  border-top: 1px solid var(--hair);
  background: var(--ink-900);
}
.footer__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
}
.footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1rem, 2.5vw, 2.2rem);
  font-size: 0.9rem;
  color: var(--fg-dim);
}
.footer__nav a:hover { color: var(--blue-300); }
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: clamp(1.2rem, 2.5vw, 2rem);
  border-top: 1px solid var(--hair);
}
.footer__legal { display: flex; gap: 1.4rem; }
.footer__legal a:hover { color: var(--blue-300); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav__links { display: none; }
  .nav__end .btn { display: none; }
  .nav__toggle { display: grid; }

  .hero__grid { grid-template-columns: 1fr; align-items: start; }
  .hero__foot { flex-direction: column; align-items: flex-start; }
  .hero__stats { text-align: left; flex-wrap: wrap; }
}

@media (max-width: 560px) {
  .hero__stats > div:last-child { display: none; }
  .footer__bottom { flex-direction: column; align-items: flex-start; }
}
