:root {
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif;
  --background: 246 44% 8%;
  --foreground: 224 55% 96%;
  --card: 246 38% 12%;
  --card-foreground: 224 55% 96%;
  --popover: 246 40% 10%;
  --popover-foreground: 224 55% 96%;
  --primary: 265 91% 66%;
  --primary-foreground: 0 0% 100%;
  --secondary: 228 54% 20%;
  --secondary-foreground: 224 55% 96%;
  --muted: 246 28% 18%;
  --muted-foreground: 226 28% 76%;
  --accent: 190 95% 56%;
  --accent-foreground: 244 46% 9%;
  --destructive: 0 76% 58%;
  --destructive-foreground: 0 0% 100%;
  --success: 150 70% 45%;
  --success-foreground: 246 44% 8%;
  --warning: 38 92% 56%;
  --warning-foreground: 246 44% 8%;
  --info: 210 92% 62%;
  --info-foreground: 246 44% 8%;
  --border: 244 34% 24%;
  --input: 244 34% 24%;
  --ring: 190 95% 56%;
  --radius: 0.625rem;
  --shadow-sm: 0 1px 2px hsl(var(--foreground) / 0.05);
  --shadow-md: 0 4px 12px hsl(var(--foreground) / 0.08);
  --shadow-lg: 0 12px 32px hsl(var(--foreground) / 0.12);
  --shadow-elegant: 0 24px 80px hsl(var(--primary) / 0.34), 0 0 80px hsl(var(--accent) / 0.18);
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.dark {
  --background: 246 44% 8%;
  --foreground: 224 55% 96%;
  --card: 246 38% 12%;
  --card-foreground: 224 55% 96%;
  --popover: 246 40% 10%;
  --popover-foreground: 224 55% 96%;
  --primary: 265 91% 66%;
  --primary-foreground: 0 0% 100%;
  --secondary: 228 54% 20%;
  --secondary-foreground: 224 55% 96%;
  --muted: 246 28% 18%;
  --muted-foreground: 226 28% 76%;
  --accent: 190 95% 56%;
  --accent-foreground: 244 46% 9%;
  --border: 244 34% 24%;
  --input: 244 34% 24%;
  --ring: 190 95% 56%;
}

html {
  scroll-behavior: smooth;
  background: hsl(var(--background));
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: hsl(var(--foreground));
  background:
    radial-gradient(circle at 20% 8%, hsl(var(--primary) / 0.24), transparent 32rem),
    radial-gradient(circle at 84% 18%, hsl(var(--accent) / 0.18), transparent 28rem),
    linear-gradient(135deg, hsl(246 44% 8%), hsl(248 42% 12%) 46%, hsl(230 58% 10%));
  overflow-x: hidden;
}

button, input, textarea, select {
  font: inherit;
}

textarea, input {
  font-size: max(16px, 1rem);
}

.ppt-slide {
  position: relative;
  isolation: isolate;
}

.ppt-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent, hsl(var(--accent) / 0.05), transparent);
  transform: translateX(-80%);
  animation: slide-shine 9s ease-in-out infinite;
  z-index: -1;
}

.glass-panel {
  background: linear-gradient(145deg, hsl(var(--card) / 0.86), hsl(var(--secondary) / 0.48));
  border: 1px solid hsl(var(--border));
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(20px);
}

.hero-orb {
  position: absolute;
  border-radius: 9999px;
  filter: blur(18px);
  opacity: 0.58;
  animation: float-orb 7s ease-in-out infinite;
}

.deck-stage {
  perspective: 1200px;
  transform-style: preserve-3d;
}

.deck-card-3d {
  transform-style: preserve-3d;
  animation: deck-float 6s ease-in-out infinite;
}

.slide-card {
  transform: rotateX(58deg) rotateZ(-28deg) translateZ(0);
  box-shadow: var(--shadow-elegant);
}

.slide-card:nth-child(2) {
  transform: rotateX(58deg) rotateZ(-28deg) translate3d(24px, -28px, -40px);
  opacity: 0.72;
}

.slide-card:nth-child(3) {
  transform: rotateX(58deg) rotateZ(-28deg) translate3d(48px, -56px, -80px);
  opacity: 0.42;
}

.typing-caret::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 4px;
  vertical-align: -0.12em;
  background: hsl(var(--accent));
  animation: caret-blink 900ms steps(2) infinite;
}

.motion-grid {
  background-image:
    linear-gradient(hsl(var(--foreground) / 0.06) 1px, transparent 1px),
    linear-gradient(90deg, hsl(var(--foreground) / 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, transparent, black 18%, black 82%, transparent);
}

.mobile-bottom-nav {
  padding-bottom: env(safe-area-inset-bottom);
}

@keyframes deck-float {
  0%, 100% { transform: translateY(0) rotateY(-8deg); }
  50% { transform: translateY(-16px) rotateY(8deg); }
}

@keyframes float-orb {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(18px, -24px, 0) scale(1.08); }
}

@keyframes caret-blink {
  0%, 45% { opacity: 1; }
  46%, 100% { opacity: 0; }
}

@keyframes slide-shine {
  0%, 55% { transform: translateX(-80%); }
  75%, 100% { transform: translateX(80%); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
