/* Apple-Inspired System Fonts Stack */
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Dynamic CSS Variables (Default Light Mode) */
:root {
  --bg-main: #FFFFFF;
  --surface-main: #F5F5F7;
  --surface-card: #FFFFFF;
  --text-main: #1D1D1F;
  --text-secondary: #86868B;
  --border-main: rgba(0, 0, 0, 0.05);
  --card-glow: rgba(0, 0, 0, 0.02);
  --radial-bg: radial-gradient(circle at 50% 50%, rgba(245, 245, 247, 0.5) 0%, rgba(255, 255, 255, 1) 100%);
  --timeline-line: rgba(0, 0, 0, 0.06);
  --accent-blue: #000000;
  --accent-rgb: 0, 0, 0;
  --cursor-dot-color: #1D1D1F;
  --cursor-glow-border: rgba(0, 0, 0, 0.12);
  --cursor-glow-bg: rgba(0, 0, 0, 0.01);
}

/* Dark Mode Overrides */
.dark {
  --bg-main: #000000;
  --surface-main: #161617;
  --surface-card: #1D1D1F;
  --text-main: #F5F5F7;
  --text-secondary: #86868B;
  --border-main: rgba(255, 255, 255, 0.08);
  --card-glow: rgba(255, 255, 255, 0.02);
  --radial-bg: radial-gradient(circle at 50% 50%, rgba(22, 22, 23, 0.5) 0%, rgba(0, 0, 0, 1) 100%);
  --timeline-line: rgba(255, 255, 255, 0.1);
  --accent-blue: #FFFFFF;
  --accent-rgb: 255, 255, 255;
  --cursor-dot-color: #FFFFFF;
  --cursor-glow-border: rgba(255, 255, 255, 0.2);
  --cursor-glow-bg: rgba(255, 255, 255, 0.02);
}

/* Global Adjustments */
html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  transition: background-color 0.4s cubic-bezier(0.25, 1, 0.5, 1), color 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  overflow-x: hidden;
}

/* Custom Scrollbar - Apple style */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 20px;
  border: 2px solid var(--bg-main);
}
.dark ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}
.dark ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.45);
}

/* Hide Default Cursor on Desktop */
@media (pointer: fine) {
  body:not(.navigating), body:not(.navigating) a, body:not(.navigating) button, body:not(.navigating) input, body:not(.navigating) select, body:not(.navigating) textarea, body:not(.navigating) [role="button"], body:not(.navigating) label {
    cursor: none !important;
  }
}

body.navigating * {
  cursor: auto !important;
}

body.navigating #cursor-dot, body.navigating #cursor-glow {
  display: none !important;
}

/* Minimal Custom Cursor */
.custom-cursor-dot {
  width: 6px;
  height: 6px;
  background: var(--cursor-dot-color);
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  transition: width 0.15s ease, height 0.15s ease, background-color 0.15s ease;
  display: none;
}

.custom-cursor-glow {
  width: 28px;
  height: 28px;
  border: 1px solid var(--cursor-glow-border);
  background: var(--cursor-glow-bg);
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.08s cubic-bezier(0.25, 1, 0.5, 1), width 0.15s ease, height 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
  display: none;
}

@media (pointer: fine) {
  .custom-cursor-dot, .custom-cursor-glow {
    display: block;
  }
}

/* Hover States */
.cursor-hover-active .custom-cursor-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-blue);
}
.cursor-hover-active .custom-cursor-glow {
  width: 44px;
  height: 44px;
  border-color: var(--accent-blue);
  background: rgba(var(--accent-rgb), 0.03);
}

/* Page Loader */
.loader-wrapper {
  position: fixed;
  inset: 0;
  background: #FFFFFF;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 0.6s cubic-bezier(0.25, 1, 0.5, 1), visibility 0.6s;
}
.dark .loader-wrapper {
  background: #000000;
}
.loader-wrapper.fade-out {
  opacity: 0;
  visibility: hidden;
}

/* Scroll Progress */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--accent-blue);
  z-index: 10001;
  width: 0%;
}

/* Clean Grid Overlay */
.grid-bg {
  position: absolute;
  inset: 0;
  background-size: 80px 80px;
  background-image: 
    linear-gradient(to right, var(--border-main) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border-main) 1px, transparent 1px);
  mask-image: radial-gradient(ellipse at center, black, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black, transparent 70%);
  z-index: 0;
  pointer-events: none;
}

/* Very Subtle Ambient Lights (Low Opacity) */
.aurora-blur {
  position: absolute;
  filter: blur(160px);
  opacity: 0.06;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.dark .aurora-blur {
  opacity: 0.08;
}

.aurora-1 {
  background: radial-gradient(circle, var(--accent-blue) 0%, transparent 80%);
  animation: drift-1 25s ease-in-out infinite alternate;
}

.aurora-2 {
  background: radial-gradient(circle, #7C3AED 0%, transparent 80%);
  animation: drift-2 30s ease-in-out infinite alternate-reverse;
}

@keyframes drift-1 {
  0% { transform: translate(-10%, -10%) scale(1); }
  100% { transform: translate(10%, 10%) scale(1.15); }
}
@keyframes drift-2 {
  0% { transform: translate(10%, 20%) scale(1.1); }
  100% { transform: translate(-10%, -20%) scale(0.9); }
}

/* Premium Minimal Cards */
.glass-card {
  background: var(--surface-card);
  border: 1px solid var(--border-main);
  box-shadow: 0 4px 24px 0 rgba(0, 0, 0, 0.015);
  transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  position: relative;
  overflow: hidden;
}

.glass-card:hover {
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.04);
  transform: translateY(-2px);
}

.dark .glass-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25);
}

/* Minimal Spotlight Card Hover */
.spotlight-glow {
  position: absolute;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.03) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.spotlight-card:hover .spotlight-glow {
  opacity: 1;
}

/* 3D Tilt Card */
.tilt-card {
  transform-style: preserve-3d;
  perspective: 1000px;
}
.tilt-inner {
  transform: translateZ(15px);
}



/* Marquee Loop */
@keyframes marquee {
  0% { transform: translateX(0%); }
  100% { transform: translateX(-50%); }
}

.marquee-container {
  overflow: hidden;
  position: relative;
  width: 100%;
}

.marquee-content {
  display: flex;
  width: max-content;
  animation: marquee 40s linear infinite;
}

.marquee-content:hover {
  animation-play-state: paused;
}

/* Minimal Vertical Timeline */
.timeline-container {
  position: relative;
}
.timeline-line {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--timeline-line);
  z-index: 0;
}
.timeline-line-progress {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  width: 1px;
  background: var(--accent-blue);
  z-index: 1;
  height: 0%;
  transition: height 0.1s linear;
}
@media (max-width: 768px) {
  .timeline-line, .timeline-line-progress {
    left: 20px;
    transform: none;
  }
}

/* Git Grid activity styling - clean neutral boxes */
.git-grid-container {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  gap: 3px;
}
.git-cell {
  aspect-ratio: 1;
  border-radius: 1px;
  background-color: rgba(0, 0, 0, 0.03);
  transition: background-color 0.3s ease, transform 0.2s ease;
}
.dark .git-cell {
  background-color: rgba(255, 255, 255, 0.03);
}

/* Terminal Typing Window Styles */
.terminal-window {
  font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
}
.terminal-cursor {
  display: inline-block;
  width: 6px;
  height: 14px;
  background: var(--accent-blue);
  margin-left: 3px;
  animation: blink 1s infinite;
  vertical-align: middle;
}
@keyframes blink {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

/* Apple inputs */
.glass-input {
  background: #FFFFFF;
  border: 1px solid var(--border-main);
  color: var(--text-main);
  outline: none;
  transition: all 0.3s ease;
}
.dark .glass-input {
  background: #1D1D1F;
}
.glass-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.08);
  background: #FFFFFF;
}
.dark .glass-input:focus {
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.12);
  background: #1D1D1F;
}

/* Testimonial sliding gaps */
.testimonial-carousel {
  display: flex;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Back to top button */
.back-to-top {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
}
.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

/* Cookie consent slide */
.cookie-consent {
  transform: translateY(150%);
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}
.cookie-consent.show {
  transform: translateY(0);
}

/* Magnetic adjustment */
.magnetic-btn {
  display: inline-block;
  transition: transform 0.18s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Fade up elements */
.fade-up-init {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}
.fade-up-active {
  opacity: 1;
  transform: translateY(0);
}

/* Phone and web dash previews */
.dashboard-mockup {
  perspective: 1000px;
}
.dashboard-mockup-inner {
  box-shadow: 0 20px 50px rgba(0,0,0,0.06);
  transition: transform 0.5s ease;
}
.dark .dashboard-mockup-inner {
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}

/* Particles Canvas */
.particles-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* Contact Map Background Filter */
#contact-map-bg {
  filter: grayscale(100%) opacity(0.2);
  opacity: 0;
  transition: opacity 1s ease-in-out;
}
#contact-map-bg.map-visible {
  opacity: 1;
}
.dark #contact-map-bg {
  filter: grayscale(100%) invert(100%) opacity(0.2);
}

/* Location Suggestions Dropdown */
#location-suggestions li {
  padding: 10px 16px;
  font-size: 11px;
  cursor: pointer;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: background-color 0.2s;
  color: var(--color-text);
}
.dark #location-suggestions li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
#location-suggestions li:last-child {
  border-bottom: none;
}
#location-suggestions li:hover {
  background-color: rgba(0, 0, 0, 0.05);
}
.dark #location-suggestions li:hover {
  background-color: rgba(255, 255, 255, 0.05);
}
