:root {
  --bg: #000000;
  --fg: #f4f4f2;
  --muted: #8f8f8f;
  --line: rgba(255, 255, 255, 0.16);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Alegreya', Georgia, 'Times New Roman', serif;
  font-size: 18px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

::selection {
  background: #ffffff;
  color: #000000;
}

/* ---------- background ---------- */

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.bg-fallback {
  position: absolute;
  inset: 0;
  background: var(--bg);
  overflow: hidden;
}

.bg-fallback::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: conic-gradient(
    from 0deg,
    #000,
    rgba(255, 255, 255, 0.05),
    #000 30%,
    rgba(255, 255, 255, 0.02) 55%,
    #000 75%,
    rgba(255, 255, 255, 0.045) 100%
  );
  filter: blur(70px);
  animation: drift 26s linear infinite;
}

.bg-fallback::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 50% at 30% 20%, rgba(255, 255, 255, 0.07), transparent 70%),
    radial-gradient(50% 60% at 75% 80%, rgba(255, 255, 255, 0.06), transparent 70%);
  animation: breathe 16s ease-in-out infinite alternate;
}

@keyframes drift {
  to {
    transform: rotate(360deg);
  }
}

@keyframes breathe {
  from {
    opacity: 0.35;
  }
  to {
    opacity: 1;
  }
}

.bg-gif {
  position: absolute;
  inset: 0;
  background: url('/bg.gif') center center / cover no-repeat;
  opacity: 0;
  transition: opacity 0.8s var(--ease);
}

.bg-gif.loaded {
  opacity: 1;
}

.bg-veil {
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 120% at 50% 20%, transparent 35%, rgba(0, 0, 0, 0.78) 100%);
  transition: background 0.8s var(--ease);
}

.bg-gif.loaded ~ .bg-veil {
  background: radial-gradient(120% 120% at 50% 20%, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.85) 100%);
}

/* ---------- epilepsy gate ---------- */

.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  overflow-y: auto;
  background: #000;
  transition: opacity 0.6s var(--ease), visibility 0s linear 0.6s;
}

.gate.done {
  opacity: 0;
  visibility: hidden;
}

.gate-box {
  max-width: 35rem;
  margin: auto;
  padding: calc(1.5rem + env(safe-area-inset-top)) 1.5rem calc(1.5rem + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6rem;
  text-align: center;
}

.gate-label {
  font-size: 0.72rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--muted);
  padding-left: 0.42em;
}

.gate-title {
  font-size: clamp(1.8rem, 5vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.gate-text {
  max-width: 30rem;
  color: var(--muted);
  font-style: italic;
  line-height: 1.8;
}

.gate-btn {
  font-size: 0.78rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  padding: 0.9em 2.2em;
  border: 1px solid var(--fg);
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

.gate-btn:active,
.gate-btn:hover {
  background: #fff;
  color: #000;
}

/* ---------- layout ---------- */

main {
  position: fixed;
  inset: 0;
  z-index: 1;
}

nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  gap: 2.4rem;
  padding: calc(2.1rem + env(safe-area-inset-top)) 1.2rem 1.5rem;
}

nav a {
  position: relative;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  opacity: 0.55;
  transition: opacity 0.3s var(--ease);
}

nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -7px;
  height: 1px;
  background: #fff;
  transition: right 0.4s var(--ease);
}

nav a:hover,
nav a.active {
  opacity: 1;
}

nav a.active::after {
  right: 0;
}

/* ---------- views ---------- */

.view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(6rem + env(safe-area-inset-top)) 1.5rem calc(3rem + env(safe-area-inset-bottom));
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px);
  transition:
    opacity 0.6s var(--ease),
    transform 0.6s var(--ease),
    visibility 0s linear 0.6s;
}

.view.active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition:
    opacity 0.7s var(--ease),
    transform 0.7s var(--ease);
}

.view--scroll {
  justify-content: flex-start;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* ---------- home ---------- */

.home-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.4rem;
}

.home-title {
  font-size: clamp(3.2rem, 14vw, 13rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.02em;
}

.title-letter {
  display: inline-block;
  opacity: 0;
}

.view.active .title-letter {
  animation: rise 0.8s var(--ease) forwards;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}

.home-desc {
  max-width: 32rem;
  color: var(--muted);
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.8;
  opacity: 0;
}

.view.active .home-desc {
  animation: rise 0.9s var(--ease) 0.45s forwards;
}

.socials {
  margin-top: 1.6rem;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  font-size: 0.78rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  opacity: 0;
}

.view.active .socials {
  animation: rise 0.9s var(--ease) 0.6s forwards;
}

.socials a {
  position: relative;
  opacity: 0.7;
  padding: 0.45em 0;
  transition: opacity 0.3s var(--ease);
}

.socials a::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 100%;
  height: 1px;
  background: currentColor;
  transition: right 0.35s var(--ease);
}

.socials a:hover {
  opacity: 1;
}

.socials a:hover::before {
  right: 0;
}

.socials .sep {
  color: var(--line);
}

/* ---------- pages / musics ---------- */

.page-title {
  font-size: clamp(3rem, 10vw, 9rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}

.page-sub {
  margin-top: 1rem;
  color: var(--muted);
  font-style: italic;
  letter-spacing: 0.02em;
  text-align: center;
}

.musics-inner {
  width: 100%;
  max-width: 1040px;
  padding-top: calc(5.5rem + env(safe-area-inset-top));
  padding-left: 1.2rem;
  padding-right: 1.2rem;
  padding-bottom: calc(4rem + env(safe-area-inset-bottom));
}

.releases {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2.4rem;
}

@media (min-width: 640px) {
  .releases {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
  }
}

.release {
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  animation: cardIn 0.6s var(--ease) both;
  transition: border-color 0.35s var(--ease), transform 0.35s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .release:hover {
    border-color: rgba(255, 255, 255, 0.55);
    transform: translateY(-4px);
  }

  .release:hover .release-cover img {
    filter: grayscale(0);
  }

  .release-open:hover,
  .copy-btn:hover {
    background: #fff;
    color: #000;
    border-color: #fff;
  }
}

.release:active {
  border-color: rgba(255, 255, 255, 0.55);
  transform: translateY(-2px) scale(0.98);
}

.release:active .release-cover img {
  filter: grayscale(0);
}

.release-open:active,
.copy-btn:active {
  background: #fff;
  color: #000;
  border-color: #fff;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

.release-cover {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #0a0a0a;
}

.release-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.06);
  transition: filter 0.6s var(--ease);
}

.release-body {
  padding: 1rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.release-name {
  font-size: 1.02rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.release-meta {
  display: flex;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.release-open {
  align-self: flex-start;
  margin-top: 0.55rem;
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  padding: 0.7em 1.2em;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.state {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  font-style: italic;
  padding: 3rem 0;
  letter-spacing: 0.06em;
}

/* ---------- contact ---------- */

.contact-box {
  margin-top: 1.8rem;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  border: 1px solid var(--line);
  padding: 0.9rem 0.9rem 0.9rem 1.2rem;
  opacity: 0;
}

.view.active .contact-box {
  animation: rise 0.9s var(--ease) 0.6s forwards;
}

.contact-mail {
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.copy-btn {
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  padding: 0.75em 1.3em;
  white-space: nowrap;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

/* ---------- responsive ---------- */

@media (max-width: 520px) {
  nav {
    gap: 1.4rem;
  }

  nav a {
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    padding: 0.6em 0.2em;
  }

  .home-title {
    font-size: clamp(2.8rem, 17vw, 4.4rem);
  }

  .home-desc {
    font-size: 0.92rem;
  }

  .socials {
    gap: 0.9rem;
    font-size: 0.7rem;
  }

  .page-title {
    font-size: clamp(2.6rem, 13vw, 4.4rem);
  }

  .contact-box {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 0.9rem;
    padding: 1.1rem;
    width: 100%;
    max-width: 22rem;
  }

  .contact-mail {
    font-size: 0.8rem;
    overflow-wrap: anywhere;
  }

  .copy-btn {
    width: 100%;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .view {
    padding-top: calc(4rem + env(safe-area-inset-top));
  }

  .home-title {
    font-size: clamp(2.2rem, 11vh, 3.4rem);
  }

  .home-desc {
    max-width: 44rem;
    font-size: 0.88rem;
    line-height: 1.6;
  }

  .socials {
    margin-top: 0.6rem;
  }

  .gate-title {
    font-size: clamp(1.4rem, 4vh, 2rem);
  }

  .gate-box {
    gap: 1rem;
  }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .bg-fallback::before,
  .bg-fallback::after,
  .title-letter,
  .home-desc,
  .socials,
  .contact-box,
  .release {
    animation: none;
  }

  .bg-gif,
  .gate {
    transition: none;
  }

  .title-letter,
  .home-desc,
  .socials,
  .contact-box {
    opacity: 1;
  }
}