:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f8f6ef;
  background: #15191a;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;

  --title-top: 32.6%;
  --button-width: 212px;
  --button-height: 50px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.mode-selector {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 650px;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.scene {
  position: absolute;
  z-index: -2;
  top: 0;
  bottom: 0;
  width: 50%;
  overflow: hidden;
}

.scene--work {
  left: 0;
}

.scene--play {
  right: 0;
}

.scene-image {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 200%;
  background-image: url("assets/two-worlds.png");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

.scene--work .scene-image {
  left: 0;
}

.scene--play .scene-image {
  right: 0;
  /* Keep the split and outer edge outside the clip throughout the drift. */
  transform-origin: 75% 50%;
  transform: translateX(-0.1%) scale(1.03);
  animation: cinema-drift 32s ease-in-out infinite alternate;
  will-change: transform;
}

.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(9 12 14 / 19%), rgb(8 12 15 / 8%) 58%);
}

.scene--play::after {
  background:
    radial-gradient(ellipse at 92% 76%, rgb(255 181 92 / 6%), transparent 64%),
    linear-gradient(180deg, rgb(9 12 14 / 16%), rgb(8 12 15 / 3%) 58%);
  animation: cinema-light 24s ease-in-out infinite alternate;
}

@keyframes cinema-light {
  from { opacity: 0.75; }
  to { opacity: 1; }
}

@keyframes cinema-drift {
  from {
    transform: translateX(-0.1%) scale(1.03);
  }
  to {
    transform: translateX(-0.7%) scale(1.06);
  }
}

.identity {
  position: absolute;
  z-index: 1;
  top: 6.7%;
  left: 50%;
  width: max-content;
  max-width: calc(100% - 32px);
  transform: translateX(-50%);
  text-align: center;
  text-shadow: 0 2px 16px rgb(0 0 0 / 28%);
}

.identity h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 550;
  line-height: 1.25;
  letter-spacing: -0.035em;
}

.identity p {
  margin: 7px 0 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0.002em;
  color: rgb(255 253 245 / 81%);
}

.invitation {
  position: absolute;
  bottom: max(28px, 4svh);
  left: 50%;
  margin: 0;
  width: max-content;
  transform: translateX(-50%);
  font-size: 13px;
  color: #dedbd4;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.02em;
  text-align: center;
  text-shadow: 0 2px 18px rgb(0 0 0 / 30%);
}

.mode {
  position: absolute;
  top: var(--title-top);
  width: 50%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mode--work {
  left: 0;
}

.mode--play {
  right: 0;
}

.mode h2 {
  margin: 0;
  width: max-content;
  max-width: calc(100% - 36px);
  font-size: clamp(30px, 2.65vw, 42px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.045em;
  white-space: nowrap;
  text-shadow: 0 2px 22px rgb(0 0 0 / 24%);
}

.mode-description {
  margin: 24px 0 0;
  width: max-content;
  max-width: calc(100% - 48px);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.012em;
  color: rgb(245 247 247 / 83%);
  text-shadow: 0 2px 12px rgb(0 0 0 / 45%);
  text-wrap: balance;
}

.mode--play .mode-description {
  color: rgb(255 250 234 / 90%);
}

.mode-link {
  position: relative;
  margin-top: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--button-width);
  max-width: calc(100% - 48px);
  height: var(--button-height);
  padding: 0 15px;
  border-radius: 999px;
  color: #fffdf6;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.012em;
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease,
    filter 180ms ease;
}

.mode-link span {
  position: relative;
  z-index: 1;
}

.mode-link--work {
  border: 1px solid rgb(226 233 236 / 53%);
  background: linear-gradient(180deg, rgb(61 68 74 / 30%), rgb(6 10 14 / 48%));
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 10%),
    0 4px 20px rgb(0 0 0 / 12%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #f4f5f4;
}

.mode-link--play {
  border: 3px solid #ecd7a9;
  background: linear-gradient(180deg, #0093a9 0%, #007e94 46%, #00596b 100%);
  box-shadow:
    inset 0 2px 1px rgb(230 255 248 / 31%),
    inset 0 -2px 1px rgb(7 42 44 / 42%),
    0 2px 0 #c8ac79,
    0 7px 0 #7c6545,
    0 9px 0 #564330,
    0 15px 24px rgb(30 25 17 / 31%);
  text-shadow: 0 1px 2px rgb(0 28 32 / 42%);
}

.mode-link:focus-visible {
  outline: 3px solid #fff9dd;
  outline-offset: 9px;
}

@media (hover: hover) and (pointer: fine) {
  .mode-link--work:hover {
    border-color: rgb(249 252 252 / 88%);
    background-color: rgb(154 172 186 / 10%);
    box-shadow:
      inset 0 1px 0 rgb(255 255 255 / 15%),
      0 6px 24px rgb(0 0 0 / 19%);
    transform: translateY(-2px);
  }

  .mode-link--play:hover {
    filter: brightness(1.06);
    transform: translateY(-2px);
    box-shadow:
      inset 0 2px 1px rgb(230 255 248 / 35%),
      inset 0 -2px 1px rgb(7 42 44 / 42%),
      0 2px 0 #c8ac79,
      0 9px 0 #7c6545,
      0 11px 0 #564330,
      0 18px 28px rgb(30 25 17 / 32%);
  }
}

.mode-link--work:active {
  transform: translateY(1px);
}

.mode-link--play:active {
  transform: translateY(5px);
  box-shadow:
    inset 0 2px 3px rgb(7 42 44 / 28%),
    0 1px 0 #c8ac79,
    0 2px 0 #7c6545,
    0 4px 0 #564330,
    0 8px 16px rgb(30 25 17 / 26%);
}

@media (max-width: 900px) {
  :root {
    --button-width: 198px;
  }

  .mode-description {
    width: 290px;
    max-width: calc(100% - 34px);
    font-size: 13px;
  }
}

@media (max-width: 560px) {
  :root {
    --title-top: 33%;
    --button-height: 46px;
  }

  .mode-selector {
    min-height: 620px;
  }

  .identity h1 {
    font-size: 21px;
  }

  .identity p {
    font-size: 12px;
  }

  .invitation { font-size: 12px; }

  .mode h2 {
    max-width: calc(100% - 20px);
    font-size: clamp(24px, 5.2vw, 28px);
  }

  .mode-description {
    max-width: calc(100% - 26px);
    font-size: 13px;
    line-height: 1.55;
  }

  .mode-link {
    max-width: calc(100% - 26px);
    padding-inline: 8px;
    font-size: 13px;
  }

  .mode-link--play {
    border-width: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scene--play::after {
    animation: none;
  }

  .scene--play .scene-image {
    animation: none;
    transform: none;
    will-change: auto;
  }

  .mode-link {
    transition: none;
  }

  .mode-link:hover,
  .mode-link:active {
    transform: none;
  }
}
