@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --bg-primary: #000000;
  --bg-secondary: #09090b;
  --accent-blue: #0071e3;
  --accent-purple: #8656cd;
  --text-primary: #f5f5f7;
  --text-secondary: #86868b;
  --text-tertiary: #6e6e73;
  --glass-bg: rgba(22, 22, 23, 0.7);
  --glass-border: rgba(255, 255, 255, 0.08);
  --modal-bg: rgba(20, 20, 20, 0.95);
  --shadow-color: rgba(0, 0, 0, 0.5);
  --accent-glow: rgba(99, 102, 241, 0.15);
}

/* Light Theme overrides mapping to Tailwind class toggles */
.light-theme {
  --bg-primary: #f5f5f7;
  --bg-secondary: #ffffff;
  --accent-blue: #0071e3;
  --accent-purple: #6e00f5;
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(0, 0, 0, 0.08);
  --modal-bg: rgba(255, 255, 255, 0.98);
  --shadow-color: rgba(0, 0, 0, 0.1);
  --accent-glow: rgba(0, 113, 227, 0.08);
}

/* Custom CSS Resets and Defaults */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  cursor: default;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.4s ease, color 0.4s ease;
}

body {
  overflow-x: hidden;
  background-attachment: fixed;
  background-color: var(--bg-primary);
}

/* Custom backgrounds depending on theme */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 50% 0%, var(--accent-glow) 0%, rgba(9, 9, 11, 0) 50%);
  pointer-events: none;
  z-index: -1;
  transition: background 0.4s ease;
}

/* Custom cursor only on non-touch devices */
@media (hover: hover) and (pointer: fine) {
  .custom-cursor {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    position: fixed;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
    transition: width 0.2s, height 0.2s, background-color 0.2s, border-color 0.2s;
  }
  
  .light-theme .custom-cursor {
    border-color: rgba(0, 0, 0, 0.3);
  }
  
  .custom-cursor-dot {
    width: 4px;
    height: 4px;
    background-color: #fff;
    border-radius: 50%;
    position: fixed;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
  }
  
  .light-theme .custom-cursor-dot {
    background-color: #000;
  }

  .interactive-hover:hover ~ .custom-cursor {
    width: 50px;
    height: 50px;
    background-color: rgba(128, 128, 128, 0.08);
    border-color: var(--text-primary);
  }

  /* Make links and buttons interactive */
  a, button, select, input, textarea, [role="button"] {
    cursor: pointer;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: rgba(128, 128, 128, 0.3);
  border-radius: 5px;
  border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(128, 128, 128, 0.5);
}

/* Apple Smooth Transitions & Animations */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(25px) saturate(190%);
  -webkit-backdrop-filter: blur(25px) saturate(190%);
  border: 1px solid var(--glass-border);
  transition: background 0.4s ease, border-color 0.4s ease;
}

/* Dynamic Gradient Text */
.gradient-text {
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Apple Squircle / Smooth Curve Layouts */
.squircle {
  border-radius: 24px;
}

/* Glow effects */
.glow-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: inherit;
  background: radial-gradient(800px circle at var(--mouse-x, 0) var(--mouse-y, 0), rgba(255,255,255,0.06), transparent 40%);
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s;
}

.light-theme .glow-card::before {
  background: radial-gradient(800px circle at var(--mouse-x, 0) var(--mouse-y, 0), rgba(0,0,0,0.03), transparent 40%);
}

.glow-card:hover::before {
  opacity: 1;
}

/* Reveal on Scroll styling */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Dynamic Island Animations */
.dynamic-island {
  transition: width 0.5s cubic-bezier(0.19, 1, 0.22, 1);
  background: rgba(22, 22, 23, 0.85) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

#island-minimized, #island-expanded {
  transition: opacity 0.25s ease-in-out;
}

/* Three.js Canvas positioning */
#canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Custom CSS Animations */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

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

@keyframes pulse-slow {
  0%, 100% { opacity: 0.15; }
  50% { opacity: 0.3; }
}

.animate-pulse-slow {
  animation: pulse-slow 8s ease-in-out infinite;
}

/* macOS Tech Dock Styling */
.tech-dock-container {
  position: relative;
  display: inline-flex;
  align-items: flex-end;
  gap: 14px;
  padding: 12px 20px;
  background: var(--glass-bg);
  backdrop-filter: blur(25px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: 0 15px 40px var(--shadow-color);
  z-index: 20;
  transition: all 0.4s ease;
}

.tech-dock-icon {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  transition: width 0.2s cubic-bezier(0.25, 1, 0.5, 1), 
              height 0.2s cubic-bezier(0.25, 1, 0.5, 1), 
              margin-bottom 0.2s cubic-bezier(0.25, 1, 0.5, 1);
  transform-origin: bottom center;
}

/* Native continuous squircle mask for iOS icons */
.tech-dock-icon svg, .tech-dock-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.light-theme .tech-dock-icon {
  border-color: rgba(0, 0, 0, 0.05);
}

.tech-dock-icon:hover {
  margin-bottom: 12px;
}

/* Tooltip on Dock Icons */
.tech-dock-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translate(-50%, -8px);
  padding: 5px 10px;
  background: rgba(0, 0, 0, 0.85);
  color: white;
  font-size: 11px;
  font-weight: 500;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tech-dock-icon:hover .tech-dock-tooltip {
  opacity: 1;
}

/* Premium Slide-Up Sheet Modal */
.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 cubic-bezier(0.25, 1, 0.5, 1);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 100%);
  width: 90%;
  max-width: 760px;
  max-height: 85vh;
  background: var(--modal-bg);
  backdrop-filter: blur(35px);
  border: 1px solid var(--glass-border);
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  box-shadow: 0 -15px 45px var(--shadow-color);
  z-index: 101;
  overflow-y: auto;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-sheet.active {
  transform: translate(-50%, 0);
}

/* Form inputs hover overrides */
.form-input-premium {
  background: rgba(128, 128, 128, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  transition: all 0.3s;
}

.form-input-premium:focus {
  background: rgba(128, 128, 128, 0.08);
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.15);
}

/* Social icons custom hover interactive transitions */
.social-icon-btn {
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.social-icon-btn:hover {
  transform: translateY(-5px) scale(1.12);
}

.social-icon-linkedin:hover {
  background-color: rgba(0, 119, 181, 0.15) !important;
  color: #0077b5 !important;
  border-color: rgba(0, 119, 181, 0.4) !important;
  box-shadow: 0 8px 20px rgba(0, 119, 181, 0.25);
}

.social-icon-instagram:hover {
  background-color: rgba(225, 48, 108, 0.15) !important;
  color: #e1306c !important;
  border-color: rgba(225, 48, 108, 0.4) !important;
  box-shadow: 0 8px 20px rgba(225, 48, 108, 0.25);
}

.social-icon-facebook:hover {
  background-color: rgba(24, 119, 242, 0.15) !important;
  color: #1877f2 !important;
  border-color: rgba(24, 119, 242, 0.4) !important;
  box-shadow: 0 8px 20px rgba(24, 119, 242, 0.25);
}

.social-icon-threads:hover {
  background-color: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 8px 20px rgba(255, 255, 255, 0.15);
}

.light-theme .social-icon-threads:hover {
  background-color: rgba(0, 0, 0, 0.08) !important;
  color: #000000 !important;
  border-color: rgba(0, 0, 0, 0.3) !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.social-icon-tiktok:hover {
  background-color: rgba(37, 244, 238, 0.15) !important;
  color: #25f4ee !important;
  border-color: rgba(37, 244, 238, 0.4) !important;
  box-shadow: 0 8px 20px rgba(37, 244, 238, 0.25);
}

.social-icon-whatsapp:hover {
  background-color: rgba(37, 211, 102, 0.15) !important;
  color: #25d366 !important;
  border-color: rgba(37, 211, 102, 0.4) !important;
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.25);
}
