:root {
  --bg-body: #f5f5f7;
  --text-main: #1d1d1f;
  --text-sub: #86868b;
  --card-bg: #ffffff;
  --nav-bg: rgba(255, 255, 255, 0.8);
  --modal-bg: rgba(255, 255, 255, 0.95);
  --border-color: rgba(0, 0, 0, 0.1);
}

.dark {
  --bg-body: #000000;
  --text-main: #f5f5f7;
  --text-sub: #86868b;
  --card-bg: #161617;
  --nav-bg: rgba(22, 22, 23, 0.8);
  --modal-bg: rgba(22, 22, 23, 0.95);
  --border-color: rgba(255, 255, 255, 0.1);
}

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  overflow-x: hidden;
  font-family: "Inter", sans-serif;
  transition:
    background-color 0.5s ease,
    color 0.5s ease;
}

/* Film Grain Texture */
.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Custom Selection Color */
::selection {
  background-color: #2997ff;
  color: white;
}

/* Hide scrollbar */
::-webkit-scrollbar {
  width: 0px;
  background: transparent;
}

/* Sticky Animation Containers */
.scroll-section {
  height: 300vh;
  position: relative;
}

.sticky-content {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: var(--bg-body);
  transition: background-color 0.5s ease;
}

/* Nav Blur */
.glass-nav {
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(134, 134, 139, 0.1);
  transition: background 0.5s ease;
}

/* Grid Items & Spotlight Effect */
.spotlight-group {
  position: relative;
}

.grid-item {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 40px;
  opacity: 0;
  transform: scale(0.95);
  transition:
    opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

/* The Spotlight Glow */
.grid-item::before {
  content: "";
  position: absolute;
  height: 100%;
  width: 100%;
  top: 0;
  left: 0;
  background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y),
      rgba(41, 151, 255, 0.08),
      transparent 40%);
  z-index: 2;
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
  background-attachment: fixed;
  /* Fix for some browsers, though JS updates vars */
}

/* Correction for spotlight to follow properly with JS */
.grid-item::before {
  background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y),
      rgba(41, 151, 255, 0.08),
      transparent 40%);
}

.grid-item:hover::before {
  opacity: 1;
}

.grid-item.visible {
  opacity: 1;
  transform: scale(1);
}

/* Product Visuals */
.product-chip {
  width: 200px;
  height: 200px;
  background: #1a1a1a;
  border-radius: 40px;
  position: relative;
  box-shadow:
    inset 0 0 20px rgba(0, 0, 0, 1),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  background: var(--card-bg);
  border-radius: 24px;
  overflow-y: auto;
  transform: translateY(50px) scale(0.95);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(134, 134, 139, 0.2);
}

.modal-overlay.active .modal-content {
  transform: translateY(0) scale(1);
}

/* Screenshot placeholder */
.screenshot-box {
  background: var(--bg-body);
  border: 1px solid rgba(134, 134, 139, 0.2);
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-sub);
  font-family: monospace;
  position: relative;
  transition: transform 0.3s ease;
}

.screenshot-box:hover {
  transform: scale(1.02);
}

.theme-toggle {
  width: 48px;
  height: 28px;
  background: #e5e5e5;
  border-radius: 20px;
  position: relative;
  cursor: pointer;
  transition: background 0.3s;
}

.dark .theme-toggle {
  background: #333;
}

.toggle-dot {
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 4px;
  left: 4px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.dark .toggle-dot {
  transform: translateX(20px);
  background: #000;
}

/* Text Blur Reveal Animation */
.blur-reveal {
  filter: blur(10px);
  opacity: 0;
  transform: translateY(20px);
  transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.blur-visible {
  filter: blur(0);
  opacity: 1;
  transform: translateY(0);
}

/* Mobile Menu Active State */
#mobile-menu.active {
  transform: translateX(0);
}