@font-face {
  font-family: Manrope;
  src: url("./assets/manrope.woff2?v=2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  font-family: Manrope, Arial, sans-serif;
  color: #3d413e;
  background: #e4d9ce;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

[hidden] { display: none !important; }

body,
h1,
p {
  margin: 0;
}

.scene {
  --sound-inset: calc(20px * var(--sound-scale, 1));
  --sound-size: calc(40px * var(--sound-scale, 1));
  --sound-hit-size: calc(44px * var(--sound-scale, 1));
  --art-width: max(100vw, calc(100svh * 16 / 9));
  --art-height: max(100svh, calc(100vw * 9 / 16));
  --copy-left: max(24px, calc(50vw - var(--art-width) * 0.182291667));
  --wordmark-y: max(26px, calc(50svh - var(--art-height) * 0.402777778));
  --message-y: max(calc(var(--wordmark-y) + 65px), calc(50svh - var(--art-height) * 0.325));
  --action-y: calc(50svh + var(--art-height) * 0.131481481);
  --title-size: 68px;
  --brand-size: 40px;
  --body-size: 20px;
  --action-size: 17px;

  position: relative;
  isolation: isolate;
  min-height: max(100svh, calc(var(--action-y) + 68px));
}

.is-arriving .scene {
  animation: arrive 290ms ease-out both;
}

@keyframes arrive {
  from { opacity: 0; }
  to { opacity: 1; }
}

.background {
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
}

.background picture,
.background img,
.background video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.background img,
.background video {
  object-fit: cover;
}

.background video {
  opacity: 0;
}

.background video.is-playing {
  opacity: 1;
}

.header,
.message,
.home {
  position: absolute;
  left: var(--copy-left);
}

.header {
  top: var(--wordmark-y);
  margin-left: 2px;
}

.brand {
  color: #266e74;
  font-size: var(--brand-size);
  font-weight: 800;
  line-height: 66%;
  letter-spacing: -0.045em;
}

.message {
  top: var(--message-y);
  right: 24px;
}

h1 {
  font-size: var(--title-size);
  font-weight: 700;
  line-height: 103%;
  letter-spacing: -0.022em;
  text-wrap: balance;
  width: fit-content;
}

.description {
  max-width: 720px;
  margin-top: 11px;
  margin-left: 2px;
  font-size: var(--body-size);
  font-weight: 500;
  line-height: 138%;
  text-wrap: pretty;
}

.home {
  top: var(--action-y);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  max-width: calc(100% - var(--copy-left) - 20px);
  border-radius: 999px;
  padding: 12px 34px 16px;
  background: #fdfcfc;
  color: #000;
  font-size: var(--action-size);
  font-weight: 700;
  line-height: 125%;
  text-align: center;
  text-decoration: none;
  transition: background-color 240ms ease;
}

.home:hover {
  background: #eaf4f1;
}

.home:focus-visible {
  outline: 3px solid #195b61;
  outline-offset: 4px;
}

.sound-toggle {
  position: absolute;
  z-index: 2;
  inset-inline-end: var(--sound-inset);
  inset-block-end: var(--sound-inset);
  display: grid;
  place-items: end;
  inline-size: var(--sound-hit-size);
  block-size: var(--sound-hit-size);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #000;
  cursor: pointer;
}

.sound-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 calc(2px * var(--sound-scale, 1)) #fff,
    0 0 0 calc(4px * var(--sound-scale, 1)) #000;
}

.sound-toggle__face {
  display: grid;
  place-items: center;
  inline-size: var(--sound-size);
  block-size: var(--sound-size);
  border-radius: inherit;
  background: #fff;
  transition: transform 300ms ease;
}

.sound-toggle[aria-pressed="true"] { color: #fff; }

.sound-toggle[aria-pressed="true"] .sound-toggle__face {
  background: #000;
}

.sound-toggle svg {
  inline-size: 40%;
  block-size: auto;
}

.sound-toggle__waves,
.sound-toggle__mute {
  transition: opacity 300ms ease;
}

.sound-toggle__waves,
.sound-toggle[aria-pressed="true"] .sound-toggle__mute { opacity: 0; }
.sound-toggle[aria-pressed="true"] .sound-toggle__waves { opacity: 1; }

@media (hover: hover) {
  .sound-toggle:not([aria-pressed="true"]):hover .sound-toggle__face { background: #eee; }
}

@media (prefers-reduced-motion: no-preference) {
  .sound-toggle:not([hidden]) { animation: sound-appear 240ms ease-out both; }
  .sound-toggle:active .sound-toggle__face { transform: scale(.7); }
  @keyframes sound-appear { from { opacity: 0; } to { opacity: 1; } }
}

@media (max-width: 1599px) {
  .scene {
    --title-size: 52px;
    --brand-size: 32px;
    --body-size: 17px;
    --action-size: 16px;
  }
}

@media (max-width: 1099px) {
  .scene {
    --title-size: 44px;
    --brand-size: 28px;
    --body-size: 16px;
  }
}

@media (max-aspect-ratio: 4/5) {
  .scene {
    --art-height: max(100svh, 205vw);
    --copy-left: clamp(22px, 9.4vw, 72px);
    --wordmark-y: max(26px, calc(50svh - var(--art-height) * 0.38));
    --message-y: max(calc(var(--wordmark-y) + 52px), calc(50svh - var(--art-height) * 0.32));
    --action-y: max(calc(var(--message-y) + 156px), calc(50svh + var(--art-height) * 0.065));
    --title-size: 36px;
    --brand-size: 32px;
  }

  .message {
    right: var(--copy-left);
  }

  .description {
    margin-top: 10px;
    margin-left: 0;
  }

  .home {
    padding: 12px 24px;
  }
}

@media (max-width: 360px) {
  .scene {
    --title-size: 32px;
    --brand-size: 28px;
  }
}

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

  .home {
    transition: none;
  }
}
