:root {
  --brand-blue: #185a70;
  --brand-green: #2f4745;
  --background-color: #000;
  --text-color: #ccc;
  --border-color: #ccc9;
  --font-stack: Arial, Helvetica, sans-serif;
  --fade-delay: 1.5s;
  interpolate-size: allow-keywords;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

html {
  font-size: 100%;
}

body {
  background-color: var(--background-color);
  background-image: url("../img/mirror-obscura-bg-pattern-mobile.webp");
  background-position: top center;
  background-repeat: repeat;
  color: var(--text-color);
  font-family: var(--font-stack);
  line-height: 1.5;
  padding-top: 1rem;
  /* vertical */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main {
  --i: 1;
  flex: 1;
}

.page {
  position: relative;
}

.wrapper {
  max-width: 960px;
  margin: 0 auto;
  padding-inline: 0.5rem;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: #111;
  transition: opacity 1s ease;
}

.overlay-content {
  text-align: center;
  color: var(--text-color);
}

.overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

.header {
  --i: 0;
  text-align: center;
  padding-block-end: 1rem;
  margin-block-end: 1rem;
  position: relative;
  border-bottom: 2px solid var(--brand-green);
}

.nav-container {
  text-align: right;
}

button {
  background-color: var(--brand-green);
  color: var(--text-color);
  border: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 1.15rem;
}

a:link,
a:visited,
a:active {
  color: var(--text-color);
  line-height: 1.75;
  letter-spacing: 0;
  transition: letter-spacing 0.25s ease-in-out;
}

a:hover {
  letter-spacing: 1px;
}

.logo {
  width: clamp(300px, 50vw, 480px);
  height: auto;
}

.mask {
  display: none;
}

.about-h2 {
  margin-block-start: 0;
}

.links {
  color: var(--brand-blue);
}

.highlight {
  background-color: var(--brand-green);
}

.footer {
  --i: 4;
  margin-top: 2rem;
  padding: 1rem 0;
}

#musicButton {
  appearance: none;
  border: 0;
  background: transparent;
  background-image: url("../img/speaker.svg");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: contain;
  display: inline-block;
  margin-right: 0.2rem;
  padding: 0;
  opacity: 0.4;
  width: 29px;
  height: 33px;
  margin-left: auto;
  position: relative;
  right: 0.5rem;
}

#musicButton.no-play {
  background-image: url("../img/speaker-no-play2.svg");
}

.toggle-details-button {
  display: none;
  background-color: transparent;
  padding: 0;
  transition: transform 700ms ease;

  &.flip {
    transform: rotate(180deg);
  }
}

.details-content {
  opacity: 0;
  transition: opacity 1.3s ease;

  &.open {
    opacity: 1;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.footer-inner-container {
  position: relative;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.footer-text {
  position: relative;
  left: 0;
  transform: translateX(0);
  padding-inline-start: 0.5rem;
  margin: 0;
}

.backdrop-container {
  --i: 2;
  max-width: 100%;
}

.fotel {
  --i: 1;
  display: block;
  margin-inline: auto;
  width: clamp(300px, 60vw, 680px);
  height: auto;
}

summary {
  cursor: pointer;
  padding: 0;
  margin-block-end: 1rem;
  display: inline-block;
  width: auto;
  height: auto;
}

@media (min-width: 480px) {
  html {
    font-size: 112.5%;
  }

  body,
  .overlay {
    background-image: url("../img/mirror-obscura-bg-pattern.webp");
  }

  .nav-links {
    display: flex;
  }

  .nav-links li:not(:last-child)::after {
    content: "|";
    margin-inline: 1rem 0.25rem;
  }
}

@media (min-width: 630px) {
  .nav-container {
    align-items: center;
    flex-direction: row;
  }
}

@media (min-width: 723px) {
  .footer-text {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
  }
}

@media (min-width: 960px) {
  .toggle-details-button {
    display: inline-block;
  }

  .fotel {
    display: none;
  }

  .main {
    background-image: url("../img/mirror-obscura-logo-bg.webp");
    background-position: top center;
    background-repeat: no-repeat;
    background-size: clamp(320px, 65vw, 2560px) auto;
    min-height: clamp(320px, 50vw, 1280px);
  }

  .backdrop-container {
    --i: 3;
    background-color: transparent;
    backdrop-filter: none;
    border: 2px solid transparent;
    max-width: 50%;
    margin-inline-start: auto;
    padding: 1rem;
    transition:
      background-color 1.3s ease,
      backdrop-filter 1.3s ease,
      border-color 1.3s ease;

    &.visible {
      background-color: rgba(0, 0, 0, 0.35);
      backdrop-filter: blur(12px);
      border-color: rgba(255, 255, 255, 0.1);
    }
  }

  .mask {
    display: block;
    background-color: rgba(0, 0, 0, 0.1);
    background-image: url("../img/mask-clean-cut.webp");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: contain;
    background-blend-mode: screen;
    opacity: 0.45;
    width: 243px;
    height: 290px;
    position: absolute;
    top: -91px;
    left: calc(50% + 199px);
  }
}

@media (min-width: 2048px) {
  .main {
    background-image: url("../img/mirror-obscura-figura-fotelben.webp");
  }

  .main .wrapper {
    padding-block-end: 10rem;
  }
}

.animated-button-container {
  opacity: 0.25;
  transform: scale(3);
  animation: shrinkToNormal 1.5s ease-out forwards;
}

.start-button {
  transition: transform 0.25s ease-in-out;
  transform-origin: center;
}

.start-button:hover {
  transform: scale(1.25);
}

@keyframes shrinkToNormal {
  from {
    transform: scale(3);
    opacity: 0.25;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

.header,
.fotel,
.main,
.backdrop-container,
.footer {
  opacity: 0;
}

body.entered .header,
body.entered .fotel,
body.entered .main,
body.entered .backdrop-container,
body.entered .footer {
  animation: fadeIn 1s ease forwards;
  animation-delay: calc(var(--i) * var(--fade-delay));
}
