/* ============================================
   LUXSTAGE — Design System CSS
   "The Digital Curator" Aesthetic
   ============================================ */

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
  --surface: #131313;
  --surface-dim: #131313;
  --surface-container-lowest: #0e0e0e;
  --surface-container-low: #1c1b1b;
  --surface-container: #201f1f;
  --surface-container-high: #2a2a2a;
  --surface-container-highest: #353534;
  --on-surface: #e5e2e1;
  --on-surface-variant: #c3c5d9;
  --on-background: #e5e2e1;
  --primary: #b7c4ff;
  --primary-container: #0052ff;
  --on-primary: #002682;
  --on-primary-container: #dfe3ff;
  --secondary: #b7c4ff;
  --outline: #8d90a2;
  --outline-variant: #434656;
  --error: #ffb4ab;
  --error-container: #93000a;
  --gradient-primary: linear-gradient(135deg, #0052ff 0%, #002682 100%);
  --shadow-ambient: 0 20px 40px rgba(0,0,0,0.4), 0 0 1px rgba(183,196,255,0.1);
  --font-headline: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Inter', sans-serif;
}

/* --- Base Reset & Defaults --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--surface);
  color: var(--on-surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  overflow-x: hidden;
}

::selection {
  background: var(--primary-container);
  color: white;
}

/* --- Japanese Text Optimization --- */
.jp-text, [lang="ja"] .jp-text {
  font-feature-settings: "palt";
}

/* --- Perspective Grid Background --- */
.perspective-grid {
  background-image: radial-gradient(circle, rgba(183, 196, 255, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* --- Glassmorphism Cards --- */
.glass-card {
  background: rgba(42, 42, 42, 0.4);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

/* --- Signature Gradient --- */
.gradient-btn {
  background: var(--gradient-primary);
  color: var(--on-primary-container);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.gradient-btn:hover {
  box-shadow: 0 0 20px rgba(0, 82, 255, 0.4);
  filter: brightness(1.1);
}

.gradient-btn:active {
  transform: scale(0.95);
}

/* --- Glass Navigation --- */
.glass-nav {
  background: rgba(19, 19, 19, 0.7);
  backdrop-filter: blur(48px);
  -webkit-backdrop-filter: blur(48px);
  box-shadow: var(--shadow-ambient);
}

/* --- Text Glow Effect --- */
.text-glow {
  text-shadow: 0 0 20px rgba(183, 196, 255, 0.3);
}

/* ============================================
   MOBILE HAMBURGER MENU
   ============================================ */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 60;
  gap: 5px;
}

.mobile-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: white;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 14, 14, 0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 45;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.mobile-nav-overlay a {
  font-family: var(--font-headline);
  font-size: 1.5rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  letter-spacing: -0.02em;
  transition: color 0.3s ease;
  text-transform: uppercase;
}

.mobile-nav-overlay a:hover,
.mobile-nav-overlay a.active {
  color: white;
}

.mobile-nav-overlay .lang-switch {
  display: flex;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(67, 70, 86, 0.3);
  margin-top: 1rem;
}

.mobile-nav-overlay .lang-switch button {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  transition: all 0.3s ease;
}

.mobile-nav-overlay .lang-switch button.active {
  color: var(--primary);
  background: rgba(183, 196, 255, 0.1);
}

/* ============================================
   STICKY MOBILE CTA
   ============================================ */
.sticky-cta {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  padding: 0.75rem 1rem;
  background: rgba(14, 14, 14, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(67, 70, 86, 0.2);
}

.sticky-cta button {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 0.375rem;
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-up-delay-1 { transition-delay: 0.1s; }
.fade-up-delay-2 { transition-delay: 0.2s; }
.fade-up-delay-3 { transition-delay: 0.3s; }
.fade-up-delay-4 { transition-delay: 0.4s; }

/* ============================================
   RESPONSIVE — MOBILE FIRST
   ============================================ */

/* Mobile (default — < 768px) */
@media (max-width: 767px) {
  .mobile-menu-btn {
    display: flex;
  }

  .desktop-nav {
    display: none !important;
  }

  .desktop-cta-nav {
    display: none !important;
  }

  .sticky-cta {
    display: block;
  }

  /* Ensure body has bottom padding for sticky CTA */
  body {
    padding-bottom: 80px;
  }

  /* Reduce hero text for mobile readability */
  .hero-headline {
    font-size: 2.25rem !important;
    line-height: 1.1 !important;
  }

  .hero-sub {
    font-size: 1rem !important;
  }

  /* Reduce section padding on mobile */
  .section-padding {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }

  /* Stack grid items on mobile */
  .bento-grid {
    grid-template-columns: 1fr !important;
  }

  /* Improve form touch targets */
  input, textarea, select, button {
    min-height: 44px;
    font-size: 16px;  /* prevent zoom on iOS */
  }
}

/* Tablet (768px+) */
@media (min-width: 768px) {
  .mobile-menu-btn {
    display: none;
  }

  .desktop-nav {
    display: flex !important;
  }

  .sticky-cta {
    display: none !important;
  }

  .section-padding {
    padding-top: 8rem;
    padding-bottom: 8rem;
  }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
  .hero-headline {
    font-size: 4.5rem !important;
  }
}

/* ============================================
   FORM STYLES
   ============================================ */
.form-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--outline-variant);
  padding: 0.75rem 0;
  color: white;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s ease;
}

.form-input:focus {
  border-bottom-color: var(--primary-container);
  border-bottom-width: 2px;
}

.form-input::placeholder {
  color: rgba(255, 255, 255, 0.15);
}

.form-label {
  display: block;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--on-surface-variant);
  margin-bottom: 0.5rem;
  transition: color 0.3s ease;
}

.form-group:focus-within .form-label {
  color: var(--primary);
}

/* ============================================
   UTILITY ANIMATIONS
   ============================================ */
@keyframes pulse-glow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

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

.animate-float {
  animation: float 6s ease-in-out infinite;
}

/* ============================================
   LANGUAGE SWITCHER
   ============================================ */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.lang-switcher button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  transition: color 0.3s ease;
}

.lang-switcher button.active {
  color: var(--primary);
}

.lang-switcher button:not(.active) {
  color: rgba(255, 255, 255, 0.4);
}

.lang-switcher button:not(.active):hover {
  color: white;
}

.lang-divider {
  color: rgba(255, 255, 255, 0.2);
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .glass-nav, .sticky-cta, .mobile-nav-overlay, .scroll-to-top-btn {
    display: none !important;
  }
  body {
    background: white;
    color: black;
    padding-bottom: 0;
  }
}

/* ============================================
   SCROLL TO TOP BUTTON
   ============================================ */
.scroll-to-top-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--surface-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  border: none;
}

.scroll-to-top-btn.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top-btn:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 16px rgba(183, 196, 255, 0.4);
}

@media (max-width: 768px) {
  .scroll-to-top-btn {
    bottom: 80px; /* Above the mobile sticky CTA */
    right: 16px;
    width: 44px;
    height: 44px;
  }
}
