:root {
  color-scheme: dark;
  background: #000;
  color: #e9f4ff;
  font-family: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

.screen {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
}

.wordmark {
  position: absolute;
  inset: 0;
  margin: 0;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  font-size: clamp(2rem, 7vw, 8rem);
  text-align: center;
}

.studio {
  position: relative;
  display: block;
  width: min(100%, 192vh);
  width: min(100%, 192svh);
}

.studio picture, .signature picture { display: block; }

.scene {
  display: block;
  width: 100%;
  height: auto;
  mask-image: linear-gradient(to bottom, transparent, black 4%, black 94%, transparent);
}

.signature {
  position: absolute;
  right: max(env(safe-area-inset-right), clamp(1.25rem, 3.1vw, 4.5rem));
  bottom: max(env(safe-area-inset-bottom), clamp(1.25rem, 3.5vh, 3.25rem));
  width: clamp(10rem, 16vw, 19rem);
  margin: 0;
}

.signature img {
  display: block;
  width: 100%;
  height: auto;
}

.signature .flame-still, .motion-toggle, .metal-drops { display: none; }

.enter {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  min-width: clamp(7.75rem, 10vw, 10rem);
  min-height: 2.875rem;
  padding: 0.5rem 1.7rem;
  border: 1px solid transparent;
  border-radius: 0.25rem;
  color: #ffe19a;
  background:
    linear-gradient(175deg, #3b2b0f 0%, #171005 39%, #463418 48%, #1c1307 52%, #100c05 76%, #352810 100%) padding-box,
    linear-gradient(135deg, #9a682a, #fff3b7 22%, #ba7f2c 48%, #ffda7a 72%, #fff5ab 83%, #8e601f) border-box;
  box-shadow: inset 0 0 0 2px #0d090680, inset 0 0 10px #ffe4a01e,
    0 0 5px #ffd46dc7, 0 0 18px #f5ae3044, 0 4px 15px #000c;
  text-decoration: none;
}

.enter span {
  font-size: 1.05rem;
  font-weight: bold;
  line-height: 1;
  letter-spacing: 0.19em;
  text-indent: 0.19em;
  text-transform: uppercase;
  color: #ffe496;
}

@supports (background-clip: text) {
  .enter span {
    background: linear-gradient(175deg, #fffbd4 12%, #ffd576 45%, #f7c25c 49%, #fff4b0 58%, #edb652 84%);
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 3px #ffbb4d70);
  }
}

.enter:hover {
  box-shadow: inset 0 0 11px #ffe8a635, 0 0 7px #ffdc85, 0 0 26px #efad386e, 0 4px 15px #000c;
}
.enter:active { transform: translate(-50%, -50%) scale(0.98); }
:focus-visible { outline: 2px solid #fff3c7; outline-offset: 5px; }

@media (min-aspect-ratio: 2/1) {
  .studio {
    mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
  }
}

@media (max-aspect-ratio: 4/5) {
  .studio {
    width: min(100%, 60vh);
    width: min(100%, 60svh);
    mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
  }
  .scene { aspect-ratio: 941 / 1672; }
  .signature { width: clamp(9.5rem, 32vw, 15rem); }
}

@media (prefers-reduced-motion: no-preference) {
  .motion-toggle {
    appearance: none;
    position: absolute;
    z-index: 1;
    bottom: max(env(safe-area-inset-bottom), clamp(1.25rem, 3.5vh, 3.25rem));
    left: max(env(safe-area-inset-left), clamp(1.25rem, 3.1vw, 4.5rem));
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    margin: 0;
    border: 1px solid #778d9c77;
    border-radius: 50%;
    background: #080e14ad;
    color: #c8deeb;
    cursor: pointer;
  }
  .motion-toggle::before {
    content: "";
    width: 9px;
    height: 12px;
    background: linear-gradient(to right, currentColor 33%, transparent 33% 67%, currentColor 67%);
  }
  .motion-toggle:checked::before {
    width: 10px;
    background: currentColor;
    clip-path: polygon(10% 0, 100% 50%, 10% 100%);
  }
  .motion-toggle:hover { border-color: #dcecf5; }
  .motion-toggle:checked ~ .signature .flame-still { display: block; }
  .motion-toggle:checked ~ .signature .flame-loop { display: none; }
  .screen:has(.motion-toggle:checked) .metal-drops > i,
  .screen:has(.motion-toggle:checked) .studio::after { animation-play-state: paused; }

  @supports (mask-image: linear-gradient(black, transparent)) {
    .studio::after {
      content: "";
      position: absolute;
      inset: 0;
      pointer-events: none;
      mask: url("./assets/wordmark-sheen-wide.webp") center / 100% 100% no-repeat;
      mix-blend-mode: screen;
      background: linear-gradient(106deg, transparent 36%, #479aff4d 42%, #b7eeffae 49%,
        #effdfff0 50%, #8fd7ff94 53%, #638dff29 60%, transparent 66%) 100% 50% / 300% 100% no-repeat;
      animation: chrome-reflection 8s cubic-bezier(.42, .04, .35, 1) -0.9s infinite;
    }
    @media (max-aspect-ratio: 4/5) {
      .studio::after { mask-image: url("./assets/wordmark-sheen-tall.webp"); }
    }
  }
}

@keyframes chrome-reflection {
  0% { background-position: 100% 50%; }
  74%, 100% { background-position: 0% 50%; }
}

@media (forced-colors: active) {
  .enter span { color: LinkText; filter: none; }
  .enter, .motion-toggle { border-color: ButtonText; }
  .motion-toggle::before { forced-color-adjust: none; color: ButtonText; }
}
