@font-face {
  font-family: Inter;
  src: url("./assets/inter-cyrillic.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0400-052F,U+2DE0-2DFF,U+A640-A69F;
}

@font-face {
  font-family: Inter;
  src: url("./assets/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF,U+2000-206F;
}

:root {
  --ink: #000d10;
  --ink-hover: #075eaa;
  --night: #0f0f1c;
  --white: #fff;
  --header-gutter: clamp(24px, 2.917vw, 56px);
  --content-gutter: clamp(28px, 3.55vw, 68px);
  --ease: cubic-bezier(.2, .7, .26, 1);
  color: var(--white);
  background: var(--ink);
  font-family: Inter, Arial, sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
h1, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; }

.control {
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 180ms var(--ease), color 180ms var(--ease), transform 180ms var(--ease), box-shadow 180ms var(--ease);
}

.control:focus-visible, .search-form input:focus-visible {
  outline: 2px solid #166780;
  outline-offset: 4px;
}

.scene {
  position: relative;
  isolation: isolate;
  overflow-x: clip;
  display: flex;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  flex-direction: column;
  justify-content: space-between;
  background: var(--night);
  animation: scene-in 290ms ease-out both;
}

@keyframes scene-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.scene-media {
  position: absolute;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.scene-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}

.ambient-video { display: none; }

.scene-media::after {
  position: absolute;
  inset: 59.07% 0 0;
  content: "";
  background: linear-gradient(180deg, #0f0f1c00, #0f0f1c87 40%, var(--ink));
}

.site-header {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  min-height: 68px;
  margin: 30px var(--header-gutter) 0;
  padding: 0 24px;
  border-radius: 999px;
  color: var(--ink);
  background: var(--white);
}

.brand {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding-right: 6px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 106%;
}

.brand img { flex: none; transition: transform 210ms var(--ease); }

.search-icon, .home-arrow {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  background: currentColor;
  transition: color 180ms var(--ease), transform 210ms var(--ease);
}

.search-icon {
  color: var(--ink);
  mask: url("./assets/search.svg") center / contain no-repeat;
}

.home-arrow { mask: url("./assets/arrow.svg") center / contain no-repeat; }

.site-nav {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: clamp(16px, 1.15vw, 22px);
}

.site-nav a {
  display: grid;
  min-height: 44px;
  place-items: center;
  border-radius: 22px;
  padding: 0 16px;
  font-size: 16px;
  line-height: 120%;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
}

.header-actions {
  grid-column: 3;
  grid-row: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
}

.search-toggle, .menu-toggle {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 15px 0 9px;
  border: 0;
  border-radius: 22px;
  background: transparent;
  font-size: 16px;
  font-weight: 500;
  line-height: 120%;
}

.search-toggle { color: #616569; }

.search-open .header-actions { visibility: hidden; }

.search-form {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 6px;
  width: min(372px, 100%);
  min-width: 0;
  animation: search-in 210ms var(--ease) both;
}

@keyframes search-in {
  from { opacity: 0; clip-path: inset(-5px -5px -5px 62%); }
  to { opacity: 1; clip-path: inset(-5px); }
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(-6px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.search-form input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid #d7dbdc;
  border-radius: 22px;
  color: var(--ink);
  background: #f6f7f7;
  font-size: 16px;
}

.search-form input::placeholder { color: #60666a; }
.search-form input:focus-visible { outline-offset: -2px; }
.search-form input::-webkit-search-cancel-button { cursor: pointer; }

.search-submit {
  flex: none;
  padding: 0 18px;
  min-height: 44px;
  border: 0;
  border-radius: 22px;
  color: var(--white);
  background: var(--ink);
  font-weight: 600;
  font-size: 16px;
}

.search-close {
  display: grid;
  flex: 0 0 44px;
  min-height: 44px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.error-layout {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 28px;
  margin: 0 var(--content-gutter);
  padding-top: 72px;
  padding-bottom: max(68px, calc(env(safe-area-inset-bottom) + 18px));
}

.error-copy { min-width: 0; }

.title-stage { position: relative; width: fit-content; max-width: 100%; }

.error-title {
  position: relative;
  width: fit-content;
  max-width: 100%;
  color: var(--white);
  font-size: 72px;
  font-weight: 700;
  letter-spacing: -.032em;
  line-height: 104%;
  text-wrap: balance;
}

.title-warp {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 124%;
  height: var(--warp-frame-height, 0px);
  transform: translate(-50%, -50%);
  visibility: hidden;
  pointer-events: none;
}

.title-warp .warp-text { height: 100%; min-height: 0; }
.title-warp .warp-text__fallback { display: none; }
.title-stage.has-warp .title-warp { visibility: visible; }
.title-stage.has-warp h1 span { opacity: 0; }

.error-copy p {
  margin-top: 22px;
  color: #f7f7f8;
  font-size: 20px;
  line-height: 135%;
  text-wrap: pretty;
  opacity: var(--description-opacity, 1);
}

@media (prefers-reduced-motion: no-preference) {
  .warp-pending .error-copy { opacity: 0; }
}

.home {
  display: flex;
  flex: 0 0 264px;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 0 28px 0 32px;
  border-radius: 28px;
  color: var(--ink);
  background: var(--white);
  font-size: 18px;
  font-weight: 600;
  line-height: 120%;
  text-transform: uppercase;
  white-space: nowrap;
}

.home:focus-visible {
  outline-color: var(--white);
  box-shadow: 0 0 0 3px var(--ink);
}

.page-fade {
  position: fixed;
  z-index: 10;
  inset: 0;
  opacity: 0;
  background: var(--ink);
  pointer-events: none;
  transition: opacity 225ms ease-in;
}

.is-leaving .page-fade { opacity: 1; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (any-hover: hover) and (any-pointer: fine) {
  .brand:hover, .site-nav a:hover, .menu-toggle:hover, .search-toggle:hover, .search-close:hover, .home:hover {
    color: var(--ink-hover);
  }
  .brand:hover img {
    transform: translateY(-1px);
  }
  .search-toggle:hover .search-icon { color: inherit; transform: scale(1.08); }
  .search-submit:hover { background: var(--ink-hover); }
  .home:hover .home-arrow { transform: translateX(4px); }
}

.control:active { transform: translateY(1px); }
.menu-toggle[aria-expanded="true"] { color: var(--ink-hover); }

@media (max-width: 1439px) {
  .error-title { font-size: 64px; }
}

@media (max-width: 1099px) {
  .search-open .site-nav { visibility: hidden; }
  .search-form { grid-column: 2 / -1; }
  .error-title { font-size: 48px; }
  .error-layout { padding-bottom: max(48px, env(safe-area-inset-bottom)); }
  .home { flex-basis: 222px; padding-inline: 22px; }
}

@media (max-aspect-ratio: 4/5) {
  .scene-media::before {
    position: absolute;
    inset: -40px;
    background: center / cover no-repeat url("./assets/piano-poster.dfaea4da50.webp");
    filter: blur(35px) brightness(.38);
    content: "";
  }
  .ambient-video {
    display: block;
    filter: blur(35px) brightness(.38);
    transform: scale(1.18);
  }
  .scene-media .piano-video {
    inset: 22% auto auto -19%;
    width: 138%;
    height: auto;
    aspect-ratio: 320 / 179;
    mask-image: linear-gradient(transparent, #000 12%, #000 77%, transparent);
  }
  .scene-media::after {
    inset: 32% 0 0;
    background: linear-gradient(#0f0f1c00 14%, #0f0f1c55 52%, var(--ink));
  }
}

@media (max-width: 760px) {
  :root { --header-gutter: 16px; --content-gutter: 22px; }
  .site-header {
    min-height: 56px;
    margin-top: max(16px, env(safe-area-inset-top));
    grid-template-columns: 1fr auto;
    padding-inline: 14px 8px;
  }
  .brand { gap: 6px; font-size: 24px; }
  .header-actions { grid-column: 2; }
  .search-open .brand { visibility: hidden; }
  .search-form { grid-column: 1 / -1; width: 100%; }
  .search-submit { padding-inline: 13px; }
  .menu-toggle:not([hidden]) { display: inline-flex; padding-inline: 12px; }
  .search-toggle { width: 44px; padding: 0; }
  .search-label { display: none; }
  .site-nav {
    grid-row: 2;
    grid-column: 1 / -1;
    padding: 4px 0;
    gap: 0;
  }
  .site-nav a { font-size: 15px; padding-inline: 10px; }
  .has-js .site-nav {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    display: none;
    min-width: min(240px, 100%);
    padding: 8px;
    flex-direction: column;
    align-items: stretch;
    border-radius: 22px;
    background: var(--white);
    box-shadow: 0 12px 28px #0003;
  }
  .has-js .site-nav.is-open { display: flex; animation: pop-in 200ms var(--ease) both; }
  .has-js .site-nav a { place-items: center start; padding-inline: 14px; }
  .error-layout {
    align-items: start;
    flex-direction: column;
    gap: 24px;
    padding-bottom: max(30px, calc(env(safe-area-inset-bottom) + 14px));
  }
  .error-title { font-size: 40px; }
  .error-copy p { margin-top: 12px; font-size: 18px; }
  .home { flex-basis: auto; width: min(100%, 256px); }
}

@media (max-width: 390px) {
  .error-title { font-size: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

.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));
  --sound-clearance: calc(76px * var(--sound-scale, 1));
}

.home { margin-inline-end: max(0px, calc(var(--sound-clearance) - var(--content-gutter))); }

@media (max-width: 760px) {
  .home {
    max-inline-size: calc(100% + var(--content-gutter) - max(var(--content-gutter), var(--sound-clearance)));
  }
}

.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; } }
}
