/* ============================================================
   MONSTER fan site — full-bleed landing page
   The artwork fills the viewport and fades in as the theme plays.
   ============================================================ */

:root {
  --paper:      #f8f4ec;
  --ink:        #1d1a17;
  --blood:      #a01212;
  --blood-dark: #7c0d0d;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body:    "Inter", -apple-system, "Segoe UI", sans-serif;
}

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

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  overflow-x: hidden;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Full-bleed stage ---------- */

.stage {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;   /* accounts for mobile browser chrome */
  display: grid;
  place-items: center;
  overflow: hidden;
}

.stage-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 38%;
  z-index: 0;
}

/* ---------- Entrance fade ----------
   With JS: the page waits, then fades in when the music starts.
   Without JS: it simply fades in on load, so nothing is ever stuck hidden. */

@keyframes fade-in-art {
  from { opacity: 0; transform: scale(1.05); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Paced against the 9.5s theme: artwork settles by ~5s,
   buttons finish by ~6.5s, leaving the last few seconds to the music. */
html:not(.js) .stage-img,
body.revealed .stage-img {
  animation: fade-in-art 5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

html:not(.js) .choices,
body.revealed .choices {
  animation: rise-in 2.4s ease-out 4.1s both;
}

/* held dark until the music starts */
html.js body:not(.revealed) .stage-img,
html.js body:not(.revealed) .choices {
  opacity: 0;
}

/* ---------- Buttons ---------- */

.choices {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 1.1rem;
  padding: 1.5rem;
  max-width: 100%;
}

.btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-width: 15rem;
  padding: 1.15rem 2rem;
  border-radius: 2px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-align: center;
  box-shadow: 0 6px 26px rgba(29, 26, 23, 0.28);
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.btn-sub {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  opacity: 0.85;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(29, 26, 23, 0.34);
}

.btn:active { transform: translateY(0); }

.btn-anime {
  background: var(--blood);
  color: var(--paper);
  border: 1px solid var(--blood);
}

.btn-anime:hover {
  background: var(--blood-dark);
  border-color: var(--blood-dark);
}

.btn-book {
  background: var(--ink);
  color: #ffffff;
  border: 1px solid var(--ink);
}

.btn-book:hover {
  background: #000000;
  border-color: var(--blood);
}

.btn:focus-visible,
.sound-toggle:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

/* the entry button is focused on arrival — keep the ring delicate */
.gate-btn:focus-visible {
  outline: 1px solid var(--blood);
  outline-offset: 6px;
}

/* ---------- Entry gate (only if the browser blocks autoplay) ---------- */

.gate {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  background: var(--paper);
}

/* the nameless monster is the door in —
   no animation and no transition, so it is visible and clickable instantly */
.gate-btn {
  cursor: pointer;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  width: clamp(210px, 34vmin, 360px);
  line-height: 0;
}

.gate-btn img {
  display: block;
  width: 100%;
  height: auto;
}

.gate-btn:hover img { filter: brightness(0.93); }

/* ---------- Sound toggle ---------- */

.sound-toggle {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 3;
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  border-radius: 50%;
  border: 1px solid rgba(29, 26, 23, 0.2);
  background: rgba(248, 244, 236, 0.82);
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1;
  backdrop-filter: blur(4px);
  transition: opacity 0.25s, color 0.2s, border-color 0.2s;
  animation: rise-in 0.8s ease-out 5.2s both;
}

.sound-toggle:hover { color: var(--blood); border-color: var(--blood); }
.sound-toggle.is-muted { opacity: 0.5; }
.sound-toggle.is-muted .sound-on { text-decoration: line-through; }

/* ---------- Responsive ---------- */

/* Portrait / narrow: keep Tenma's face in frame and stack the buttons */
@media (max-aspect-ratio: 1/1) {
  .stage-img { object-position: 85% 35%; }
}

@media (max-width: 620px) {
  .choices {
    flex-direction: column;
    width: 100%;
    gap: 0.9rem;
  }

  .btn {
    min-width: 0;
    width: 100%;
    font-size: 1.3rem;
    padding: 1rem 1.25rem;
  }

}

@media (prefers-reduced-motion: reduce) {
  .btn, .sound-toggle { transition: none; }
  .btn:hover { transform: none; }
  html:not(.js) .stage-img, body.revealed .stage-img,
  html:not(.js) .choices,   body.revealed .choices,
  .sound-toggle { animation: none; }
  html.js body:not(.revealed) .stage-img,
  html.js body:not(.revealed) .choices { opacity: 0; }
  body.revealed .stage-img, body.revealed .choices { opacity: 1; }
}
