:root {
  --white: #fffdf3;
  --crop-y: max(0px, calc((55.813953vw - 100vh) / 2));
  --crop-y: max(0px, calc((55.813953vw - 100dvh) / 2));
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #279ec0;
  color: var(--white);
  font-family: 'Manrope', sans-serif;
  -webkit-font-smoothing: antialiased;
}

::selection { background: #fff2bd; color: #173d3b; }

.scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.artwork {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100vw, 179.166667vh);
  width: max(100vw, 179.166667dvh);
  aspect-ratio: 2752 / 1536;
  transform: translate(-50%, -50%);
}

.scene-image {
  display: block;
  width: 100%;
  height: 100%;
  user-select: none;
  -webkit-user-drag: none;
}

.scene-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to top,
    rgba(5, 39, 41, .88) var(--crop-y),
    rgba(5, 44, 48, .16) calc(var(--crop-y) + 25vh),
    transparent calc(var(--crop-y) + 50vh));
}

.portal {
  position: absolute;
  top: 17%;
  bottom: 0;
  width: 29%;
  color: var(--white);
  text-align: center;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.portal-strength { left: 2.2%; }
.portal-harmony { left: 35.5%; }
.portal-infinity { left: 68.8%; }

.portal-outline {
  position: absolute;
  top: 3%;
  left: 17.25%;
  width: 65.5%;
  height: 66.5%;
  border-radius: 50% 50% 2px 2px / 27% 27% 2px 2px;
  transition: background-color 350ms ease-out, box-shadow 350ms ease-out;
}

.portal-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--crop-y) + clamp(26px, 4vh, 54px));
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 12px;
}

.portal-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(32px, 3.2vw, 60px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -.025em;
}

.portal-description {
  margin-top: 5px;
  color: #eeeee0;
  font-size: clamp(12px, 1.05vw, 16px);
  line-height: 1.65;
}

.portal-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  margin-top: 17px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 253, 243, .44);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
}

.portal-action svg { flex-shrink: 0; transition: transform 350ms ease-out; }

.portal:hover .portal-outline, .portal.is-selected .portal-outline {
  background-color: rgba(255, 241, 182, .09);
  box-shadow: inset 0 2px 24px rgba(255, 240, 172, .38);
}

.portal:hover .portal-action svg, .portal:focus-visible .portal-action svg { transform: translateX(5px); }
.portal:hover .portal-action, .portal:focus-visible .portal-action { border-color: var(--white); }
.portal:focus-visible { outline: none; }
.portal:focus-visible .portal-outline { outline: 2px solid #fff2bd; outline-offset: 3px; background-color: rgba(255, 241, 182, .12); }

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

@media (max-aspect-ratio: 4/3) {
  .scene { overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none; }
  .scene::-webkit-scrollbar { display: none; }
  .artwork { position: relative; left: auto; transform: translateY(-50%); }
}

@media (max-width: 700px) {
  .portal-name { font-size: 44px; }
  .portal-description { font-size: 14px; }
}

@media (max-height: 540px) and (min-aspect-ratio: 4/3) {
  .portal-name { font-size: 32px; }
  .portal-description { font-size: 12px; }
  .portal-action { margin-top: 8px; }
  .portal-caption { bottom: calc(var(--crop-y) + 18px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
