/* Footer: Kontakt + Formular, Link-Spalten, Abschlusszeile.
   Mobil (Basis): normaler Fluss. Desktop (ab 901 px): eine Bühne im selben
   1440x810-Raster und mit derselben Skalierung wie der Hero. Rechts oben bleibt eine
   Lücke, in die der Projekt-Würfel aus dem Hero fährt (Footer-Phase, siehe hero.css). */

.site-footer {
  position: relative;
  scroll-margin-top: 72px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  overflow: hidden;
}

.site-footer::before {
  content: '';
  display: block;
  height: 1px;
  background: var(--hair);
}

.footer-canvas {
  position: relative;
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 56px;
  scroll-margin-top: 96px;
}

.footer-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 90%;
  font-size: 46px;
  line-height: 0.9;
  letter-spacing: -0.035em;
  color: var(--ink);
  /* Schutz bei vergrößerten Textabständen; ohne Überlauf wirkungslos. */
  overflow-wrap: break-word;
}

.footer-title:focus {
  outline: none;
}

.footer-intro {
  max-width: 440px;
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink-body);
}

.footer-halo {
  display: none;
}
/* Formular */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 6px;
}

.contact-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--ink-muted);
}

.field input,
.field textarea {
  width: 100%;
  height: 46px;
  padding: 0 16px;
  border: 1px solid var(--field-border);
  border-radius: var(--radius-field);
  background: var(--surface);
  color: var(--ink2);
  font: 15px/1.4 var(--font-sans);
  -webkit-appearance: none;
  appearance: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.field textarea {
  height: auto;
  min-height: 132px;
  padding: 12px 16px;
  resize: vertical;
}

.field input:hover,
.field textarea:hover {
  border-color: var(--ink-subtle);
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.field [aria-invalid='true'] {
  border-color: #c0392b;
}

.contact-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.contact-actions .mw-btn {
  height: 48px;
}

.contact-note {
  font-size: 12px;
  color: var(--ink-muted);
}

.contact-status {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  color: var(--ink2);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}

.contact-status:focus {
  outline: none;
}

.contact-status--error {
  background: color-mix(in srgb, #c0392b 10%, transparent);
  border-color: color-mix(in srgb, #c0392b 45%, transparent);
}

/* Link-Spalten */
.footer-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px 24px;
  padding: 72px 0 18px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.footer-col--mail {
  grid-column: 1 / -1;
}

.footer-col--profiles {
  order: 3;
}

.footer-cap {
  margin-bottom: 12px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--ink-muted);
}

.footer-link {
  display: inline-block;
  max-width: 100%;
  padding: 4px 0;
  font-size: 14px;
  color: var(--ink-link);
  /* Lange Adressen bei vergrößerten Textabständen umbrechen statt überlaufen. */
  overflow-wrap: break-word;
}

.footer-link:hover {
  color: var(--accent);
}

.footer-link[aria-current='page'] {
  color: var(--ink);
  font-weight: 600;
}

/* Abschlusszeile */
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 24px;
  margin-top: 10px;
  padding: 20px 0 28px;
  border-top: 1px solid var(--hair);
}

.footer-wordmark {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.26em;
  color: var(--ink2);
}

.footer-copy {
  order: 3;
  width: 100%;
  font-size: 12px;
  color: var(--ink-muted);
}

.footer-bottom-tools {
  display: flex;
  align-items: center;
  gap: 18px;
}

.footer-top {
  padding: 12px 0;
}

/* Mobil: kleiner, rein dekorativer MW-Würfel oben rechts (Handoff) */
.footer-mini {
  position: absolute;
  right: 0;
  top: 24px;
}

.contact-row {
  grid-template-columns: 1fr;
  gap: 14px;
}

.contact-actions {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.contact-actions .mw-btn {
  justify-content: center;
}

/* ---------- Desktop: Bühne ---------- */
@media (min-width: 901px) {
  /* Andocken exakt am Seitenende, damit der Würfel genau in seiner Lücke sitzt. */
  .site-footer--home {
    scroll-margin-top: 0;
    max-width: none;
    height: 100vh;
    min-height: calc(810px * var(--hero-scale, 1));
    padding: 0;
  }

  .site-footer--home::before {
    display: none;
  }

  .site-footer--home .footer-canvas {
    position: absolute;
    left: 50%;
    top: 0;
    width: 1440px;
    height: 810px;
    transform: translateX(-50%) scale(var(--hero-scale, 1));
    transform-origin: 50% 0;
  }

  .site-footer--home .footer-canvas > * {
    position: absolute;
  }

  /* Mit JavaScript: Bühnenebene über der angehefteten Hero-Bühne. Sie blendet in der
     Footer-Phase an Ort und Stelle ein (Prototyp: 0,8 s mit 0,55 s Verzögerung, gleitet
     60 px hoch), während derselbe Würfel in seine Lücke fährt. Unsichtbar bleibt sie
     fokussierbar; Fokus darin führt per home.js in die Footer-Phase. */
  :root.js .site-footer--home {
    position: fixed;
    inset: 0;
    z-index: 4;
    height: auto;
    min-height: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  :root.js .site-footer--home .footer-canvas {
    transform: translateX(-50%) translateY(60px) scale(var(--hero-scale, 1));
    transition: transform 0.5s ease;
  }

  :root.js[data-hero-phase='footer'] .site-footer--home {
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.8s ease 0.55s;
  }

  :root.js[data-hero-phase='footer'] .site-footer--home .footer-canvas {
    transform: translateX(-50%) scale(var(--hero-scale, 1));
    transition: transform 1s var(--ease-out) 0.55s;
  }

  .site-footer--home .footer-halo {
    display: block;
    left: 760px;
    top: -11px;
    width: 700px;
    height: 620px;
    border-radius: 50%;
    background: radial-gradient(closest-side, var(--halo-a), var(--halo-b) 55%, var(--ground-0));
    pointer-events: none;
  }

  .site-footer--home .footer-contact {
    left: 72px;
    top: 104px;
    width: 600px;
    padding-top: 0;
    gap: 12px;
  }

  .site-footer--home .footer-title {
    font-size: 72px;
  }

  .site-footer--home .footer-intro {
    font-size: 16px;
    max-width: 460px;
  }

  .site-footer--home .contact-form {
    gap: 12px;
  }

  .site-footer--home .field textarea {
    min-height: 104px;
  }

  .site-footer--home .contact-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .site-footer--home .contact-actions {
    flex-direction: row;
    align-items: center;
    gap: 18px;
  }

  .site-footer--home .footer-mini {
    display: none;
  }

  /* Rechts unter der Würfel-Lücke: Kontaktzeile über die volle Breite, darunter drei Spalten */
  .site-footer--home .footer-links {
    left: 800px;
    right: 72px;
    top: 506px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px 24px;
    padding: 0;
  }

  .site-footer--home .footer-col--mail {
    flex-direction: row;
    align-items: baseline;
    gap: 16px;
    padding-bottom: 14px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--hair);
  }

  .site-footer--home .footer-col--mail .footer-cap {
    margin-bottom: 0;
  }

  .site-footer--home .footer-col--profiles {
    order: 0;
  }

  .site-footer--home .footer-cap {
    margin-bottom: 8px;
  }

  .site-footer--home .footer-bottom {
    left: 72px;
    right: 72px;
    top: 752px;
    flex-wrap: nowrap;
    margin: 0;
    padding: 8px 0 0;
    border-top: 1px solid var(--hair);
  }

  .site-footer--home .footer-copy {
    order: 0;
    width: auto;
  }

  /* Wachsende Bühne (siehe hero.css): Die Fußzeile folgt Kontaktspalte und Linkspalten,
     die Bühne wird höher und ihr Überhang per Scrollweg erreichbar (--footer-lift). */
  :root.js[data-stage-grow] .site-footer--home {
    overflow: clip;
  }

  :root.js[data-stage-grow] .site-footer--home .footer-canvas {
    height: var(--footer-stage-h, 810px);
    translate: 0 calc(-1 * var(--footer-lift, 0px));
  }

  :root.js[data-stage-grow] .site-footer--home .footer-bottom {
    top: calc(752px + var(--footer-bottom-shift, 0px));
  }
}
/* Mini-MW-Würfel */
.cube-stage--mini {
  --cube: 64px;
}

.cube-face-mw {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 90%;
  font-size: calc(var(--cube) * 0.3);
  letter-spacing: -0.02em;
  color: var(--ink-muted);
}
