/**
 * Cover Page Styles (index.html)
 * Miftah Kaidah Shorof - Buku Digital Interaktif
 * Centered Cover Card with In-Cover CTA Button & Royal Islamic Background
 */

:root {
  --color-stage-bg: #071912;
  --color-green-dark: #0b291d;
  --color-primary-green: #144233;
  --color-primary-hover: #1b5341;
  
  --color-gold: #f5bc47;
  --color-gold-deep: #d98e1b;
  --color-gold-glow: rgba(245, 188, 71, 0.35);
  
  --color-text-white: #ffffff;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--color-stage-bg);
  font-family: var(--font-sans);
  color: var(--color-text-white);
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}

:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
  border-radius: 8px;
}

/* Ambient Islamic Background: Radial Glow, Geometric Star Motif & Vignette */
.ambient-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
  animation: backdropEntrance 0.9s ease-out forwards;
}

@keyframes backdropEntrance {
  0% {
    opacity: 0;
    transform: scale(1.04);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.ambient-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 95vw;
  max-width: 1000px;
  height: 95vh;
  max-height: 1000px;
  border-radius: 50%;
  background: radial-gradient(
    circle, 
    rgba(24, 78, 59, 0.65) 0%, 
    rgba(14, 48, 35, 0.4) 45%, 
    rgba(7, 25, 18, 0.8) 75%, 
    #05140e 100%
  );
  filter: blur(40px);
}

.ambient-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23e5bc68' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M40 0 L55 25 L80 40 L55 55 L40 80 L25 55 L0 40 L25 25 Z'/%3E%3Cpath d='M0 0 L25 0 L40 25 L55 0 L80 0 L80 25 L55 40 L80 55 L80 80 L55 80 L40 55 L25 80 L0 80 L0 55 L25 40 L0 25 Z'/%3E%3Ccircle cx='40' cy='40' r='10' stroke='%23f2d28b' stroke-width='1'/%3E%3Ccircle cx='0' cy='0' r='10' stroke='%23f2d28b' stroke-width='1'/%3E%3Ccircle cx='80' cy='0' r='10' stroke='%23f2d28b' stroke-width='1'/%3E%3Ccircle cx='0' cy='80' r='10' stroke='%23f2d28b' stroke-width='1'/%3E%3Ccircle cx='80' cy='80' r='10' stroke='%23f2d28b' stroke-width='1'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 80px 80px;
  background-repeat: repeat;
  mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.85) 60%, rgba(0, 0, 0, 0.95) 100%);
  -webkit-mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.85) 60%, rgba(0, 0, 0, 0.95) 100%);
}

.ambient-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 35%, rgba(3, 13, 9, 0.7) 85%, #020a07 100%);
}

/* Main Landing Stage: Dead-Centered Vertically & Horizontally */
.landing-stage {
  position: relative;
  z-index: 10;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

/* Centered Book Cover Card */
.cover-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: min(92vw, calc(88dvh * (1024 / 1536)), 550px);
  animation: coverCardEntrance 0.95s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

@keyframes coverCardEntrance {
  0% {
    opacity: 0;
    transform: translateY(32px) scale(0.95);
    filter: blur(4px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.cover-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1024 / 1536;
  max-height: min(88vh, 825px);
  max-height: min(88dvh, 825px);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 
    0 28px 75px rgba(0, 0, 0, 0.75),
    0 0 35px rgba(11, 41, 29, 0.45);
  container-type: inline-size;
  transition: transform 0.35s var(--ease-smooth),
              box-shadow 0.35s var(--ease-smooth);
}

.cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

/* Subtle Glass Sheen Sweep */
.cover-glass-glare {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    rgba(255, 255, 255, 0.16) 0%,
    rgba(255, 255, 255, 0.04) 40%,
    transparent 60%
  );
  pointer-events: none;
  animation: glareSweep 1.2s ease-out 0.4s both;
}

@keyframes glareSweep {
  0% {
    opacity: 0;
    transform: translateX(-35%);
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.6;
    transform: translateX(0);
  }
}

/* Hover Lift on the Card */
.cover-card:hover .cover-media {
  transform: translateY(-5px) scale(1.01);
  box-shadow: 
    0 30px 70px rgba(0, 0, 0, 0.78),
    0 0 40px var(--color-gold-glow);
}

/* Button Mulai Belajar (Di dalam foto cover, presisi di celah peci & jilbab) */
.btn-mulai-belajar {
  position: absolute;
  top: 55.85%;
  left: 50%;
  transform: translateX(-50%);
  width: 25.5%;
  height: 3.9%;
  border-radius: 8px; /* Rounded rectangle tegas & rapi, BUKAN pillbox */
  background: linear-gradient(135deg, #f9be42 0%, #e08e14 100%);
  color: var(--color-green-dark);
  font-family: var(--font-sans);
  font-size: clamp(10px, 2.5cqi, 18px);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1;
  text-decoration: none;
  border: 1.5px solid #ffffff;
  box-shadow: 
    0 4px 14px rgba(11, 41, 29, 0.4), 
    0 0 14px rgba(249, 190, 66, 0.65),
    inset 0 1px 1px rgba(255, 255, 255, 0.7);
  cursor: pointer;
  z-index: 20;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
  transition: all 0.22s var(--ease-smooth);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  animation: 
    buttonEntrance 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.55s both,
    pulseGlow 2.4s ease-in-out 1.25s infinite alternate;
}

@keyframes buttonEntrance {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(14px) scale(0.82);
  }
  70% {
    transform: translateX(-50%) translateY(-2px) scale(1.04);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

/* Opsi 1: Efek Kilatan Cahaya Berjalan (Shimmer Glint / Sheen Sweep) */
.btn-mulai-belajar::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -130%;
  width: 55%;
  height: 200%;
  background: linear-gradient(
    115deg,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 20%,
    rgba(255, 255, 255, 0.8) 50%,
    rgba(255, 255, 255, 0.1) 80%,
    transparent 100%
  );
  transform: rotate(25deg);
  animation: buttonShimmer 3.2s cubic-bezier(0.4, 0, 0.2, 1) 1.25s infinite;
  pointer-events: none;
}

@keyframes buttonShimmer {
  0%, 25% {
    left: -130%;
  }
  60%, 100% {
    left: 230%;
  }
}

.btn-mulai-belajar:hover {
  transform: translateX(-50%) translateY(-2px) scale(1.03);
  background: linear-gradient(135deg, #ffd066 0%, #ea9a22 100%);
  box-shadow: 
    0 6px 20px rgba(11, 41, 29, 0.5), 
    0 0 22px rgba(249, 190, 66, 0.9),
    inset 0 1px 1px rgba(255, 255, 255, 0.9);
}

.btn-mulai-belajar:active {
  transform: translateX(-50%) translateY(1px) scale(0.97);
}

@keyframes pulseGlow {
  0% {
    box-shadow: 
      0 4px 14px rgba(11, 41, 29, 0.4), 
      0 0 10px rgba(249, 190, 66, 0.45),
      inset 0 1px 1px rgba(255, 255, 255, 0.6);
  }
  100% {
    box-shadow: 
      0 6px 18px rgba(11, 41, 29, 0.45), 
      0 0 18px rgba(249, 190, 66, 0.8),
      inset 0 1px 1px rgba(255, 255, 255, 0.85);
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .ambient-backdrop,
  .cover-card,
  .cover-glass-glare,
  .btn-mulai-belajar,
  .btn-mulai-belajar::after {
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
  .btn-mulai-belajar {
    transform: translateX(-50%) !important;
  }
}
