/* ===== CSS Variables ===== */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a2e;
  --bg-card-hover: #22223a;
  --accent: #6c63ff;
  --accent-light: #8b83ff;
  --accent-glow: rgba(108, 99, 255, 0.15);
  --accent-glow-strong: rgba(108, 99, 255, 0.3);
  --text-primary: #e8e8f0;
  --text-secondary: #a0a0b8;
  --text-muted: #6a6a80;
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(108, 99, 255, 0.3);
  --gradient-accent: linear-gradient(135deg, #6c63ff 0%, #a78bfa 100%);
  --gradient-bg: linear-gradient(180deg, #0a0a0f 0%, #0f0f1a 100%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 60px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(108, 99, 255, 0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;
  --nav-height: 72px;
}

/* ===== Light Mode Overrides ===== */
body.light-mode {
  --bg-primary: #f8f9fa;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f3f5;
  --text-primary: #1a1a2e;
  --text-secondary: #495057;
  --text-muted: #6c757d;
  --border: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(108, 99, 255, 0.4);
  --gradient-bg: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 60px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 40px rgba(108, 99, 255, 0.05);
}


/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  color: var(--accent-light);
}

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

ul {
  list-style: none;
}

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Section Base ===== */
.section {
  padding: 100px 0;
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-label {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  position: relative;
  padding: 6px 16px;
  background: var(--accent-glow);
  border-radius: 20px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

/* ===== Navigation ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  z-index: 1000;
  transition: background var(--transition), box-shadow var(--transition);
  background: transparent;
}

.navbar.scrolled {
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 var(--border);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* ===== Theme Toggle ===== */
.theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 1.1rem;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: rotate(15deg);
  box-shadow: var(--shadow-glow);
}

.theme-toggle .sun-icon {
  display: none;
}

body.light-mode .theme-toggle .sun-icon {
  display: block;
}

body.light-mode .theme-toggle .moon-icon {
  display: none;
}


.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}

.nav-logo span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  padding: 4px 0;
  transition: color var(--transition);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: width var(--transition);
}

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

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

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== Hero Section ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: var(--nav-height);
}

.hero-bg-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(108, 99, 255, 0.08) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: pulseGlow 6s ease-in-out infinite;
}

@keyframes pulseGlow {

  0%,
  100% {
    opacity: 0.6;
    transform: translate(-50%, -50%) scale(1);
  }

  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.15);
  }
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

/* ===== Hero Image ===== */
.hero-image-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.hero-image-frame {
  width: 320px;
  height: 320px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--border-hover);
  box-shadow: 0 0 50px rgba(108, 99, 255, 0.15), 0 0 100px rgba(108, 99, 255, 0.05);
  position: relative;
  z-index: 2;
  transition: all 0.5s ease;
}

.hero-image-frame:hover {
  border-color: var(--accent);
  transform: scale(1.03);
  box-shadow: 0 0 60px rgba(108, 99, 255, 0.25), 0 0 120px rgba(108, 99, 255, 0.1);
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: grayscale(10%) contrast(1.05);
  transition: filter 0.5s ease;
}

.hero-image-frame:hover .hero-image {
  filter: grayscale(0%) contrast(1.1);
}

.hero-image-glow {
  position: absolute;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(108, 99, 255, 0.12) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  animation: pulseGlow 6s ease-in-out infinite;
}

.hero-greeting {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-greeting::before {
  content: '';
  width: 32px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.hero-name {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 2px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 30px;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin-bottom: 40px;
  line-height: 1.8;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 20px rgba(108, 99, 255, 0.3);
}

.btn-primary:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(108, 99, 255, 0.4);
  color: #fff;
}

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

.btn-outline:hover {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent-light);
  transform: translateY(-2px);
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: bounceDown 2s ease-in-out infinite;
}

.hero-scroll-indicator span {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--accent), transparent);
}

@keyframes bounceDown {

  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }

  50% {
    transform: translateX(-50%) translateY(8px);
  }
}

/* ===== Quote Section ===== */
.quote-section {
  min-height: auto;
  padding: 200px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, rgba(108, 99, 255, 0.08) 0%, var(--bg-primary) 60%);
  position: relative;
}

.quote-block {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  padding: 0 40px;
}

.quote-block p {
  font-family: var(--font-heading);
  font-size: clamp(1.2rem, 3vw, 1.4rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.9);
  position: relative;
  z-index: 2;
  animation: floatSlow 8s ease-in-out infinite;
}

.quote-mark {
  position: absolute;
  font-family: serif;
  font-size: 6rem;
  color: rgba(108, 99, 255, 0.15);
  line-height: 1;
  user-select: none;
  z-index: 1;
}

.quote-mark.left {
  top: -30px;
  left: 0;
}

.quote-mark.right {
  bottom: -60px;
  right: 0;
}

@keyframes floatSlow {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

/* ===== About Section ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px 64px;
  align-items: start;
}

.about-text p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.85;
  width: 100%;
  max-width: 200ch;
  margin-bottom: 0.7rem;
}

.about-text p:last-child {
  margin-bottom: 0;
}


.about-objective {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 0px;
}

.about-objective h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.about-objective p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.75;
}

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  text-align: center;
  transition: all var(--transition);
}

.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent);
  display: block;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 6px;
  display: block;
}

/* ===== Skills Section ===== */
#skills {
  background: var(--bg-secondary);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
}

.skill-category {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px 28px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.skill-category::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.skill-category:hover::before {
  transform: scaleX(1);
}

.skill-category:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.skill-icon {
  font-size: 1.8rem;
  margin-bottom: 16px;
  display: block;
}

.skill-category h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  background: rgba(108, 99, 255, 0.08);
  color: var(--text-secondary);
  border-radius: 20px;
  border: 1px solid rgba(108, 99, 255, 0.1);
  transition: all var(--transition);
}

.skill-category:hover .skill-tag {
  background: rgba(108, 99, 255, 0.12);
  border-color: rgba(108, 99, 255, 0.2);
  color: var(--text-primary);
}

/* ===== Projects Section ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 24px;
  padding-top: 32px;
  transition: all var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 600px;
  row-gap: 12px;
}

.project-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.03), transparent);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.project-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-6px);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.project-card:hover::after {
  opacity: 1;
}

.project-number {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 800;
  color: rgba(108, 99, 255, 0.1);
  line-height: 1;
  margin-bottom: 0px;
  position: absolute;
  top: 16px;
  left: 24px;
}

.project-card h3 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
  align-items: center;
  gap: 16px;
  padding-left: 75px; 
  min-height: 1rem;
  display: flex;
}

.project-card p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.75;
  position: relative;
  z-index: 1;
  left: 5px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -15px;
  margin-bottom: 50px;
  position: relative;
  z-index: 1;
}

.project-tag {
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-glow);
  border-radius: 20px;
  margin-top: 4px; 
  margin-bottom: 4px;
}

.project-details-btn {
  margin-top: 4px;
  align-self: flex-start;
  z-index: 2;
  position: relative;
}

/* ===== Dashboard Carousel ===== */
.dashboard-carousel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 28px 0 12px;
  z-index: 1;
}

.carousel-viewport {
  position: relative;
  width: 100%;
  max-width: 430px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid var(--border);
  box-shadow: var(--shadow-md);
  background: #0f172a;
  /* Solid dark shade for frames */
  aspect-ratio: unset;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -20px;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.5s ease;
  transform: scale(0.97);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-slide.active {
  position: relative;
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Ensures no data is cut off */
  display: block;
  transition: transform 0.3s ease;
}

/* Arrow controls */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(calc(-50% - 24px));
  z-index: 5;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-hover);
  background: rgba(10, 10, 15, 0.7);
  backdrop-filter: blur(8px);
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  opacity: 0;
}

.dashboard-carousel:hover .carousel-arrow {
  opacity: 1;
}

.carousel-arrow:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(108, 99, 255, 0.4);
  transform: translateY(calc(-50% - 24px)) scale(1.1);
}

.carousel-arrow svg {
  width: 22px;
  height: 22px;
}

.carousel-arrow--prev {
  left: -20px;
}

.carousel-arrow--next {
  right: -20px;
}

/* Placeholder for missing images */
.carousel-placeholder {
  width: 100%;
  height: 100%;
  background: rgba(108, 99, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
}

/* Label */
.carousel-label {
  display: block;
  margin-top: 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-light);
  text-transform: uppercase;
  letter-spacing: 2px;
  text-align: center;
  transition: opacity 0.3s ease;
}

.carousel-label.fade {
  opacity: 0;
}

/* Dot indicators */
.carousel-dots {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.carousel-dot.active {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(108, 99, 255, 0.5);
  transform: scale(1.2);
}

.carousel-dot:hover:not(.active) {
  border-color: var(--accent-light);
}

/* More Details button */
.project-details-btn {
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.project-details-btn svg {
  transition: transform 0.3s ease;
}

.project-details-btn:hover svg {
  transform: translate(2px, -2px);
}

.project-buttons-row {
  display: flex;
  gap: 10px;
  margin-top: -50px;
  flex-wrap: wrap;
  width: 100%;
}

.project-buttons-row .btn {
  flex: 1 1 calc(33.333% - 8px);
  min-width: 0px;
  justify-content: center;
  margin-top: 0;
  padding: 10px 12px;
  font-size: 0.82rem;
  letter-spacing: 0.5px;
}

.project-buttons-row .btn svg {
  transition: transform 0.3s ease;
}

.project-buttons-row .btn:hover svg {
  transform: translate(2px, -2px);
}

.btn-code {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(139, 131, 255, 0.3);
  border: none;
}

.btn-code:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(139, 131, 255, 0.4);
  color: #ffffff;
}

.project-buttons-row--single {
  justify-content: flex-start;
}

.project-buttons-row--single .btn {
  flex: 0 1 auto;
  min-width: 220px;
  padding: 11px 20px;
}

@media (max-width: 576px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .project-buttons-row {
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
  }

  .project-buttons-row .btn {
    width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
  }

  .project-buttons-row--single {
    flex-direction: column;
    align-items: stretch;
  }

  .project-buttons-row--single .btn {
    width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
  }

  /* Contact cards mobile fixes – keep two columns */
  .contact-links {
    grid-template-columns: repeat(2, 1fr) !important;
    width: 100%;
  }
  .contact-link {
    min-width: 0;
    overflow: hidden;
    width: 100%;
  }
  .contact-link p,
  .contact-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }

  /* Reduce font size for email and label to prevent truncation */
  .contact-link p,
  .contact-link span {
    font-size: 0.65rem;
    white-space: normal;
    word-break: break-all;
  }

  /* Ensure copy button is always visible on mobile */
  .copy-btn {
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-flex !important;
    margin-top: -25px;
  }

  /* Ensure the contact card is tall enough for content and button */
  .contact-link {
    min-height: 80px;
  }

  /* Fix 1 – Email overflow handling */
  .contact-secondary {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow: hidden;
    flex-wrap: wrap;
  }
  .contact-secondary span {
    font-size: 0.55rem;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
  }

  /* Reduce padding of the contact card on mobile to give more space for the email */
  .contact-link {
    padding: 12px 8px;
  }

  /* Slightly smaller font for the email/phone text to prevent side clipping */
  .contact-secondary span {
    font-size: 0.55rem;
  }

  /* Fix 2 – Ensure copy button always visible on mobile */
  .copy-btn {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    flex-shrink: 0;
  }

  /* Ensure any .contact-grid uses two columns on mobile */
  .contact-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    width: 100% !important;
  }

  /* Always show copy button on mobile */
  .copy-btn {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  /* Fix 1 — Copy button inline positioning */
  .copy-btn {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    opacity: 1 !important;
    flex-shrink: 0;
  }
  .contact-link:hover .copy-btn {
    opacity: 1 !important;
  }

  /* Fix 2 — Email text overflow handling */
  .contact-secondary {
    overflow: hidden;
    max-width: 100%;
    justify-content: flex-start;
    gap: 4px;
  }
  .contact-secondary span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
    font-size: 0.6rem;
  }

  /* Reduce copy button size on mobile for more text space */
  .copy-btn svg {
    width: 12px !important;
    height: 12px !important;
  }
  .copy-btn {
    padding: 2px !important;
  }

  /* Increase font size of contact text for readability */
  .contact-secondary span {
    font-size: 0.7rem !important;
  }
}

/* Responsive: arrows inside on smaller screens */
@media (max-width: 992px) {
  .carousel-arrow--prev {
    left: 8px;
  }

  .carousel-arrow--next {
    right: 8px;
  }
}

@media (max-width: 480px) {
  .lightbox-arrow {
      display: none !important;
    }
  .carousel-arrow {
    position: absolute;
    width: 36px;
    height: 36px;
    opacity: 0;
    top: 40%;
  }

  .carousel-arrow svg {
    width: 18px;
    height: 18px;
  }
}

/* ===== Experience Section ===== */
#experience {
  background: var(--bg-secondary);
}

.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding-left: 40px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), rgba(108, 99, 255, 0.1));
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  margin-bottom: 48px;
}

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

.timeline-dot {
  position: absolute;
  left: -46px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg-secondary);
  box-shadow: 0 0 0 3px var(--accent-glow-strong);
}

.timeline-date {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.timeline-item h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.timeline-item p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.75;
}

/* ===== Services Section ===== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 36px 28px;
  text-align: center;
  transition: all var(--transition);
}

.service-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.service-icon {
  font-size: 2.2rem;
  margin-bottom: 18px;
  display: block;
}

.service-card h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.service-card p {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.7;
}

/* ===== Contact Section ===== */
#contact {
  background: var(--bg-secondary);
}

.contact-content {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.contact-content p {
  color: var(--text-secondary);
  margin-bottom: 36px;
  font-size: 1.05rem;
}

.contact-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  max-width: 800px;
  margin: 0 auto;
}

.contact-link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 24px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all var(--transition);
  text-decoration: none;
  cursor: pointer;
  position: relative;
}

.contact-link-main {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1.05rem;
}

.contact-secondary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  color: var(--text-secondary);
  opacity: 0.7;
  transition: opacity 0.3s;
}

.contact-link:hover .contact-secondary {
  opacity: 1;
  color: #fff;
}

.mail-anchor {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.contact-link svg {
  width: 22px;
  height: 22px;
  fill: var(--accent);
  transition: fill var(--transition);
}

.contact-link:hover {
  border-color: var(--accent);
  background: var(--accent);
  transform: scale(1.05);
  box-shadow: var(--shadow-glow);
  color: #fff;
}

.contact-link:hover svg {
  fill: #fff;
}

.contact-tooltip {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: none;
  white-space: nowrap;
  z-index: 10;
  box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
}

.contact-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: var(--accent) transparent transparent transparent;
}

.contact-link:hover .contact-tooltip {
  opacity: 1;
  visibility: visible;
  top: -20px;
}

.copy-btn {
  position: absolute;
  left: calc(100% + 4px);
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
  opacity: 0;
}

.contact-link:hover .copy-btn {
  opacity: 1;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-50%) scale(1.1);
}



.copy-btn svg {
  width: 18px;
  height: 18px;
  fill: none !important;
  stroke: var(--accent);
  transition: stroke var(--transition);
}

.contact-link:hover .copy-btn svg {
  stroke: #fff;
}

/* ===== Footer ===== */
.footer {
  padding: 32px 0;
  text-align: center;
  border-top: 1px solid var(--border);
}

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

.footer span {
  color: var(--accent);
  display: inline-block;
  animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {

  0%,
  100% {
    transform: scale(1);
  }

  15% {
    transform: scale(1.3);
  }

  30% {
    transform: scale(1);
  }

  45% {
    transform: scale(1.3);
  }

  60% {
    transform: scale(1);
  }
}

/* ===== Scroll Animations ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* ===== Responsive ===== */
@media (max-width: 992px) {
  .about-grid {
    /* Keep two columns on small screens for carousel sections */
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  .hero-image-wrapper {
    order: -1;
  }

  .hero-image-frame {
    width: 260px;
    height: 260px;
  }

  .hero-image-glow {
    width: 280px;
    height: 280px;
  }
}

/* Mobile overflow fixes (max-width: 768px) */
@media (max-width: 768px) {
  /* Prevent horizontal scroll */
  html, body {
    overflow-x: hidden;
  }
    .section {
    padding: 72px 0;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: 100%;
    flex-direction: column;
    background: rgba(10, 10, 15, 0.97);
    backdrop-filter: blur(20px);
    padding: 32px 24px;
    gap: 20px;
    transform: translateY(-120%);
    transition: transform 0.4s ease;
    border-bottom: 1px solid var(--border);
  }

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

  .nav-toggle {
    display: flex;
  }

  .hero-content {
    text-align: center;
  }

  .hero-image-frame {
    width: 220px;
    height: 220px;
  }

  .hero-image-glow {
    width: 240px;
    height: 240px;
  }

  .hero-greeting {
    justify-content: center;
  }

  .hero-desc {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-buttons {
    justify-content: center;
  }

  .about-stats {
    grid-template-columns: 1fr 1fr;
  }

  .hero-scroll-indicator {
    display: none;
  }

  /* Ensure grid containers do not exceed viewport */
  .case-grid,
  .case-column,
  .dashboard-carousel,
  .swipe-carousel,
  .carousel-viewport,
  .swipe-carousel-viewport {
    max-width: 100% !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  /* Flex/grid children should be allowed to shrink */
  .case-column > *,
  .dashboard-carousel > *,
  .swipe-carousel > * {
    min-width: 0 !important;
  }

  /* Images should not force overflow */
  img {
    max-width: 100%;
    height: auto;
  }

  /* About section adjustments */
  .about-grid {
    grid-template-columns: 1fr !important;
    width: 100% !important;
  }
  .about-text,
  .about-stats {
    width: 100% !important;
    min-width: 0 !important;
  }
  /* Keep stats in two columns */
  .about-stats {
    grid-template-columns: 1fr 1fr !important;
  }

  .project-card {
    height: auto;
  } 
  .carousel-viewport {
    height: auto;
    aspect-ratio: 16 / 9;
  } 
  .project-card h3 {
    padding-left: auto;
    margin-bottom: auto;
  } 
  .project-number {
    position: relative;
    top: auto;
    left: auto;
    font-size: 3rem;
    margin-bottom: -70px;
  }
}


/* Ensure carousel containers stay side‑by‑side on screens <768px */
@media (max-width: 767px) {
  /* Override any previous single‑column rule for case grids */
  .case-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 24px !important;
  }

  /* Allow carousel viewport to shrink within its column */
  .carousel-viewport,
  .swipe-carousel {
    min-width: 0;
    max-width: 100%;
  }

  /* Slightly reduce font sizes inside carousel slides to prevent overflow */
  .carousel-slide img,
  .swipe-slide-placeholder span,
  .swipe-slide-placeholder p {
    font-size: 0.9rem;
  }
}

/* Contact card text overflow fixes for small screens */
@media (max-width: 576px) {
  .contact-secondary {
    min-width: 0 !important;
    overflow: hidden !important;
  }
  .contact-secondary span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: break-all; /* fallback for very long strings */
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .about-stats {
    grid-template-columns: 1fr;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  .hero-image-frame {
    width: 180px;
    height: 180px;
  }

  .hero-image-glow {
    width: 200px;
    height: 200px;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ===== Lightbox ===== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.lightbox-placeholder {
  width: 90vw;
  height: 90vh;
  max-width: 1200px;
  max-height: 800px;
  background: #0a0a0f;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 4px;
  font-weight: 600;
  border: 2px dashed var(--border-hover);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.lightbox.active .lightbox-img,
.lightbox.active .lightbox-placeholder {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  transition: color 0.3s;
  z-index: 10000;
}

.lightbox-close:hover {
  color: var(--accent);
}

.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10000;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--border-hover);
  background: rgba(10, 10, 15, 0.7);
  backdrop-filter: blur(8px);
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.lightbox-arrow:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(108, 99, 255, 0.4);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-arrow svg {
  width: 28px;
  height: 28px;
}

.lightbox-arrow--prev {
  left: 32px;
}

.lightbox-arrow--next {
  right: 32px;
}

/* Make images clickable */
.carousel-slide img,
.hero-image,
.carousel-placeholder {
  cursor: zoom-in;
}