/* 
   Premium Modular Tech Portfolio Theme
   Features: Layered surfaces, ambient mesh gradients, mouse-reactive lighting
*/

:root {
  /* Colors - Lighter Dark Theme (Zinc/Slate base) */
  --bg-primary: #09090b;
  /* Base dark */
  --surface-1: rgba(24, 24, 27, 0.6);
  /* Level 1 card */
  --surface-2: rgba(39, 39, 42, 0.7);
  /* Level 2 card */
  --surface-3: rgba(63, 63, 70, 0.8);
  /* Highlight/Hover */

  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;

  --accent-glow: rgba(255, 255, 255, 0.1);
  --accent-color: #38bdf8;

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-highlight: rgba(255, 255, 255, 0.15);

  /* Elevations & Shadows */
  --shadow-float: 0 20px 40px -10px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 255, 255, 0.02);
  --shadow-inner: inset 0 1px 1px rgba(255, 255, 255, 0.05);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Ambient Background Mesh Gradient */
.scroll-indicator {
  display: none;
}

.ambient-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  background: var(--bg-primary);
}

.ambient-blob {
  position: absolute;
  filter: blur(100px);
  opacity: 0.4;
  animation: float 20s infinite ease-in-out alternate;
}

.blob-1 {
  top: -10%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.15) 0%, transparent 70%);
  animation-delay: 0s;
}

.blob-2 {
  bottom: -20%;
  right: -10%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.1) 0%, transparent 70%);
  animation-delay: -5s;
}

.blob-3 {
  top: 40%;
  left: 40%;
  width: 40vw;
  height: 40vw;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.05) 0%, transparent 70%);
  animation-delay: -10s;
}

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

  100% {
    transform: translate(5%, 5%) scale(1.1);
  }
}

::selection {
  background: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
}

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

a:hover {
  color: var(--text-secondary);
}

/* Layout */
section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 6rem 2rem;
  position: relative;
  z-index: 1;
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 3rem;
  text-align: center;
  background: linear-gradient(180deg, #FFFFFF 0%, rgba(255, 255, 255, 0.5) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(9, 9, 11, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  font-size: 1.25rem;
  font-weight: 600;
}

header h1 a {
  display: inline-block;
  transition: transform var(--transition-normal), color var(--transition-fast);
}

header h1 a:hover {
  transform: scale(1.05) rotate(-2deg);
  color: var(--accent-color) !important;
}

nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  background: var(--surface-1);
  padding: 0.5rem 1.5rem;
  border-radius: 100px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-inner);
}

nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

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

/* Nav Dropdown */
.nav-dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}

.dropdown-arrow-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0 0.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  line-height: 1;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.dropdown-arrow-btn:hover {
  color: var(--text-primary);
}

.nav-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 0.5rem;
}

.nav-dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #18181b;
  min-width: 220px;
  box-shadow: var(--shadow-float);
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  padding: 0.5rem 0;
  z-index: 1000;
  margin-top: 0.5rem;
}

.nav-dropdown:hover .nav-dropdown-content {
  display: block;
  animation: fadeIn 0.2s ease;
}

.nav-dropdown-content a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-align: left;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.nav-dropdown-content a:hover {
  background-color: var(--surface-2);
  color: var(--text-primary);
}

#themeToggle {
  display: none;
}

.nav-toggle {
  display: none;
}

.nav-backdrop {
  display: none;
}

.dropdown-chevron {
  font-size: 0.75rem;
  margin-left: 0.25rem;
  display: inline-block;
  transition: transform var(--transition-fast);
}

/* Hero */
#hero {
  padding-top: 14rem;
  padding-bottom: 8rem;
  text-align: center;
  position: relative;
}

.hero-badges {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.badge {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  padding: 0.5rem 1rem;
  border-radius: 100px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-inner);
  animation: floatBadge 6s ease-in-out infinite alternate;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

a.badge:hover {
  color: var(--text-primary);
  border-color: var(--border-highlight);
  background: var(--surface-2);
}

.badge:nth-child(2) {
  animation-delay: -2s;
}

.badge:nth-child(3) {
  animation-delay: -4s;
}

@keyframes floatBadge {
  0% {
    transform: translateY(0);
  }

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

#hero h1 {
  font-size: 4.5rem;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 1.5rem;
  background: linear-gradient(to bottom right, #FFFFFF, #A1A1AA);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#hero p {
  font-size: 1.25rem;
  max-width: 700px;
  margin: 0 auto 1.5rem auto;
}

/* Mouse Reactive Cards */
.card {
  background: var(--surface-1);
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
  padding: 2.5rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-inner), 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
  display: flex;
  flex-direction: column;
}

/* Inner card layers for extra depth */
.card-inner-layer {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1.5rem;
}



.project-card:has(.project-content.collapsed) {
  padding: 1.25rem 1.5rem;
}

.project-card:has(.project-content.collapsed) .product-header {
  margin-bottom: 0;
}

.cert-card h4 {
  margin-bottom: 0.75rem;
}

/* Mouse Spotlight Effects */
.card::before,
.card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

/* Border Glow */
.card::before {
  background: radial-gradient(800px circle at var(--mouse-x, 0) var(--mouse-y, 0),
      var(--border-highlight),
      transparent 40%);
  z-index: 3;
}

/* Inner Surface Glow */
.card::after {
  background: radial-gradient(600px circle at var(--mouse-x, 0) var(--mouse-y, 0),
      rgba(255, 255, 255, 0.03),
      transparent 40%);
  z-index: 1;
}

.card:hover::before,
.card:hover::after {
  opacity: 1;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-float), var(--shadow-inner);
}

.card>* {
  z-index: 2;
  position: relative;
}

/* Products/Projects Override */
.product-showcase {
  margin-bottom: 3rem;
}

.product-showcase .card {
  padding: 3rem;
}

.project-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 3rem;
}

/* Grid Animation for Project Lists */
.project-list-wrapper {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
  opacity: 1;
}

.project-list-wrapper.collapsed {
  grid-template-rows: 0fr;
  opacity: 0;
  pointer-events: none;
}

.project-group:has(.project-list-wrapper.collapsed) {
  margin-bottom: 1rem;
}

.project-group:has(.project-list-wrapper.collapsed) .project-subsection-title {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.project-list-inner {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}


.project-subsection-title {
  font-size: 1.5rem;
  margin: 3rem 0 2rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-highlight);
  color: var(--text-primary);
  display: inline-block;
}

.product-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.product-title,
.project-title {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.product-title h4,
.project-title h4 {
  margin-bottom: 0;
  font-size: 1.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem 0.75rem;
  flex-wrap: wrap;
  line-height: 1.4;
}

.product-metrics {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.metric {
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border-highlight);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-width: 140px;
  text-align: center;
  flex: 1;
}

.metric-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-color);
  margin-bottom: 0.2rem;
}

.metric-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* Pills */

.project-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
  padding-left: 0.75rem;
  border-left: 1px solid var(--border-highlight);
  white-space: normal;
  word-break: break-word;
}

.project-pill {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}




/* Grid Animation for Project Content */
.project-content {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease, margin 0.35s ease;
  opacity: 1;
  margin-top: 1.5rem;
}

.project-content.collapsed {
  grid-template-rows: 0fr;
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
}

.content-inner {
  overflow: hidden;
}

/* Ensure all project description and experience bullets wrap normally */
.project-content ul li,
.experience-details ul li {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: normal;
  overflow-wrap: break-word;
}

/* Truncate long resource links with ellipsis so they stay on their original line */
.project-links-grid ul li,
.project-links-list li {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.project-links-grid ul li a,
.project-links-list li a {
  display: inline;
  white-space: nowrap;
}

.contact-card .contact-value {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.project-pill-imd {
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.project-pill-mysphere {
  background: rgba(167, 139, 250, 0.1);
  color: #a78bfa;
  border: 1px solid rgba(167, 139, 250, 0.2);
}

.project-pill-vit {
  background: rgba(52, 211, 153, 0.1);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.project-pill-hf {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.project-pill-research {
  background: rgba(236, 72, 153, 0.12);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.25);
}

.project-pill-dataset {
  background: rgba(14, 165, 233, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.25);
}

.project-pill-opensource {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.25);
}

.project-pill-kaptaan {
  background: rgba(244, 63, 94, 0.12);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.25);
}

/* Timeline Experience inside Cards */
.timeline {
  position: relative;
  padding-left: 2rem;
  margin-top: 1rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--border-subtle) 10%, var(--border-subtle) 90%, transparent);
}

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

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

.timeline-dot {
  position: absolute;
  left: -2.35rem;
  top: 0.25rem;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--surface-1);
  border: 2px solid var(--text-secondary);
  transition: var(--transition-normal);
  z-index: 2;
}

.timeline-dot.dot-imd {
  border-color: #38bdf8;
}

.timeline-dot.dot-mysphere {
  border-color: #a78bfa;
}

.timeline-item:hover .timeline-dot {
  background: var(--text-primary);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
}

.timeline-item:hover .timeline-dot.dot-imd {
  background: #38bdf8;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

.timeline-dot.dot-kaptaan {
  border-color: #fb7185;
}
.timeline-item:hover .timeline-dot.dot-kaptaan {
  background: #fb7185;
  box-shadow: 0 0 15px rgba(251, 113, 133, 0.4);
}

.timeline-item:hover .timeline-dot.dot-mysphere {
  background: #a78bfa;
  box-shadow: 0 0 15px rgba(167, 139, 250, 0.4);
}

.timeline-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-family: monospace;
}

.timeline-content h4 {
  font-size: 1.35rem;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
  letter-spacing: -0.01em;
}

.timeline-content p,
.timeline-content ul li {
  font-size: 1.05rem;
  color: var(--text-secondary);
}

/* Tech Stacks */
.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.tech-tag {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.tech-tag:hover {
  background: var(--surface-3);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Grids */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 2rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.cert-grid,
.education-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.contact-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.contact-card {
  flex: 1 1 300px;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.5rem;
  transition: var(--transition-normal);
  text-align: center;
}

.contact-card-wide {
  grid-column: 1 / -1;
}

.cert-card-wide {
  grid-column: 1 / -1;
}

@media (min-width: 768px) {
  .cert-card-wide {
    grid-column: span 2;
  }
}

.toggle-btn {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
  transition: transform 0.3s ease, background 0.2s ease;
  flex-shrink: 0;
}

.toggle-btn:hover {
  background: var(--surface-3);
}



.mini-project h5 {
  font-size: 1.15rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.mini-project h5 span {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 400;
}

/* Dashboard Resume */
.dashboard-resume {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 2rem;
  align-items: stretch;
}

.resume-preview-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: var(--surface-1);
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  padding: 3rem 2.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  height: 100%;
  box-sizing: border-box;
}

.resume-sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  box-sizing: border-box;
}

.resume-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(3, 138px);
  gap: 1rem;
}

.resume-stat-card {
  background: var(--surface-2);
  padding: 1.25rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.resume-stat-card h3 {
  font-size: clamp(1.4rem, 2.2vw, 1.85rem);
  margin-bottom: 0.2rem;
  line-height: 1.1;
  white-space: nowrap;
}

.resume-stat-card p {
  font-size: 0.85rem;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.download-btn {
  width: 100%;
  background: var(--text-primary);
  color: var(--bg-primary);
  border: none;
  padding: 1.25rem;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  margin-top: 1rem;
}

.download-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 25px -5px rgba(255, 255, 255, 0.2);
}

/* Resume Track Switcher */
.resume-tabs-container {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
  width: 100%;
}

.resume-tabs {
  display: inline-flex;
  gap: 0.5rem;
  background: var(--surface-1);
  padding: 0.4rem;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-inner);
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.resume-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.35rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.resume-tab svg {
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.resume-tab:hover {
  color: var(--text-primary);
  background: var(--surface-2);
}

.resume-tab:hover svg {
  transform: scale(1.1);
}

.resume-tab.active {
  color: #ffffff;
  background: var(--surface-2);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.15);
}

.resume-tab .tab-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all var(--transition-fast);
}

.resume-tab.active .tab-badge {
  background: rgba(56, 189, 248, 0.2);
  color: var(--accent-color);
}

.resume-focus-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-color);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  margin-bottom: 0.85rem;
  position: relative;
  z-index: 2;
  transition: opacity var(--transition-fast);
}

.resume-highlights-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  max-width: 85%;
  margin: 0 auto 1.75rem;
  position: relative;
  z-index: 2;
}

.resume-highlight-tag {
  font-size: 0.82rem;
  background: var(--surface-2);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--transition-fast);
}

.resume-highlight-tag:hover {
  border-color: rgba(56, 189, 248, 0.3);
  color: var(--text-primary);
}

.resume-actions-row {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 2;
  width: 100%;
}

.resume-actions-row .download-btn {
  width: auto;
  min-width: 220px;
  padding: 1rem 2.5rem;
  margin-top: 0;
}

.resume-secondary-btn {
  background: var(--surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.resume-secondary-btn:hover {
  background: var(--surface-3);
  border-color: var(--border-highlight);
}

.fade-in-content {
  animation: resumeFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes resumeFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

ul {
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

li {
  margin-bottom: 0.75rem;
}

/* Reveal Animations */
.reveal-up {
  opacity: 0;
  transform: translateY(40px) scale(0.98);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Staggering for grids */
.grid-2 .reveal-up:nth-child(1) {
  transition-delay: 0.1s;
}

.grid-2 .reveal-up:nth-child(2) {
  transition-delay: 0.2s;
}

.grid-3 .reveal-up:nth-child(1) {
  transition-delay: 0.1s;
}

.grid-3 .reveal-up:nth-child(2) {
  transition-delay: 0.2s;
}

.grid-3 .reveal-up:nth-child(3) {
  transition-delay: 0.3s;
}

/* Responsive */
@media (max-width: 768px) {
  html {
    scroll-padding-top: 75px;
  }

  /* Mobile Header Bar */
  header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.25rem;
    gap: 0;
    background: rgba(9, 9, 11, 0.92);
    border-bottom: 1px solid var(--border-subtle);
  }

  header h1 {
    font-size: 1.15rem;
    margin: 0;
  }

  /* Hamburger Toggle Button */
  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    gap: 4.5px;
    padding: 0;
    transition: background var(--transition-fast), border-color var(--transition-fast);
    z-index: 1001;
  }

  .nav-toggle:hover {
    background: var(--surface-3);
    border-color: var(--border-highlight);
  }

  .nav-toggle .hamburger-bar {
    width: 18px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
  }

  .nav-toggle.active .hamburger-bar:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
  }

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

  .nav-toggle.active .hamburger-bar:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
  }

  /* Mobile Backdrop */
  .nav-backdrop {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 998;
  }

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

  /* Mobile Slide-down Drawer */
  nav {
    position: fixed;
    top: 58px;
    left: 0;
    width: 100%;
    max-height: calc(100vh - 58px);
    overflow-y: auto;
    background: rgba(14, 14, 18, 0.98);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-bottom: 1px solid var(--border-subtle);
    border-radius: 0 0 20px 20px;
    padding: 1rem 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.3rem;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.85);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 999;
  }

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

  nav a {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: 10px;
    transition: background var(--transition-fast), color var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  nav a:hover,
  nav a.active {
    background: var(--surface-2);
    color: var(--accent-color);
    font-weight: 600;
  }

  .nav-dropdown {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .nav-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    border-radius: 10px;
    background: transparent;
    transition: background var(--transition-fast);
  }

  .nav-dropdown-trigger:hover {
    background: var(--surface-2);
  }

  .nav-dropdown-trigger a {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    width: auto;
  }

  .nav-dropdown-trigger a:hover,
  .nav-dropdown-trigger a.active {
    background: transparent;
    color: var(--accent-color);
    font-weight: 600;
  }

  .dropdown-arrow-btn {
    background: transparent;
    border: none;
    border-left: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.75rem 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    border-radius: 0 10px 10px 0;
    transition: color var(--transition-fast), background var(--transition-fast);
  }

  .dropdown-arrow-btn:hover,
  .dropdown-arrow-btn:active {
    color: var(--text-primary);
    background: var(--surface-3);
  }

  .nav-dropdown.open .dropdown-arrow-btn .dropdown-chevron {
    transform: rotate(180deg);
  }

  .nav-dropdown-content {
    display: none;
    position: static;
    transform: none;
    min-width: 100%;
    background: rgba(24, 24, 27, 0.5);
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    margin: 0.25rem 0 0.25rem 0.5rem;
    padding: 0.25rem 0.5rem;
    box-shadow: none;
    animation: none;
  }

  .nav-dropdown.open .nav-dropdown-content {
    display: flex;
    flex-direction: column;
  }

  .nav-dropdown-content a {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
  }

  .nav-dropdown-content a:hover {
    background: var(--surface-3);
    color: var(--text-primary);
  }

  /* Compact Layout & Anti-Clipping on Mobile */
  #hero {
    padding-top: 6.5rem;
    padding-bottom: 4rem;
  }

  #hero h1 {
    font-size: clamp(2.2rem, 7vw, 3rem);
  }

  section {
    padding: 4rem 1.25rem;
    max-width: 100%;
    overflow-x: hidden;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  /* Resume Section Mobile Optimization */
  .resume-tabs-container {
    width: 100%;
    margin-bottom: 1.5rem;
  }

  .resume-tabs {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
    padding: 0.5rem;
    box-sizing: border-box;
    overflow-x: visible;
  }

  .resume-tab {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.15rem;
    box-sizing: border-box;
  }

  .resume-tab .tab-badge {
    margin-left: auto;
  }

  .dashboard-resume {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .resume-preview-section {
    padding: 2rem 1.25rem;
    height: auto;
    min-height: auto;
    box-sizing: border-box;
    width: 100%;
  }

  .resume-preview-section #resumeTitle {
    font-size: 1.3rem;
    line-height: 1.35;
    margin-bottom: 0.75rem;
  }

  .resume-preview-section #resumeDescription {
    max-width: 100% !important;
    font-size: 0.92rem;
    line-height: 1.6;
    margin: 0 0 1.25rem 0;
  }

  .resume-highlights-grid {
    max-width: 100% !important;
    width: 100%;
    margin: 0 0 1.5rem 0;
    gap: 0.45rem;
  }

  .resume-highlight-tag {
    font-size: 0.8rem;
    padding: 0.35rem 0.65rem;
  }

  .resume-actions-row {
    width: 100%;
  }

  .resume-actions-row .download-btn {
    width: 100%;
    min-width: unset;
    padding: 0.95rem 1.5rem;
  }

  .resume-stats {
    grid-template-rows: auto;
    gap: 0.75rem;
  }

  .resume-stat-card {
    padding: 1rem 0.75rem;
  }

  /* Position toggle button at top-right so tags and metrics utilize 100% of card width */
  .product-header {
    position: relative;
    display: block;
    margin-bottom: 1.25rem;
    width: 100%;
  }

  .product-header .toggle-btn {
    position: absolute;
    top: 0;
    right: 0;
    margin: 0;
    z-index: 2;
  }

  .product-title,
  .project-title {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .product-title h4,
  .project-title h4 {
    font-size: 1.2rem;
    gap: 0.4rem 0.6rem;
    line-height: 1.35;
    padding-right: 2.75rem; /* Reserve space ONLY for the top line where the toggle button is */
  }

  .experience-org-meta {
    padding-right: 2.75rem;
  }

  /* Fix right edge clipping on long dates, pills, and tags */
  .project-date {
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: break-word;
    border-left: none !important;
    padding-left: 0 !important;
    display: inline;
  }

  .project-pill {
    max-width: 100%;
    white-space: normal;
    text-align: center;
  }

  .tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    width: 100%;
    max-width: 100%;
    margin-top: 0.85rem;
  }

  .tech-tag {
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
    font-size: 0.78rem;
    padding: 0.35rem 0.65rem;
  }

  .metric-label {
    word-break: break-word;
    overflow-wrap: break-word;
    font-size: 0.75rem;
  }

  .card {
    padding: 1.25rem;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .timeline {
    padding-left: 1.25rem;
  }

  .timeline-dot {
    left: -1.65rem;
  }

  #contact .card {
    padding: 1.25rem 0.75rem;
  }

  .contact-grid {
    gap: 0.75rem;
    width: 100%;
  }

  .contact-card {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 0.85rem 0.65rem;
    overflow: hidden;
  }

  .contact-card .contact-value {
    font-size: clamp(0.78rem, 3.8vw, 0.9rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: block;
    text-align: center;
    line-height: 1.4;
  }
}

/* Custom Webkit Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: 10px;
  border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Custom Context Menu */
.custom-context-menu {
  position: absolute;
  top: 0;
  left: 0;
  background: rgba(24, 24, 27, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-highlight);
  border-radius: 12px;
  padding: 0.5rem;
  min-width: 200px;
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.7), var(--shadow-inner);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  opacity: 0;
  transform: scale(0.95);
  transform-origin: top left;
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.custom-context-menu.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.context-menu-item svg {
  width: 16px;
  height: 16px;
  opacity: 0.8;
}

.context-menu-item:hover {
  background: var(--surface-3);
  color: var(--text-primary);
}

/* Back to Top FAB */
.fab-back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border-highlight);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-float);
  cursor: pointer;
  z-index: 999;
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(10px);
}

.fab-back-to-top.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.fab-back-to-top:hover {
  background: var(--surface-3);
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.5), var(--shadow-inner);
}

/* Premium Footer */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-primary);
  padding: 4rem 2rem 2rem;
  margin-top: 4rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 2fr;
  gap: 3rem;
  margin-bottom: 2rem;
  align-items: start;
}

.footer-brand h3 {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.footer-brand h3 a,
.footer-bottom p a {
  transition: color var(--transition-fast), text-shadow var(--transition-fast);
}

.footer-brand h3 a:hover,
.footer-bottom p a:hover {
  color: var(--text-primary) !important;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 320px;
  line-height: 1.6;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: 2rem;
  justify-content: flex-end;
}

.footer-col h4 {
  color: var(--text-primary);
  font-size: 0.95rem;
  margin-bottom: 0.9rem;
  letter-spacing: -0.01em;
}

.footer-col ul {
  list-style: none;
  padding: 0;
}

.footer-col ul li {
  margin-bottom: 0.45rem;
}

.footer-col ul a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.2s ease;
}

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

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-socials {
  display: flex;
  gap: 1rem;
}

.footer-socials a {
  color: var(--text-muted);
  transition: color 0.2s ease;
}

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

@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
  }

  .footer-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem 0.5rem;
    justify-content: space-between;
    width: 100%;
  }

  .footer-col h4 {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    white-space: nowrap;
  }

  .footer-col ul li {
    margin-bottom: 0.4rem;
  }

  .footer-col ul a {
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}
/* Toggle Button Rotation Animations */
.project-section-heading .toggle-btn[data-action="expand"],
.project-subsection-title .toggle-btn[data-action="expand"] {
  transform: rotate(180deg);
}

.project-header .toggle-btn[data-action="collapse"] {
  transform: rotate(180deg);
}

/* Card Toggle Button (+ / -) */
.card-toggle-btn .icon-plus {
  display: none;
}

.card-toggle-btn .icon-minus {
  display: block;
}

.card-toggle-btn[data-action="expand"] .icon-plus {
  display: block;
}

.card-toggle-btn[data-action="expand"] .icon-minus {
  display: none;
}

.project-section-heading .card-toggle-btn[data-action="expand"],
.project-subsection-title .card-toggle-btn[data-action="expand"] {
  transform: none;
}
