:root {
  color-scheme: dark;
  background: #171d28;
  font-family: system-ui, sans-serif;
}

body {
  margin: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.scene {
  position: relative;
  display: block;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  padding: 0;
  border: 0;
  overflow: hidden;
  isolation: isolate;
  background: transparent;
  color: #fff;
  font: inherit;
}

.replay {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid #ffffff80;
  border-radius: 6px;
  background: #171d28dc;
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.main-menu {
  position: absolute;
  top: 53%;
  left: 50%;
  width: max-content;
  max-width: calc(100% - 32px);
  transform: translateX(-50%);
  display: grid;
  padding: 6px 12px;
  background: #161519eb;
  border-left: 1px solid #fff4;
  transition: opacity 450ms ease;
}

.main-menu.is-waiting {
  opacity: 0;
  pointer-events: none;
}

.main-menu:focus-within {
  opacity: 1;
  pointer-events: auto;
}

.main-menu a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px 0 26px;
  color: #fff7ec;
  font-size: clamp(1rem, 0.9rem + 0.5vw, 1.3rem);
  text-decoration: none;
}

.main-menu a::before {
  content: "";
  position: absolute;
  left: 4px;
  width: 12px;
  height: 2px;
  background: currentColor;
  opacity: 0;
}

.main-menu a:hover::before,
.main-menu a:focus-visible::before {
  opacity: 1;
}

.main-menu a:focus-visible,
.replay:focus-visible {
  outline: 2px solid #fff7ec;
  outline-offset: -2px;
}

.inner-page {
  width: min(1050px, calc(100% - 36px));
  margin: 0 auto;
  padding: 32px 0 48px;
  color: #f5efe8;
}

.inner-page a {
  color: #f7d8b3;
}

.inner-page h1 {
  margin-top: 40px;
  font-size: clamp(2rem, 5vw, 3.5rem);
}

.inner-page p {
  max-width: 62ch;
  line-height: 1.6;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 20px;
}

.project-grid figure {
  margin: 0;
}

.project-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.project-grid figcaption {
  padding: 10px 0;
}

.scene-layer {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--sky) top / 100% 50% no-repeat, var(--ground);
  pointer-events: none;
}

.panorama {
  position: relative;
  container-type: size;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.render {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100cqw, 177.7777778cqh);
  height: max(56.25cqw, 100cqh);
  object-fit: cover;
  transform: translate(-50%, -50%);
  user-select: none;
}

@media (max-aspect-ratio: 1/1) {
  .panorama {
    height: min(100%, 123vw);
  }
}

@media (max-height: 480px) {
  .main-menu {
    top: auto;
    bottom: 12px;
  }
}

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