/* ==========================================================================
   CSS Variables for Theming (Light/Dark Mode)
   ========================================================================== */

:root {
  /* Light Theme Colors (Default Fallback) */
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f7; /* Apple's classic light gray */
  --bg-glass: rgba(255, 255, 255, 0.7);
  
  --text-primary: #1d1d1f;
  --text-secondary: #86868b;
  --text-inverse: #ffffff;
  
  --accent-primary: #0066cc; /* Apple Blue */
  --accent-hover: #0077ed;
  
  --border-color: rgba(0, 0, 0, 0.1);
  --shadow-sm: 0 4px 6px rgba(0,0,0,0.04);
  --shadow-md: 0 10px 30px rgba(0,0,0,0.08);
  
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

[data-theme="dark"] {
  /* Dark Theme Colors */
  --bg-primary: #000000;
  --bg-secondary: #1d1d1f;
  --bg-glass: rgba(29, 29, 31, 0.7);
  
  --text-primary: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-inverse: #000000;
  
  --accent-primary: #2997ff;
  --accent-hover: #147ce5;
  
  --border-color: rgba(255, 255, 255, 0.1);
  --shadow-sm: 0 4px 6px rgba(255,255,255,0.02);
  --shadow-md: 0 10px 30px rgba(0,0,0,0.5);
}

/* ==========================================================================
   Global Resets & Base Styles
   ========================================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  transition: background-color 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
}

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

ul {
  list-style: none;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.section-title {
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  text-align: center;
  margin-bottom: 2rem;
  background: linear-gradient(90deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ==========================================================================
   Layout Containers
   ========================================================================== */

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

.section {
  padding: 60px 0;
  position: relative;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 999px; /* Pill shape */
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  text-align: center;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background-color: var(--text-primary);
  color: var(--text-inverse);
  border: none;
}

.btn-primary:hover {
  background-color: var(--text-secondary);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--bg-secondary);
}

.btn-outline {
  border: 1px solid var(--border-color);
  background: transparent;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
}

.btn-outline:hover {
  border-color: var(--text-primary);
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: background 0.2s;
}

.icon-btn:hover {
  background: var(--bg-secondary);
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.glass-nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  background-color: var(--bg-glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.4s ease;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 5%;
}

.brand {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.toggle-button {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
}

.toggle-button .bar {
  height: 2px;
  width: 100%;
  background-color: var(--text-primary);
  border-radius: 10px;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
   
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(to right, #359aff, #c850c0);
  width: 0%;
  z-index: 99999;
  transform-origin: left;
  border-radius: 0 2px 2px 0;
}

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 60px; /* Offset for nav */
  position: relative;
  overflow: hidden;
  /* Developer Grid Background */
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

.mouse-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(53, 154, 255, 0.25) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none; /* Allows clicking through the glow */
  transform: translate(-50%, -50%);
  z-index: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.hero-content {
  max-width: 800px;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

.profile-pic-container {
  width: 90px;
  height: 90px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--bg-secondary);
  box-shadow: var(--shadow-sm);
}

.profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-greeting {
  font-size: 1.1rem;
  color: var(--accent-primary);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  
  /* Modern Animated Gradient Text */
  background: linear-gradient(to right, #359aff, #c850c0, #359aff);
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: gradientText 3s linear infinite; /* Sped up so it's obvious */
}

@keyframes gradientText {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.social-links-hero {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.social-icon {
  color: var(--text-secondary);
  transition: color 0.2s ease, transform 0.2s ease;
}

.social-icon:hover {
  color: var(--text-primary);
  transform: scale(1.1);
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

/* ==========================================================================
   About Section
   ========================================================================== */

.about {
  background-color: var(--bg-secondary);
  text-align: center;
}

.about-content {
  max-width: 800px;
  margin: 0 auto;
}

.about-text {
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ==========================================================================
   Skills Section
   ========================================================================== */

.skills-section {
  background-color: var(--bg-primary);
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  max-width: 800px;
  margin: 0 auto;
  padding: 2.5rem;
  background-color: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.02);
}

.skill-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  background-color: var(--bg-primary);
  border-radius: 99px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  gap: 0.75rem;
}

.skill-card:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 20px rgba(0,0,0,0.05);
  border-color: var(--text-primary);
}

.skill-card img {
  width: 22px;
  height: 22px;
  margin-bottom: 0;
  object-fit: contain;
}

.skill-card span {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ==========================================================================
   Projects Section
   ========================================================================== */

.projects-section {
  background-color: var(--bg-secondary);
}

.projects-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

@media (min-width: 768px) {
  .project-card {
    flex-direction: row;
    height: 320px;
  }
  
  .project-card:nth-child(even) {
    flex-direction: row-reverse;
  }
}

.project-content {
  flex: 1;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.project-content h3 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.project-content p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

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

.project-visual {
  flex: 1;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.visual-text {
  font-size: 2rem;
  font-weight: 800;
  color: var(--bg-primary);
  opacity: 0.5;
  letter-spacing: 0.2em;
}

/* ==========================================================================
   Contact Section
   ========================================================================== */

.contact-section {
  background-color: var(--bg-primary);
}

.contact-card {
  background-color: var(--bg-secondary);
  padding: 4rem 2rem;
  border-radius: var(--radius-lg);
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
}

.contact-desc {
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  font-size: 1.1rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  text-align: left;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--text-primary);
}

.btn-block {
  width: 100%;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  background-color: var(--bg-secondary);
  padding: 3rem 0;
  border-top: 1px solid var(--border-color);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
}

.footer p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

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

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

@media (min-width: 768px) {
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* ==========================================================================
   Responsive & Mobile Navigation
   ========================================================================== */

@media (max-width: 768px) {
  .toggle-button {
    display: flex;
  }
  
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%;
    background-color: var(--bg-glass);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-color);
  }
  
  .nav-links.active {
    display: flex;
  }
  
  .hero-actions {
    flex-direction: column;
  }
  
  .project-links {
    flex-direction: column;
  }
  
  .project-links .btn {
    margin-left: 0 !important;
    margin-top: 10px;
  }
}