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

@font-face {
  font-family: Unbounded;
  src: url("./unbounded.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --background: #000101;
  --foreground: #f5f5f5;
  --heading: #f7f7f1;
  --muted: #a2a6ab;
  --accent: #ff0033;
  --content-bottom: clamp(40px, 9.166667vh, 99px);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  font-family: Manrope, sans-serif;
  background: var(--background);
  color: var(--foreground);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-width: 320px; }
body { overflow-x: hidden; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: white; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 7px; }

.page {
  --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));
  position: relative;
  min-height: 100svh;
  height: max(720px, 100svh);
  overflow: clip;
  isolation: isolate;
  background: var(--background);
}

.scene {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}
.scene ::selection { background: transparent; }
/* The 404 belongs to the page, with no video tracking or animated transforms. */
.error-number-layer {
  position: absolute;
  top: -1.7593%;
  left: 16.4583%;
  width: 89.8958%;
  aspect-ratio: 1726 / 703;
}
.error-number { display: block; width: 100%; height: auto; }

.character {
  position: absolute;
  right: 7.0833%;
  bottom: 0;
  width: min(63.8542vw, 113.5185svh);
  aspect-ratio: 1226 / 1010;
  overflow: hidden;
}

.character__poster,
.character__video {
  position: absolute;
  left: -47.63%;
  top: -.01%;
  width: 147.63%;
  height: 100.02%;
  max-width: none;
  object-fit: fill;
}
.character__poster { opacity: 1; }
.character__video { opacity: 0; }
.video-ready .character__video { opacity: 1; }
.video-ready .character__poster { opacity: 0; }

.header {
  position: absolute;
  z-index: 2;
  top: 5.6944%;
  left: 5.2083%;
  right: 5.2083%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.brand { display: flex; align-items: center; gap: clamp(12px, 1.0132vw, 19.453px); flex-shrink: 0; }
.brand img { display: block; width: clamp(112px, 8.3661vw, 160.629px); height: auto; }
.brand__description { font-size: 15px; font-weight: 500; line-height: 1.4286; }
.navigation {
  display: flex;
  align-items: center;
  gap: clamp(22px, 2.0833vw, 40px);
  position: absolute;
  left: 50%;
  top: 15px;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: clamp(15px, .9119vw, 18px);
  font-weight: 500;
  line-height: 1.2778;
}
.account { display: flex; align-items: center; gap: clamp(20px, 2.0833vw, 40px); font-size: 15px; font-weight: 500; line-height: 1.25; white-space: nowrap; transform: translateY(4.875px); }
.header a { transition: color 220ms ease; }
.header a:not(.brand):hover { color: var(--accent); }
.header-links { display: contents; }
.menu-toggle { display: none; }

.recovery {
  position: absolute;
  z-index: 2;
  bottom: var(--content-bottom);
  left: 5.2083%;
  width: 36.4583%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(17px, 1.25vw, 24px);
}
h1 { margin: 0; color: var(--heading); font-family: Unbounded, sans-serif; font-size: 48px; font-weight: 400; line-height: 1.2258; letter-spacing: -.02em; }
.recovery p { margin: 0; max-width: 34ch; color: var(--muted); font-size: clamp(16px, 1.1458vw, 20px); font-weight: 400; line-height: 1.5; }
.recovery h1, .recovery p { position: relative; top: -10px; }
.catalog-button {
  position: relative;
  min-height: 56px;
  width: clamp(250px, 17.1875vw, 330px);
  height: clamp(56px, 3.75vw, 72px);
  padding: 0 24px;
  border: 0;
  border-radius: 4px;
  background: #d5002b;
  color: #fff;
  cursor: pointer;
  font-size: clamp(16px, 1.09375vw, 20px);
  font-weight: 600;
  line-height: 1.3333;
  transition: background-color 240ms ease, box-shadow 240ms ease;
}
.catalog-button:hover { background: #e60032; box-shadow: 0 10px 30px #ff003326; }
.catalog-button > span { display: inline-block; transform: translateY(-2px); }
.catalog-button:active { background: #c80028; box-shadow: 0 3px 14px #ff00331a; }
.catalog-button:disabled { cursor: wait; }
.footer {
  position: absolute;
  z-index: 2;
  bottom: var(--content-bottom);
  right: max(5.2083%, calc(76px * var(--sound-scale, 1)));
  color: var(--foreground);
  opacity: .56;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.2667;
  white-space: nowrap;
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* A single reveal: the scene opens first, followed by the interface. */
.has-js:not(.inside-gallery):not(.is-ready) .scene,
.has-js:not(.inside-gallery):not(.is-ready) .header,
.has-js:not(.inside-gallery):not(.is-ready) .recovery,
.has-js:not(.inside-gallery):not(.is-ready) .footer { opacity: 0; }
.is-ready:not(.inside-gallery) .scene { animation: scene-reveal 1100ms var(--ease-out) both; }
.is-ready:not(.inside-gallery) .error-number { animation: scene-reveal 1100ms var(--ease-out) both; }
.is-ready:not(.inside-gallery) .header { animation: interface-reveal 900ms 200ms var(--ease-out) both; }
.is-ready:not(.inside-gallery) .recovery { animation: scene-reveal 1000ms 320ms var(--ease-out) both; }
.is-ready:not(.inside-gallery) .footer { animation: footer-reveal 900ms 440ms var(--ease-out) both; }
.is-leaving .page { opacity: 0; transition: opacity 260ms ease; }
@keyframes scene-reveal { from { opacity: 0; } to { opacity: 1; } }
@keyframes interface-reveal { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes footer-reveal { from { opacity: 0; } to { opacity: .56; } }

@media (min-width: 1700px) { h1 { font-size: 56px; } }
@media (min-width: 1920px) { h1 { font-size: 64px; } }

@media (min-aspect-ratio: 2/1) and (min-width: 1001px) {
  .error-number-layer { width: auto; height: 72%; left: auto; right: -5%; }
}

@media (max-width: 1000px) {
  .page { height: auto; min-height: 100svh; display: flex; flex-direction: column; padding: 28px; }
  .header { position: relative; inset: auto; gap: 24px; }
  .brand img { width: 126px; }
  .error-number-layer { top: 110px; left: 5%; width: 118%; }
  .page { --character-top: 150px; }
  .character { top: var(--character-top); bottom: auto; left: 0; width: 100%; height: auto; aspect-ratio: 1226 / 1010; }
  .character::after { content: ""; position: absolute; inset: auto -10% -1px; height: 100px; background: linear-gradient(transparent, var(--background)); }
  .recovery { position: relative; inset: auto; margin-top: calc(82.38vw + 72px); width: 100%; gap: 20px; }
  h1 { font-size: 40px; }
  .recovery h1 br { display: none; }
  .recovery p { font-size: 17px; }
  .footer { position: relative; inset: auto; margin-top: auto; padding-top: 48px; white-space: normal; }
}

@media (max-width: 600px) {
  .page { height: auto; min-height: 100svh; display: flex; flex-direction: column; padding: 24px 22px 22px; }
  .header { position: relative; inset: auto; row-gap: 24px; }
  .brand { gap: 11px; }
  .brand img { width: 112px; }
  .error-number-layer { top: 137px; left: -14%; width: 147%; }
  .page { --character-top: 145px; }
  .character { left: 0; width: 100%; height: auto; aspect-ratio: 1226 / 1010; overflow: visible; }
  .character::after { content: ""; position: absolute; inset: auto -10% -1px; height: 100px; background: linear-gradient(transparent, var(--background)); }
  .character__poster, .character__video { left: -47.63%; }
  .recovery { position: relative; inset: auto; width: 100%; margin-top: calc(82.38vw + 80px); gap: 20px; }
  h1 { font-size: 32px; line-height: 1.25; }
  .recovery p { font-size: 16px; line-height: 1.55; }
  .catalog-button { width: 100%; height: 58px; font-size: 17px; }
}

@media (max-width: 430px) {
  .brand { flex-direction: column; align-items: flex-start; gap: 8px; }
  .brand img { width: 96px; }
  .header { gap: 14px; }
  h1 { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .has-js:not(.inside-gallery):not(.is-ready) .scene, .has-js:not(.inside-gallery):not(.is-ready) .header, .has-js:not(.inside-gallery):not(.is-ready) .recovery { opacity: 1; }
  .has-js:not(.inside-gallery):not(.is-ready) .footer { opacity: .56; }
}

.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;
  box-shadow: inset 0 0 0 calc(1px * var(--sound-scale, 1)) rgb(255 255 255 / 75%);
}

.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: 1120px) {
  html.menu-open { overflow: hidden; }
  .header-links { display: none; }
  .menu-open .header { z-index: 4; animation: none; opacity: 1; }
  .header .brand, .menu-toggle { position: relative; z-index: 1; }
  .menu-toggle {
    display: grid;
    place-content: center;
    gap: 6px;
    flex: none;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
  }
  .menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    transition: transform 220ms ease;
  }
  .menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .menu-open .header-links {
    position: fixed;
    inset: 0;
    display: block;
    overflow: auto;
    padding: max(136px, 16svh) max(22px, 5.2083vw) 24px;
    background: var(--background);
  }
  .header-links .navigation, .header-links .account {
    position: static;
    align-items: stretch;
    flex-direction: column;
    gap: 0;
    transform: none;
  }
  .header-links a {
    display: flex;
    align-items: center;
    min-height: 48px;
    border-bottom: 1px solid rgb(255 255 255 / 20%);
  }
  .header-links a:focus-visible { outline-offset: -2px; }
}

@media (max-width: 1000px) {
  .sound-toggle {
    inset-block-start: calc(var(--character-top) + 82.38vw - var(--sound-inset) - var(--sound-hit-size));
    inset-block-end: auto;
  }
}
