/* ==========================================================================
   MAIN GLOBAL CSS (Resets, Navigation, Footer, Cursor, Background, Base Layouts)
   ========================================================================== */

/* Resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  width: 100%;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-fast);
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

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

::-webkit-scrollbar-thumb {
  background: rgba(var(--accent-1-rgb), 0.3);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--accent-1-rgb), 0.6);
}

/* Selection */
::selection {
  background-color: rgba(var(--accent-1-rgb), 0.3);
  color: var(--text-primary);
}

/* Container */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

@media (max-width: 768px) {
  .container {
    padding: 0 1.25rem;
  }
}

section {
  padding: 6rem 0;
  position: relative;
}

@media (max-width: 768px) {
  section {
    padding: 4rem 0;
  }
}

/* Typography Utility */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-primary);
}

.text-gradient {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

.text-gradient-cyan {
  background: var(--grad-secondary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}


/* Floating Shapes / Animated Glass Background */
.bg-mesh-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.bg-mesh-glow {
  position: absolute;
  border-radius: var(--radius-full);
  filter: blur(140px);
  opacity: 0.15;
  mix-blend-mode: screen;
  animation: float-slow infinite alternate ease-in-out;
}

body.light-theme .bg-mesh-glow {
  opacity: 0.06;
  mix-blend-mode: multiply;
}

.bg-glow-1 {
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, var(--accent-1) 0%, transparent 80%);
  top: -10vw;
  right: -10vw;
  animation-duration: 25s;
}

.bg-glow-2 {
  width: 40vw;
  height: 40vw;
  background: radial-gradient(circle, var(--accent-2) 0%, transparent 80%);
  bottom: -10vw;
  left: -10vw;
  animation-duration: 30s;
  animation-delay: -5s;
}

.bg-glow-3 {
  width: 35vw;
  height: 35vw;
  background: radial-gradient(circle, var(--accent-3) 0%, transparent 80%);
  top: 40vh;
  left: 30vw;
  animation-duration: 20s;
  animation-delay: -10s;
}

@keyframes float-slow {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(5vw, 5vh) scale(1.1);
  }
  100% {
    transform: translate(-5vw, -5vh) scale(0.9);
  }
}

/* Floating Elements (Background Grid & Shapes) */
.glass-shape {
  position: absolute;
  z-index: -1;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(5px);
  border-radius: var(--radius-md);
  box-shadow: var(--glass-shadow);
  animation: float-rotate 15s infinite linear;
}

.shape-1 {
  width: 60px;
  height: 60px;
  top: 20%;
  left: 10%;
}

.shape-2 {
  width: 90px;
  height: 90px;
  bottom: 15%;
  right: 8%;
  animation-duration: 25s;
  animation-direction: reverse;
}

.shape-3 {
  width: 40px;
  height: 40px;
  top: 50%;
  right: 15%;
  border-radius: var(--radius-full);
  animation-duration: 12s;
}

@keyframes float-rotate {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
  }
  100% {
    transform: translateY(0) rotate(360deg);
  }
}

/* Loading Screen */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-primary);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loader-logo {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  letter-spacing: -1px;
}

.loader-bar-container {
  width: 200px;
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

body.light-theme .loader-bar-container {
  background: rgba(0, 0, 0, 0.05);
}

.loader-bar {
  width: 0%;
  height: 100%;
  background: var(--grad-primary);
  transition: width 0.3s ease;
}

/* Scroll Progress Bar */
.scroll-progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  z-index: 1001;
}

.scroll-progress {
  width: 0%;
  height: 100%;
  background: var(--grad-primary);
}

/* Navigation */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  transition: padding var(--transition-normal), background-color var(--transition-normal);
  padding: 1.5rem 0;
}

.header.sticky {
  padding: 1rem 0;
  background-color: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.logo-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-1);
  border-radius: 50%;
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(var(--accent-1-rgb), 0.7);
  }
  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 8px rgba(var(--accent-1-rgb), 0);
  }
  100% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(var(--accent-1-rgb), 0);
  }
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2.25rem;
}

.nav-link {
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  opacity: 0.85;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--grad-primary);
  transition: width var(--transition-normal);
}

.nav-link:hover, .nav-link.active {
  opacity: 1;
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
}

.theme-toggle-btn:hover {
  border-color: var(--glass-border-hover);
  transform: translateY(-2px);
}

.theme-toggle-btn svg {
  width: 20px;
  height: 20px;
  fill: var(--text-primary);
  transition: transform 0.5s ease;
}

.theme-toggle-btn .moon-icon {
  display: none;
}

.theme-toggle-btn .sun-icon {
  display: block;
}

body.light-theme .theme-toggle-btn .moon-icon {
  display: block !important;
}

body.light-theme .theme-toggle-btn .sun-icon {
  display: none !important;
}

/* Mobile Menu Toggle */
.mobile-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  cursor: pointer;
  z-index: 1001;
}

.mobile-nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--text-primary);
  border-radius: var(--radius-full);
  transition: transform var(--transition-normal), opacity var(--transition-normal);
}

@media (max-width: 1024px) {
  .mobile-nav-toggle {
    display: flex;
  }
  
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background-color: var(--nav-menu-bg);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
    z-index: 1000;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
    transition: right var(--transition-slow);
  }
  
  .nav-menu.active {
    right: 0;
  }
  
  .nav-actions {
    gap: 1rem;
  }
  
  /* Mobile Hamburger Animation */
  .mobile-nav-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  
  .mobile-nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  
  .mobile-nav-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
}

/* Scroll Reveal Base */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.reveal.reveal-left {
  transform: translateX(-50px);
}

.reveal.reveal-right {
  transform: translateX(50px);
}

.reveal.reveal-zoom {
  transform: scale(0.9);
}

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

/* Parallax Box */
.parallax-wrap {
  overflow: hidden;
  position: relative;
}

.parallax-bg {
  position: absolute;
  top: -10%;
  left: 0;
  width: 100%;
  height: 120%;
  z-index: -1;
  background-size: cover;
  background-position: center;
  will-change: transform;
}

/* Footer styling */
.footer {
  border-top: 1px solid var(--glass-border);
  background: linear-gradient(180deg, transparent 0%, var(--bg-secondary) 100%);
  padding: 5rem 0 2rem 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 4rem;
  margin-bottom: 4rem;
}

@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
}

@media (max-width: 600px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

.footer-col-info .footer-desc {
  color: var(--text-secondary);
  margin: 1.5rem 0;
  max-width: 320px;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-link {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
}

.social-link.instagram {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: #ffffff;
  border-color: transparent;
}
.social-link.facebook {
  background: #1877f2;
  color: #ffffff;
  border-color: transparent;
}
.social-link.x {
  background: #000000;
  color: #ffffff;
  border-color: transparent;
}
.social-link.threads {
  background: #101010;
  color: #ffffff;
  border-color: transparent;
}

.social-link:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  filter: brightness(1.15);
}

.social-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.footer-col h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  position: relative;
  display: inline-block;
}

.footer-col h3::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 30px;
  height: 2px;
  background: var(--grad-primary);
  border-radius: var(--radius-full);
}

.footer-links li {
  margin-bottom: 0.8rem;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.footer-links a:hover {
  color: var(--accent-1);
  padding-left: 5px;
}

.footer-col-news p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.footer-news-form {
  display: flex;
  position: relative;
}

.footer-news-input {
  width: 100%;
  padding: 0.85rem 3.5rem 0.85rem 1.25rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: var(--transition-normal);
}

.footer-news-input:focus {
  border-color: var(--accent-1);
  background: rgba(255, 255, 255, 0.05);
}

body.light-theme .footer-news-input:focus {
  background: rgba(0, 0, 0, 0.01);
}

.footer-news-btn {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: var(--transition-normal);
}

.footer-news-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(var(--accent-1-rgb), 0.3);
}

.footer-news-btn svg {
  width: 16px;
  height: 16px;
  fill: #fff;
}

.footer-bottom {
  border-top: 1px solid var(--glass-border);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

.footer-legal-links {
  display: flex;
  gap: 1.5rem;
}

.footer-legal-links a:hover {
  color: var(--text-secondary);
}

/* ==========================================================================
   MOBILE & RESPONSIVE LAYOUT OVERRIDES (SOLVING HEADER & FORM OVERFLOWS)
   ========================================================================== */

@media (max-width: 768px) {
  .logo {
    font-size: 1.35rem; /* Scale down logo font-size slightly */
  }
  
  /* Prevent large headings from overflowing mobile viewport */
  h1, .hero-content h1 {
    font-size: clamp(1.8rem, 6.5vw, 2.5rem) !important;
  }
  h2 {
    font-size: clamp(1.5rem, 5vw, 2rem) !important;
  }
}

@media (max-width: 600px) {
  /* Hide the Hire Me button in header on mobile to prevent overflow */
  .nav-actions .btn {
    display: none;
  }
  
  /* Reduce nav actions gap to fit on small mobile screens */
  .nav-actions {
    gap: 0.5rem; /* Reduced from 0.75rem to save space */
  }

  .logo {
    font-size: 1.15rem; /* Reduced slightly from 1.2rem to prevent overlap */
  }
}

@media (max-width: 480px) {
  /* Make sure container spacing is safe */
  .container {
    padding: 0 1rem;
  }
  
  .logo {
    font-size: 1.05rem; /* Scale down logo slightly further on tiny viewports */
  }

  .mobile-nav-toggle {
    margin-right: 0.35rem; /* Move the hamburger toggle slightly left from the screen edge */
  }
  
  /* Ensure headings fit perfectly on tiny mobile screens (e.g. 320px) */
  h1, .hero-content h1 {
    font-size: clamp(1.45rem, 7.5vw, 1.85rem) !important;
  }
  h2 {
    font-size: clamp(1.25rem, 6vw, 1.45rem) !important;
  }
}
