:root {
  color-scheme: dark;
}

/* Subtle noise + glow helpers (works with Tailwind classes above). */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -9;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

.glass-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow:
    0 0 0 1px rgba(2, 132, 199, 0.08) inset,
    0 20px 60px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.feature-card {
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease, background 220ms ease;
}
.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.22);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.18) inset,
    0 30px 80px rgba(0, 0, 0, 0.55);
}

/* Navbar subtle shadow when scrolled */
.nav-elevated {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55);
}

/* 3D laptop */
.laptop-scene {
  perspective: 1200px;
  perspective-origin: 50% 40%;
}

.laptop {
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(8deg) rotateY(-16deg);
  animation: floaty 6s ease-in-out infinite;
}

.lid {
  position: relative;
  transform-style: preserve-3d;
  transform-origin: bottom center;
  transform: translateZ(18px) rotateX(-6deg);
}

.screen {
  position: relative;
  width: min(720px, 92vw);
  aspect-ratio: 16 / 10;
  margin: 0 auto;
  border-radius: 26px;
  overflow: hidden;
  background: radial-gradient(circle at 30% 20%, rgba(56, 189, 248, 0.18), transparent 45%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 40px 120px rgba(0, 0, 0, 0.70),
    0 0 90px rgba(56, 189, 248, 0.18);
}

.screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.16), transparent 35%, rgba(255, 255, 255, 0.07));
  opacity: 0.55;
  pointer-events: none;
}

.screen-media {
  position: absolute;
  inset: 8px;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  object-fit: cover;
  border-radius: 20px;
  filter: saturate(1.05) contrast(1.04);
}

.screen-overlay {
  position: absolute;
  inset: 8px;
  border-radius: 20px;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.30), transparent 24%, transparent 76%, rgba(15, 23, 42, 0.38)),
    radial-gradient(circle at 80% 20%, rgba(56, 189, 248, 0.18), transparent 40%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

.base {
  position: relative;
  width: min(760px, 96vw);
  height: 76px;
  margin: -18px auto 0;
  border-radius: 0 0 28px 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 40px 100px rgba(0, 0, 0, 0.65);
  transform: translateZ(0);
}

.base-highlight {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 30% 20%, rgba(56, 189, 248, 0.16), transparent 55%);
  pointer-events: none;
}

.trackpad {
  position: absolute;
  left: 50%;
  top: 18px;
  width: min(190px, 36vw);
  height: 42px;
  transform: translateX(-50%);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.30);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.08) inset;
}

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

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .feature-card,
  .laptop {
    transition: none !important;
    animation: none !important;
  }
}

/* Small screens: reduce 3D tilt */
@media (max-width: 640px) {
  .laptop {
    transform: rotateX(6deg) rotateY(-10deg);
  }
}

/* Progressive scroll animations */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

.fade-in-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.fade-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.fade-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.scale-in {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger animation delays */
.fade-in:nth-child(1) { transition-delay: 0.1s; }
.fade-in:nth-child(2) { transition-delay: 0.2s; }

/* Disable animations for reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .fade-in,
  .fade-in-left,
  .fade-in-right,
  .scale-in {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}