/* ===================================================
   MEMMY — Magical Dreamy Website Stylesheet
   =================================================== */

/* ── CSS Variables ── */
:root {
  --bg-deep:       #0a0618;
  --bg-mid:        #120930;
  --bg-card:       rgba(255,255,255,0.04);
  --bg-card-hover: rgba(255,255,255,0.09);
  --purple-deep:   #3d1b6e;
  --purple-mid:    #6a35b0;
  --purple-light:  #a86ee0;
  --gold:          #f5c842;
  --gold-light:    #ffe991;
  --pink:          #e06cb0;
  --blue-glow:     #4cc9f0;
  --text-primary:  #f0e8ff;
  --text-muted:    #b8a8d8;
  --text-dim:      #7a6a9a;
  --radius-card:   20px;
  --radius-btn:    50px;
  --shadow-card:   0 8px 40px rgba(100,50,200,0.25);
  --shadow-glow:   0 0 60px rgba(168,110,224,0.3);
  --transition:    0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}
img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }

/* ── Container ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Background gradient ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(106,53,176,0.25) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(76,201,240,0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 50%, rgba(18,9,48,1) 0%, var(--bg-deep) 100%);
  z-index: -2;
  pointer-events: none;
}

/* ── Stars ── */
.stars-container {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.star {
  position: absolute;
  border-radius: 50%;
  background: white;
  animation: twinkle var(--dur, 3s) ease-in-out infinite var(--delay, 0s);
}
.star:nth-child(1)  { width:2px;height:2px; top:5%;left:10%;   --dur:4s;  --delay:0s;   opacity:.7; }
.star:nth-child(2)  { width:3px;height:3px; top:15%;left:25%;  --dur:3s;  --delay:.5s;  opacity:.5; }
.star:nth-child(3)  { width:2px;height:2px; top:8%;left:60%;   --dur:5s;  --delay:1s;   opacity:.8; }
.star:nth-child(4)  { width:4px;height:4px; top:20%;left:80%;  --dur:3.5s;--delay:.3s;  opacity:.6; }
.star:nth-child(5)  { width:2px;height:2px; top:35%;left:5%;   --dur:4.5s;--delay:1.5s; opacity:.7; }
.star:nth-child(6)  { width:3px;height:3px; top:50%;left:45%;  --dur:3s;  --delay:2s;   opacity:.4; }
.star:nth-child(7)  { width:2px;height:2px; top:65%;left:90%;  --dur:6s;  --delay:.8s;  opacity:.6; }
.star:nth-child(8)  { width:5px;height:5px; top:70%;left:20%;  --dur:4s;  --delay:2.5s; opacity:.3; }
.star:nth-child(9)  { width:2px;height:2px; top:80%;left:70%;  --dur:5s;  --delay:.2s;  opacity:.8; }
.star:nth-child(10) { width:3px;height:3px; top:90%;left:40%;  --dur:3.5s;--delay:1.8s; opacity:.5; }
.star:nth-child(11) { width:2px;height:2px; top:25%;left:55%;  --dur:4s;  --delay:.7s;  opacity:.9; }
.star:nth-child(12) { width:4px;height:4px; top:42%;left:15%;  --dur:3s;  --delay:3s;   opacity:.4; }
.star:nth-child(13) { width:2px;height:2px; top:58%;left:75%;  --dur:5.5s;--delay:.4s;  opacity:.7; }
.star:nth-child(14) { width:3px;height:3px; top:12%;left:40%;  --dur:4s;  --delay:1.2s; opacity:.6; }
.star:nth-child(15) { width:2px;height:2px; top:88%;left:88%;  --dur:3s;  --delay:2.2s; opacity:.8; }
.star:nth-child(16) { width:3px;height:3px; top:30%;left:95%;  --dur:4.5s;--delay:.9s;  opacity:.5; }
.star:nth-child(17) { width:2px;height:2px; top:73%;left:55%;  --dur:5s;  --delay:3.5s; opacity:.7; }
.star:nth-child(18) { width:4px;height:4px; top:48%;left:30%;  --dur:3.8s;--delay:1.1s; opacity:.3; }
.star:nth-child(19) { width:2px;height:2px; top:18%;left:72%;  --dur:4.2s;--delay:2.8s; opacity:.9; }
.star:nth-child(20) { width:3px;height:3px; top:95%;left:12%;  --dur:3.5s;--delay:0.6s; opacity:.6; }

@keyframes twinkle {
  0%, 100% { opacity: var(--base-opacity, .6); transform: scale(1); }
  50%       { opacity: 0.1; transform: scale(0.5); }
}

/* ── HEADER ── */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(10,6,24,0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(168,110,224,0.15);
  transition: var(--transition);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  gap: 1rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-family: 'Baloo 2', cursive;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.logo-icon { font-size: 1.4rem; filter: drop-shadow(0 0 8px var(--gold)); }

/* Language switcher */
.lang-switcher {
  display: flex;
  gap: .3rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(168,110,224,0.2);
  border-radius: 50px;
  padding: .25rem;
}
.lang-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: 'Nunito', sans-serif;
  font-size: .8rem;
  font-weight: 700;
  padding: .3rem .7rem;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: .05em;
}
.lang-btn.active, .lang-btn:hover {
  background: linear-gradient(135deg, var(--purple-mid), var(--purple-light));
  color: white;
  box-shadow: 0 0 12px rgba(168,110,224,0.4);
}

.play-badge-small {
  height: 36px;
  width: auto;
  border-radius: 6px;
  transition: var(--transition);
}
.play-badge-small:hover { transform: translateY(-2px); filter: brightness(1.1); }

/* ── HERO ── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 100px 0 60px;
  overflow: hidden;
}
.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}
.hero-glow-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(106,53,176,0.35) 0%, transparent 70%);
  top: -100px; left: -200px;
  animation: floatGlow 8s ease-in-out infinite;
}
.hero-glow-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(76,201,240,0.2) 0%, transparent 70%);
  bottom: 0; right: -100px;
  animation: floatGlow 10s ease-in-out infinite reverse;
}
.hero-glow-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(245,200,66,0.15) 0%, transparent 70%);
  top: 50%; right: 30%;
  animation: floatGlow 6s ease-in-out infinite 2s;
}
@keyframes floatGlow {
  0%, 100% { transform: translate(0,0) scale(1); }
  50%       { transform: translate(20px,-20px) scale(1.05); }
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(245,200,66,0.12);
  border: 1px solid rgba(245,200,66,0.3);
  color: var(--gold-light);
  font-size: .85rem;
  font-weight: 700;
  padding: .4rem 1rem;
  border-radius: 50px;
  margin-bottom: 1.2rem;
  letter-spacing: .05em;
  animation: fadeInDown .6s ease-out;
}
.hero-title {
  font-family: 'Baloo 2', cursive;
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.2rem;
  color: var(--text-primary);
  animation: fadeInDown .7s ease-out .1s both;
}
.gradient-word {
  background: linear-gradient(135deg, var(--gold) 0%, var(--pink) 50%, var(--purple-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 20px rgba(245,200,66,0.4));
}
.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 480px;
  line-height: 1.7;
  margin-bottom: 2rem;
  animation: fadeInDown .8s ease-out .2s both;
}
.hero-cta-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  animation: fadeInDown .9s ease-out .3s both;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  background: linear-gradient(135deg, var(--purple-mid) 0%, var(--purple-light) 50%, var(--pink) 100%);
  color: white;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  padding: .85rem 2rem;
  border-radius: var(--radius-btn);
  box-shadow: 0 4px 25px rgba(106,53,176,0.5), 0 0 0 0 rgba(168,110,224,0.4);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--purple-light) 0%, var(--pink) 50%, var(--gold) 100%);
  opacity: 0;
  transition: var(--transition);
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 35px rgba(106,53,176,0.7), 0 0 0 4px rgba(168,110,224,0.2);
}
.btn-primary:hover::before { opacity: 1; }
.btn-primary > * { position: relative; z-index: 1; }
.btn-primary.btn-large { font-size: 1.15rem; padding: 1rem 2.4rem; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(168,110,224,0.3);
  color: var(--text-primary);
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  padding: .85rem 1.8rem;
  border-radius: var(--radius-btn);
  transition: var(--transition);
  backdrop-filter: blur(10px);
}
.btn-secondary:hover {
  background: rgba(168,110,224,0.15);
  border-color: var(--purple-light);
  transform: translateY(-2px);
}
.btn-icon  { width: 18px; height: 18px; flex-shrink: 0; }
.btn-icon-right { width: 18px; height: 18px; flex-shrink: 0; }

.hero-languages {
  display: flex;
  gap: .7rem;
  flex-wrap: wrap;
  animation: fadeInDown 1s ease-out .4s both;
}
.lang-tag {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50px;
  padding: .3rem .85rem;
  font-size: .82rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Hero card stack */
.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 500px;
  animation: fadeInRight .9s ease-out .2s both;
}
.hero-story-carousel {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .55rem;
  width: min(470px, 100%);
  direction: ltr;
}
.hero-carousel-viewport {
  position: relative;
  height: 390px;
  overflow: hidden;
  perspective: 900px;
}
.hero-carousel-track {
  position: relative;
  height: 100%;
}
.hero-carousel-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 220px;
  aspect-ratio: 3 / 4;
  transform: translate(-50%, -50%) translateX(var(--hero-x, 0px))
    rotate(var(--hero-r, 0deg)) scale(var(--hero-s, .7));
  opacity: var(--hero-o, .28);
  z-index: var(--hero-z, 1);
  filter: saturate(.72) brightness(.68);
  transition: transform .55s cubic-bezier(.22,.75,.25,1), opacity .4s ease, filter .4s ease;
  pointer-events: none;
}
.hero-carousel-card.is-active {
  opacity: 1;
  filter: saturate(1.05) brightness(1);
  pointer-events: auto;
}
.hero-carousel-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.2);
  box-shadow: 0 22px 55px rgba(0,0,0,.42), 0 0 30px rgba(168,110,224,.24);
}
.hero-carousel-label {
  position: absolute;
  left: .8rem;
  right: .8rem;
  bottom: .8rem;
  padding: .45rem .65rem;
  border-radius: 12px;
  color: white;
  background: rgba(10,6,24,.76);
  font-family: 'Baloo 2', cursive;
  font-size: .85rem;
  line-height: 1.1;
  text-align: center;
  backdrop-filter: blur(8px);
}
.rtl .hero-carousel-label { direction: rtl; }
.hero-carousel-arrow {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(168,110,224,.38);
  border-radius: 50%;
  background: rgba(10,6,24,.48);
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
  z-index: 4;
  transition: var(--transition);
}
.hero-carousel-arrow:hover {
  transform: translateY(-2px);
  background: rgba(168,110,224,.24);
  border-color: var(--purple-light);
}
.hero-card-stack {
  position: relative;
  width: 280px;
  height: 380px;
}
.floating-card {
  position: absolute;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}
.floating-card img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.card-back {
  width: 240px; height: 320px;
  top: 60px; left: -20px;
  transform: rotate(-8deg) scale(.92);
  opacity: .6;
  filter: blur(1px);
  animation: floatCard 5s ease-in-out infinite;
}
.card-mid {
  width: 250px; height: 335px;
  top: 30px; left: 30px;
  transform: rotate(-3deg) scale(.96);
  opacity: .8;
  animation: floatCard 4.5s ease-in-out infinite .5s;
}
.card-front {
  width: 260px; height: 350px;
  top: 0; left: 60px;
  transform: rotate(2deg);
  box-shadow: 0 20px 60px rgba(100,50,200,0.5), 0 0 0 2px rgba(168,110,224,0.3);
  animation: floatCard 4s ease-in-out infinite 1s;
}
.card-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
  pointer-events: none;
}
.hero-card-stack:hover .card-front  { transform: rotate(0) scale(1.05); }
.hero-card-stack:hover .card-mid   { transform: rotate(-6deg) translateX(-15px); }
.hero-card-stack:hover .card-back  { transform: rotate(-12deg) translateX(-30px) scale(.9); }

@keyframes floatCard {
  0%, 100% { transform: rotate(var(--rot, 2deg)) translateY(0); }
  50%       { transform: rotate(var(--rot, 2deg)) translateY(-12px); }
}

.hero-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.sparkle {
  position: absolute;
  font-size: 1.5rem;
  animation: sparkleFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 0 8px var(--gold));
}
.s1 { top: 5%;  left: 5%;  animation-delay: 0s;   animation-duration: 3.5s; }
.s2 { top: 10%; right: 0%; animation-delay: .8s;  animation-duration: 4s; }
.s3 { bottom: 20%; left: 0%; animation-delay: 1.5s; animation-duration: 3s; }
.s4 { bottom: 5%; right: 5%; animation-delay: .3s;  animation-duration: 5s; }
@keyframes sparkleFloat {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); opacity: .8; }
  50%       { transform: translateY(-15px) rotate(10deg) scale(1.2); opacity: 1; }
}

.hero-scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
}
.scroll-dot {
  width: 6px; height: 6px;
  background: var(--purple-light);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--purple-light);
  animation: scrollBounce 2s ease-in-out infinite;
}
@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); opacity: .8; }
  50%       { transform: translateY(10px); opacity: .3; }
}

/* ── SECTION SHARED ── */
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}
.section-tag {
  display: inline-block;
  background: rgba(245,200,66,0.1);
  border: 1px solid rgba(245,200,66,0.25);
  color: var(--gold-light);
  font-size: .85rem;
  font-weight: 700;
  padding: .35rem .9rem;
  border-radius: 50px;
  margin-bottom: .8rem;
  letter-spacing: .06em;
}
.section-title {
  font-family: 'Baloo 2', cursive;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: .6rem;
}
.section-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 550px;
  margin: 0 auto;
  line-height: 1.65;
}

/* ── STORIES — Flip Cards ── */
.stories-section { padding: 80px 0; }

/* Grid: 3 equal columns, centred */
.flip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  perspective: 1200px;
}

/* Outer wrapper — sets the 3/4 aspect ratio */
.flip-wrap {
  position: relative;
  aspect-ratio: 3/4;
  cursor: pointer;
  /* lift on hover before the flip starts */
  transition: transform .2s ease, filter .2s ease;
}
.flip-wrap:hover { filter: drop-shadow(0 20px 40px rgba(100,50,200,0.5)); }

/* Featured card is slightly taller */
.featured-flip { transform: scale(1.04); z-index: 2; }
.featured-flip:hover { filter: drop-shadow(0 24px 50px rgba(245,200,66,0.35)); }

/* The inner element that actually rotates */
.flip-inner {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  transform-style: preserve-3d;
  transition: transform .7s cubic-bezier(0.4, 0.2, 0.2, 1);
  will-change: transform;
}
.flip-wrap:hover .flip-inner,
.flip-wrap.flipped  .flip-inner { transform: rotateY(180deg); }

/* FRONT face */
.flip-front {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border: 2px solid rgba(168,110,224,0.18);
}
.flip-front img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.flip-front-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.18) 0%,
    rgba(255,255,255,0.04) 40%,
    transparent 60%
  );
  pointer-events: none;
  border-radius: 22px;
}
.flip-front-badge {
  position: absolute;
  top: .9rem; left: .9rem;
  font-size: .75rem;
  font-weight: 800;
  padding: .3rem .8rem;
  border-radius: 50px;
  z-index: 3;
  letter-spacing: .04em;
  backdrop-filter: blur(4px);
}
.flip-front-badge.free {
  background: rgba(245,200,66,0.92);
  color: #1a0a00;
  box-shadow: 0 2px 14px rgba(245,200,66,0.5);
}
.flip-front-badge.new-badge {
  top: 3.3rem;
  background: rgba(76,201,240,0.92);
  color: #001a2e;
  box-shadow: 0 2px 14px rgba(76,201,240,0.4);
}

/* BACK face */
.flip-back {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: rotateY(180deg);
  background: linear-gradient(145deg, #1a0a3a 0%, #0e0520 100%);
  border: 2px solid rgba(168,110,224,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Ambient glow behind the text */
.flip-back-glow {
  position: absolute;
  width: 200%; height: 200%;
  top: -50%; left: -50%;
  background: radial-gradient(circle at center, rgba(106,53,176,0.45) 0%, transparent 65%);
  animation: pulseGlow 3s ease-in-out infinite;
  pointer-events: none;
}
.flip-back-glow.glow-gold {
  background: radial-gradient(circle at center, rgba(245,200,66,0.3) 0%, rgba(106,53,176,0.3) 50%, transparent 70%);
}
.flip-back-glow.glow-pink {
  background: radial-gradient(circle at center, rgba(224,108,176,0.35) 0%, rgba(106,53,176,0.25) 55%, transparent 70%);
}
@keyframes pulseGlow {
  0%, 100% { opacity: .8; transform: scale(1); }
  50%       { opacity: 1;  transform: scale(1.06); }
}

/* Back text content */
.flip-back-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.8rem 1.4rem;
  gap: .7rem;
}
.flip-series {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--purple-light);
  background: rgba(168,110,224,0.15);
  padding: .25rem .75rem;
  border-radius: 50px;
  border: 1px solid rgba(168,110,224,0.3);
}
.flip-title {
  font-family: 'Baloo 2', cursive;
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}
.flip-desc {
  font-size: clamp(.75rem, 1.5vw, .88rem);
  color: var(--text-muted);
  line-height: 1.55;
}
.flip-langs {
  display: flex;
  gap: .5rem;
  justify-content: center;
}
.slang {
  font-size: 1.2rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

/* CTA button on back */
.flip-cta {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-top: .3rem;
  background: linear-gradient(135deg, var(--purple-mid), var(--purple-light));
  color: white;
  font-family: 'Nunito', sans-serif;
  font-size: .88rem;
  font-weight: 800;
  padding: .55rem 1.4rem;
  border-radius: 50px;
  letter-spacing: .03em;
  box-shadow: 0 4px 20px rgba(106,53,176,0.5);
  transition: var(--transition);
}
.flip-cta:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 28px rgba(106,53,176,0.7);
}
.flip-cta-gold {
  background: linear-gradient(135deg, #d4a200, var(--gold), #ffe060);
  color: #1a0a00;
  box-shadow: 0 4px 20px rgba(245,200,66,0.45);
}
.flip-cta-gold:hover { box-shadow: 0 6px 28px rgba(245,200,66,0.65); }

/* Mobile tap hint */
.flip-hint {
  text-align: center;
  margin-top: 2rem;
  font-size: .8rem;
  color: var(--text-dim);
  letter-spacing: .08em;
  opacity: .6;
}
/* Hide hint on desktop (they already see the hover effect) */
@media (hover: hover) { .flip-hint { display: none; } }

/* ── Catalog wave carousel ── */
.catalog-wave {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  margin-top: 2.2rem;
}
.catalog-viewport {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  perspective: 1200px;
  touch-action: pan-y;
}
.catalog-track {
  position: relative;
  height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.catalog-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(290px, 68vw);
  aspect-ratio: 3 / 4;
  transform-origin: center 115%;
  transform: translate(-50%, -50%) translateX(var(--x, 0px)) rotate(var(--r, 0deg)) scale(var(--s, .72));
  opacity: var(--o, .28);
  z-index: var(--z, 1);
  transition: transform .55s cubic-bezier(.22,.75,.25,1), opacity .4s ease, filter .4s ease;
  filter: saturate(.7) brightness(.68);
  pointer-events: none;
}
.catalog-card.is-active {
  filter: saturate(1.05) brightness(1);
  pointer-events: auto;
}
.catalog-card-shell {
  height: 100%;
  overflow: hidden;
  border-radius: 24px;
  background: rgba(17, 9, 42, .94);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 24px 55px rgba(0,0,0,.35), 0 0 0 1px rgba(168,110,224,.08);
  cursor: pointer;
  transition: transform .3s ease, box-shadow .3s ease;
}
.catalog-card.is-active .catalog-card-shell:hover {
  transform: translateY(-8px);
  box-shadow: 0 32px 70px rgba(0,0,0,.45), 0 0 32px rgba(168,110,224,.25);
}
.catalog-cover {
  width: 100%;
  height: 72%;
  object-fit: cover;
  background: linear-gradient(135deg, #2b1654, #0f766e);
}
.catalog-card-body {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: .85rem 1rem 1rem;
  min-height: 28%;
}
.catalog-card-kicker {
  color: var(--gold-light);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.catalog-card-title {
  color: var(--text-primary);
  font-family: 'Baloo 2', cursive;
  font-size: 1.16rem;
  line-height: 1.1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.catalog-card-description {
  color: var(--text-muted);
  font-size: .78rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.catalog-card-badges {
  position: absolute;
  top: .8rem;
  left: .8rem;
  right: .8rem;
  display: flex;
  justify-content: space-between;
  gap: .4rem;
  pointer-events: none;
}
.catalog-badge {
  display: inline-flex;
  align-items: center;
  padding: .3rem .55rem;
  border-radius: 999px;
  background: rgba(10,6,24,.72);
  border: 1px solid rgba(255,255,255,.2);
  color: white;
  font-size: .68rem;
  font-weight: 800;
  backdrop-filter: blur(8px);
}
.catalog-arrow {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border: 1px solid rgba(168,110,224,.32);
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  color: var(--text-primary);
  font-size: 1.3rem;
  cursor: pointer;
  transition: var(--transition);
}
.catalog-arrow:hover:not(:disabled) {
  transform: translateY(-2px);
  background: rgba(168,110,224,.22);
  border-color: var(--purple-light);
}
.catalog-arrow:disabled { opacity: .35; cursor: default; }
.catalog-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: .8rem;
}
.catalog-dots { display: flex; align-items: center; gap: .38rem; }
.catalog-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  cursor: pointer;
  transition: var(--transition);
}
.catalog-dot.is-active {
  width: 24px;
  border-radius: 999px;
  background: var(--gold);
}
.catalog-count {
  color: var(--text-dim);
  font-size: .78rem;
  min-width: 60px;
  text-align: center;
}
.catalog-note {
  text-align: center;
  color: var(--text-dim);
  font-size: .82rem;
  margin-top: 1rem;
}
.catalog-loading,
.catalog-empty {
  align-self: center;
  color: var(--text-muted);
  text-align: center;
  padding: 2rem;
}
.rtl .catalog-card-kicker,
.rtl .catalog-card-title,
.rtl .catalog-card-description { text-align: right; }
.rtl .catalog-arrow-prev { order: 3; }
.rtl .catalog-arrow-next { order: 1; }

/* ── Story universe: an editorial, character-wave library ── */
.story-universe {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 8.5rem 0 7.5rem;
  background:
    radial-gradient(circle at 50% 42%, rgba(137, 81, 221, .22), transparent 29rem),
    linear-gradient(180deg, rgba(19, 10, 48, .3), rgba(8, 5, 21, .78));
}
.story-universe::before {
  content: '';
  position: absolute;
  inset: 1px 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 233, 145, .5), transparent);
}
.story-orbit {
  position: absolute;
  width: 36rem;
  aspect-ratio: 1;
  border: 1px solid rgba(245, 200, 66, .1);
  border-radius: 50%;
  z-index: -1;
}
.story-orbit-left { left: -26rem; top: 6rem; }
.story-orbit-right { right: -26rem; bottom: -12rem; }
.catalog-intro { max-width: 650px; margin: 0 auto; text-align: center; }
.catalog-eyebrow {
  margin: 1rem 0 .25rem;
  color: var(--gold-light);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.catalog-title {
  max-width: 610px;
  margin: 0 auto;
  font-family: 'Baloo 2', cursive;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 800;
  line-height: .98;
  letter-spacing: -.05em;
  text-wrap: balance;
}
.catalog-lede { max-width: 410px; margin: 1rem auto 0; color: var(--text-muted); font-size: 1.03rem; }
.catalog-wave { margin-top: 3rem; }
.catalog-viewport { min-height: 500px; height: 500px; overflow: visible; }
.catalog-track { height: 500px; overflow: hidden; border-radius: 36px; }
.catalog-track::before {
  content: '';
  position: absolute;
  left: 50%; bottom: 1.8rem;
  width: min(76%, 760px); height: 28px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(0,0,0,.58), transparent 67%);
  filter: blur(7px);
}
.catalog-card {
  width: min(270px, 64vw);
  height: 380px;
  transform: translate(-50%, -50%) translate(var(--x, 0px), var(--y, 0px)) rotate(var(--r, 0deg)) scale(var(--s, .7));
  transform-origin: center bottom;
  filter: saturate(.62) brightness(.62) blur(var(--blur, 0px));
  transition: transform .72s cubic-bezier(.16, 1, .3, 1), opacity .45s ease, filter .45s ease;
}
.catalog-card.is-active { filter: saturate(1.12) brightness(1.04); }
.catalog-card-shell {
  border-radius: 26px;
  border: 1px solid rgba(255,255,255,.18);
  background: #170d36;
  box-shadow: 0 30px 70px rgba(0,0,0,.48), inset 0 1px rgba(255,255,255,.15);
}
.catalog-card.is-active .catalog-card-shell { box-shadow: 0 35px 85px rgba(0,0,0,.6), 0 0 0 1px rgba(245,200,66,.23), 0 0 48px rgba(163, 93, 224, .26); }
.catalog-cover { height: 100%; object-position: center; }
.catalog-card-shell::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(180deg, transparent 52%, rgba(7, 3, 18, .74));
}
.catalog-card-body { position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; min-height: auto; padding: 1.15rem 1.2rem; }
.catalog-card-title { color: #fff; font-size: 1.22rem; text-shadow: 0 2px 12px rgba(0,0,0,.75); }
.catalog-arrow { position: relative; z-index: 3; width: 52px; height: 52px; flex-basis: 52px; border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.06); backdrop-filter: blur(12px); }
.catalog-arrow:hover:not(:disabled) { color: #160a35; background: var(--gold-light); border-color: var(--gold-light); }
.catalog-meta { margin-top: 1.4rem; }
.catalog-dot { background: rgba(255,255,255,.18); }
.catalog-dot.is-active { background: linear-gradient(90deg, var(--gold), var(--pink)); box-shadow: 0 0 14px rgba(245,200,66,.35); }
.catalog-note { margin-top: .7rem; }
@media (max-width: 700px) {
  .story-universe { padding: 6.5rem 0 5.5rem; }
  .catalog-viewport, .catalog-track { min-height: 420px; height: 420px; }
  .catalog-card { width: min(220px, 63vw); height: 315px; }
  .catalog-wave { gap: .4rem; }
  .catalog-arrow { width: 40px; height: 40px; flex-basis: 40px; }
}

/* ── FEATURES ── */
.features-section {
  padding: 80px 0;
  background: linear-gradient(180deg, transparent 0%, rgba(61,27,110,0.1) 50%, transparent 100%);
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}
.feature-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(168,110,224,0.12);
  border-radius: var(--radius-card);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(168,110,224,0.08) 0%, transparent 60%);
  opacity: 0;
  transition: var(--transition);
}
.feature-card:hover {
  transform: translateY(-6px);
  border-color: rgba(168,110,224,0.3);
  background: rgba(255,255,255,0.06);
}
.feature-card:hover::before { opacity: 1; }
.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  filter: drop-shadow(0 4px 12px rgba(168,110,224,0.4));
  transition: var(--transition);
}
.feature-card:hover .feature-icon {
  transform: scale(1.15) rotate(-5deg);
  filter: drop-shadow(0 4px 20px rgba(168,110,224,0.7));
}
.feature-title {
  font-family: 'Baloo 2', cursive;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: .5rem;
}
.feature-desc {
  font-size: .85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── DOWNLOAD ── */
.download-section {
  position: relative;
  padding: 100px 0;
  overflow: hidden;
}
.download-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(106,53,176,0.25) 0%, transparent 65%);
  pointer-events: none;
}
.download-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4rem;
  align-items: center;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(168,110,224,0.2);
  border-radius: 28px;
  padding: 3rem;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-glow);
}
.download-title {
  font-family: 'Baloo 2', cursive;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: .8rem;
  line-height: 1.2;
}
.download-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 1.8rem;
  max-width: 420px;
}
.play-badge {
  height: 48px;
  width: auto;
  transition: var(--transition);
  border-radius: 8px;
}
.play-badge:hover { transform: translateY(-3px) scale(1.03); filter: brightness(1.1); }

/* QR Card */
.qr-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .8rem;
}
.qr-frame {
  background: white;
  border-radius: 18px;
  padding: .8rem;
  box-shadow: 0 0 0 3px rgba(168,110,224,0.3), 0 8px 30px rgba(100,50,200,0.3);
  transition: var(--transition);
}
.qr-frame:hover {
  transform: scale(1.05);
  box-shadow: 0 0 0 4px rgba(168,110,224,0.5), 0 12px 40px rgba(100,50,200,0.4);
}
.qr-frame img { border-radius: 10px; }
.qr-label {
  font-size: .88rem;
  color: var(--text-muted);
  font-weight: 600;
  text-align: center;
}

/* ── FOOTER ── */
.footer {
  padding: 2.5rem 0;
  border-top: 1px solid rgba(168,110,224,0.12);
  background: rgba(0,0,0,0.2);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .8rem;
  text-align: center;
}
.footer-logo {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-family: 'Baloo 2', cursive;
  font-size: 1.4rem;
  font-weight: 800;
}
.footer-tagline {
  font-size: .95rem;
  color: var(--text-muted);
}
.footer-links { display: flex; gap: 1.5rem; }
.footer-link {
  font-size: .85rem;
  color: var(--text-dim);
  font-weight: 600;
  transition: var(--transition);
}
.footer-link:hover { color: var(--purple-light); }
.footer-copy {
  font-size: .8rem;
  color: var(--text-dim);
}

/* ── ANIMATIONS ── */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Intersection Observer scroll animations */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .6s ease, transform .6s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* RTL support for Arabic */
.rtl { direction: rtl; text-align: right; }
.rtl .hero-cta-group { flex-direction: row-reverse; }
.rtl .hero-languages { flex-direction: row-reverse; }
.rtl .story-langs    { flex-direction: row-reverse; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }
  .hero-visual { height: 350px; }
  .hero-subtitle { margin: 0 auto 2rem; }
  .hero-cta-group { justify-content: center; }
  .hero-languages { justify-content: center; }
  .hero-badge { margin: 0 auto 1.2rem; }

  .download-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }
  .download-subtitle { margin: 0 auto 1.8rem; }
  .download-qr { display: flex; justify-content: center; }
}
@media (max-width: 600px) {
  .nav { gap: .5rem; }
  .play-badge-small { height: 28px; }
  .lang-btn { padding: .25rem .5rem; font-size: .75rem; }
  .flip-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .featured-flip { transform: none; }
  .features-grid { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .download-inner { padding: 1.8rem; }
  .hero-card-stack { width: 220px; height: 300px; }
  .card-front { width: 200px; height: 270px; }
  .card-mid   { width: 195px; height: 260px; }
  .card-back  { width: 185px; height: 245px; }
  .catalog-wave { gap: .5rem; }
  .catalog-viewport, .catalog-track { min-height: 500px; height: 500px; }
  .catalog-card { width: min(250px, 68vw); }
}
@media (max-width: 400px) {
  .flip-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .catalog-arrow { width: 38px; height: 38px; flex-basis: 38px; font-size: 1.05rem; }
  .catalog-viewport, .catalog-track { min-height: 460px; height: 460px; }
  .catalog-card { width: min(220px, 65vw); }
}

/* Keep the story-wave deliberately spacious on compact screens. */
@media (max-width: 600px) {
  .catalog-viewport, .catalog-track { min-height: 420px; height: 420px; }
  .catalog-card { width: min(218px, 62vw); height: 310px; }
  .catalog-card-body { padding: .9rem 1rem; }
}

/* Preserve the three-column carousel geometry in RTL; motion itself mirrors in JS. */
.rtl .catalog-arrow-prev, .rtl .catalog-arrow-next { order: initial; }
