:root {
  --paper: #f5ecdf;
  --ink: #2b1e14;
  --shadow: 0 44px 120px rgba(53, 29, 14, 0.28);
  --panel-shadow: 0 28px 90px rgba(16, 8, 3, 0.48);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 14%, rgba(255, 255, 255, 0.86), transparent 20%),
    radial-gradient(circle at 84% 12%, rgba(255, 225, 188, 0.34), transparent 26%),
    linear-gradient(180deg, #f8f0e5 0%, #e7d2b8 52%, #d3b18d 100%);
}

body.menu-open {
  overflow: hidden;
}

.cover-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.hero-scene {
  width: min(1480px, 100%, calc((100vh - 36px) * 1.5));
  margin-inline: auto;
}

.hero-painting {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  max-height: calc(100vh - 36px);
  overflow: hidden;
  border-radius: 34px;
  box-shadow: var(--shadow);
  isolation: isolate;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 25%),
    linear-gradient(180deg, #b88759 0%, #6a4226 100%);
  transform: perspective(1600px) rotateX(0.01deg);
}

.hero-art {
  position: absolute;
  inset: 0;
  z-index: -1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hotspot-map {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: visible;
  pointer-events: none;
}

.character-hotspot {
  pointer-events: auto;
  cursor: pointer;
  fill: rgba(255, 247, 231, 0.01);
  stroke: rgba(255, 247, 229, 0);
  stroke-width: 0.35;
  vector-effect: non-scaling-stroke;
  transition: fill 220ms ease, stroke 220ms ease, filter 220ms ease;
}

.character-hotspot:hover,
.character-hotspot:focus-visible {
  fill: rgba(255, 246, 228, 0.12);
  stroke: rgba(255, 247, 229, 0.42);
  filter: brightness(1.03);
  outline: none;
}

.hero-painting::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 61% 18%, rgba(255, 244, 215, 0.52), transparent 18%),
    linear-gradient(180deg, rgba(76, 42, 22, 0.18), transparent 16%),
    linear-gradient(90deg, rgba(55, 27, 14, 0.5), transparent 10% 90%, rgba(55, 27, 14, 0.5));
}

.hero-painting::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, transparent 56%, rgba(46, 24, 12, 0.22) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 18%);
}

.hero-frame,
.hero-light,
.hero-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-frame {
  z-index: 1;
  border-radius: 34px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.22),
    inset 0 0 0 22px rgba(98, 63, 39, 0.26),
    inset 0 0 0 94px rgba(78, 46, 26, 0.08);
}

.hero-light {
  z-index: 1;
  opacity: 0.92;
  background:
    linear-gradient(108deg, transparent 0 56%, rgba(255, 250, 228, 0.18) 56% 63%, transparent 63% 100%),
    linear-gradient(102deg, transparent 0 64%, rgba(255, 248, 222, 0.12) 64% 70%, transparent 70% 100%);
}

.hero-grain {
  z-index: 1;
  opacity: 0.45;
  mix-blend-mode: screen;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.18) 0 0.12rem, transparent 0.14rem),
    radial-gradient(circle at 76% 36%, rgba(255, 252, 244, 0.15) 0 0.1rem, transparent 0.12rem),
    radial-gradient(circle at 68% 24%, rgba(255, 247, 230, 0.14) 0 0.1rem, transparent 0.12rem);
}

.hero-signature {
  position: absolute;
  left: 2.4rem;
  bottom: 2rem;
  z-index: 2;
  font-family: "Instrument Serif", serif;
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  letter-spacing: 0.06em;
  color: rgba(255, 247, 238, 0.74);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.16);
  pointer-events: none;
}

.menu-layer {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.menu-layer.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.menu-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 246, 224, 0.12), rgba(255, 255, 255, 0) 18%),
    rgba(15, 8, 4, 0.58);
  backdrop-filter: blur(14px);
}

.menu-card {
  position: relative;
  width: min(520px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  margin: 0;
  transform: translateY(22px) scale(0.96);
  transition: transform 260ms ease;
}

.menu-layer.is-open .menu-card {
  transform: translateY(0) scale(1);
}

.menu-layer-nested {
  z-index: 40;
}

.menu-card-frame {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  box-shadow: var(--panel-shadow);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0)),
    #24130b;
}

.menu-card-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 30px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 247, 228, 0.24),
    inset 0 0 0 18px rgba(96, 58, 34, 0.18);
  pointer-events: none;
}

.menu-hotspot-map {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: visible;
  pointer-events: none;
}

.menu-hotspot {
  pointer-events: none;
  fill: rgba(255, 247, 231, 0.02);
}

.menu-layer.is-open .menu-hotspot {
  pointer-events: auto;
}

.menu-art {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 28px);
  object-fit: contain;
}

.menu-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  border: 0;
  border-radius: 999px;
  padding: 0.5rem 0.8rem;
  background: rgba(22, 10, 4, 0.66);
  color: rgba(255, 247, 236, 0.92);
  font: inherit;
  letter-spacing: 0.06em;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.menu-close:hover,
.menu-close:focus-visible {
  background: rgba(34, 16, 7, 0.84);
  outline: none;
}

@media (max-width: 900px) {
  .cover-page {
    min-height: 100dvh;
    padding: 10px;
  }

  .hero-scene {
    width: min(100%, calc((100dvh - 20px) * 1.5));
  }

  .hero-painting {
    height: auto;
    max-height: calc(100dvh - 20px);
    min-height: auto;
    aspect-ratio: 3 / 2;
  }

  .hero-frame {
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.2),
      inset 0 0 0 14px rgba(98, 63, 39, 0.22),
      inset 0 0 0 48px rgba(78, 46, 26, 0.06);
  }

  .hero-signature {
    left: 1.4rem;
    bottom: 1.2rem;
    font-size: 1rem;
  }

  .menu-layer {
    padding: 10px;
  }

  .menu-card {
    width: min(500px, calc(100vw - 20px));
  }

  .menu-card-frame,
  .menu-card-frame::before {
    border-radius: 24px;
  }

  .menu-close {
    top: 10px;
    right: 10px;
    padding: 0.45rem 0.7rem;
    font-size: 0.92rem;
  }
}
