:root { --hold: 7s; }

body.home .top {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 5;
  max-width: none;
  border-bottom: 0;
  color: #fff;
  background: linear-gradient(to bottom, rgba(6, 8, 10, 0.88) 0%, rgba(6, 8, 10, 0.4) 72%, rgba(6, 8, 10, 0) 100%);
  padding: max(0.85rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) 1.8rem max(1rem, env(safe-area-inset-left));
}

body.home .brand,
body.home .top nav a {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

body.home .top nav a:focus-visible,
body.home .brand:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

body.home main {
  max-width: none;
  padding: 0;
}

.rest {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.5rem 16px 3rem;
  overflow-wrap: break-word;
}

.hero-slides {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100svh;
  padding-top: 9.5rem;
  background: #101214;
  color: #fff;
}

.hero-slides:focus { outline: none; }

.hero-slides:focus-visible {
  outline: 3px solid #fff;
  outline-offset: -6px;
}

.hero-frames {
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-frame {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transition: opacity 1s ease;
}

.hero-frame picture {
  position: absolute;
  inset: 0;
  display: block;
}

.hero-frame.is-active {
  opacity: 1;
  z-index: 1;
}

.hero-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-frame img:not([src]) { visibility: hidden; }

.hero-frame.is-active img {
  animation: hero-drift var(--hold) linear forwards;
}

.frame-diamond img { object-position: center 40%; transform-origin: center 32%; }
.frame-nyhavn img { object-position: center 46%; }
.frame-palace img { object-position: center 40%; }
.frame-pavilion img { object-position: center 42%; }
.frame-borsen img { object-position: center 75%; transform-origin: center 75%; }
.frame-planetarium img { object-position: center center; transform-origin: center 42%; }

@keyframes hero-drift {
  from { transform: scale(1); }
  to { transform: scale(1.05); }
}

.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(to top, rgba(6, 8, 10, 0.22) 0%, rgba(6, 8, 10, 0) 28%);
}

.hero-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  z-index: 6;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.28);
}

.hero-progress > span {
  display: block;
  height: 100%;
  width: 100%;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left center;
}

.hero-progress > span.is-run {
  animation: hero-grow var(--hold) linear forwards;
}

@keyframes hero-grow {
  to { transform: scaleX(1); }
}

.hero-slides.is-held .hero-frame img,
.hero-slides.is-held .hero-progress > span {
  animation-play-state: paused;
}

.hero-hud {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "copy controls"
    "credit credit";
  align-items: end;
  justify-items: start;
  gap: 0.45rem 1rem;
  width: 100%;
  max-width: 100%;
  margin-top: auto;
  padding: 0.7rem max(0.8rem, env(safe-area-inset-right)) max(0.7rem, env(safe-area-inset-bottom)) max(0.8rem, env(safe-area-inset-left));
}

.hero-copy {
  grid-area: copy;
  min-width: 0;
  max-width: min(38rem, 100%);
}

.hero-slides h1 {
  display: inline;
  margin: 0;
  color: #fff;
  font-size: 1.2rem;
  line-height: 1.55;
  font-weight: 600;
  text-wrap: balance;
  background: rgba(6, 8, 10, 0.66);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  padding: 0.08rem 0.42rem;
  border-radius: 0.28rem;
}

.hero-credit {
  grid-area: credit;
  justify-self: end;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  color: #fff;
  font-size: 0.7rem;
  line-height: 1.35;
  text-align: right;
  background: rgba(6, 8, 10, 0.66);
  border-radius: 0.25rem;
  padding: 0.12rem 0.4rem;
}

.hero-credit a {
  color: #fff;
  text-underline-offset: 0.12em;
}

.hero-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}

.hero-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem;
  max-width: 100%;
  justify-content: flex-end;
}

.hero-dot {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.hero-dot::after {
  content: "";
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 999px;
  background: transparent;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.9), 0 1px 2px rgba(0, 0, 0, 0.85);
}

.hero-dot.is-on::after {
  background: #fff;
}

.hero-transport {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
  max-width: 100%;
}

.hero-btn {
  appearance: none;
  color: #fff;
  background: rgba(6, 8, 10, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  padding: 0.18rem 0.7rem;
  min-height: 2.1rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}

.hero-btn:hover { background: rgba(6, 8, 10, 0.8); }

.hero-btn:focus-visible,
.hero-dot:focus-visible,
.hero-credit a:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

@media (max-aspect-ratio: 1/1) {
  .frame-diamond img { transform-origin: center 28%; }
  .frame-borsen img { transform-origin: center 18%; }
  .frame-planetarium img { transform-origin: center 38%; }
  .hero-frame img { object-position: center center; }

  .hero-hud {
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy"
      "controls"
      "credit";
  }

  .hero-controls { align-items: flex-start; justify-self: start; }
  .hero-dots,
  .hero-transport { justify-content: flex-start; }
  .hero-copy { max-width: none; }
  .hero-credit { justify-self: start; text-align: left; }
}

.hero-licence,
.hero-credit a[data-credit="page"] { white-space: nowrap; }

@media (max-height: 520px) {
  .hero-slides { padding-top: 5.5rem; }
  .hero-slides h1 { font-size: 1.1rem; }
  .hero-hud {
    align-items: end;
    padding-top: 0.35rem;
    padding-bottom: 0.4rem;
    gap: 0.3rem 0.7rem;
  }
  .hero-dot { width: 1.85rem; height: 1.85rem; }
  .hero-btn { min-height: 2rem; padding: 0.1rem 0.55rem; }
  body.home .top { padding-bottom: 0.7rem; }
  .frame-diamond img { object-position: center 18%; transform-origin: center 22%; }
  .frame-borsen img { object-position: center 26%; transform-origin: center 18%; }
  .frame-planetarium img { object-position: center 32%; transform-origin: center 36%; }
}

@media (max-aspect-ratio: 1/1) {
  .frame-diamond img,
  .frame-nyhavn img,
  .frame-palace img,
  .frame-pavilion img,
  .frame-borsen img,
  .frame-planetarium img {
    object-position: center center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-frame { transition: none; }
  .hero-frame img,
  .hero-progress > span { animation: none !important; transform: none; }
  #hero-toggle { display: none; }
}
