html {
  overflow-x: clip;
}

body {
  overflow-x: clip;
}

body.menu-open {
  overflow: hidden;
}

#mobile-menu {
  max-height: calc(100dvh - 4rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#header {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

footer {
  padding-bottom: max(3rem, env(safe-area-inset-bottom));
}

.grain::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.04;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hero-gradient {
  background: linear-gradient(135deg, #0C0F14 0%, #151922 40%, #1a1f2e 70%, #0C0F14 100%);
}

.text-gradient-gold {
  background: linear-gradient(135deg, #E8C547 0%, #C9A227 50%, #a88620 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.bundel-card img {
  transition: transform 0.5s ease;
}

.bundel-card:hover img {
  transform: scale(1.05);
}

.nav-active {
  color: #E8C547 !important;
}

.pdf-viewer-frame {
  min-height: 70vh;
}

.pdf-viewer-frame:fullscreen,
.flipbook-viewer:fullscreen {
  min-height: 100vh;
  background: #0C0F14;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.flipbook-viewer:fullscreen .flipbook-stage {
  flex: 1;
  min-height: 0;
}

.flipbook-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 65vh;
  padding: 2rem 1rem 1.5rem;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(61, 31, 36, 0.12) 0%, transparent 55%),
    linear-gradient(180deg, #e8e4dc 0%, #ddd8cf 45%, #d4cfc4 100%);
  position: relative;
}

.flipbook-stage::after {
  content: '';
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(72%, 520px);
  height: 18px;
  background: radial-gradient(ellipse, rgba(12, 15, 20, 0.28) 0%, transparent 72%);
  pointer-events: none;
}

.flipbook-book {
  position: relative;
  z-index: 1;
  filter: drop-shadow(-10px 16px 28px rgba(12, 15, 20, 0.28))
    drop-shadow(4px 8px 16px rgba(12, 15, 20, 0.12));
}

.flipbook-book .stf__parent {
  margin: 0 auto;
}

.flipbook-book .stf__item {
  background: #f8f6f3;
}

.flipbook-book .stf__item canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* StPageFlip page surfaces */
.flipbook-page {
  background-color: #f8f6f3;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 2px;
}

.flipbook-page--hard {
  background-color: #3d1f24;
  box-shadow:
    inset -8px 0 16px rgba(0, 0, 0, 0.22),
    inset 0 0 0 3px rgba(201, 162, 39, 0.35);
}

.flipbook-page--hard-back {
  box-shadow:
    inset 8px 0 16px rgba(0, 0, 0, 0.22),
    inset 0 0 0 3px rgba(201, 162, 39, 0.35);
}

.flipbook-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem 1.5rem 1.25rem;
  background: #fff;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.flipbook-hint {
  text-align: center;
  font-size: 0.8rem;
  color: #6b7280;
  padding-bottom: 0.75rem;
  background: #fff;
}

.flipbook-toolbar-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-photo-badge {
  max-width: calc(100% - 1rem);
}

@media (max-width: 639px) {
  .flipbook-stage {
    min-height: 50vh;
    padding: 0.75rem 0.5rem 1rem;
  }

  .flipbook-controls {
    flex-wrap: wrap;
    gap: 0.625rem;
    padding: 0.75rem 1rem 1rem;
  }

  .flipbook-controls button {
    flex: 1 1 auto;
    min-width: 2.75rem;
    justify-content: center;
  }

  .flipbook-hint {
    font-size: 0.75rem;
    line-height: 1.45;
    padding: 0 0.75rem 0.75rem;
  }

  .flipbook-viewer.rounded-3xl {
    border-radius: 1.25rem;
  }

  .flipbook-viewer [data-flipbook-loading] {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .bundel-card img {
    transition: none;
  }
}
