/* ==========================================================================
   Scales & Stones — Landing Page (The Dark Water Portal)
   Kira & Sana Marlowe
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Philosopher:ital,wght@0,400;0,700;1,400;1,700&family=UnifrakturMaguntia&display=swap');

html {
  font-size: clamp(15.5px, 0.22vw + 14px, 19px);
}

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

.landing-body {
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  background: #050707;
  color: #E3DEC8;
  font-family: 'Philosopher', serif;
  position: relative;
}

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

/* ─── Slow Dark Water Canvas ─── */
#ripple-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
}

/* ─── Full-Viewport Gothic Frame on Landing ─── */
.landing-frame {
  position: fixed;
  inset: 18px;
  border: 1.5px solid rgba(227, 222, 200, 0.65);
  border-radius: 18px;
  box-shadow: 0 0 0 100vmax #050707;
  pointer-events: none;
  z-index: 15;
}

.landing-corner {
  position: absolute;
  width: 72px;
  height: auto;
  opacity: 0.9;
}

.landing-corner .corner-img {
  width: 100%;
  height: auto;
  display: block;
}

.landing-corner.tl { top: 4px; left: 4px; }
.landing-corner.tr { top: 4px; right: 4px; transform: scaleX(-1); }
.landing-corner.bl { bottom: 4px; left: 4px; transform: scaleY(-1); }
.landing-corner.br { bottom: 4px; right: 4px; transform: scale(-1, -1); }

/* ─── Center Portal Content ─── */
.landing-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  height: 100dvh;
  padding: 2rem;
  pointer-events: none;
}

.landing-authors {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  color: rgba(227, 222, 200, 0.72);
  margin-bottom: 0.6rem;
  opacity: 0;
  animation: fadeUp 1.8s ease-out 0.2s forwards;
}

.landing-title {
  text-align: center;
  line-height: 1;
  margin-bottom: 1.8rem;
  opacity: 0;
  animation: fadeUp 1.8s ease-out 0.4s forwards;
}

.landing-title-logo {
  width: clamp(270px, 38vw, 560px);
  max-width: 90vw;
  height: auto;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 10px 35px rgba(0, 0, 0, 0.95));
}

/* ─── Book Cover Portal ─── */
.book-container {
  position: relative;
  pointer-events: auto;
  cursor: pointer;
  opacity: 0;
  animation: fadeUp 2s ease-out 0.7s forwards;
}

.book-cover {
  width: clamp(175px, 14vw, 380px);
  height: auto;
  display: block;
  border: 1px solid rgba(227, 222, 200, 0.45);
  box-shadow:
    0 22px 55px rgba(0, 0, 0, 0.95),
    0 0 40px rgba(0, 0, 0, 0.8);
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.7s ease,
              border-color 0.7s ease;
}

.book-container:hover .book-cover {
  transform: translateY(-6px) scale(1.025);
  border-color: #E3DEC8;
  box-shadow:
    0 28px 65px rgba(0, 0, 0, 0.98),
    0 0 55px rgba(227, 222, 200, 0.14);
}

.landing-tagline {
  font-size: 1.02rem;
  font-style: italic;
  color: rgba(227, 222, 200, 0.85);
  text-align: center;
  margin-top: 1.8rem;
  max-width: 420px;
  line-height: 1.65;
  opacity: 0;
  animation: fadeUp 1.8s ease-out 1s forwards;
}

.landing-enter {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  color: rgba(227, 222, 200, 0.55);
  margin-top: 1.4rem;
  opacity: 0;
  animation: fadeUp 1.8s ease-out 1.3s forwards, slowBreath 4.5s ease-in-out 3s infinite;
}

/* ─── Transition Out ─── */
.transition-overlay {
  position: fixed;
  inset: 0;
  background: #080909;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.1s ease-in-out;
}

.landing-body.transitioning .transition-overlay {
  opacity: 1;
}

.landing-body.transitioning .landing-content {
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

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

@keyframes slowBreath {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 0.85; }
}

@media (max-width: 600px) {
  .landing-frame { inset: 10px; }
  .landing-corner { width: 46px; height: auto; }
  .book-cover { width: 175px; }
}
