/* ============================================================
   PORTFOLIO DESIGN SYSTEM — Utkarsh Kumar Rajput
   Blue-Green Accent · Apple/Google Inspired · Dark-First
   ============================================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,700&display=swap');

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Accent — Steel Blue (extracted from profile: mountain mist, snow, clouds) */
  --accent-h: 210;
  --accent-s: 40%;
  --accent-l: 58%;
  --accent: hsl(var(--accent-h), var(--accent-s), var(--accent-l));
  --accent-light: hsl(var(--accent-h), var(--accent-s), 72%);
  --accent-dark: hsl(var(--accent-h), var(--accent-s), 40%);
  --accent-glow: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.2);

  /* Typography — Poppins (Google Product Sans alternative) */
  --font-body: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  --fs-xs: clamp(0.7rem, 0.8vw, 0.8rem);
  --fs-sm: clamp(0.85rem, 1vw, 0.95rem);
  --fs-base: clamp(1rem, 1.1vw, 1.1rem);
  --fs-md: clamp(1.15rem, 1.3vw, 1.35rem);
  --fs-lg: clamp(1.5rem, 2vw, 2rem);
  --fs-xl: clamp(2rem, 3vw, 3rem);
  --fs-2xl: clamp(2.5rem, 4.5vw, 4.5rem);
  --fs-hero: clamp(3rem, 7vw, 7rem);

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;
  --space-3xl: 10rem;
  --section-pad: clamp(5rem, 10vh, 10rem);

  /* Borders */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 999px;

  /* Transitions */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 0.2s;
  --dur-normal: 0.4s;
  --dur-slow: 0.6s;
  --theme-transition: 0.5s var(--ease-out);
}

/* ---------- Dark Theme (Default) ---------- */
[data-theme="dark"] {
  --bg-primary: #08090c;
  --bg-secondary: #0e1015;
  --bg-card: #13161c;
  --bg-card-hover: #1a1d25;
  --bg-nav: rgba(14, 16, 21, 0.75);
  --text-primary: #e8eaed;
  --text-secondary: #9aa0a6;
  --text-tertiary: #5f6368;
  --border-color: rgba(255, 255, 255, 0.07);
  --border-color-hover: rgba(255, 255, 255, 0.14);
  --shadow-card: 0 4px 30px rgba(0, 0, 0, 0.3);
  --shadow-card-hover: 0 20px 60px rgba(0, 0, 0, 0.5);
  --shadow-nav: 0 4px 30px rgba(0, 0, 0, 0.4);
  --cursor-color: var(--accent-light);
  --gradient-hero: radial-gradient(ellipse at 50% 0%, hsla(210, 30%, 18%, 0.4) 0%, transparent 60%);
  --dot-grid-color: rgba(255, 255, 255, 0.025);
}

/* ---------- Light Theme ---------- */
[data-theme="light"] {
  --bg-primary: #f8f9fa;
  --bg-secondary: #f0f1f3;
  --bg-card: #ffffff;
  --bg-card-hover: #f5f6f8;
  --bg-nav: rgba(248, 249, 250, 0.75);
  --text-primary: #202124;
  --text-secondary: #5f6368;
  --text-tertiary: #9aa0a6;
  --border-color: rgba(0, 0, 0, 0.06);
  --border-color-hover: rgba(0, 0, 0, 0.12);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 20px 50px rgba(0, 0, 0, 0.1);
  --shadow-nav: 0 4px 20px rgba(0, 0, 0, 0.06);
  --cursor-color: var(--accent-dark);
  --gradient-hero: radial-gradient(ellipse at 50% 0%, hsla(210, 40%, 88%, 0.5) 0%, transparent 60%);
  --dot-grid-color: rgba(0, 0, 0, 0.03);
}

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

html {
  scroll-behavior: auto; /* Lenis handles smooth scroll */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  line-height: 1.7;
  overflow-x: hidden;
  cursor: none;
  transition: background-color var(--theme-transition), color var(--theme-transition);
}

a {
  color: inherit;
  text-decoration: none;
  cursor: none;
}

button {
  cursor: none;
  border: none;
  background: none;
  font-family: inherit;
  color: inherit;
}

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

ul, ol {
  list-style: none;
}

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

/* ---------- Custom Cursor ---------- */
.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background: var(--cursor-color);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease-out), height 0.3s var(--ease-out), background 0.3s;
  mix-blend-mode: difference;
}

.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--cursor-color);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99998;
  transform: translate(-50%, -50%);
  transition: width 0.4s var(--ease-out), height 0.4s var(--ease-out), border-color 0.3s, opacity 0.3s;
  opacity: 0.5;
}

.cursor-dot.hovering {
  width: 60px;
  height: 60px;
  background: var(--accent-glow);
  mix-blend-mode: normal;
}

.cursor-ring.hovering {
  width: 70px;
  height: 70px;
  opacity: 0;
}

.cursor-dot.clicking {
  transform: translate(-50%, -50%) scale(0.7);
}

/* ---------- Glassmorphism Navbar ---------- */
.nav-wrapper {
  position: fixed;
  top: 20px;
  left: 0;
  width: 100vw;
  display: flex;
  justify-content: center;
  z-index: 9999;
  pointer-events: none; /* Let clicks pass through empty space */
}

.navbar {
  pointer-events: auto; /* Re-enable clicks for the nav itself */
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 8px 12px;
  background: var(--bg-nav);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: var(--shadow-nav);
  transition: background var(--theme-transition), border-color var(--theme-transition), box-shadow var(--theme-transition);
}

.navbar.hidden {
  transform: translateX(-50%) translateY(-120%);
}

.nav-link {
  padding: 8px 18px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  transition: color var(--dur-fast), background var(--dur-fast);
  letter-spacing: -0.01em;
  position: relative;
}

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

.nav-divider {
  width: 1px;
  height: 20px;
  background: var(--border-color);
  margin: 0 4px;
}

.theme-toggle {
  display: grid;
  place-items: center;
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--border-color);
  transition: background var(--dur-fast), transform var(--dur-fast);
  font-size: 1.1rem;
}

.theme-toggle:hover {
  background: var(--border-color-hover);
  transform: rotate(30deg);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  transition: opacity 0.3s, transform 0.3s;
  grid-area: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-theme="dark"] .theme-toggle .icon-sun { opacity: 1; transform: rotate(0deg); }
[data-theme="dark"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(-90deg); }
[data-theme="light"] .theme-toggle .icon-sun { opacity: 0; transform: rotate(90deg); }
[data-theme="light"] .theme-toggle .icon-moon { opacity: 1; transform: rotate(0deg); }

/* ---------- Shared Section Styles ---------- */
.section {
  position: relative;
  padding: var(--section-pad) var(--space-lg);
  max-width: 1200px;
  margin: 0 auto;
  transition: background-color var(--theme-transition);
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: var(--space-md);
}

.section-label::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.7); }
}

.section-title {
  font-family: var(--font-heading);
  font-size: var(--fs-2xl);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  letter-spacing: -0.02em;
  transition: color var(--theme-transition);
}

.section-subtitle {
  font-size: var(--fs-md);
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.6;
  transition: color var(--theme-transition);
}

/* ---------- Reveal Animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  will-change: transform, opacity;
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  will-change: transform, opacity;
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  will-change: transform, opacity;
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  will-change: transform, opacity;
}

/* ---------- Hero Section ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: hidden;
  padding: var(--space-3xl) var(--space-lg) var(--space-2xl);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-hero);
  transition: background var(--theme-transition);
  pointer-events: none;
}

#heroGlobe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  transform: translateZ(0); /* Hardware accelerate component */
}

.hero-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-blur-tunnel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 900px;
  max-width: 95vw;
  height: 520px;
  border-radius: 40px; /* Square with rounded corners shape */
  background: rgba(0, 0, 0, 0.02); /* Slight frosted glass tint */
  border: 1px solid rgba(255, 255, 255, 0.05); /* Premium glass edge */
  z-index: 1; /* Sits above canvas, behind text */
  pointer-events: none;
  /* Glass card blur */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  /* The dissolve effect: fades to 0% opacity heavily at the absolute borders */
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,1) 40%, rgba(0,0,0,0) 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,1) 40%, rgba(0,0,0,0) 80%);
}

.hero-greeting {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: var(--space-md);
  position: relative;
  z-index: 1;
}

.hero-name {
  font-family: var(--font-heading);
  font-size: var(--fs-hero);
  font-weight: 700;
  line-height: 1.05;
  color: var(--text-primary);
  position: relative;
  z-index: 10;
  letter-spacing: -0.03em;
  transition: color var(--theme-transition);
}

.hero-name .accent-text {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title-line {
  display: block;
  overflow: hidden;
}

.hero-title-inner {
  display: block;
  transform: translateY(105%);
  will-change: transform;
}

.hero-subtitle {
  font-size: var(--fs-md);
  color: var(--text-secondary);
  max-width: 600px;
  margin-top: var(--space-md);
  position: relative;
  z-index: 10;
  font-weight: 400;
  letter-spacing: -0.01em;
  transition: color var(--theme-transition);
}

.hero-cta-group {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-xl);
  position: relative;
  z-index: 10;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  color: var(--text-tertiary);
  font-size: var(--fs-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  z-index: 1;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: var(--text-tertiary);
  position: relative;
  overflow: hidden;
}

.scroll-line::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--accent);
  animation: scroll-down 2s infinite;
}

@keyframes scroll-down {
  0% { top: -100%; }
  100% { top: 100%; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  font-size: var(--fs-sm);
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: all var(--dur-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
  letter-spacing: -0.01em;
}

.btn-primary, .btn-secondary {
  background: linear-gradient(135deg, hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.9) 0%, hsla(var(--accent-h), var(--accent-s), 72%, 0.8) 100%);
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn-primary:hover, .btn-secondary:hover {
  background: linear-gradient(135deg, hsla(var(--accent-h), var(--accent-s), 72%, 0.95) 0%, hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.85) 100%);
  color: #fff;
  box-shadow: 0 8px 40px var(--accent-glow);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
}

.scroll-top-btn {
  position: fixed;
  bottom: 40px;
  right: 40px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9990;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.scroll-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top-btn:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.btn .btn-arrow {
  transition: transform 0.3s var(--ease-out);
}

.btn:hover .btn-arrow {
  transform: translateX(4px);
}

.magnetic-wrap {
  display: inline-block;
  position: relative;
}

/* ---------- About Section ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
  margin-top: var(--space-xl);
  padding: var(--space-xl) var(--space-lg);
  border-radius: var(--radius-xl);
  transition: background 1.5s ease-out, border-color 1.5s ease-out;
}

.about-grid[style] {
  background: radial-gradient(circle at center, rgba(var(--slide-accent), 0.1) 0%, transparent 70%);
}

.about-image-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/5;
  background: var(--bg-card);
}

.about-slider {
  width: 100%;
  height: 100%;
  position: relative;
}

.about-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.5s var(--ease-out), transform 3s var(--ease-out);
  transform: scale(1.05);
}

.about-slide.active {
  opacity: 1;
  transform: scale(1);
}

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

/* Dots Progress Overlay */
.slider-indicators {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 10;
  padding: 0 40px;
}

.indicator-dot {
  height: 4px;
  flex: 1;
  max-width: 40px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.indicator-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: #ffffff;
  border-radius: 4px;
}

.indicator-dot.active .indicator-fill {
  animation: fillProgress 4s linear forwards;
}

@keyframes fillProgress {
  0% { width: 0%; }
  100% { width: 100%; }
}

.about-image-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  pointer-events: none;
}

.about-text p {
  font-size: var(--fs-base);
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  line-height: 1.8;
  transition: color var(--theme-transition);
}

.about-text p strong {
  color: var(--text-primary);
  font-weight: 600;
  transition: color var(--theme-transition);
}

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

.stat-card {
  text-align: center;
  padding: var(--space-lg) var(--space-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--dur-normal) var(--ease-out), background var(--theme-transition), border-color var(--theme-transition);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-card-hover);
}

.stat-number {
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.stat-label {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ---------- Experience Section (Timeline) ---------- */
.timeline {
  position: relative;
  margin-top: var(--space-xl);
  padding-left: 40px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border-color);
  transition: background var(--theme-transition);
}

.timeline-item {
  position: relative;
  margin-bottom: var(--space-2xl);
}

.timeline-dot {
  position: absolute;
  left: -33px;
  top: 8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 2px solid var(--accent);
  z-index: 2;
  transition: background var(--dur-fast), border-color var(--dur-fast), box-shadow var(--dur-fast), background-color var(--theme-transition);
}

.timeline-item:hover .timeline-dot {
  background: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--dur-normal) var(--ease-out), background var(--theme-transition), border-color var(--theme-transition);
  position: relative;
  overflow: hidden;
}

.timeline-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-card-hover);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.timeline-company {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-heading);
  transition: color var(--theme-transition);
}

.timeline-role {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--accent);
  margin-bottom: var(--space-xs);
}

.timeline-meta {
  display: flex;
  gap: var(--space-md);
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  margin-bottom: var(--space-sm);
}

.timeline-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.timeline-details {
  margin-top: var(--space-sm);
}

.timeline-details li {
  position: relative;
  padding-left: 20px;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
  line-height: 1.7;
  transition: color var(--theme-transition);
}

.timeline-details li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.6;
}

/* ---------- Skills Section ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

.skill-category {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--dur-normal) var(--ease-out), background var(--theme-transition), border-color var(--theme-transition);
  position: relative;
  overflow: hidden;
}

.skill-category:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-card-hover);
}

.skill-category-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--accent-glow);
  color: var(--accent);
  font-size: 1.3rem;
  margin-bottom: var(--space-sm);
}

.skill-category-title {
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  transition: color var(--theme-transition);
}

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

.skill-tag {
  padding: 6px 14px;
  font-size: var(--fs-xs);
  font-weight: 500;
  background: var(--border-color);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  transition: all var(--dur-fast), background var(--theme-transition), color var(--theme-transition);
  border: 1px solid transparent;
}

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

/* ---------- Projects Section ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

.project-card {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  transition: all var(--dur-slow) var(--ease-out), background var(--theme-transition), border-color var(--theme-transition);
  will-change: transform;
}

.project-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-card-hover);
}

.project-card-image {
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
  position: relative;
}

.project-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}

.project-card:hover .project-card-image img {
  transform: scale(1.05);
}

.project-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--dur-normal);
  display: flex;
  align-items: flex-end;
  padding: var(--space-lg);
}

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

.project-card-body {
  padding: var(--space-lg);
}

.project-card-category {
  font-size: var(--fs-xs);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.project-card-title {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
  font-family: var(--font-heading);
  transition: color var(--theme-transition);
}

.project-card-desc {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  transition: color var(--theme-transition);
}

.project-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--space-sm);
}

.project-card-tags span {
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 500;
  background: var(--border-color);
  color: var(--text-tertiary);
  border-radius: var(--radius-full);
  transition: background var(--theme-transition), color var(--theme-transition);
}

/* Featured project (full width) */
.project-card.featured {
  grid-column: 1 / -1;
}

.project-card.featured .project-card-image {
  aspect-ratio: 21/9;
}

/* ---------- Certifications Section ---------- */
.cert-card {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-top: var(--space-md);
  transition: all var(--dur-normal) var(--ease-out), background var(--theme-transition), border-color var(--theme-transition);
  position: relative;
  overflow: hidden;
}

.cert-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-card-hover);
}

/* ---------- Glow Overlay (follows mouse) ---------- */
.glow-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 1;
  border-radius: inherit;
}

/* Animated border glow (shadcn/Radix inspired) */
.timeline-card::before,
.skill-category::before,
.project-card::before,
.cert-card::before,
.contact-link::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(
    from var(--border-angle, 0deg),
    transparent 40%,
    var(--accent-light) 50%,
    transparent 60%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 2;
  pointer-events: none;
}

.timeline-card:hover::before,
.skill-category:hover::before,
.project-card:hover::before,
.cert-card:hover::before,
.contact-link:hover::before {
  opacity: 1;
  animation: border-spin 3s linear infinite;
}

@keyframes border-spin {
  to { --border-angle: 360deg; }
}

@property --border-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

.timeline-card:hover .glow-overlay,
.skill-category:hover .glow-overlay,
.stat-card:hover .glow-overlay,
.project-card:hover .glow-overlay,
.cert-card:hover .glow-overlay,
.contact-link:hover .glow-overlay {
  opacity: 1;
}

.cert-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
}

.cert-info h3 {
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--text-primary);
  transition: color var(--theme-transition);
}

.cert-info p {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  transition: color var(--theme-transition);
}

/* ---------- Contact Section ---------- */
.contact-section {
  text-align: center;
  position: relative;
  overflow: hidden;
}

.contact-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-hero);
  pointer-events: none;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  margin-top: var(--space-xl);
  flex-wrap: wrap;
}

.contact-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  min-width: 180px;
  transition: all var(--dur-normal) var(--ease-out), background var(--theme-transition), border-color var(--theme-transition);
  position: relative;
  overflow: hidden;
}

.contact-link:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-card-hover);
}

.contact-link-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--accent);
  transition: background var(--dur-fast), transform var(--dur-fast);
}

.contact-link:hover .contact-link-icon {
  background: var(--accent);
  color: #fff;
  transform: scale(1.1);
}

.contact-link-label {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.contact-link-value {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-primary);
  transition: color var(--theme-transition);
}

.contact-cta {
  margin-top: var(--space-2xl);
  position: relative;
  z-index: 1;
}

.contact-cta .section-title {
  margin-bottom: var(--space-md);
}

/* ---------- Interactive QR Code Component ---------- */
.qr-code-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-nav);
  cursor: crosshair;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.qr-code-wrapper:hover {
  transform: scale(1.05); /* Straight orientation by default, pops outward playfully */
}
.qr-text {
  position: absolute;
  color: #1e293b;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 1px;
  opacity: 0;
  white-space: nowrap;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1;
  pointer-events: none;
}
.qr-text.left {
  right: 50%; /* Start collapsed in the exact center */
}
.qr-text.right {
  left: 50%;
}
.qr-code-wrapper.hovered .qr-text {
  opacity: 1; /* Appear smoothly when hovered */
}
.qr-code-wrapper.hovered .qr-text.left {
  right: calc(100% + 15px); /* Slide out left */
}
.qr-code-wrapper.hovered .qr-text.right {
  left: calc(100% + 15px); /* Slide out right */
}

/* ---------- Footer ---------- */
.footer {
  padding: var(--space-lg);
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  border-top: 1px solid var(--border-color);
  transition: border-color var(--theme-transition), color var(--theme-transition);
}

.footer a {
  color: var(--accent);
  transition: opacity var(--dur-fast);
}

.footer a:hover {
  opacity: 0.7;
}

/* ---------- Page Loader ---------- */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  transition: background-color var(--theme-transition);
}

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

.loader-name {
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--text-primary);
  opacity: 0;
  transform: translateY(20px);
}

.loader-bar {
  width: 100px;
  height: 2px;
  background: var(--border-color);
  margin: var(--space-sm) auto 0;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.loader-bar-inner {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: var(--radius-full);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
  .about-image-wrap {
    width: 100%; /* Fix 0px width grid collapse bug on mobile Safari */
    max-width: 400px;
    margin: 0 auto;
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .section {
    padding: var(--space-2xl) var(--space-md);
  }
  .nav-wrapper {
    max-width: 95vw;
    margin: 0 auto;
  }
  .navbar {
    padding: 6px 8px;
    gap: 2px;
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Hide scrollbar Firefox */
  }
  .navbar::-webkit-scrollbar {
    display: none; /* Hide scrollbar Chrome/Safari */
  }
  .nav-link {
    padding: 6px 12px;
    font-size: clamp(10px, 3vw, 12px);
    white-space: nowrap;
  }
  .theme-toggle {
    margin-left: auto; /* Push toggle to the right */
    flex-shrink: 0;
  }
  .hero-blur-tunnel {
    height: 400px;
    mask-image: radial-gradient(ellipse at center, rgba(0,0,0,1) 30%, rgba(0,0,0,0) 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,1) 30%, rgba(0,0,0,0) 80%);
  }
  .stats-row {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }
  .stat-card {
    padding: var(--space-md);
  }
  .timeline {
    padding-left: 30px;
  }
  .timeline::before {
    left: 10px;
  }
  .timeline-dot {
    left: -27px;
    width: 12px;
    height: 12px;
  }
  .timeline-header {
    flex-direction: column;
  }
  .skills-grid {
    grid-template-columns: 1fr;
  }
  .contact-links {
    flex-direction: column;
    align-items: center;
  }
  .hero-cta-group {
    flex-direction: column;
    align-items: center;
  }
  .cert-card {
    flex-direction: column;
    text-align: center;
  }
  /* Hide custom cursor on touch devices */
  .cursor-dot, .cursor-ring {
    display: none !important;
  }
  body {
    cursor: auto;
  }
  a, button {
    cursor: pointer;
  }
}

@media (max-width: 480px) {
  .hero-name {
    font-size: clamp(2.5rem, 12vw, 3.5rem);
  }
  .hero-subtitle {
    font-size: 1rem;
    padding: 0 var(--space-sm);
  }
  .hero-blur-tunnel {
    height: 480px; 
    border-radius: 24px;
    mask-image: radial-gradient(ellipse at center, rgba(0,0,0,1) 25%, rgba(0,0,0,0) 75%);
    -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,1) 25%, rgba(0,0,0,0) 75%);
  }
  .btn {
    width: 100%;
    justify-content: center;
  }
  .hero-cta-group .magnetic-wrap {
    width: 100%;
  }
  .scroll-top-btn {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
  }
}

/* ---------- Accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* smooth all themed transitions */
.section, .timeline-card, .skill-category, .project-card, .stat-card,
.cert-card, .contact-link, .footer, .about-text p, .about-text p strong,
.timeline-company, .timeline-details li, .skill-category-title,
.project-card-title, .project-card-desc, .contact-link-value, .cert-info h3,
.cert-info p {
  transition-property: background-color, color, border-color, box-shadow, transform;
  transition-duration: var(--dur-normal);
  transition-timing-function: var(--ease-out);
}
