@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --bg-gradient: radial-gradient(circle at 50% 50%, #1e1233 0%, #0d0818 100%);
  --card-bg: rgba(255, 255, 255, 0.03);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-glow: rgba(138, 79, 255, 0.15);
  
  --text-main: #f5f3f7;
  --text-muted: #a9a3b8;
  
  --accent-gold: #e5c158;
  --accent-gold-glow: rgba(229, 193, 88, 0.4);
  --accent-purple: #9c73e6;
  --accent-purple-glow: rgba(156, 115, 230, 0.4);
  
  --font-display: 'Cinzel', serif;
  --font-sans: 'Inter', sans-serif;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
}

/* Subtle background stars/particles */
body::before, body::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  background-image: 
    radial-gradient(circle, rgba(255,255,255,0.15) 1px, transparent 1px),
    radial-gradient(circle, rgba(255,255,255,0.08) 1.5px, transparent 1.5px);
  background-size: 80px 80px, 200px 200px;
  background-position: 0 0, 40px 40px;
  opacity: 0.3;
  animation: backgroundShift 120s linear infinite;
}

body::after {
  background-size: 150px 150px, 350px 350px;
  background-position: 20px 20px, 100px 100px;
  opacity: 0.15;
  animation: backgroundShiftReverse 180s linear infinite;
}

@keyframes backgroundShift {
  from { background-position: 0 0, 40px 40px; }
  to { background-position: 1000px 1000px, 1040px 1040px; }
}

@keyframes backgroundShiftReverse {
  from { background-position: 20px 20px, 100px 100px; }
  to { background-position: -1000px 1000px, -900px 1100px; }
}

/* Glow Orbs in background */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  z-index: 0;
  pointer-events: none;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: rgba(138, 79, 255, 0.12);
  top: -100px;
  left: -100px;
  animation: floatOrb 20s ease-in-out infinite alternate;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: rgba(229, 193, 88, 0.08);
  bottom: -150px;
  right: -150px;
  animation: floatOrb 25s ease-in-out infinite alternate-reverse;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(50px, 50px) scale(1.1); }
}

/* Main Container */
.container {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px;
  width: 100%;
  max-width: 550px;
}

/* Glassmorphic Portal Card */
.portal-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 48px 32px;
  width: 100%;
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 40px var(--card-glow);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  animation: floatCard 6s ease-in-out infinite;
}

@keyframes floatCard {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.portal-card:hover {
  transform: translateY(-16px) scale(1.02);
  border-color: rgba(229, 193, 88, 0.3);
  box-shadow: 
    0 30px 60px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 50px rgba(229, 193, 88, 0.15);
}

/* Book Icon Container & SVG Animations */
.book-icon-wrapper {
  margin-bottom: 32px;
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.book-icon-wrapper::after {
  content: '';
  position: absolute;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-purple-glow) 0%, transparent 70%);
  z-index: -1;
  opacity: 0.6;
  transition: all 0.5s ease;
}

.portal-card:hover .book-icon-wrapper::after {
  transform: scale(1.3);
  background: radial-gradient(circle, var(--accent-gold-glow) 0%, transparent 70%);
  opacity: 0.8;
}

/* Book SVG Styling & Animations */
.book-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.5));
}

.book-cover {
  fill: #2d1b4e;
  stroke: var(--accent-gold);
  stroke-width: 2.5;
  transition: all 0.5s ease;
}

.book-pages {
  fill: #fdfbf7;
  stroke: #4a3672;
  stroke-width: 1;
}

.book-gold-details {
  fill: none;
  stroke: var(--accent-gold);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: all 0.5s ease;
}

/* Animated book bookmark */
.book-bookmark {
  fill: #bf3f5a;
  transform-origin: top center;
  animation: bookmarkWiggle 4s ease-in-out infinite;
}

@keyframes bookmarkWiggle {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(5deg); }
}

/* Page flip simulation on hover */
.book-page-flip {
  transform-origin: center left;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.portal-card:hover .book-page-flip {
  transform: scaleX(0.1) skewY(-10deg);
}

.portal-card:hover .book-cover {
  fill: #392264;
}

/* App Branding on Portal */
.title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 600;
  letter-spacing: 2px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--text-main) 30%, var(--accent-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: all 0.5s ease;
}

.portal-card:hover .title {
  background: linear-gradient(135deg, #ffffff 0%, var(--accent-gold) 70%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 15px rgba(229, 193, 88, 0.2);
}

.subtitle {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text-muted);
  letter-spacing: 4px;
  text-transform: uppercase;
  font-weight: 400;
  margin-bottom: 32px;
}

/* Action Button */
.enter-button {
  background: linear-gradient(135deg, #7c44e3 0%, #5627a8 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 14px 36px;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 
    0 4px 15px rgba(124, 68, 227, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.enter-button span {
  transition: transform 0.3s ease;
}

.portal-card:hover .enter-button {
  background: linear-gradient(135deg, var(--accent-gold) 0%, #c49f3b 100%);
  box-shadow: 
    0 6px 20px rgba(229, 193, 88, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  color: #120a22;
  border-color: rgba(255, 255, 255, 0.2);
}

.portal-card:hover .enter-button span {
  transform: translateX(4px);
}

/* Footer styling */
.footer {
  margin-top: 48px;
  font-size: 0.75rem;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.25);
  font-weight: 300;
}

/* Floating Language Switcher */
.lang-switcher {
  position: fixed;
  top: 24px;
  right: 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 6px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 100;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.lang-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.lang-btn:hover {
  color: var(--text-main);
}

.lang-btn.active {
  color: var(--accent-gold);
  font-weight: 600;
  text-shadow: 0 0 8px rgba(229, 193, 88, 0.4);
}

.lang-divider {
  color: rgba(255, 255, 255, 0.15);
  font-size: 0.8rem;
  user-select: none;
}
