/* --- Design System & Variables --- */
:root {
  /* Light Theme (Apple-inspired with vibrant indigo/purple) */
  --bg-color: #f5f5f7;
  --nav-bg: rgba(255, 255, 255, 0.7);
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --accent: #0071e3;
  --accent-secondary: #863bf2;
  --glow: rgba(0, 113, 227, 0.12);
  --card-bg: rgba(255, 255, 255, 0.65);
  --card-border: rgba(0, 0, 0, 0.08);
  --card-shadow: rgba(0, 0, 0, 0.04);
  --card-hover-shadow: rgba(0, 113, 227, 0.12);
  --grid-color: rgba(0, 113, 227, 0.02);
  --tag-bg: rgba(0, 113, 227, 0.06);
  --tag-text: #0071e3;
  --timeline-line: rgba(0, 0, 0, 0.08);
  --timeline-dot-border: #ffffff;
}

[data-theme="dark"] {
  /* Premium Dark Theme (Obsidian & Emerald/Cyan) */
  --bg-color: #060913;
  --nav-bg: rgba(6, 9, 19, 0.75);
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --accent: #64ffda;
  --accent-secondary: #00e5ff;
  --glow: rgba(100, 255, 218, 0.15);
  --card-bg: rgba(15, 23, 42, 0.45);
  --card-border: rgba(100, 255, 218, 0.08);
  --card-shadow: rgba(2, 6, 12, 0.6);
  --card-hover-shadow: rgba(100, 255, 218, 0.18);
  --grid-color: rgba(100, 255, 218, 0.025);
  --tag-bg: rgba(100, 255, 218, 0.08);
  --tag-text: #64ffda;
  --timeline-line: rgba(100, 255, 218, 0.12);
  --timeline-dot-border: #060913;
}

/* --- Base Setup --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.5s ease, color 0.5s ease;
  overflow-x: hidden;
  position: relative;
}

h1, h2, h3, h4 {
  font-family: 'Outfit', sans-serif;
}

::selection {
  background: var(--accent);
  color: #060913;
}

.container {
  max-width: 1050px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* --- Ambient Background Glows --- */
.blob-glow {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.1;
  z-index: -2;
  pointer-events: none;
  transition: background 0.8s ease;
}
.blob-1 {
  top: -10%;
  left: -15%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  animation: float1 25s infinite alternate ease-in-out;
}
.blob-2 {
  bottom: -15%;
  right: -10%;
  background: radial-gradient(circle, var(--accent-secondary) 0%, transparent 70%);
  animation: float2 30s infinite alternate ease-in-out;
}
.grid-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.6;
  z-index: -3;
  pointer-events: none;
}

@keyframes float1 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(80px, 60px) scale(1.15); }
  100% { transform: translate(-40px, 120px) scale(0.9); }
}
@keyframes float2 {
  0% { transform: translate(0, 0) scale(1.1); }
  50% { transform: translate(-100px, -50px) scale(0.85); }
  100% { transform: translate(60px, -120px) scale(1.05); }
}

/* --- Floating Glass Navbar --- */
nav {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 1050px;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 50px;
  box-shadow: 0 8px 32px var(--card-shadow);
  z-index: 1000;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.nav-content {
  padding: 0.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.logo {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.03em;
  transition: color 0.3s ease;
}
.logo span {
  color: var(--accent);
}

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

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  position: relative;
  padding: 0.25rem 0;
  transition: color 0.3s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s cubic-bezier(0.65, 0, 0.35, 1);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--accent);
}

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

.nav-links a:hover::after,
.nav-links a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

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

.nav-actions a,
.theme-toggle,
.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-actions a:hover,
.theme-toggle:hover,
.menu-toggle:hover {
  color: var(--text-primary);
  background: var(--card-border);
  transform: translateY(-2px);
}

.nav-actions svg {
  width: 20px;
  height: 20px;
}

/* Mobile Drawer Navigation Styles */
.menu-toggle {
  display: none;
}

.mobile-nav {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  width: 100%;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(25px);
  -webkit-backdrop-filter: saturate(180%) blur(25px);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  box-shadow: 0 16px 40px var(--card-shadow);
  padding: 1.5rem;
  flex-direction: column;
  gap: 1rem;
  opacity: 0;
  transform: translateY(-15px);
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
  z-index: 999;
}

.mobile-nav.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.mobile-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: center;
  padding: 0.65rem 0;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.mobile-nav a:hover,
.mobile-nav a.active {
  color: var(--text-primary);
  background: var(--card-border);
}

/* --- Hero Section --- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  padding-top: 140px;
  padding-bottom: 80px;
}

.hero h1 {
  font-size: clamp(2.8rem, 7.5vw, 4.5rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  min-height: 2.2em; /* Prevents visual jumping */
}

.hero .highlight {
  color: var(--accent);
  text-shadow: 0 0 20px var(--glow);
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.cursor {
  display: inline-block;
  width: 4px;
  height: 0.85em;
  background-color: var(--accent);
  vertical-align: baseline;
  margin-left: 5px;
  border-radius: 2px;
  box-shadow: 0 0 10px var(--glow);
  position: relative;
  top: 2px;
  animation: smoothBlink 1.2s infinite ease-in-out;
}

@keyframes smoothBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero p {
  font-size: clamp(1.1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 620px;
  margin-bottom: 2.5rem;
  line-height: 1.8;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 2rem;
  background-color: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 14px;
  font-weight: 600;
  text-decoration: none;
  font-size: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn:hover {
  background-color: var(--tag-bg);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px var(--glow);
  border-color: var(--accent-secondary);
  color: var(--text-primary);
}

.scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  pointer-events: none;
}

.mouse-box {
  width: 22px;
  height: 36px;
  border: 2px solid var(--text-secondary);
  border-radius: 12px;
  position: relative;
  opacity: 0.7;
}

.mouse-wheel {
  width: 4px;
  height: 8px;
  background-color: var(--accent);
  border-radius: 2px;
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  animation: scrollWheel 1.6s infinite;
}

@keyframes scrollWheel {
  0% { opacity: 0; top: 6px; }
  20% { opacity: 1; }
  85% { opacity: 0; top: 20px; }
  100% { opacity: 0; top: 6px; }
}

/* --- Section Styling & Typography --- */
section {
  padding: 7rem 0;
  position: relative;
}

h2.section-title {
  font-size: clamp(2rem, 5vw, 2.6rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 3.5rem;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
}

h2.section-title span {
  color: var(--accent);
  margin-right: 0.5rem;
}

h2.section-title::after {
  content: "";
  display: block;
  height: 1px;
  background: linear-gradient(90deg, var(--card-border), transparent);
  margin-left: 2rem;
  flex-grow: 1;
}

/* --- Squircle Glassmorphism Cards --- */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 2.25rem;
  box-shadow: 0 8px 32px var(--card-shadow);
  transition:
    transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.2),
    box-shadow 0.4s ease,
    border-color 0.4s ease;
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    to right,
    transparent,
    rgba(255, 255, 255, 0.06),
    transparent
  );
  transform: skewX(-25deg);
  transition: left 0.85s ease;
}

.glass-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px var(--card-hover-shadow);
  border-color: var(--accent);
}

.glass-card:hover::before {
  left: 200%;
}

/* --- About Grid Layout --- */
.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 2.5rem;
  align-items: stretch;
}

.about-text {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.85;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.about-stats {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.25rem;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 0.75rem;
}
.stat-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.stat-label {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.stat-val {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.95rem;
  text-align: right;
}

/* --- Timeline Layouts (Experience & Education) --- */
.timeline {
  position: relative;
  padding-left: 2.25rem;
  margin-left: 0.5rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background-color: var(--timeline-line);
}

.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
}

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

.timeline-dot {
  position: absolute;
  left: calc(-2.25rem - 5px);
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  border: 2px solid var(--timeline-dot-border);
  transition: all 0.3s ease;
}

.timeline-item:hover .timeline-dot {
  transform: scale(1.4);
  background-color: var(--accent-secondary);
  box-shadow: 0 0 14px var(--accent-secondary);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.card-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
}

.card-date {
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--tag-bg);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  border: 1px solid rgba(100, 255, 218, 0.04);
}

.card-subtitle {
  color: var(--accent-secondary);
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 1.25rem;
}

.details-list {
  color: var(--text-secondary);
}

.details-list li {
  margin-bottom: 0.6rem;
  position: relative;
  padding-left: 1.5rem;
  list-style-type: none;
}

.details-list li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* --- Grid Layouts --- */
.grid-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 1.75rem;
}

.education-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
}

/* --- Projects Showcase --- */
.project-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.project-body {
  margin-bottom: 1.5rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.project-tag {
  font-size: 0.8rem;
  font-weight: 600;
  background-color: var(--tag-bg);
  color: var(--tag-text);
  padding: 0.2rem 0.65rem;
  border-radius: 6px;
}

.project-footer {
  display: flex;
  gap: 1rem;
  margin-top: auto;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 0.3s ease;
}

.project-link:hover {
  color: var(--accent);
}

.project-link svg {
  width: 16px;
  height: 16px;
}

/* --- Skills & Certs Hover Scale --- */
.skill-item,
.cert-item {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  height: 100%;
}

.skill-item:hover,
.cert-item:hover {
  transform: translateY(-8px) scale(1.05); /* Explicit scale target */
}

.skill-category {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-secondary);
  margin-bottom: 1rem;
  font-weight: 700;
}

.skill-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
}

.skill-chip {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.skill-chip:hover {
  background: var(--tag-bg);
  border-color: var(--accent);
  color: var(--tag-text);
  transform: translateY(-2px);
}

.cert-item {
  justify-content: space-between;
  min-height: 90px;
  border-left: 3px solid var(--accent);
  text-decoration: none;
  color: inherit;
}

.cert-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.cert-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.5rem;
}

.cert-link svg {
  width: 14px;
  height: 14px;
}

/* --- Contact Widget & Alerts --- */
.contact-card {
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
}

.contact-card p {
  color: var(--text-secondary);
  font-size: 1.15rem;
  margin-bottom: 2rem;
}

.contact-interactive {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.copy-email-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.75rem;
  background: var(--tag-bg);
  border: 1px dashed var(--accent);
  color: var(--text-primary);
  font-family: 'Fira Code', monospace;
  font-size: 1.05rem;
  font-weight: 500;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.copy-email-btn:hover {
  background: rgba(100, 255, 218, 0.12);
  border-color: var(--accent-secondary);
  transform: scale(1.02);
}

.copy-email-btn svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
  transition: color 0.3s ease;
}

.social-links {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin-top: 1rem;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.social-links a:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

/* Floating Toast Notification */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(6, 9, 19, 0.9);
  color: #64ffda;
  border: 1px solid rgba(100, 255, 218, 0.2);
  padding: 0.8rem 1.8rem;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  z-index: 2000;
  pointer-events: none;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.25);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

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

/* --- Scroll Reveal Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.165, 0.84, 0.44, 1), 
              transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

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

.animate-up {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.8s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

.delay-1 {
  animation-delay: 0.18s;
}
.delay-2 {
  animation-delay: 0.36s;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Responsive Design --- */
@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .education-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .menu-toggle {
    display: flex;
  }
  .mobile-nav {
    display: flex;
  }
  section {
    padding: 5rem 0;
  }
  nav {
    width: 92%;
    border-radius: 30px;
  }
  .grid-layout {
    grid-template-columns: 1fr;
  }
  h2.section-title::after {
    display: none;
  }
}
