@font-face {
  font-family: "Special Elite";
  src: url("../fonts/special-elite.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --hintergrund: #eeeade;
  --randabstand: 20px;
  --schriftfarbe: #12304b;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--hintergrund);
}

body {
  min-height: 100vh;
  min-height: 100svh;
}

.visitenkarte {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: var(--hintergrund);
}

.logo-knopf {
  position: absolute;
  z-index: 3;
  top: 4.5%;
  --logo-breite: max(10.8%, min(12%, calc(50vw - 32% - 10px)));
  left: min(82%, calc(50vw + 50% - 10px - var(--logo-breite)));
  width: var(--logo-breite);
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.logo {
  display: block;
  width: 100%;
  height: auto;
}

.logo-knopf:focus-visible {
  outline: 2px solid var(--schriftfarbe);
  outline-offset: 4px;
}

.motiv {
  position: absolute;
  top: 50%;
  left: 50%;
  width: auto;
  height: calc(100svh - 2 * var(--randabstand));
  aspect-ratio: 2143 / 2449;
  transform: translate(-50%, -50%);
}

.motiv img {
  position: absolute;
  display: block;
  height: auto;
}

.mond {
  z-index: 0;
  left: max(35.2%, calc(10px + 50% - 50vw + 150px));
  bottom: 31.8%;
  width: 19.5%;
  translate: -150px 20px;
  animation: mond-schweben 28s ease-in-out infinite;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.mond.is-dragging {
  cursor: grabbing;
}

.rot {
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100% !important;
  object-fit: fill;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.kontakt-gruppe {
  position: absolute;
  z-index: 2;
  left: max(34.5%, calc(10px + 50% - 50vw + 170px));
  bottom: max(24.4%, calc(50% - 50svh + 135px));
  width: 250px;
  --gruppen-versatz-x: -170px;
  --gruppen-versatz-y: 75px;
  --gruppen-drag-x: 0px;
  --gruppen-drag-y: 0px;
  translate: calc(var(--gruppen-versatz-x) + var(--gruppen-drag-x)) calc(var(--gruppen-versatz-y) + var(--gruppen-drag-y));
  transition: transform 280ms ease;
}

.name-knopf {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  line-height: 0;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.kontakt-gruppe.is-dragging .name-knopf {
  cursor: grabbing;
}

.name-knopf:focus-visible {
  outline: 2px solid var(--schriftfarbe);
  outline-offset: 4px;
}

.name {
  display: block;
  width: 100%;
  height: auto;
}

.kontakt-info {
  position: absolute;
  top: calc(100% + 3.2em);
  left: 0;
  display: none;
  color: var(--schriftfarbe);
  font-family: "Special Elite", "Courier New", monospace;
  font-size: clamp(15px, 1.6vw, 21px);
  line-height: 1.4;
  white-space: nowrap;
}

.kontakt-gruppe:hover .kontakt-info,
.kontakt-gruppe:focus-within .kontakt-info,
.kontakt-gruppe.is-open .kontakt-info {
  display: block;
}

.kontakt-zeile {
  display: block;
  width: max-content;
  clip-path: inset(0 100% 0 0);
}

.kontakt-zeile:first-child {
  animation: anschreiben 1.35s steps(15, end) forwards;
}

.kontakt-zeile:last-child {
  color: inherit;
  text-decoration: none;
  animation: anschreiben 1.2s steps(13, end) 1.4s forwards;
}

.kontakt-zeile:last-child:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

@keyframes anschreiben {
  to { clip-path: inset(0 0 0 0); }
}

@keyframes mond-schweben {
  0%,
  100% { translate: -150px 20px; }
  25% { translate: -160px 14px; }
  50% { translate: -150px 8px; }
  75% { translate: -140px 14px; }
}

.kontakt-gruppe.is-open {
  transform: translateY(-15px);
}

@media (max-height: 520px) {
  .kontakt-gruppe {
    --gruppen-versatz-y: 35px;
  }

  .kontakt-info {
    top: auto;
    bottom: calc(100% + 0.8em);
  }
}

@media (max-height: 150px) {
  .visitenkarte {
    overflow: visible;
  }

  .kontakt-gruppe {
    top: 0;
    bottom: auto;
    --gruppen-versatz-y: 0px;
  }

  .kontakt-info {
    top: calc(100% + 0.8em);
    bottom: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mond {
    animation: none;
  }

  .kontakt-zeile {
    animation: none;
    clip-path: none;
  }

  .kontakt-gruppe {
    transition: none;
  }
}
