:root {
  /* Apple-inspired color palette */
  --bg-primary: #f5f5f7;
  /* Light mode default */
  --bg-secondary: #ffffff;
  --text-primary: #1d1d1f;
  --text-secondary: #86868b;
  --accent-color: #0071e3;
  --accent-glow: rgba(0, 113, 227, 0.4);

  /* Glassmorphism Variables */
  --glass-bg: rgba(255, 255, 255, 0.6);
  --glass-border: rgba(255, 255, 255, 0.4);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
  --glass-gradient: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.05));
  --glass-border-main: rgba(255, 255, 255, 0.5);
  --glass-border-light: rgba(255, 255, 255, 0.8);
  --glass-highlight: rgba(255, 255, 255, 0.2);
  --glass-highlight-strong: rgba(255, 255, 255, 0.5);
  --glass-blur: blur(20px);
  --glass-border-radius: 20px;

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
  --transition-smooth: 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
  --transition-spring: 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

[data-theme="dark"] {
  --bg-primary: #000000;
  --bg-secondary: #1c1c1e;
  --text-primary: #f5f5f7;
  --text-secondary: #a1a1a6;
  --glass-bg: rgba(28, 28, 30, 0.6);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --glass-gradient: linear-gradient(135deg, rgba(40, 40, 42, 0.6), rgba(28, 28, 30, 0.2));
  --glass-border-main: rgba(255, 255, 255, 0.08);
  --glass-border-light: rgba(255, 255, 255, 0.12);
  --glass-highlight: rgba(255, 255, 255, 0.03);
  --glass-highlight-strong: rgba(255, 255, 255, 0.05);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-primary: #000000;
    --bg-secondary: #1c1c1e;
    --text-primary: #f5f5f7;
    --text-secondary: #a1a1a6;
    --glass-bg: rgba(28, 28, 30, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --glass-gradient: linear-gradient(135deg, rgba(40, 40, 42, 0.6), rgba(28, 28, 30, 0.2));
    --glass-border-main: rgba(255, 255, 255, 0.08);
    --glass-border-light: rgba(255, 255, 255, 0.12);
    --glass-highlight: rgba(255, 255, 255, 0.03);
    --glass-highlight-strong: rgba(255, 255, 255, 0.05);
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "San Francisco", "Inter", "Roboto", "Helvetica Neue", sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

/* Moving blurred background blobs */
.ambient-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(circle at 15% 50%, rgba(0, 113, 227, 0.15), transparent 40%),
    radial-gradient(circle at 85% 30%, rgba(0, 113, 227, 0.1), transparent 40%);
}

.ambient-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.6;
  animation: float 20s infinite ease-in-out alternate;
}

.blob-1 {
  top: 10%;
  left: 20%;
  width: 400px;
  height: 400px;
  background: var(--accent-glow);
  animation-delay: 0s;
}

.blob-2 {
  bottom: 20%;
  right: 10%;
  width: 500px;
  height: 500px;
  background: rgba(83, 113, 227, 0.3);
  /* Changed from purple to blue */
  animation-delay: -5s;
}

@keyframes float {
  0% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(20px, 40px) scale(1.05);
  }

  100% {
    transform: translate(-20px, -20px) scale(0.95);
  }
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 1.1;
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1.5rem;
  letter-spacing: -0.015em;
}

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

p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 600px;
}

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

a:hover {
  filter: brightness(1.2);
}

/* Global Glass Class */
.glass-panel {
  background: var(--glass-gradient);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border-main);
  border-top-color: var(--glass-border-light);
  border-left-color: var(--glass-border-light);
  border-radius: var(--glass-border-radius);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.1),
    inset 0 0 0 1px var(--glass-highlight),
    inset 0 0 20px var(--glass-highlight-strong);
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), border-color var(--transition-smooth);
}

/* Navigation Bar */
.navbar {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 2rem);
  max-width: 800px;
  z-index: 1000;
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 100px;
}

.nav-brand {
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-link {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
  padding: 0.5rem 0;
  transition: color var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform var(--transition-smooth);
  transform-origin: center;
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: translateX(-50%) scaleX(1);
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: color var(--transition-fast), transform var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.theme-toggle:hover {
  color: var(--text-primary);
  transform: rotate(15deg);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 30px;
  height: 20px;
  position: relative;
  z-index: 1001;
}

.mobile-menu-btn span {
  position: absolute;
  width: 100%;
  height: 2px;
  background-color: var(--text-primary);
  border-radius: 2px;
  transition: transform var(--transition-smooth), opacity var(--transition-smooth), top var(--transition-smooth), bottom var(--transition-smooth);
}

.mobile-menu-btn span:nth-child(1) {
  top: 0;
  left: 0;
}

.mobile-menu-btn span:nth-child(2) {
  top: 50%;
  transform: translateY(-50%);
  left: 0;
}

.mobile-menu-btn span:nth-child(3) {
  bottom: 0;
  left: 0;
}

.mobile-menu-btn.active span:nth-child(1) {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
  bottom: 50%;
  transform: translateY(50%) rotate(-45deg);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.8rem;
  border-radius: 100px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-spring);
  border: none;
  outline: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background-color: var(--text-primary);
  color: var(--bg-primary);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  filter: none;
}

@media (prefers-color-scheme: dark) {
  .btn-primary:hover {
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.15);
  }
}

.btn-glass {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

@media (prefers-color-scheme: dark) {
  .btn-glass {
    background: rgba(255, 255, 255, 0.05);
  }
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
  border-color: var(--text-primary);
  filter: none;
}

/* Liquid / Magnetic Button Effect Sub-element */
.btn-glow {
  position: absolute;
  width: 150%;
  height: 150%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  transition: transform 0.6s ease, opacity 0.6s ease;
  pointer-events: none;
}

.btn:hover .btn-glow {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

/* Layout */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

section {
  padding-top: 36px;
  padding-bottom: 36px;
  position: relative;
}

/* Setup for entrance animations */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding-top: 6rem;
  gap: 4rem;
}

.hero-content {
  flex: 1;
}

.hero-image {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.liquid-sphere-container {
  position: relative;
  width: 350px;
  height: 350px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.profile-img {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  object-fit: cover;
  position: relative;
  z-index: 2;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  border: 4px solid rgba(255, 255, 255, 0.6);
}

.liquid-sphere {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.0));
  backdrop-filter: blur(15px) saturate(200%);
  -webkit-backdrop-filter: blur(15px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow:
    inset 0 0 50px rgba(255, 255, 255, 0.6),
    inset 20px 0 80px rgba(0, 113, 227, 0.4),
    inset -20px 0 80px rgba(0, 113, 227, 0.4),
    0 30px 60px rgba(0, 0, 0, 0.15);
  z-index: 1;
  animation: liquid-morph 8s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes liquid-morph {
  0% {
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
  }

  34% {
    border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%;
  }

  67% {
    border-radius: 100% 60% 60% 100% / 100% 100% 60% 60%;
  }

  100% {
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
  }
}

.hero p.subtitle {
  font-size: 1.5rem;
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 2rem;
}

.hero .btn-group {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

/* About Section */
.about p {
  font-size: 1.25rem;
  max-width: 800px;
}

/* Skills Grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.skill-card {
  padding: 2rem 1rem;
  text-align: center;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  border-radius: 24px;
}

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

.skill-card i {
  font-size: 2.5rem;
  color: var(--text-primary);
}

/* Project Cards Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 24px;
  height: 100%;
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.12);
}

.project-image-wrapper {
  width: 100%;
  height: 220px;
  overflow: hidden;
  position: relative;
}

.project-image-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.2), rgba(0, 113, 227, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: var(--text-secondary);
  transition: transform var(--transition-spring);
}

.project-card:hover .project-image-placeholder {
  transform: scale(1.1);
}

.project-info {
  padding: 2rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.project-info h3 {
  margin-bottom: 0.5rem;
}

.project-info p {
  margin-bottom: 1.5rem;
  flex-grow: 1;
  font-size: 1rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tag {
  font-size: 0.8rem;
  padding: 0.3rem 0.8rem;
  background: var(--bg-primary);
  border-radius: 100px;
  font-weight: 500;
  border: 1px solid var(--glass-border);
}

/* Timeline (Education & Experience) */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 3rem auto 0;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 20px;
  width: 2px;
  background: var(--glass-border);
}

.timeline-item {
  position: relative;
  padding-left: 60px;
  margin-bottom: 3rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: 11px;
  top: 10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 4px solid var(--accent-color);
  box-shadow: 0 0 0 4px var(--glass-bg);
  z-index: 10;
  transition: transform var(--transition-spring), box-shadow var(--transition-smooth);
}

.timeline-item:hover .timeline-dot {
  transform: scale(1.3);
  box-shadow: 0 0 15px var(--accent-glow);
}

.timeline-content {
  padding: 2rem;
  border-radius: 20px;
}

.timeline-content:hover {
  transform: translateX(10px);
}

.timeline-date {
  font-size: 0.9rem;
  color: var(--accent-color);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.timeline-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.timeline-subtitle {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-weight: 500;
}

.timeline-list {
  padding-left: 1.2rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.timeline-list li {
  margin-bottom: 0.5rem;
}

/* Contact Page Form */
.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  margin-top: 3rem;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: 20px;
}

.contact-item i {
  font-size: 1.5rem;
  color: var(--accent-color);
}

.contact-item h3 {
  margin-bottom: 0.2rem;
  font-size: 1.1rem;
}

.contact-item p,
.contact-item a {
  margin: 0;
  font-size: 1rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 3rem;
  border-radius: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 500;
  padding-left: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  transition: all var(--transition-smooth);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-color);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 4px var(--accent-glow);
  transform: translateY(-2px);
}

textarea.form-control {
  resize: vertical;
  min-height: 150px;
}

/* Footer */
footer {
  text-align: center;
  padding: 3rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 4rem;
  border-top: 1px solid var(--glass-border);
}

footer p {
  max-width: none;
  margin: 0 auto;
}

/* Page Header for specific pages */
.page-header {
  padding-top: 10rem;
  padding-bottom: 4rem;
  text-align: center;
}

.page-header p {
  margin: 0 auto;
}

/* Responsive */
@media (max-width: 768px) {
  .hero {
    flex-direction: column-reverse;
    text-align: center;
    padding-top: 8rem;
  }

  .hero-image {
    margin-bottom: 3rem;
  }

  .navbar {
    top: 0;
    width: 100%;
    border-radius: 0;
    border-top: none;
    border-left: none;
    border-right: none;
    padding: 1rem 1.5rem;
  }

  .nav-links {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    background: var(--bg-primary);
    transform: translateY(-100%);
    transition: transform var(--transition-smooth);
    z-index: 1000;
  }

  .nav-links.active {
    transform: translateY(0);
  }

  .nav-link {
    font-size: 1.5rem;
  }

  .mobile-menu-btn {
    display: block;
  }

  .hero .btn-group {
    flex-direction: column;
    width: 100%;
  }

  .hero .btn-group .btn {
    width: 100%;
  }

  .contact-wrapper {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .contact-form {
    padding: 2rem 1.5rem;
  }

  .timeline::before {
    left: 15px;
  }

  .timeline-dot {
    left: 6px;
  }

  .timeline-item {
    padding-left: 45px;
  }
}