:root {
  --surface: #ffffff;
  --text: #222222;
  --muted: #888888;
  --font: "AkkuratStd", "Akkurat Std", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

body {
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 400;
  line-height: normal;
}

.idle {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.idle__piece {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.idle__piece.is-dragging {
  z-index: 20;
  cursor: grabbing;
}

.idle__piece img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
}

.idle__title {
  display: none;
}

body.is-grid .idle__title,
body.is-releasing .idle__title {
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  margin-top: 16px;
  text-align: center;
  font-size: 15px;
  line-height: normal;
}

body.is-grid .idle__piece.is-last-row .idle__title,
body.is-releasing .idle__piece.is-last-row .idle__title {
  margin-top: 15px;
}

@media (max-width: 720px) {
  body.is-grid .idle__piece.is-last-row .idle__title,
  body.is-releasing .idle__piece.is-last-row .idle__title {
    margin-top: 16px;
  }

  .home-grid .overview__card.is-last-row {
    gap: 16px;
  }
}

body.is-releasing .idle__title {
  opacity: 0;
  transition: opacity 0.8s ease;
}

.overview {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding-top: 0;
  padding-bottom: 48px;
  background: var(--surface);
}

.dock {
  position: sticky;
  top: 40px;
  z-index: 5;
  width: calc(100% - 80px);
  max-width: none;
  margin: 40px 40px 40px;
  pointer-events: none;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  background: transparent;
}

body.about-open::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 4;
  background: rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.dock > * {
  pointer-events: auto;
}

.dock__about {
  position: relative;
}

.dock__name,
.dock__grid {
  position: relative;
  z-index: 6;
  isolation: isolate;
  height: 28px;
  border: 0;
  border-radius: 30px;
  background: transparent;
  color: #ffffff;
}

.dock__name::before,
.dock__grid::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.02);
  -webkit-backdrop-filter: invert(1);
  backdrop-filter: invert(1);
}

.dock__name {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 28px;
  padding: 0 16px;
  border-radius: 30px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.dock__name img {
  display: block;
  width: auto;
  height: 1em;
  max-width: none;
  filter: brightness(0) invert(1);
}

.dock__drop {
  position: absolute;
  z-index: 6;
  top: calc(100% + 12px);
  left: 0;
  width: min(486px, calc(100vw - 80px));
  padding: 16px 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  white-space: normal;
  display: none;
}

.dock__about.is-open .dock__drop {
  display: block;
}

.dock__drop > * + * {
  display: block;
  margin-top: 10px;
}

.dock__grid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 28px;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 30px;
  cursor: pointer;
}

.dock__grid svg {
  width: 14px;
  height: 14px;
  max-width: none;
}

.dock__grid .layout-logo {
  display: none;
  width: auto;
  height: 20px;
}

.dock__grid[aria-pressed="true"] svg:not(.layout-logo) {
  display: none;
}

.dock__grid[aria-pressed="true"] .layout-logo {
  display: block;
}

.dock__grid[aria-pressed="true"] {
  background: transparent;
  color: #ffffff;
}

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

.overview__media {
  display: block;
  width: 100%;
  max-width: 100%;
}

.caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.overview__grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  column-gap: 14px;
  row-gap: 48px;
  width: calc(100% - 80px);
  margin: 20px auto 0;
}

.home-grid {
  display: none;
  width: auto;
  margin: 0 40px 0;
  column-gap: 40px;
  row-gap: 40px;
}

.home-grid .overview__media,
.home-grid .caption {
  visibility: hidden;
}

.home-grid .overview__media {
  aspect-ratio: 1;
}

body.is-grid {
  position: relative;
  padding-bottom: 20px;
}

body.is-grid .home-grid {
  display: grid;
}

body.is-grid .idle {
  position: absolute;
  overflow: visible;
}

.overview__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  min-width: 0;
  transform-origin: center bottom;
  transition: transform 0.2s ease;
}

.home-grid .overview__card.is-last-row {
  gap: 40px;
}

.overview__card:hover,
.overview__card:focus-within {
  z-index: 1;
  transform: scale(1.05);
}

.overview__media img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.detail {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 0 40px;
  overflow: hidden;
  background: var(--surface);
}

.detail__stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

.detail__strip {
  position: absolute;
  top: 40px;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-inline: 40px;
  scrollbar-width: none;
}

.detail__strip::-webkit-scrollbar {
  display: none;
}

.detail__strip.is-single {
  justify-content: center;
  align-items: center;
}

.detail__photo {
  width: auto;
  height: 100%;
  max-width: calc(100vw - 80px);
  max-height: 100%;
  object-fit: contain;
  flex: 0 0 auto;
}

video.detail__photo {
  cursor: pointer;
}

.detail__bar {
  display: grid;
  grid-template-columns: 1fr minmax(0, 463px) 1fr;
  align-items: center;
  column-gap: 24px;
  width: 100%;
  margin-inline: 0;
  padding: 7px 40px;
  flex-shrink: 0;
}

.detail__meta {
  justify-self: end;
  text-align: right;
}

.detail__copy {
  width: 100%;
}

.detail__back {
  justify-self: start;
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 16px;
  border-radius: 30px;
  background: transparent;
  color: #ffffff;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.detail__back::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.02);
  -webkit-backdrop-filter: invert(1);
  backdrop-filter: invert(1);
}

@media (max-width: 800px) {
  .detail {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .detail__stage {
    flex: 1 1 auto;
    min-height: 0;
  }

  .detail__bar {
    grid-template-columns: 1fr;
    row-gap: 16px;
    width: 100%;
    padding-inline: 40px;
  }

  .detail__meta {
    justify-self: start;
    text-align: left;
  }

  .detail__back {
    justify-self: start;
  }
}

@media (max-width: 720px) {
  .overview__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: calc(100% - 32px);
    row-gap: 32px;
  }
}

.info {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--surface);
}

.info__text {
  width: min(486px, calc(100% - 80px));
  margin: 24px 0 0 40px;
  font-size: 15px;
  line-height: normal;
  color: #000000;
}

.contact {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

.contact__bio {
  width: calc(100% - 80px);
  margin: 24px auto 0;
  font-size: 15px;
  line-height: 1.45;
  text-align: justify;
}

.contact__stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1400px;
  padding: 24px;
}

.card {
  width: min(830px, 100%);
  aspect-ratio: 830 / 494;
  transform: translate(var(--tx, 0px), var(--ty, 0px)) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.12s linear;
  cursor: pointer;
}

.card__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.7s ease;
}

.card.is-flipped .card__inner {
  transform: rotateY(180deg);
}

.card__face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.card__front img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: fill;
}

.card__back {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--text);
  background: url("../assets/kontakt/card-bg.webp") center / cover no-repeat;
  transform: rotateY(180deg);
  text-align: center;
}

.card__name {
  margin-bottom: 34px;
  font-size: 46px;
  line-height: normal;
}

.card__back a {
  margin-bottom: 22px;
  font-size: 15px;
  line-height: normal;
  color: var(--text);
}

.card__back p:last-child {
  font-size: 15px;
  line-height: normal;
}

@media (max-width: 720px) {
  body {
    overflow-x: hidden;
  }

  .overview__grid {
    width: calc(100% - 24px);
    column-gap: 10px;
    row-gap: 28px;
  }

  .detail__strip {
    top: 40px;
    padding-inline: 40px;
  }

  .detail__photo {
    max-width: calc(100vw - 80px);
  }

  .detail__back {
    height: 28px;
  }

  .info__text {
    width: calc(100% - 32px);
    margin: 20px 0 0 16px;
  }

  .contact {
    height: auto;
    min-height: 100dvh;
  }

  .contact__bio {
    width: calc(100% - 32px);
    margin-top: 16px;
    text-align: left;
  }

  .contact__stage {
    padding: 16px;
  }

  .card__back {
    padding: 16px;
  }

  .card__name {
    margin-bottom: 16px;
    font-size: 26px;
  }

  .card__back a,
  .card__back p:last-child {
    font-size: 13px;
  }

  .card__back a {
    margin-bottom: 12px;
    overflow-wrap: anywhere;
  }

  .dock {
    top: max(12px, env(safe-area-inset-top));
    width: calc(100% - 32px);
    max-width: none;
    margin: max(12px, env(safe-area-inset-top)) 16px 16px;
    gap: 12px;
  }

  .dock__name,
  .dock__grid,
  .detail__back {
    min-height: 44px;
    height: 44px;
  }

  .dock__grid {
    width: 44px;
  }

  .dock__drop {
    position: fixed;
    top: calc(max(12px, env(safe-area-inset-top)) + 56px);
    right: max(16px, env(safe-area-inset-right));
    left: max(16px, env(safe-area-inset-left));
    width: auto;
    max-height: calc(100dvh - 96px);
    overflow-y: auto;
  }

  .home-grid.overview__grid {
    width: auto;
    margin: 0 16px 0;
    column-gap: 16px;
    row-gap: 16px;
  }

  body.is-grid {
    padding-top: 0;
  }

  .detail {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
    padding: 16px 16px max(24px, env(safe-area-inset-bottom));
  }

  .detail__stage {
    flex: none;
  }

  .detail__strip {
    position: static;
    flex-direction: column;
    align-items: center;
    overflow: visible;
    padding: 0;
    gap: 16px;
  }

  .detail__photo {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: none;
  }

  .detail__bar {
    width: 100%;
    margin-top: 8px;
    padding-inline: 0;
  }

  .info__text {
    width: auto;
    margin: 16px 16px 24px;
  }

  .contact__bio {
    width: auto;
    margin: 16px 16px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .card__inner {
    transition: none;
  }
}
