/* === PREVENT FIRST PAINT FLASH === */
body.menu-enter {
  opacity: 0;
  visibility: hidden;
}


/* BACK LINK */
.back-to-table {
  position: fixed;
  top: 4vh;
  left: 4vw;
  z-index: 5;
  font-style: italic;
  color: rgba(60,40,25,0.75);
  text-decoration: none;
  border-bottom: 1px solid rgba(60,40,25,0.3);
  padding-bottom: 2px;
}

/* STAGE */
.menu-stage {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* MENU BOOK */
.menu-book {
  position: relative;
  width: 620px;
  height: 720px;
  padding: 4rem 4.2rem 5.5rem;
  background: linear-gradient(to bottom, #2c241e, #1f1914);
  color: #f4efe9;
  border-radius: 28px;
  overflow: hidden;

  box-shadow:
    0 60px 140px rgba(0,0,0,0.55),
    inset 0 1px 0 rgba(255,255,255,0.05);

  transform:
    perspective(1400px)
    rotateX(6deg)
    translateY(12px);
}

/* RIGHT EDGE (page thickness) */
.menu-book::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(255,255,255,0.12),
    rgba(0,0,0,0.35)
  );
  border-radius: 0 20px 20px 0;
  pointer-events: none;
}

/* BOTTOM FADE (intentional) */
.menu-book .page-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 90px;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0),
    rgba(20,15,12,0.75)
  );
  pointer-events: none;
}

/* BACK LAYER (DEPTH) */
.menu-book::after {
  content: "";
  position: absolute;
  inset: 10px;
  background: #19130f;
  border-radius: 16px;
  z-index: -1;
  box-shadow: 0 40px 90px rgba(0,0,0,0.45);
}

/* PAGES */
.menu-pages {
  position: relative;
  width: 100%;
  height: 100%;
  perspective: 1400px;
}


.menu-page {
  position: absolute;
  inset: 0;
  opacity: 0;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  transform-origin: left center;
  transform: rotateY(0deg);
  transition:
    opacity 0.6s ease,
    transform 1.1s cubic-bezier(.4,0,.2,1);
}

.menu-page.active {
  opacity: 1;
  pointer-events: auto;
}


/* TYPOGRAPHY */
.menu-whisper {
  font-style: italic;
  color: rgba(244,239,233,0.65);
  margin-bottom: 1rem;
}

.menu-page h1 {
  margin-bottom: 2.5rem;
}

.menu-page h2 {
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  margin: 2.5rem 0 1.4rem;
}

/* ITEMS */
.item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.4rem;
  margin-bottom: 0.9rem;
}

.item b {
  font-weight: 600;
}

.item em {
  grid-column: 1 / -1;
  font-size: 0.78rem;
  color: rgba(244,239,233,0.55);
  margin-top: 0.15rem;
}

.menu-scroll {
  max-height: 60vh; 
  overflow-y: auto;
  padding-right: 0.5rem;

  scrollbar-width: none; 
}

.menu-scroll::-webkit-scrollbar {
  display: none;
}



.item span {
  right: 0;
  color: #d2b48c;
}

/* .item em {
  display: block;
  font-size: 0.85rem;
  color: rgba(244,239,233,0.6);
} */

/* PAGE NUMBER */
.menu-page::after {
  content: attr(data-page);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.75rem;
  color: rgba(244,239,233,0.45);
}

/* CONTROLS */
.menu-controls {
  position: absolute;
  bottom: 1.8rem;
  left: 0;
  right: 0;
  padding: 0 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: rgba(244,239,233,0.7);
}

.menu-controls button {
  background: none;
  border: none;
  color: inherit;
  font-size: 1.3rem;
  cursor: pointer;
}

.scroll-hint {
  position: relative;
  margin: 2.2rem 0 0;
  text-align: center;
  pointer-events: none;
  opacity: 0.7;
  font-style: italic;
  font-size: 0.72rem;
  color: rgba(244,239,233,0.7);
}

.scroll-hint::before {
  content: "";
  display: block;
  width: 42px;
  height: 1px;
  margin: 0 auto 0.6rem;
  background: linear-gradient(
    to right,
    transparent,
    rgba(244,239,233,0.45),
    transparent
  );
}

.scroll-hint span {
  display: inline-block;
  animation: hintPulse 2.6s ease-in-out infinite;
}

.scroll-hint span::after {
  content: " ↓";
  font-size: 0.85rem;
  opacity: 0.7;
}

@keyframes hintPulse {
  0%, 100% {
    transform: translateY(0);
    opacity: 0.55;
  }
  50% {
    transform: translateY(4px);
    opacity: 0.9;
  }
}




/* ================================
   MENU PAGE ARRIVAL
   ================================ */

body.menu-enter.loaded {
  opacity: 1;
  visibility: visible;
  transition: opacity 1s ease;
}

body.menu-enter main {
  transform: translateY(24px) scale(0.97);
  filter: blur(3px);
}

body.menu-enter.loaded main {
  transform: translateY(0) scale(1);
  filter: blur(0);
  transition:
    transform 1.2s cubic-bezier(.22,.61,.36,1),
    filter 1.2s ease;
}

/* ================================
   MENU PAGE TRANSITION — REFINED
   ================================ */

body.is-transitioning {
  cursor: default;
}

/* Dimming layer */
body.is-transitioning::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(20, 15, 10, 0.22); /* warmer, deeper */
  opacity: 0;
  animation: fadeDim 1.2s ease forwards; /* SLOWER */
  z-index: 999;
  pointer-events: none;
}

@keyframes fadeDim {
  to { opacity: 1; }
}

/* Lift the menu more, slower */
body.is-transitioning .menu-presence {
  transform:
    translateY(-28px)
    scale(1.035)
    rotate(-0.4deg);
  box-shadow:
    0 90px 180px rgba(0,0,0,0.28),
    inset 0 1px 0 rgba(255,255,255,0.85);
  transition:
    transform 1.1s cubic-bezier(.22,.61,.36,1),
    box-shadow 1.1s cubic-bezier(.22,.61,.36,1);
}

/* Fade the room away more decisively */
body.is-transitioning main {
  opacity: 0.35;
  filter: blur(2px);
  transition:
    opacity 1.1s ease,
    filter 1.1s ease;
}

/* RESPONSIVENESS */
@media (max-width: 600px) {
  .menu-stage {
    align-items: flex-start;
    padding-top: 2.5rem;
  }

  .menu-book {
    height: calc(100vh - 3rem);
    min-height: unset;
    overflow: hidden;
  }
}


@media (max-width: 800px) {
  .menu-book {
    width: 92vw;
    height: auto;
    min-height: 80vh;
    padding: 2.5rem 2.5rem 4rem;
    transform: none;
  }

  .menu-page {
    position: relative;
    transform: none !important;
  }

  .menu-pages {
    perspective: none;
  }
}

@media (max-width: 600px) {
    .menu-page > *:not(.menu-scroll):not(.scroll-hint) {
    flex-shrink: 0;
  }

  .menu-scroll {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 1rem;
  }
   .menu-scroll {
    max-height: none;
    padding-right: 0;
  }
  .menu-book {
    width: 96vw;
    max-width: none;
    height: 90svh;
    max-height: 90svh;
    overflow: hidden;

    padding: 2.8rem 2.4rem 3.5rem;
    border-radius: 22px;

    transform: none;
  }
  .menu-page {
    display: flex;
    transform: none !important;
    top: 0;
    left: 0;
    flex-direction: column;
    height: 100%;
  }
  .menu-page {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
  }

  .menu-page.active {
    opacity: 1;
    pointer-events: auto;
  }
  .menu-page h1 {
    font-size: 1.9rem;
    margin-bottom: 2rem;
  }

  .menu-page h2 {
    font-size: 0.85rem;
    letter-spacing: 0.14em;
    margin-bottom: 1.2rem;
  }

  .item {
    gap: 0.8rem;
    margin-bottom: 1.2rem;
  }

  .item b {
    font-size: 0.95rem;
  }

  .item span {
    font-size: 0.9rem;
  }

  .item em {
    font-size: 0.72rem;
    margin-top: 0.25rem;
  }
   .menu-page::after {
    position: absolute;
    bottom: 0.8rem;
    left: 0;
    right: 0;
    text-align: center;
    opacity: 0.35;
  }
   .menu-book::before {
    width: 4px;
  }

  .menu-book::after {
    inset: 6px;
  }
  .back-to-table {
    top: 1rem;
    left: 1rem;

    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;

    background: rgba(244,239,233,0.85);
    color: #2c241e;

    border-radius: 999px;
    border: none;
    z-index: 20;
  }
 .menu-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;

    z-index: 5;
    padding: 1rem 1.5rem;

    background: linear-gradient(
      to top,
      rgba(31,25,20,0.95),
      rgba(31,25,20,0.75),
      transparent
    );
  }
}